Skip to content

Commit b5bbcb2

Browse files
committed
Added icon on user pages to report page
- Not shown for admins or VIPs - Has to be turned on in the config to be active
1 parent d928b19 commit b5bbcb2

File tree

7 files changed

+104
-1
lines changed

7 files changed

+104
-1
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,5 @@ ALLOW_USER_EXPORT=true
130130
ALLOW_USER_IMPORT=true
131131

132132
MANUAL_USER_VERIFICATION=true
133+
134+
ENABLE_REPORT_ICON=false

resources/lang/de/messages.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@
734734
'ADMIN_EMAIL.description' => 'Wird zum Versenden von Benachrichtigungs-E-Mails verwendet.',
735735
'HIDE_VERIFICATION_CHECKMARK.title' => 'Verifizierungshäkchen ausblenden',
736736
'HIDE_VERIFICATION_CHECKMARK.description' => 'Versteckt das Verifizierungsabzeichen, das auf Admin- und VIP-Seiten angezeigt wird.',
737+
'ENABLE_REPORT_ICON.title' => 'Report-Icon aktivieren',
738+
'ENABLE_REPORT_ICON.description' => 'Zeigt ein Symbol auf Benutzerseiten an, das es Benutzern ermöglicht, Seiten zu melden.',
737739
'LOCALE.title' => 'App Lokalisierung',
738740
'LOCALE.description' => 'Ändern Sie die Sprache Ihrer Anwendung.',
739741

@@ -1090,7 +1092,7 @@
10901092
'report_error' => 'Profil konnte nicht gemeldet werden',
10911093
'report_success' => 'Profil wurde erfolgreich gemeldet',
10921094

1093-
1095+
10941096
#=============================================================================#
10951097
# Laravel internal translations #
10961098
#=============================================================================#

resources/lang/en/messages.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,8 @@
731731
'ADMIN_EMAIL.description' => 'Used to send notification emails.',
732732
'HIDE_VERIFICATION_CHECKMARK.title' => 'Hide verification checkmark',
733733
'HIDE_VERIFICATION_CHECKMARK.description' => 'Hides verification badge displayed on admin and VIP pages.',
734+
'ENABLE_REPORT_ICON.title' => 'Enable report icon',
735+
'ENABLE_REPORT_ICON.description' => 'Displays an icon on user pages that allows users to report pages.',
734736
'LOCALE.title' => 'App locale',
735737
'LOCALE.description' => 'Change the language of your application',
736738

resources/views/components/config/config.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ function text($key){
274274
{{toggle('HIDE_VERIFICATION_CHECKMARK')}}
275275

276276

277+
{{toggle('ENABLE_REPORT_ICON')}}
278+
279+
277280
<a name="Panel-settings"><h2 class="ch2">{{__('messages.Panel settings')}}</h2></a>
278281

279282
{{toggle('NOTIFY_EVENTS')}}

resources/views/components/finishing.blade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
if(EnvEditor::keyExists('LOCALE')){ /* Do nothing if key already exists */
6161
} else {EnvEditor::addKey('LOCALE', 'en');}
6262
63+
if(EnvEditor::keyExists('ENABLE_REPORT_ICON')){ /* Do nothing if key already exists */
64+
} else {EnvEditor::addKey('ENABLE_REPORT_ICON', false);}
65+
6366
if(EnvEditor::keyExists('ADMIN_EMAIL')){} else
6467
{if(Auth::user()->id == 1){EnvEditor::addKey('ADMIN_EMAIL', App\Models\User::find(1)->email);}
6568
else{EnvEditor::addKey('ADMIN_EMAIL', '');}}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
@if($userinfo->role == 'user' and env('ENABLE_REPORT_ICON') == true)
2+
<style>
3+
.report-pill-container {
4+
position: fixed;
5+
bottom: 60px;
6+
left: 30px;
7+
z-index: 5;
8+
}
9+
10+
.report-icon {
11+
font-size: 36px;
12+
z-index: 5;
13+
position: absolute;
14+
top: 7px;
15+
left: 7px;
16+
display: flex;
17+
justify-content: center;
18+
align-items: center;
19+
}
20+
21+
.report-expanding-pill {
22+
background-color: #58595b;
23+
position: absolute;
24+
width: 0px;
25+
height: 30px;
26+
border-radius: 50px;
27+
overflow: hidden;
28+
padding-right: 30px;
29+
/* box-shadow: 0px 0px 15px #777; */
30+
display: flex;
31+
justify-content: flex-end;
32+
align-items: center;
33+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
34+
}
35+
36+
.report-text {
37+
opacity: 0;
38+
font-size: 14px;
39+
transition: opacity 0.3s ease-out;
40+
font-family: Arial, Helvetica, sans-serif;
41+
color: white;
42+
text-decoration: none;
43+
}
44+
45+
.report-text:hover {
46+
text-decoration: underline;
47+
color: white;
48+
}
49+
50+
51+
.report-show {
52+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
53+
width: 130px;
54+
}
55+
56+
.report-show-text {
57+
transition: opacity 3s ease-out;
58+
opacity: 1;
59+
}
60+
61+
.report-hide {
62+
opacity: 0;
63+
transition: opacity 0.3s ease-out;
64+
}
65+
</style>
66+
<div class="report-pill-container">
67+
<div class="report-icon-container">
68+
<div class="report-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" class="bi bi-info-circle" viewBox="0 0 16 16">
69+
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
70+
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
71+
</svg></div>
72+
</div>
73+
<div class="report-expanding-pill">
74+
<a href="{{url('report?'.$userinfo->id)}}" target="_blank" class="report-text">Report abuse</a>
75+
</div>
76+
</div>
77+
78+
<script>
79+
let icon = document.querySelector('.report-icon-container')
80+
let expandingPill = document.querySelector('.report-expanding-pill')
81+
let text = document.querySelector('.report-text')
82+
83+
icon.addEventListener('click', function() {
84+
expandingPill.classList.toggle('report-show');
85+
text.classList.toggle('report-show-text');
86+
notification.classList.add('report-hide')
87+
});
88+
</script>
89+
@endif

resources/views/littlelink.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ function themeAsset($path){
252252

253253
<?php ////end share button//// ?>
254254

255+
@include('components.report-icon')
256+
255257
<div class="container">
256258
<div class="row">
257259
<div class="column" style="margin-top: 5%">

0 commit comments

Comments
 (0)