Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-nonstop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-nonstop
Commits
48281229
Commit
48281229
authored
Oct 05, 2017
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add links to nonstop home, and handle permissions
parent
8001623b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
57 additions
and
2 deletions
+57
-2
nonstop/templates/nonstop/artist_detail.html
nonstop/templates/nonstop/artist_detail.html
+5
-0
nonstop/templates/nonstop/artist_list.html
nonstop/templates/nonstop/artist_list.html
+5
-0
nonstop/templates/nonstop/cleanup.html
nonstop/templates/nonstop/cleanup.html
+5
-0
nonstop/templates/nonstop/quick_links.html
nonstop/templates/nonstop/quick_links.html
+7
-0
nonstop/templates/nonstop/recent_tracks.html
nonstop/templates/nonstop/recent_tracks.html
+5
-0
nonstop/templates/nonstop/search.html
nonstop/templates/nonstop/search.html
+5
-0
nonstop/templates/nonstop/somalogline_archive_day.html
nonstop/templates/nonstop/somalogline_archive_day.html
+2
-1
nonstop/templates/nonstop/statistics.html
nonstop/templates/nonstop/statistics.html
+5
-0
nonstop/templates/nonstop/track_detail.html
nonstop/templates/nonstop/track_detail.html
+8
-0
nonstop/templates/nonstop/upload.html
nonstop/templates/nonstop/upload.html
+6
-1
nonstop/views.py
nonstop/views.py
+4
-0
No files found.
nonstop/templates/nonstop/artist_detail.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop - Artist: {{ object.name }}
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<h3>
{% trans "Most recently played" %}
</h3>
...
...
nonstop/templates/nonstop/artist_list.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop - Artists
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<ul
class=
"artists-list"
>
...
...
nonstop/templates/nonstop/cleanup.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop{% if zone %} — {{zone.title}} — {{count}} tracks{% endif %}
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<form
id=
"track-search"
>
{{ form.as_p }}
...
...
nonstop/templates/nonstop/quick_links.html
View file @
48281229
...
...
@@ -5,14 +5,21 @@
<h2>
Nonstop
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<ul>
<li><a
href=
"{% url 'nonstop-today' %}"
>
Aujourd'hui
</a>
(avec des liens pour naviguer vers les autres jours)
</li>
<li><a
href=
"{% url 'artist-list' %}"
>
Artistes
</a>
présents (un jour ou l'autre) dans le nonstop
</li>
<li><a
href=
"{% url 'nonstop-search' %}"
>
Recherche
</a>
dans les pistes et artistes
</li>
{% if perms.nonstop.add_track %}
<li><a
href=
"{% url 'nonstop-upload-tracks' %}"
>
Ajout de nouveaux morceaux
</a></li>
<li><a
href=
"{% url 'nonstop-recent-tracks' %}"
>
Édition rapide de métadonnées de nouveaux morceaux
</a>
(langue, Instru, SABAM, CFWB)
</li>
<li><a
href=
"{% url 'nonstop-cleanup' %}"
>
Nettoyage de vieux morceaux
</a></li>
{% endif %}
</ul>
{% endblock %}
nonstop/templates/nonstop/recent_tracks.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop - {% trans "Recent Tracks" %}
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %}
...
...
nonstop/templates/nonstop/search.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<form
id=
"track-search"
>
{{ form.as_p }}
...
...
nonstop/templates/nonstop/somalogline_archive_day.html
View file @
48281229
...
...
@@ -8,7 +8,8 @@
{% endblock %}
{% block more-user-links %}
<a
href=
"{% url 'nonstop-today' %}"
>
Aujourd'hui
</a>
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
...
...
nonstop/templates/nonstop/statistics.html
View file @
48281229
...
...
@@ -7,6 +7,11 @@
<a
href=
"?from=-30d"
>
during last month
</a>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<div
class=
"nonstop-stats"
>
...
...
nonstop/templates/nonstop/track_detail.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop - Track: {{ object.artist.name }} / {{ object.title }}
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
{% if not object.file_exists %}
...
...
@@ -31,6 +36,7 @@
<p>
In nonstop since {{ object.added_to_nonstop_timestamp|date:"SHORT_DATE_FORMAT" }}.
</p>
{% if perms.nonstop.add_track %}
<form
method=
"POST"
>
{% csrf_token %}
{{ metadata_form.as_p }}
...
...
@@ -41,6 +47,8 @@
</div>
{% endif %}
{% endif %}
<style>
ul
.soma-list
{
float
:
left
;
...
...
nonstop/templates/nonstop/upload.html
View file @
48281229
...
...
@@ -5,6 +5,11 @@
<h2>
Nonstop - {% trans "Upload" %}
</h2>
{% endblock %}
{% block more-user-links %}
{{ block.super }}
<a
href=
"{% url 'nonstop-quick-links' %}"
>
Gestion nonstop
</a>
{% endblock %}
{% block content %}
<form
method=
"post"
enctype=
"multipart/form-data"
>
...
...
@@ -14,7 +19,7 @@
{{ form.as_p }}
<div
class=
"buttons"
>
<button
class=
"submit-button"
>
{% trans "Upload" %}
</button>
<a
class=
"cancel"
href=
"
...
"
>
{% trans "Cancel" %}
</a>
<a
class=
"cancel"
href=
"
{% url 'nonstop-quick-links' %}
"
>
{% trans "Cancel" %}
</a>
</div>
</form>
...
...
nonstop/views.py
View file @
48281229
...
...
@@ -69,6 +69,7 @@ class TrackDetailView(DetailView):
return
ctx
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
assert
self
.
request
.
user
.
has_perm
(
'nonstop.add_tracks'
)
instance
=
self
.
get_object
()
old_nonstop_zones
=
copy
.
copy
(
instance
.
nonstop_zones
.
all
())
form
=
TrackMetaForm
(
request
.
POST
,
instance
=
instance
)
...
...
@@ -171,6 +172,7 @@ class UploadTracksView(FormView):
success_url
=
'.'
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
assert
self
.
request
.
user
.
has_perm
(
'nonstop.add_tracks'
)
form_class
=
self
.
get_form_class
()
form
=
self
.
get_form
(
form_class
)
tracks
=
request
.
FILES
.
getlist
(
'tracks'
)
...
...
@@ -228,6 +230,7 @@ class RecentTracksView(ListView):
return
Track
.
objects
.
exclude
(
creation_timestamp__isnull
=
True
)
.
order_by
(
'-creation_timestamp'
)[:
50
]
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
assert
self
.
request
.
user
.
has_perm
(
'nonstop.add_tracks'
)
for
track_id
in
request
.
POST
.
getlist
(
'track'
):
track
=
Track
.
objects
.
get
(
id
=
track_id
)
track
.
language
=
request
.
POST
.
get
(
'lang-
%
s'
%
track_id
,
''
)
...
...
@@ -302,6 +305,7 @@ class CleanupView(TemplateView):
return
ctx
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
assert
self
.
request
.
user
.
has_perm
(
'nonstop.add_tracks'
)
count
=
0
for
track_id
in
request
.
POST
.
getlist
(
'track'
):
if
request
.
POST
.
get
(
'remove-
%
s'
%
track_id
):
...
...
Write
Preview
Markdown
is supported
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