From e9d408ec1ee694a851bcf8c3483e047be430ab18 Mon Sep 17 00:00:00 2001 From: Hinrikus Wolf <hinrikus.wolf@rwth-aachen.de> Date: Sat, 7 Nov 2015 13:10:46 +0100 Subject: [PATCH] add event support! --- templates/admin_event_edit.html | 7 ++++ templates/admin_event_index.html | 34 +++++++++++++++++++ templates/admin_event_new.html | 7 ++++ ...admin_topic_edit => admin_topic_edit.html} | 0 templates/admin_topic_index.html | 6 ++-- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 templates/admin_event_edit.html create mode 100644 templates/admin_event_index.html create mode 100644 templates/admin_event_new.html rename templates/{admin_topic_edit => admin_topic_edit.html} (100%) diff --git a/templates/admin_event_edit.html b/templates/admin_event_edit.html new file mode 100644 index 0000000..5af4db2 --- /dev/null +++ b/templates/admin_event_edit.html @@ -0,0 +1,7 @@ +{% extends "layout.html" %} +{% from "macros.html" import render_form %} +{% block title %}Edit Event - Administration{% endblock %} + +{% block content %} + {{ render_form(form, action_url=url_for(".event_edit", id=id), action_text="Apply", title="Edit Event") }} +{% endblock %} diff --git a/templates/admin_event_index.html b/templates/admin_event_index.html new file mode 100644 index 0000000..ebff41a --- /dev/null +++ b/templates/admin_event_index.html @@ -0,0 +1,34 @@ +{% extends "admin_index.html" %} +{% block admin_title %}Event{% endblock %} + +{% block content %} + <div class="mdl-cell mdl-cell--3-col mdl-grid mdl-grid--no-spacing"> + <table class="mdl-data-table mdl-js-table mdl-shadow--2dp mdl-cell mdl-cell--3-col"> + <thead> + <tr> + <th class="mdl-data-table__cell--non-numeric">Name</th> + <th class="mdl-data-table__cell--non-numeric">Delete</th> + </tr> + </thead> + <tbody> + {% for event in events %} + <tr> + <td class="mdl-data-table__cell--non-numeric"><a href="{{ url_for(".event_edit", id=event.id) }}">{{ event.name }}</a></td> + <td class="mdl-data-table__cell--non-numeric"> + <a href="{{ url_for('.event_delete', id=event.id) }}"> + <i class="material-icons">delete</i> + </a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + <div class="rede-separator"> + <div class="mdl-cell mdl-cell--1-col"> + <a class="mdl-button mdl-button--colored mdl-js-button mdl-button--fab mdl-js-ripple-effect" href="{{ url_for('.event_new') }}"> + <i class="material-icons">add</i> + </a> + </div> + </div> + </div> +{% endblock %} diff --git a/templates/admin_event_new.html b/templates/admin_event_new.html new file mode 100644 index 0000000..81ac4ee --- /dev/null +++ b/templates/admin_event_new.html @@ -0,0 +1,7 @@ +{% extends "layout.html" %} +{% from "macros.html" import render_form %} +{% block title %}Add Event - Administration{% endblock %} + +{% block content %} + {{ render_form(form, action_url=url_for(".event_new", id=id), action_text="Add", title="New Event") }} +{% endblock %} diff --git a/templates/admin_topic_edit b/templates/admin_topic_edit.html similarity index 100% rename from templates/admin_topic_edit rename to templates/admin_topic_edit.html diff --git a/templates/admin_topic_index.html b/templates/admin_topic_index.html index ff35f77..4f850de 100644 --- a/templates/admin_topic_index.html +++ b/templates/admin_topic_index.html @@ -12,12 +12,12 @@ </tr> </thead> <tbody> - {% for topic in events %} + {% for topic in topics %} <tr> - <td class="mdl-data-table__cell--non-numeric"><a href="{{ url_for(".topic_edit", id=event.id) }}">{{ event.name }}</a></td> + <td class="mdl-data-table__cell--non-numeric"><a href="{{ url_for(".topic_edit", id=topic.id) }}">{{ topic.name }}</a></td> <td class="mdl-data-table__cell--non-numeric">{{ topic.mode }}</td> <td class="mdl-data-table__cell--non-numeric"> - <a href="{{ url_for('.topic_delete', id=event.id) }}"> + <a href="{{ url_for('.topic_delete', id=topic.id) }}"> <i class="material-icons">delete</i> </a> </td> -- GitLab