Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
eaa48a73
Commit
eaa48a73
authored
Aug 06, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FEAT: display show owners, if superuser
parent
b1e00e78
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/components/ShowManager.vue
View file @
eaa48a73
...
@@ -274,6 +274,7 @@
...
@@ -274,6 +274,7 @@
<hr>
<hr>
<h2>
Allgemeine Einstellungen zur Sendereihe:
</h2>
<h2>
Allgemeine Einstellungen zur Sendereihe:
</h2>
<b-row>
<b-row>
<b-col
lg=
"6"
>
<b-col
lg=
"6"
>
<p>
<p>
...
@@ -399,6 +400,56 @@
...
@@ -399,6 +400,56 @@
</b-col>
</b-col>
</b-row>
</b-row>
<hr
v-if=
"$parent.user.steeringUser.is_superuser"
>
<b-row
v-if=
"$parent.user.steeringUser.is_superuser"
>
<b-col
lg=
"2"
>
<b-badge
variant=
"info"
style=
"width:80%;"
>
Owners:
</b-badge>
<img
src=
"../assets/16x16/emblem-system.png"
alt=
"edit"
@
click=
"$refs.appModalSuperuser.showModalOwners()"
>
</b-col>
<b-col
lg=
"10"
>
<div
v-if=
"loaded.owners"
>
<p
v-if=
"shows[currentShow].owners.length === 0"
>
<small><i>
(none set)
</i></small>
</p>
<p
v-else
>
<!-- TODO: make link on name; when user clicks, open modal to edit host -->
<ul>
<li
v-for=
"owner in current.owners"
:key=
"owner.id"
>
{{ owner.first_name }} {{ owner.last_name }}
<b-badge
variant=
"light"
>
username:
</b-badge>
<small>
{{ owner.username }}
</small>
<span
v-if=
"owner.email.length > 0"
>
<b-badge
variant=
"light"
>
email:
</b-badge>
<small>
{{ owner.email }}
</small>
</span>
</li>
</ul>
</p>
</div>
<div
v-else
>
<img
src=
"../assets/radio.gif"
height=
"24px"
alt=
"loading data"
><br>
</div>
</b-col>
</b-row>
<hr
v-if=
"$parent.user.steeringUser.is_superuser"
>
<b-row>
<b-row>
<b-col
lg=
"2"
>
<b-col
lg=
"2"
>
<b-badge
style=
"width:80%;"
>
<b-badge
style=
"width:80%;"
>
...
@@ -671,7 +722,8 @@ export default {
...
@@ -671,7 +722,8 @@ export default {
topics
:
false
,
topics
:
false
,
musicfocus
:
false
,
musicfocus
:
false
,
fundingcategory
:
false
,
fundingcategory
:
false
,
type
:
false
type
:
false
,
owners
:
false
,
},
},
// the current object is used to hold all the necessary data to describe
// the current object is used to hold all the necessary data to describe
...
@@ -695,7 +747,8 @@ export default {
...
@@ -695,7 +747,8 @@ export default {
note
:
{},
note
:
{},
notes
:
[],
notes
:
[],
image
:
''
,
image
:
''
,
logo
:
''
logo
:
''
,
owners
:
[],
},
},
// this is used to configure the table with all the filtered timeslots
// this is used to configure the table with all the filtered timeslots
...
@@ -812,6 +865,7 @@ export default {
...
@@ -812,6 +865,7 @@ export default {
this
.
loaded
.
languages
=
false
this
.
loaded
.
languages
=
false
this
.
loaded
.
musicfocus
=
false
this
.
loaded
.
musicfocus
=
false
this
.
loaded
.
fundingcategory
=
false
this
.
loaded
.
fundingcategory
=
false
this
.
loaded
.
owners
=
false
// set the current show and its ID to whatever we want to switch to now
// set the current show and its ID to whatever we want to switch to now
this
.
currentShow
=
index
this
.
currentShow
=
index
this
.
currentShowID
=
this
.
shows
[
this
.
currentShow
].
id
this
.
currentShowID
=
this
.
shows
[
this
.
currentShow
].
id
...
@@ -829,6 +883,9 @@ export default {
...
@@ -829,6 +883,9 @@ export default {
this
.
getMusicfocus
()
this
.
getMusicfocus
()
this
.
getFundingCategory
()
this
.
getFundingCategory
()
this
.
getType
()
this
.
getType
()
if
(
this
.
$parent
.
user
.
steeringUser
.
is_superuser
)
{
this
.
getOwners
()
}
// now fetch the timeslots (including notes) for a given show from PV backend
// now fetch the timeslots (including notes) for a given show from PV backend
this
.
getTimeslots
(
this
.
dateStart
,
this
.
dateEnd
,
this
.
numSlots
)
this
.
getTimeslots
(
this
.
dateStart
,
this
.
dateEnd
,
this
.
numSlots
)
},
},
...
@@ -1124,6 +1181,29 @@ export default {
...
@@ -1124,6 +1181,29 @@ export default {
if
(
!
loadingError
)
{
this
.
loaded
.
type
=
true
}
if
(
!
loadingError
)
{
this
.
loaded
.
type
=
true
}
},
},
getOwners
:
function
()
{
this
.
current
.
owners
=
[]
let
loadingError
=
false
if
(
this
.
shows
[
this
.
currentShow
].
owners
.
length
===
0
)
{
this
.
loaded
.
owners
=
true
}
else
{
for
(
let
i
in
this
.
shows
[
this
.
currentShow
].
owners
)
{
axios
.
get
(
process
.
env
.
VUE_APP_API_STEERING
+
'
users/
'
+
this
.
shows
[
this
.
currentShow
].
owners
[
i
]
+
'
/
'
,
{
withCredentials
:
true
,
headers
:
{
'
Authorization
'
:
'
Bearer
'
+
this
.
$parent
.
user
.
access_token
}
}).
then
(
response
=>
{
this
.
current
.
owners
.
push
(
response
.
data
)
}).
catch
(
error
=>
{
loadingError
=
true
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not load owner data. See console for details.
'
)
})
}
if
(
!
loadingError
)
{
this
.
loaded
.
owners
=
true
}
}
},
// Just a placeholder function we can use in the UI, to signal if something
// Just a placeholder function we can use in the UI, to signal if something
// is not yet implemented
// is not yet implemented
notYetImplemented
:
function
()
{
notYetImplemented
:
function
()
{
...
...
src/components/ShowManagerModalSuperuser.vue
View file @
eaa48a73
...
@@ -248,6 +248,10 @@ export default {
...
@@ -248,6 +248,10 @@ export default {
this
.
$refs
.
modalDeleteShow
.
show
()
this
.
$refs
.
modalDeleteShow
.
show
()
},
},
showModalOwners
()
{
alert
(
'
coming soon
'
)
},
// fetch all available (that is: active) show type from steering
// fetch all available (that is: active) show type from steering
loadTypes
()
{
loadTypes
()
{
this
.
loaded
.
types
=
false
this
.
loaded
.
types
=
false
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment