Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
hesafredrika
server
Compare Revisions
d44fd43a9fc88320c54fdb2be6bdcba3ce21840b...8a1e41ea58dad0eac72acc0a16b7943c98f3a52e
Source
8a1e41ea58dad0eac72acc0a16b7943c98f3a52e
Select Git revision
...
Target
d44fd43a9fc88320c54fdb2be6bdcba3ce21840b
Select Git revision
Compare
Commits (5)
Linus fixar nåt
· 23f3b620
Hesa Fredrika
authored
Sep 07, 2017
23f3b620
linus grejar
· 3e14011c
Hesa Fredrika
authored
Oct 11, 2017
3e14011c
only do location override if it is actually set
· 8b0177da
Hesa Fredrika
authored
Dec 04, 2017
8b0177da
Added a way to un-tag errors (I'm looking at you VMA-test)
· 3544e469
Hesa Fredrika
authored
Dec 04, 2017
3544e469
Changed encodeing
· 8a1e41ea
Hesa Fredrika
authored
Dec 04, 2017
8a1e41ea
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
9 deletions
+25
-9
vma.py
feedparsers/vma.py
+4
-3
forms.py
fredrika/forms.py
+2
-0
views.py
fredrika/main/views.py
+1
-0
base.html
fredrika/templates/base.html
+1
-0
logging.html
fredrika/templates/logging.html
+13
-5
message_edit.html
fredrika/templates/message_edit.html
+4
-1
No files found.
feedparsers/vma.py
View file @
8a1e41ea
...
...
@@ -132,10 +132,11 @@ def parse_feed(db, Message, topic_id, app):
'''
# Override misspelled county :/
location
=
location
.
replace
(
'Gataland'
,
'Gotaland'
)
if
location
:
location
=
location
.
replace
(
'Gataland'
,
'Gotaland'
)
# current location
logging
.
info
(
location
)
logging
.
info
(
"Location:
%
s"
,
location
)
try
:
location
=
locationfinder
(
location
)
...
...
@@ -145,7 +146,7 @@ def parse_feed(db, Message, topic_id, app):
logging
.
error
(
"
%
s location conversion with id
%
s failed!"
%
(
name
,
alert
))
msg
=
Message
()
msg
.
subject
=
u
'VMA - Viktigt Meddelande till Allmänheten'
msg
.
subject
=
'VMA - Viktigt Meddelande till Allmänheten'
msg
.
message
=
data
[
'info'
][
0
][
'resource'
][
0
][
'derefUri'
]
msg
.
active
=
True
msg
.
topic_id
=
topic_id
...
...
fredrika/forms.py
View file @
8a1e41ea
...
...
@@ -64,6 +64,7 @@ class MessageForm(Form):
location
=
TextField
(
_
(
'Location'
))
url
=
TextField
(
_
(
'URL'
))
topic_id
=
SelectField
(
_
(
'Topic'
),
coerce
=
int
)
error
=
BooleanField
(
_
(
'Error'
))
def
validate
(
self
):
check_validate
=
super
(
MessageForm
,
self
)
.
validate
()
...
...
@@ -86,6 +87,7 @@ class MessageEditForm(Form):
subject
=
TextField
(
_
(
'Subject'
))
location
=
TextField
(
_
(
'Location'
))
url
=
TextField
(
_
(
'URL'
))
error
=
BooleanField
(
_
(
'Error'
))
def
validate
(
self
):
check_validate
=
super
(
MessageEditForm
,
self
)
.
validate
()
...
...
fredrika/main/views.py
View file @
8a1e41ea
...
...
@@ -406,6 +406,7 @@ def fix():
def
sendalarm
():
e
=
False
messages
=
Message
.
query
.
filter
(
Message
.
delivered
==
'f'
,
Message
.
location
!=
None
,
Message
.
error
==
'f'
)
.
all
()
for
m
in
messages
:
# Loop over messages, make sure that we could parse something from the location
if
m
.
location
:
...
...
fredrika/templates/base.html
View file @
8a1e41ea
...
...
@@ -9,6 +9,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<link
rel=
"shortcut icon"
href=
"{{ url_for('static', filename='favicon.ico') }}"
>
<meta
name=
"flattr:id"
content=
"voqoy3"
>
{% block css %}
{% endblock %}
...
...
fredrika/templates/logging.html
View file @
8a1e41ea
...
...
@@ -6,16 +6,19 @@
<div
class=
"container-fluid"
>
<div
class=
"row"
style=
"background-color: #ccc;"
>
<div
class=
"col-sm-2"
>
<div
class=
"col-sm-2"
align=
center
>
Date - Time
</div>
<div
class=
"col-sm-1"
>
Topic
</div>
<div
class=
"col-sm-1"
>
Active
<div
class=
"col-sm-1"
align=
center
>
Active
</div>
<div
class=
"col-sm-1"
align=
center
>
Error
</div>
<div
class=
"col-sm-
4
"
>
<div
class=
"col-sm-
3
"
>
Location
</div>
<div
class=
"col-sm-1"
>
...
...
@@ -48,7 +51,12 @@
<a
href=
"{{ url_for('.logging', activate=l.id ) }} "
>
<span
class=
"icon-plus"
></a>
{%endif%}
</div>
<div
class=
"col-sm-4"
>
<div
class=
"col-sm-1"
align=
center
>
{% if l.error %}
{{ l.error }}
{% endif %}
</div>
<div
class=
"col-sm-3"
>
{% if l.location[0] %}
{{ l.location[0]['display_name'] }}
{% else %}
...
...
fredrika/templates/message_edit.html
View file @
8a1e41ea
...
...
@@ -37,7 +37,7 @@
To:
<br/>
{{ data.topic.name }}
</div>
<div
class=
"col-sm-
8
"
>
<div
class=
"col-sm-
4
"
>
Active:
<br/>
{{ form.active() }}
{% if form.active.errors %}
{% for e in form.active.errors %}
...
...
@@ -45,6 +45,9 @@
{% endfor %}
{% endif %}
</div>
<div
class=
"col-sm-4"
>
Error:
<br/>
{{ form.error() }}
</div>
</div>
{# end row #}
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
...
...