Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mélanie Chauvel
funkwhale
Commits
08eeab4d
Verified
Commit
08eeab4d
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
See #890: UI for reporting libraries
parent
05e36c74
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
front/src/components/mixins/Report.vue
+15
-4
15 additions, 4 deletions
front/src/components/mixins/Report.vue
front/src/style/_main.scss
+4
-1
4 additions, 1 deletion
front/src/style/_main.scss
front/src/views/content/remote/Card.vue
+30
-2
30 additions, 2 deletions
front/src/views/content/remote/Card.vue
with
49 additions
and
7 deletions
front/src/components/mixins/Report.vue
+
15
−
4
View file @
08eeab4d
<
script
>
export
default
{
methods
:
{
getReportableObjs
({
track
,
album
,
artist
,
playlist
,
account
})
{
getReportableObjs
({
track
,
album
,
artist
,
playlist
,
account
,
library
})
{
let
reportableObjs
=
[]
if
(
account
)
{
let
accountLabel
=
this
.
$pgettext
(
'
*/Moderation/*/Verb
'
,
"
Report @%{ username }…
"
)
...
...
@@ -57,17 +57,28 @@ export default {
}
})
}
if
(
this
.
playlist
)
{
if
(
playlist
)
{
reportableObjs
.
push
({
label
:
this
.
$pgettext
(
'
*/Moderation/*/Verb
'
,
"
Report this playlist…
"
),
target
:
{
type
:
'
playlist
'
,
id
:
this
.
playlist
.
id
,
label
:
this
.
playlist
.
name
,
id
:
playlist
.
id
,
label
:
playlist
.
name
,
typeLabel
:
this
.
$pgettext
(
"
*/*/*
"
,
'
Playlist
'
),
}
})
}
if
(
library
)
{
reportableObjs
.
push
({
label
:
this
.
$pgettext
(
'
*/Moderation/*/Verb
'
,
"
Report this library…
"
),
target
:
{
type
:
'
library
'
,
uuid
:
library
.
uuid
,
label
:
library
.
name
,
typeLabel
:
this
.
$pgettext
(
"
*/*/*
"
,
'
Library
'
),
}
})
}
return
reportableObjs
},
}
...
...
This diff is collapsed.
Click to expand it.
front/src/style/_main.scss
+
4
−
1
View file @
08eeab4d
...
...
@@ -184,7 +184,7 @@ body {
}
}
.ellipsis
{
.ellipsis
:not
(
.icon
)
{
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
overflow
:
hidden
;
...
...
@@ -250,6 +250,9 @@ a {
display
:
none
;
}
.nomargin
{
margin
:
0
!
important
;
}
button
.reset
{
border
:
none
;
margin
:
0
;
...
...
This diff is collapsed.
Click to expand it.
front/src/views/content/remote/Card.vue
+
30
−
2
View file @
08eeab4d
...
...
@@ -3,17 +3,30 @@
<div
class=
"content"
>
<div
class=
"header"
>
{{
library
.
name
}}
<div
class=
"ui right floated dropdown"
>
<i
class=
"ellipsis vertical grey large icon nomargin"
></i>
<div
class=
"menu"
>
<div
role=
"button"
v-for=
"obj in getReportableObjs(
{library, account: library.actor})"
:key="obj.target.type + obj.target.id"
class="item basic"
@click.stop.prevent="$store.dispatch('moderation/report', obj.target)">
<i
class=
"share icon"
/>
{{
obj
.
label
}}
</div>
</div>
</div>
<span
v-if=
"library.privacy_level === 'me'"
class=
"right floated"
:data-tooltip=
"labels.tooltips.me"
>
<i
class=
"small lock icon"
></i>
<i
class=
"small lock
grey
icon"
></i>
</span>
<span
v-else-if=
"library.privacy_level === 'everyone'"
class=
"right floated"
:data-tooltip=
"labels.tooltips.everyone"
>
<i
class=
"small globe icon"
></i>
<i
class=
"small globe
grey
icon"
></i>
</span>
</div>
<div
class=
"meta"
>
...
...
@@ -120,8 +133,11 @@
</template>
<
script
>
import
axios
from
'
axios
'
import
ReportMixin
from
'
@/components/mixins/Report
'
import
jQuery
from
'
jquery
'
export
default
{
mixins
:
[
ReportMixin
],
props
:
{
library
:
{
type
:
Object
,
required
:
true
},
displayFollow
:
{
type
:
Boolean
,
default
:
true
},
...
...
@@ -136,6 +152,18 @@ export default {
latestScan
:
this
.
library
.
latest_scan
,
}
},
mounted
()
{
let
self
=
this
jQuery
(
this
.
$el
).
find
(
'
.ui.dropdown
'
).
dropdown
({
selectOnKeydown
:
false
,
action
:
function
(
text
,
value
,
$el
)
{
// used ton ensure focusing the dropdown and clicking via keyboard
// works as expected
self
.
$refs
[
$el
.
data
(
'
ref
'
)].
click
()
jQuery
(
self
.
$el
).
find
(
'
.ui.dropdown
'
).
dropdown
(
'
hide
'
)
}
})
},
computed
:
{
labels
()
{
let
me
=
this
.
$pgettext
(
'
Content/Library/Card.Help text
'
,
'
This library is private and your approval from its owner is needed to access its content
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment