Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
panikdb
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
panikdb
Commits
c7507e67
Commit
c7507e67
authored
Dec 27, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for notification messages
parent
b6e5ba37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
+29
-2
panikdb/static/css/style.css
panikdb/static/css/style.css
+14
-0
panikdb/templates/base.html
panikdb/templates/base.html
+10
-0
panikdb/urls.py
panikdb/urls.py
+1
-1
panikdb/views.py
panikdb/views.py
+4
-1
No files found.
panikdb/static/css/style.css
View file @
c7507e67
...
...
@@ -532,6 +532,20 @@ div.text {
margin-bottom
:
1em
;
}
ul
.messages
{
position
:
absolute
;
background
:
rgba
(
10
,
10
,
10
,
0.8
);
display
:
block
;
top
:
5px
;
right
:
0px
;
color
:
white
;
border-radius
:
1em
;
list-style
:
none
;
z-index
:
10
;
box-shadow
:
0px
0px
5px
black
;
}
[
class
^=
"icon-"
]
:after
,
[
class
*=
" icon-"
]
:after
,
[
class
^=
"icon-"
]
:before
,
[
class
*=
" icon-"
]
:before
{
font-family
:
FontAwesome
;
...
...
panikdb/templates/base.html
View file @
c7507e67
...
...
@@ -92,6 +92,16 @@
{% endblock %}
</div>
{% block beforecontent %}
{% if messages %}
<ul
class=
"messages"
>
{% for message in messages %}
<li
{%
if
message
.
tags
%}
class=
"{{ message.tags }}"
{%
endif
%}
>
{{ message }}
</li>
{% endfor %}
</ul>
<script>
$
(
document
).
ready
(
function
()
{
$
(
'
.messages
'
).
delay
(
5000
).
fadeOut
(
'
slow
'
);
});
</script>
{% endif %}
{% endblock %}
{% block content %}
{% endblock %}
...
...
panikdb/urls.py
View file @
c7507e67
...
...
@@ -27,7 +27,7 @@ urlpatterns = patterns('',
url
(
r'^search/'
,
search_view_factory
(
view_class
=
FacetedSearchView
,
form_class
=
FacetedSearchForm
,
searchqueryset
=
sqs
),
name
=
'haystack_search'
),
url
(
r'^emissions/$'
,
'panikdb.views.emissions'
,
name
=
'emission-list'
),
url
(
r'^emissions/$'
,
'panikdb.views.emissions
_list
'
,
name
=
'emission-list'
),
url
(
r'^emissions/'
,
decorated_includes
(
login_required
,
include
(
emissions_urlpatterns
))),
...
...
panikdb/views.py
View file @
c7507e67
...
...
@@ -6,6 +6,7 @@ from django.core.urlresolvers import reverse
from
django.template
import
loader
,
Context
from
django.views.generic.base
import
TemplateView
,
RedirectView
from
django.views.generic.list
import
ListView
from
django.contrib
import
messages
from
emissions.models
import
*
from
emissions.utils
import
period_program
...
...
@@ -31,7 +32,7 @@ home = login_required(Home.as_view())
class
EmissionListView
(
emissions
.
views
.
EmissionListView
):
pass
emissions
=
login_required
(
EmissionListView
.
as_view
())
emissions
_list
=
login_required
(
EmissionListView
.
as_view
())
...
...
@@ -95,6 +96,7 @@ class FocusSetView(RedirectView):
def
get_redirect_url
(
self
,
object_type
,
object_id
):
if
not
self
.
request
.
user
.
has_perm
(
'emissions.add_focus'
):
raise
PermissionDenied
()
messages
.
success
(
self
.
request
,
emissions
.
views
.
SUCCESS_MESSAGE
)
if
object_type
==
'emission'
:
emission
=
Emission
.
objects
.
get
(
id
=
object_id
)
try
:
...
...
@@ -149,6 +151,7 @@ class FocusUnsetView(RedirectView):
def
get_redirect_url
(
self
,
object_type
,
object_id
):
if
not
self
.
request
.
user
.
has_perm
(
'emissions.delete_focus'
):
raise
PermissionDenied
()
messages
.
success
(
self
.
request
,
emissions
.
views
.
SUCCESS_MESSAGE
)
if
object_type
==
'emission'
:
emission
=
Emission
.
objects
.
get
(
id
=
object_id
)
focus
=
Focus
.
objects
.
get
(
emission
=
emission
)
...
...
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