Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redeleitsystem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redl
redeleitsystem
Commits
88eae95f
Commit
88eae95f
authored
9 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
Mostly changes to admin_topic_show
parent
ff9627d0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/database.py
+5
-0
5 additions, 0 deletions
models/database.py
modules/admin.py
+9
-1
9 additions, 1 deletion
modules/admin.py
templates/admin_topic_show.html
+8
-1
8 additions, 1 deletion
templates/admin_topic_show.html
with
22 additions
and
2 deletions
models/database.py
+
5
−
0
View file @
88eae95f
...
...
@@ -148,3 +148,8 @@ class Statement(db.Model):
self
.
execution_time
=
datetime
.
now
()
return
True
def
undo
(
self
):
if
not
self
.
executed
:
return
False
self
.
executed
=
False
self
.
execution_time
=
datetime
(
1970
,
1
,
1
)
This diff is collapsed.
Click to expand it.
modules/admin.py
+
9
−
1
View file @
88eae95f
...
...
@@ -189,7 +189,7 @@ def topic_edit():
if
form
.
validate_on_submit
():
form
.
populate_obj
(
topic
)
db
.
session
.
commit
()
return
redirect
(
url_for
(
"
.
index
"
))
return
redirect
(
url_for
(
"
.
topic_show
"
,
id
=
topic
.
id
))
else
:
return
render_layout
(
"
admin_topic_edit.html
"
,
form
=
form
,
id
=
topic_id
)
else
:
...
...
@@ -256,3 +256,11 @@ def statement_delete():
return
redirect
(
url_for
(
"
.topic_show
"
,
id
=
topic_id
))
return
redirect
(
url_for
(
"
.index
"
))
@admin.route
(
"
/statement/undo
"
)
@login_required
@admin_permission.require
()
def
statement_undo
():
statement
=
Statement
.
query
.
filter_by
(
executed
=
True
).
order_by
(
db
.
desc
(
Statement
.
execution_time
)).
first
()
statement
.
undo
()
db
.
session
.
commit
()
return
redirect
(
url_for
(
"
.topic_show
"
,
id
=
statement
.
topic
.
id
))
This diff is collapsed.
Click to expand it.
templates/admin_topic_show.html
+
8
−
1
View file @
88eae95f
...
...
@@ -35,5 +35,12 @@
</tbody>
</table>
</div>
{{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--3-col mdl-cell-3-col-tablet mdl-cell--4-col-phone") }}
<div
class=
"mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing"
>
{{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone") }}
<div
class=
"mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone"
>
<ul
class=
"mdl-menu"
>
<li
class=
"mdl-menu__item"
><a
class=
"mdl-navigation__link"
href=
"{{ url_for("
.
statement_undo
")
}}"
><i
class=
"material-icons"
role=
"presentation"
>
undo
</i>
Undo
</a></li>
</ul>
</div>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment