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
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
panikdb
Commits
e7c5b954
Commit
e7c5b954
authored
Sep 22, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a link to view page online
parent
b4376229
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
2 deletions
+23
-2
panikdb/customtags/__init__.py
panikdb/customtags/__init__.py
+0
-0
panikdb/customtags/templatetags/__init__.py
panikdb/customtags/templatetags/__init__.py
+0
-0
panikdb/customtags/templatetags/panikdbtags.py
panikdb/customtags/templatetags/panikdbtags.py
+16
-0
panikdb/settings.py
panikdb/settings.py
+2
-0
panikdb/templates/base.html
panikdb/templates/base.html
+5
-2
No files found.
panikdb/customtags/__init__.py
0 → 100644
View file @
e7c5b954
panikdb/customtags/templatetags/__init__.py
0 → 100644
View file @
e7c5b954
panikdb/customtags/templatetags/panikdbtags.py
0 → 100644
View file @
e7c5b954
from
django.template
import
Library
from
django.conf
import
settings
from
emissions.models
import
Emission
,
Episode
,
NewsItem
register
=
Library
()
@
register
.
filter
def
online_url
(
object
):
if
isinstance
(
object
,
NewsItem
):
return
settings
.
WEBSITE_BASE_URL
+
'news/'
+
object
.
slug
if
isinstance
(
object
,
Emission
):
return
settings
.
WEBSITE_BASE_URL
+
'emissions/'
+
object
.
slug
+
'/'
if
isinstance
(
object
,
Episode
):
return
settings
.
WEBSITE_BASE_URL
+
'emissions/'
+
object
.
emission
.
slug
+
'/'
+
object
.
slug
return
'XXX'
panikdb/settings.py
View file @
e7c5b954
...
...
@@ -132,6 +132,7 @@ INSTALLED_APPS = (
'django_bootstrap_staticfiles'
,
'emissions'
,
'panikdb.aa'
,
'panikdb.customtags'
,
)
# A sample logging configuration. The only tangible logging
...
...
@@ -189,6 +190,7 @@ CACHES = {
AUTH_USER_MODEL
=
'aa.User'
LOGIN_REDIRECT_URL
=
'/'
WEBSITE_BASE_URL
=
'http://test-web.radiopanik.org/'
try
:
from
local_settings
import
*
...
...
panikdb/templates/base.html
View file @
e7c5b954
{% load url from future %}
{% load i18n %}
{% load panikdbtags %}
<!DOCTYPE html>
<html>
<head>
...
...
@@ -42,8 +43,10 @@
{% block user-links %}
<a
href=
"{% url 'home' %}"
class=
"icon-home-space"
>
Accueil
</a>
<a
target=
"blank"
href=
"http://stats.radiopanik.org/index.php?module=Login&action=logme&login=panikdb&password=d48fb8e3a453d965901339e6b020538f"
class=
"icon-bar-chart"
>
Statistiques
</a>
{% block online-page %}
<!--<a href="#" class="icon-eye-open">Page en ligne</a>-->
{% block online-url %}
{% if object %}
<a
href=
"{{ object|online_url }}"
target=
"blank"
class=
"icon-eye-open"
>
Voir en ligne
</a>
{% endif %}
{% endblock %}
<span
class=
"right"
>
...
...
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