Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
redl
redeleitsystem
Commits
dfecd5d9
Commit
dfecd5d9
authored
Nov 08, 2015
by
Robin Sonnabend
Browse files
Previous tut (erstmal) wieder
parent
6928922e
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/admin.py
View file @
dfecd5d9
...
@@ -325,8 +325,8 @@ def statement_delete():
...
@@ -325,8 +325,8 @@ def statement_delete():
@
admin_permission
.
require
()
@
admin_permission
.
require
()
def
statement_undo
():
def
statement_undo
():
topic_id
=
request
.
args
.
get
(
"topic_id"
,
None
)
topic_id
=
request
.
args
.
get
(
"topic_id"
,
None
)
if
statement
_id
is
not
None
:
if
topic
_id
is
not
None
:
statement
=
Statement
.
query
.
filter_by
(
executed
=
True
).
order_by
(
db
.
desc
(
Statement
.
execution_time
)).
first
()
statement
=
Statement
.
query
.
filter_by
(
executed
=
True
,
topic_id
=
topic_id
).
order_by
(
db
.
desc
(
Statement
.
execution_time
)).
first
()
statement
.
undo
()
statement
.
undo
()
db
.
session
.
commit
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
".topic_show"
,
id
=
topic_id
))
return
redirect
(
url_for
(
".topic_show"
,
id
=
topic_id
))
...
...
templates/admin_topic_show.html
View file @
dfecd5d9
...
@@ -59,7 +59,7 @@
...
@@ -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>
<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>
</li>
{% endif %}
{% 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_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><a
href=
"{{ url_for("
.
topic_show
",
id=
topic.get_previous_index())
}}"
><i
class=
"material-icons"
>
arrow_backward
</i>
Previous Topic
</a></li>
<li>
<li>
...
...
Write
Preview
Supports
Markdown
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