Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-nonstop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-nonstop
Commits
88f62b7e
Commit
88f62b7e
authored
Nov 01, 2014
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add track view
parent
11ac959f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
3 deletions
+26
-3
nonstop/models.py
nonstop/models.py
+4
-0
nonstop/templates/nonstop/somalogline_archive_day.html
nonstop/templates/nonstop/somalogline_archive_day.html
+3
-1
nonstop/templates/nonstop/track_detail.html
nonstop/templates/nonstop/track_detail.html
+11
-0
nonstop/urls.py
nonstop/urls.py
+2
-1
nonstop/views.py
nonstop/views.py
+6
-1
No files found.
nonstop/models.py
View file @
88f62b7e
from
django.core.urlresolvers
import
reverse
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
...
...
@@ -28,6 +29,9 @@ class Track(models.Model):
sabam
=
models
.
BooleanField
(
'SABAM'
,
default
=
True
)
cfwb
=
models
.
BooleanField
(
'CFWB'
,
default
=
False
)
def
get_absolute_url
(
self
):
return
reverse
(
'track-view'
,
kwargs
=
{
'pk'
:
self
.
id
})
class
NonstopFile
(
models
.
Model
):
filepath
=
models
.
CharField
(
_
(
'Filepath'
),
max_length
=
255
)
...
...
nonstop/templates/nonstop/somalogline_archive_day.html
View file @
88f62b7e
...
...
@@ -9,8 +9,10 @@
<ul
class=
"soma-list"
>
{% for somalog in object_list %}
<li><span
class=
"timestamp"
>
{{ somalog.play_timestamp|date:"H:i" }}
</span>
:
<span
class=
"tracktitle"
>
{{ somalog.filepath.track.title }}
</span>
{% if somalog.filepath.track %}
<a
href=
"{{ somalog.filepath.track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.filepath.track.title }}
</a>
<span
class=
"trackartist"
>
({{ somalog.filepath.track.artist.name }})
</span>
{% endif %}
<span
class=
"filepath"
>
{{ somalog.filepath.short }}
</span>
</li>
{% endfor %}
...
...
nonstop/templates/nonstop/track_detail.html
0 → 100644
View file @
88f62b7e
{% extends "base.html" %}
{% block appbar %}
<h2>
Nonstop - Track: {{ object.title }}
</h2>
{% endblock %}
{% block content %}
<p>
{{ object.artist.name }}
</p>
{% endblock %}
nonstop/urls.py
View file @
88f62b7e
from
django.conf.urls
import
url
from
.views
import
SomaDayArchiveView
,
RedirectTodayView
from
.views
import
SomaDayArchiveView
,
RedirectTodayView
,
TrackDetailView
urlpatterns
=
[
# Example: /2012/nov/10/
url
(
r
'^$'
,
RedirectTodayView
.
as_view
()),
url
(
r
'^tracks/(?P<pk>\d+)/$'
,
TrackDetailView
.
as_view
(),
name
=
'track-view'
),
url
(
r
'^(?P<year>[0-9]{4})/(?P<month>[-\w]+)/(?P<day>[0-9]+)/$'
,
SomaDayArchiveView
.
as_view
(),
name
=
"archive_day"
),
...
...
nonstop/views.py
View file @
88f62b7e
...
...
@@ -3,8 +3,9 @@ import datetime
from
django.core.urlresolvers
import
reverse
from
django.views.generic.base
import
RedirectView
from
django.views.generic.dates
import
DayArchiveView
from
django.views.generic.detail
import
DetailView
from
.models
import
SomaLogLine
from
.models
import
SomaLogLine
,
Track
class
SomaDayArchiveView
(
DayArchiveView
):
queryset
=
SomaLogLine
.
objects
.
all
()
...
...
@@ -21,3 +22,7 @@ class RedirectTodayView(RedirectView):
'year'
:
today
.
year
,
'month'
:
today
.
month
,
'day'
:
today
.
day
})
class
TrackDetailView
(
DetailView
):
model
=
Track
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