Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
django-panik-nonstop
Commits
7182bf01
Commit
7182bf01
authored
Jul 02, 2020
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add direct track reference into logline record
parent
17f771e0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
9 deletions
+38
-9
nonstop/migrations/0026_somalogline_track.py
nonstop/migrations/0026_somalogline_track.py
+21
-0
nonstop/models.py
nonstop/models.py
+8
-0
nonstop/templates/nonstop/artist_detail.html
nonstop/templates/nonstop/artist_detail.html
+3
-3
nonstop/templates/nonstop/somalogline_archive_day.html
nonstop/templates/nonstop/somalogline_archive_day.html
+3
-3
nonstop/templates/nonstop/track_detail.html
nonstop/templates/nonstop/track_detail.html
+3
-3
No files found.
nonstop/migrations/0026_somalogline_track.py
0 → 100644
View file @
7182bf01
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-07-02 09:58
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'nonstop'
,
'0025_recurringrandomdirectorydiffusion_recurringrandomdirectoryoccurence'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'somalogline'
,
name
=
'track'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'nonstop.Track'
),
),
]
nonstop/models.py
View file @
7182bf01
...
...
@@ -158,9 +158,17 @@ class SomaLogLine(models.Model):
ordering
=
[
'play_timestamp'
]
filepath
=
models
.
ForeignKey
(
NonstopFile
)
track
=
models
.
ForeignKey
(
Track
,
null
=
True
)
play_timestamp
=
models
.
DateTimeField
()
on_air
=
models
.
NullBooleanField
(
'On Air'
)
def
get_track
(
self
):
if
self
.
track_id
:
return
self
.
track
if
self
.
filepath_id
:
return
self
.
filepath
.
track
return
None
class
Jingle
(
models
.
Model
):
class
Meta
:
...
...
nonstop/templates/nonstop/artist_detail.html
View file @
7182bf01
...
...
@@ -17,9 +17,9 @@
<ul
class=
"soma-list"
>
{% for somalog in object.recent_diffusions|slice:":20" %}
<li><span
class=
"timestamp"
>
{{ somalog.play_timestamp|date:"d/m/Y H:i" }}
</span>
:
{% if somalog.
filepath.
track %}
<a
href=
"{{ somalog.
filepath.
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
filepath.
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
filepath.
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
filepath.
track.artist.name }}
</a>
)
</span>
{% if somalog.
get_
track %}
<a
href=
"{{ somalog.
get_
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
get_
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
get_
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
get_
track.artist.name }}
</a>
)
</span>
{% endif %}
<span
class=
"filepath"
>
{{ somalog.filepath.short }}
</span>
</li>
...
...
nonstop/templates/nonstop/somalogline_archive_day.html
View file @
7182bf01
...
...
@@ -17,9 +17,9 @@
<ul
class=
"soma-list"
>
{% for somalog in object_list %}
<li
class=
"on-air-{{ somalog.on_air }}"
><span
class=
"timestamp"
>
{{ somalog.play_timestamp|date:"H:i" }}
</span>
:
{% if somalog.
filepath.
track %}
<a
href=
"{{ somalog.
filepath.
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
filepath.
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
filepath.
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
filepath.
track.artist.name }}
</a>
)
</span>
{% if somalog.
get_
track %}
<a
href=
"{{ somalog.
get_
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
get_
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
get_
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
get_
track.artist.name }}
</a>
)
</span>
{% endif %}
<span
class=
"filepath"
>
{{ somalog.filepath.short }}
</span>
</li>
...
...
nonstop/templates/nonstop/track_detail.html
View file @
7182bf01
...
...
@@ -19,9 +19,9 @@
<ul
class=
"soma-list"
>
{% for somalog in object.recent_diffusions|slice:":20" %}
<li><span
class=
"timestamp"
>
{{ somalog.play_timestamp|date:"d/m/Y H:i" }}
</span>
:
{% if somalog.
filepath.
track %}
<a
href=
"{{ somalog.
filepath.
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
filepath.
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
filepath.
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
filepath.
track.artist.name }}
</a>
)
</span>
{% if somalog.
get_
track %}
<a
href=
"{{ somalog.
get_
track.get_absolute_url }}"
class=
"tracktitle"
>
{{ somalog.
get_
track.title }}
</a>
<span
class=
"trackartist"
>
(
<a
href=
"{{ somalog.
get_
track.artist.get_absolute_url }}"
class=
"trackartist"
>
{{ somalog.
get_
track.artist.name }}
</a>
)
</span>
{% endif %}
<span
class=
"filepath"
>
{{ somalog.filepath.short }}
</span>
</li>
...
...
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