Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
redeleitsystem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
redl
redeleitsystem
Commits
559389cc
Commit
559389cc
authored
Nov 08, 2015
by
Hinrikus Wolf
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.fsmpi.rwth-aachen.de:redl/redeleitsystem
parents
c5901a6a
5b682ddb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
38 deletions
+75
-38
config.py.example
config.py.example
+0
-1
models/forms.py
models/forms.py
+2
-1
modules/admin.py
modules/admin.py
+4
-3
static/css/style.css
static/css/style.css
+10
-0
templates/admin_topic_show.html
templates/admin_topic_show.html
+5
-5
templates/macros.html
templates/macros.html
+18
-0
templates/speech_content_index.html
templates/speech_content_index.html
+36
-28
No files found.
config.py.example
View file @
559389cc
...
...
@@ -2,5 +2,4 @@ SQLALCHEMY_DATABASE_URI = "sqlite:///example.db" # SQLAlchemy connection data
SECRET_KEY = "abcdef" #
DEBUG = False # Debug Mode
UPDATE_INDEX_INTERVAL = 1 # Time in seconds between requests
UPDATE_SHOW_INTERVAL = 1 #
UPDATE_TIME_INTERVAL = 10 #
models/forms.py
View file @
559389cc
...
...
@@ -23,11 +23,12 @@ class AdminUserForm(Form):
roles
=
SelectMultipleField
(
"User roles"
,
choices
=
[(
x
.
lower
().
strip
(),
x
)
for
x
in
shared
.
roles
])
class
AddStatementForm
(
Form
):
speaker_name
=
StringField
(
"Speaker"
,
validators
=
[
InputRequired
(
"Entering the speaker is required."
)])
speaker_name
=
StringField
(
"Speaker"
,
validators
=
[
InputRequired
(
"Entering the speaker
name or number
is required."
)])
topic
=
HiddenField
(
"Topic"
)
class
EditSpeakerForm
(
Form
):
name
=
StringField
(
"Speaker"
,
validators
=
[
InputRequired
(
"Entering the speaker is required."
)])
number
=
IntegerField
(
"Number"
,
validators
=
[
Optional
(),
NumberRange
(
min
=
0
)])
topic_id
=
HiddenField
(
"Topic_id"
)
id
=
HiddenField
(
"Speaker_id"
)
...
...
modules/admin.py
View file @
559389cc
...
...
@@ -252,10 +252,11 @@ def speaker_edit():
speaker
=
Speaker
.
query
.
filter_by
(
id
=
speaker_id
).
first
()
form
=
EditSpeakerForm
(
obj
=
speaker
)
form
.
topic_id
.
data
=
topic_id
if
speaker
is
not
None
:
if
form
.
validate_on_submit
():
speaker
.
name
=
form
.
name
.
data
speaker
.
number
=
form
.
number
.
data
db
.
session
.
commit
()
return
redirect
(
url_for
(
".topic_show"
,
id
=
form
.
topic_id
.
data
))
else
:
...
...
@@ -330,8 +331,8 @@ def statement_delete():
@
admin_permission
.
require
()
def
statement_undo
():
topic_id
=
request
.
args
.
get
(
"topic_id"
,
None
)
if
statement
_id
is
not
None
:
statement
=
Statement
.
query
.
filter_by
(
executed
=
True
).
order_by
(
db
.
desc
(
Statement
.
execution_time
)).
first
()
if
topic
_id
is
not
None
:
statement
=
Statement
.
query
.
filter_by
(
executed
=
True
,
topic_id
=
topic_id
).
order_by
(
db
.
desc
(
Statement
.
execution_time
)).
first
()
statement
.
undo
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
".topic_show"
,
id
=
topic_id
))
...
...
static/css/style.css
View file @
559389cc
...
...
@@ -137,6 +137,16 @@ th.rede-medium-text {
background-color
:
#F44335
;
}
.rede-table-bg-blue
{
color
:
white
;
background-color
:
#448AFF
;
font-weight
:
bold
;
}
.rede-table-centered
>
td
{
text-align
:
center
;
}
.rede-paused-title
{
margin
:
0
auto
;
}
...
...
templates/admin_topic_show.html
View file @
559389cc
...
...
@@ -21,11 +21,11 @@
</thead>
<tbody>
{% for statement in topic.sorted_statements() %}
{% if statement.is_meta %}
{% if statement.is_meta %}
<tr
class=
"rede-table-bg-red"
>
{% else %}
<tr>
{% endif %}
{% else %}
<tr>
{% endif %}
<td
class=
"mdl-data-table__cell--non-numeric"
>
{{ statement.speaker.identifier() }}
</td>
<td
class=
"mdl-data-table__cell"
>
{{ statement.speaker.count(statement.topic) }}
</td>
<td
class=
"mdl-data-table__cell--non-numeric"
>
...
...
@@ -59,7 +59,7 @@
<a
href=
"{{ url_for("
.
statement_done
",
id=
topic.sorted_statements()[0].id,
topic_id=
topic.id)
}}"
class=
"rede-href"
><i
class=
"material-icons"
role=
"presentation"
>
redo
</i>
Next
</a>
</li>
{% endif %}
<li><a
href=
"{{ url_for("
.
statement_undo
")
}}"
class=
"rede-href"
><i
class=
"material-icons"
role=
"presentation"
>
undo
</i>
Previous
</a></li>
<li><a
href=
"{{ url_for("
.
statement_undo
"
,
topic_id=
topic.id
)
}}"
class=
"rede-href"
><i
class=
"material-icons"
role=
"presentation"
>
undo
</i>
Previous
</a></li>
<li><a
href=
"{{ url_for("
.
topic_show
",
id=
topic.get_next_index())
}}"
><i
class=
"material-icons"
>
arrow_forward
</i>
Next Topic
</a></li>
<li><a
href=
"{{ url_for("
.
topic_show
",
id=
topic.get_previous_index())
}}"
><i
class=
"material-icons"
>
arrow_backward
</i>
Previous Topic
</a></li>
<li>
...
...
templates/macros.html
View file @
559389cc
...
...
@@ -22,6 +22,22 @@
</div>
{%- endmacro %}
{% macro render_integerfield(field) -%}
<div
class=
"mdl-textfield mdl-js-textfield mdl-textfield--floating-label"
>
<input
id=
"{{ field.id }}"
name=
"{{ field.id }}"
class=
"mdl-textfield__input"
type=
"text"
{%
if
field.data
is
not
none
%}
value=
"{{ field.data }}"
{%
endif
%}
/>
<label
class=
"mdl-textfield__label"
for=
"{{ field.id }}"
>
{{ field.label.text }}
</label>
{% if field.errors %}
{% for e in field.errors %}
<div
class=
"mdl-card__supporting-text"
>
{{ e }}
</div>
{% endfor %}
{% endif %}
</div>
{%- endmacro %}
{% macro render_passwordfield(field) -%}
<div
class=
"mdl-textfield mdl-js-textfield mdl-textfield--floating-label"
>
<input
id=
"{{ field.id }}"
name=
"{{ field.id }}"
class=
"mdl-textfield__input"
type=
"password"
/>
...
...
@@ -116,6 +132,8 @@
{{ render_stringfield(f) }}
{% elif f.type == "PasswordField" %}
{{ render_passwordfield(f) }}
{% elif f.type == "IntegerField" %}
{{ render_integerfield(f) }}
{% elif f.type == "BooleanField" %}
{{ render_booleanfield(f) }}
{% elif f.type == "CSRFTokenField" %}
...
...
templates/speech_content_index.html
View file @
559389cc
{% for event in events %}
<div
class=
"mdl-cell mdl-cell--6-col mdl-cell--8-col-tablet mdl-cell--4-col-phone mdl-card mdl-shadow--2dp"
>
{% if not event.paused %}
{% if event.current_topic_id != -1 and event.get_current_topic() %}
<div
class=
"mdl-card__title"
>
{{ event.name }}: {{ event.get_current_topic().name }}
</div>
<table
class=
"mdl-data-table mdl-js-table"
style=
"min-width: 100%"
>
<thead>
<tr>
<th
class=
"mdl-data-table__cell--non-numeric"
>
Speaker
</th>
<th
class=
"mdl-data-table__cell"
>
Count
</th>
</tr>
</thead>
<tbody>
{% for statement in event.get_current_topic().sorted_statements() %}
<tr>
<td
class=
"mdl-data-table__cell--non-numeric"
>
{{ statement.speaker.identifier() }}
</td>
<td
class=
"mdl-data-table__cell"
>
{{ statement.speaker.count(event.current_topic) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div
class=
"mdl-card__title"
>
{{ event.name }}: No topic set
</div>
{% endif %}
{% else %}
{% if event.paused %}
<div
class=
"mdl-card__title rede-paused-title"
>
<h4
class=
"mdl-card__title-text rede-paused-title-text"
>
{{ event.name}}:
Paused until {{ event.paused_until.strftime("%H:%M") }}
Paused until {{ event.paused_until.strftime("%H:%M") }}
</h4>
</div>
{% endif %}
<div
class=
"mdl-card__title"
>
{{ event.name }}: {{ event.get_current_topic().name }}
</div>
<table
class=
"mdl-data-table mdl-js-table"
style=
"min-width: 100%"
>
<thead>
<tr>
<th
class=
"mdl-data-table__cell--non-numeric"
>
Speaker
</th>
<th
class=
"mdl-data-table__cell"
>
Count
</th>
</tr>
</thead>
<tbody>
{% for topic in event.topics %}
{% if topic.id == event.current_topic_id %}
<tr
class=
"rede-table-bg-blue rede-table-centered"
>
<td
colspan=
"2"
>
{{ topic.name }}
</td>
</tr>
{% for statement in event.get_current_topic().sorted_statements() %}
{% if statement.is_meta %}
<tr
class=
"rede-table-bg-red"
>
{% else %}
<tr>
{% endif %}
<td
class=
"mdl-data-table__cell--non-numeric"
>
{{ statement.speaker.identifier() }}
</td>
<td
class=
"mdl-data-table__cell"
>
{{ statement.speaker.count(event.get_current_topic()) }}
</td>
</tr>
{% endfor %}
{% else %}
<tr
class=
"rede-table-centered"
>
<td
colspan=
"2"
>
{{ topic.name }}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
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