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
P
panikdb
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
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
panikdb
Commits
75e4571e
Commit
75e4571e
authored
Sep 22, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a contextual button to top links
parent
c219eaaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
panikdb/customtags/templatetags/panikdbtags.py
panikdb/customtags/templatetags/panikdbtags.py
+19
-0
panikdb/static/css/style.css
panikdb/static/css/style.css
+5
-1
panikdb/templates/base.html
panikdb/templates/base.html
+10
-0
No files found.
panikdb/customtags/templatetags/panikdbtags.py
View file @
75e4571e
from
django.template
import
Library
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
emissions.models
import
Emission
,
Episode
,
NewsItem
...
...
@@ -14,3 +15,21 @@ def online_url(object):
if
isinstance
(
object
,
Episode
):
return
settings
.
WEBSITE_BASE_URL
+
'emissions/'
+
object
.
emission
.
slug
+
'/'
+
object
.
slug
return
'XXX'
@
register
.
filter
def
context_url
(
object
):
if
isinstance
(
object
,
NewsItem
)
and
object
.
emission
:
return
reverse
(
'emission-view'
,
kwargs
=
{
'slug'
:
object
.
emission
.
slug
})
if
isinstance
(
object
,
Episode
):
return
reverse
(
'emission-view'
,
kwargs
=
{
'slug'
:
object
.
emission
.
slug
})
return
None
@
register
.
filter
def
context_title
(
object
):
if
isinstance
(
object
,
NewsItem
)
and
object
.
emission
:
return
object
.
emission
.
title
if
isinstance
(
object
,
Episode
):
return
object
.
emission
.
title
return
None
panikdb/static/css/style.css
View file @
75e4571e
...
...
@@ -471,9 +471,13 @@ span.add-on {
background
:
#aaa
;
}
#user-links
span
.middle
{
padding-left
:
15px
;
}
#user-links
span
.right
{
position
:
absolute
;
right
:
15
px
;
right
:
20
px
;
}
...
...
panikdb/templates/base.html
View file @
75e4571e
...
...
@@ -49,6 +49,16 @@
{% endif %}
{% endblock %}
{% if object %}
{% with object|context_url as context_url %}
{% if context_url %}
<span
class=
"middle"
>
<a
href=
"{{ object|context_url }} "
>
{{ object|context_title }}
</a>
</span>
{% endif %}
{% endwith %}
{% endif %}
<span
class=
"right"
>
<a
href=
"{% url 'auth_password_change' %}"
>
Changement de mot de passe
</a>
<a
href=
"{% url 'logout' %}"
>
Déconnexion
</a>
...
...
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