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
panikdb
Commits
e97101bb
Commit
e97101bb
authored
Apr 21, 2015
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't allow focus on soundfiles without a type
parent
5253438b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
panikdb/customtags/templatetags/panikdbtags.py
panikdb/customtags/templatetags/panikdbtags.py
+2
-2
panikdb/templates/base.html
panikdb/templates/base.html
+1
-1
panikdb/templates/emissions/episode_detail.html
panikdb/templates/emissions/episode_detail.html
+3
-1
No files found.
panikdb/customtags/templatetags/panikdbtags.py
View file @
e97101bb
...
...
@@ -95,13 +95,13 @@ def set_focus_url(object):
@
register
.
filter
def
can_focus
(
object
):
if
isinstance
(
object
,
NewsItem
):
return
True
return
bool
(
object
.
category
and
object
.
image
)
elif
isinstance
(
object
,
Emission
):
return
True
elif
isinstance
(
object
,
Episode
):
return
True
elif
isinstance
(
object
,
SoundFile
):
return
True
return
bool
(
object
.
format
)
return
False
...
...
panikdb/templates/base.html
View file @
e97101bb
...
...
@@ -52,7 +52,7 @@
{% endif %}
{% endblock %}
{% block manage-focus %}
{% if object|can_focus %}
{% if object|can_focus
or object|has_focus
%}
{% if perms.emissions.add_focus %}
{% if object|has_focus %}
<a
class=
"icon-pushpin"
href=
"{{ object|unset_focus_url }}"
>
Retirer le focus
</a>
...
...
panikdb/templates/emissions/episode_detail.html
View file @
e97101bb
...
...
@@ -100,7 +100,9 @@ Tags :
{% if soundfile.has_focus %}
✓
<a
class=
"icon-pushpin"
href=
"{{ soundfile|unset_focus_url }}"
>
retirer
</a>
{% else %}
<a
class=
"icon-pushpin"
href=
"{{ soundfile|set_focus_url }}"
>
mettre
</a>
{% if soundfile.format %}
<a
class=
"icon-pushpin"
href=
"{{ soundfile|set_focus_url }}"
>
mettre
</a>
{% endif %}
{% endif %}
</td>
{% endif %}
...
...
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