Commit 3c0fda90 authored by Lars Beckers's avatar Lars Beckers

Merge branch 'master' of git.fsmpi.rwth-aachen.de:redl/redeleitsystem

parents 9a26e165 555eea51
#!/usr/bin/env python3 #!/usr/bin/env python3
from flask import Flask, g, current_app, request, session, flash, redirect, url_for, abort from flask import Flask, g, current_app, request, session, flash, redirect, url_for, abort, render_template, Response
from flask.ext.login import login_user, logout_user, login_required, current_user from flask.ext.login import login_user, logout_user, login_required, current_user
from flask.ext.principal import Principal, Identity, AnonymousIdentity, identity_changed, identity_loaded, UserNeed, RoleNeed from flask.ext.principal import Principal, Identity, AnonymousIdentity, identity_changed, identity_loaded, UserNeed, RoleNeed
from flask.ext.script import Manager from flask.ext.script import Manager
...@@ -116,6 +116,10 @@ def register(): ...@@ -116,6 +116,10 @@ def register():
return redirect(url_for(".login")) return redirect(url_for(".login"))
return render_layout("register.html", form=form) return render_layout("register.html", form=form)
@app.route("/icon-font.css")
def icon_font():
return Response(render_template("icon-font.css"), mimetype="text/css")
@identity_loaded.connect_via(app) @identity_loaded.connect_via(app)
def on_identity_loaded(sender, identity): def on_identity_loaded(sender, identity):
# Set the identity user object # Set the identity user object
......
This diff is collapsed.
var keyhash = "";
var changehash = false;
var notificationArea;
var timeout;
function hashkey(e) {
return e.keyCode + ";" + e.charCode;
}
function clickNextSpeaker() {
var rows = document.getElementById("next-speaker-table").rows;
if (rows.length > 1) {
var row = rows[1];
var a = row.children[2].childNodes[1];
a.click();
}
}
window.onkeypress = function(e) {
if (changehash) {
keyhash = hashkey(e);
changehash = false;
sessionStorage["keyhash"] = keyhash;
notificationArea.innerHTML = "Key has been set.";
timeout = window.setTimeout(function() { notificationArea.innerHTML = ""; }, 5000);
} else {
if (hashkey(e) == keyhash) {
clickNextSpeaker();
}
}
};
function setkeyhash() {
changehash = true;
notificationArea.innerHTML = "Please click the key.";
window.clearTimeout(timeout);
}
var nextbuttoncachedonloadfunction = window.onload;
window.onload = function() {
nextbuttoncachedonloadfunction();
if (sessionStorage["keyhash"]) {
keyhash = sessionStorage["keyhash"];
}
notificationArea = document.getElementById("rede-layout-notification");
};
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url({{ url_for('static', filename='font/icon-font.ttf') }}) format('truetype');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
}
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="description" content="moderation tool for handling speaking order"> <meta name="description" content="moderation tool for handling speaking order">
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.4/material.red-blue.min.css" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/material.red-blue.min.css') }}" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="{{ url_for('icon_font') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" />
<script src="{{ url_for('static', filename='js/material.min.js') }}"></script> <script src="{{ url_for('static', filename='js/material.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/sorttable.js') }}"></script> <script src="{{ url_for('static', filename='js/sorttable.js') }}"></script>
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
{% include "content_time.html" %} {% include "content_time.html" %}
</span> </span>
<div class="mdl-layout-spacer"></div> <div class="mdl-layout-spacer"></div>
<span id="rede-layout-notification" class="mdl-layout-title"></span>
<div class="mdl-layout-spacer"></div>
<button class="mdl-button mdl-js-button mdl-js-ripple-effet mdl-button--icon" id="hdrbtn"> <button class="mdl-button mdl-js-button mdl-js-ripple-effet mdl-button--icon" id="hdrbtn">
<i class="material-icons">more_vert</i> <i class="material-icons">more_vert</i>
</button> </button>
...@@ -83,6 +85,9 @@ ...@@ -83,6 +85,9 @@
<a class="mdl-navigation__link" href="{{ url_for("speech.show") }}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">announcement</i>Pending speakers</a> <a class="mdl-navigation__link" href="{{ url_for("speech.show") }}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">announcement</i>Pending speakers</a>
{% if current_user.is_authenticated and "admin" in current_user.roles %} {% if current_user.is_authenticated and "admin" in current_user.roles %}
<a class="mdl-navigation__link" href="{{ url_for("admin.index") }}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">computer</i>Administration</a> <a class="mdl-navigation__link" href="{{ url_for("admin.index") }}"><i class="mdl-color-text--blue-grey-400 material-icons" role="presentation">computer</i>Administration</a>
{% block additional_sidelinks %}
<!-- put your additional sidelinks here -->
{% endblock %}
{% endif %} {% endif %}
</nav> </nav>
</div> </div>
......
...@@ -2,9 +2,17 @@ ...@@ -2,9 +2,17 @@
{% from "macros.html" import render_form %} {% from "macros.html" import render_form %}
{% block title %}Statements{% endblock %} {% block title %}Statements{% endblock %}
{% block additional_js %}
<script src="{{ url_for('static', filename='js/nextbutton.js') }}" async></script>
{% endblock %}
{% block additional_sidelinks %}
<a href="#" class="mdl-navigation__link" onclick="setkeyhash()"><i class="mdl-colo-text--blue-grey-400 material-icons" role="presentation">keyboard</i>Set Next Key</a>
{% endblock %}
{% block content %} {% block content %}
{% for statements, add_form, event in meta %} {% for statements, add_form, event in meta %}
<table class="mdl-data-table mdl-js-table mdl-shadow--2dp mdl-cell mdl-cell--6-col mdl-cell--4-col-tablet mdl-cell--4-col-phone sortable"> <table id="next-speaker-table" class="mdl-data-table mdl-js-table mdl-shadow--2dp mdl-cell mdl-cell--6-col mdl-cell--4-col-tablet mdl-cell--4-col-phone sortable">
<thead> <thead>
<tr> <tr>
<th class="mdl-data-table__cell--non-numeric">Speaker</th> <th class="mdl-data-table__cell--non-numeric">Speaker</th>
......
...@@ -27,5 +27,5 @@ var {{ prefix }}f = window.onload; ...@@ -27,5 +27,5 @@ var {{ prefix }}f = window.onload;
window.onload=function() { window.onload=function() {
{{ prefix }}f(); {{ prefix }}f();
window.setInterval({{ prefix }}request, 1000 * {{ update_interval }}); window.setInterval({{ prefix }}request, 1000 * {{ update_interval }});
} };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment