Skip to content
Snippets Groups Projects
Commit c48327c9 authored by Andreas Valder's avatar Andreas Valder
Browse files

added hints to some edit options, closes #105

parent d754741f
No related branches found
No related tags found
No related merge requests found
...@@ -14,19 +14,19 @@ editable_tables = { ...@@ -14,19 +14,19 @@ editable_tables = {
'idcolumn': 'id', 'idcolumn': 'id',
'editable_fields': { 'editable_fields': {
'visible': {'type': 'boolean'}, 'visible': {'type': 'boolean'},
'listed': {'type': 'boolean'}, 'listed': {'type': 'boolean', 'description': 'Soll die Veranstaltung auf der Hauptseite gelistet werden?'},
'title': {'type': 'shortstring'}, 'title': {'type': 'shortstring'},
'short': {'type': 'shortstring'}, 'short': {'type': 'shortstring', 'description': 'Abkürzung für die Veranstaltung, z.B. für den Drehplan'},
'handle': {'type': 'shortstring'}, 'handle': {'type': 'shortstring'},
'organizer': {'type': 'shortstring'}, 'organizer': {'type': 'shortstring'},
'subject': {'type': 'shortstring'}, 'subject': {'type': 'shortstring'},
'semester': {'type': 'shortstring'}, 'semester': {'type': 'shortstring'},
'downloadable': {'type': 'boolean'}, 'downloadable': {'type': 'boolean', 'description': 'Hiermit kann der Download-Button disabled werden'},
'internal': {'type': 'text'}, 'internal': {'type': 'text'},
'responsible': {'type': 'shortstring'}, 'responsible': {'type': 'shortstring'},
'deleted': {'type': 'boolean'}, 'deleted': {'type': 'boolean'},
'description': {'type': 'text'}, 'description': {'type': 'text'},
'external': {'type': 'boolean'}}, 'external': {'type': 'boolean', 'description': 'Soll die Veranstaltung nicht im Drehplan angezeigt werden?'}},
'creationtime_fields': ['created_by', 'time_created', 'time_updated'] }, 'creationtime_fields': ['created_by', 'time_created', 'time_updated'] },
'lectures': { 'lectures': {
'table': 'lectures_data', 'table': 'lectures_data',
...@@ -42,7 +42,7 @@ editable_tables = { ...@@ -42,7 +42,7 @@ editable_tables = {
'duration': {'type': 'duration'}, 'duration': {'type': 'duration'},
'jumplist': {'type': ''}, 'jumplist': {'type': ''},
'deleted': {'type': 'boolean'}, 'deleted': {'type': 'boolean'},
'live': {'type': 'boolean'}, 'live': {'type': 'boolean', 'description': 'Ist ein Livestream geplant?'},
'norecording': {'type': 'boolean'}}, 'norecording': {'type': 'boolean'}},
'creationtime_fields': ['course_id', 'time_created', 'time_updated'] }, 'creationtime_fields': ['course_id', 'time_created', 'time_updated'] },
'videos': { 'videos': {
...@@ -110,6 +110,13 @@ def parseeditpath(path): ...@@ -110,6 +110,13 @@ def parseeditpath(path):
assert column in editable_tables[table]['editable_fields'] assert column in editable_tables[table]['editable_fields']
type = editable_tables[table]['editable_fields'][column]['type'] type = editable_tables[table]['editable_fields'][column]['type']
return {'table': table, 'id': id, 'column': column, 'type': type, 'tableinfo': editable_tables[table]} return {'table': table, 'id': id, 'column': column, 'type': type, 'tableinfo': editable_tables[table]}
@app.template_filter(name='getfielddescription')
def getfielddescription(path):
p = parseeditpath(path)
desc = p['tableinfo']['editable_fields'][p['column']].get('description', '')
if desc != '':
desc = '<br>'+desc
return desc
@app.route('/internal/edit', methods=['GET', 'POST']) @app.route('/internal/edit', methods=['GET', 'POST'])
@mod_required @mod_required
......
...@@ -202,7 +202,11 @@ ...@@ -202,7 +202,11 @@
{% endif %} {% endif %}
<script> <script>
$( function () { $( function () {
$('[data-toggle="tooltip"]').tooltip({ 'trigger': 'hover' }); $('[data-toggle="tooltip"]').tooltip(
{
trigger: 'hover',
html: true
});
}); });
</script> </script>
</body> </body>
......
...@@ -103,9 +103,18 @@ $.ajax({ ...@@ -103,9 +103,18 @@ $.ajax({
method: "GET", method: "GET",
url: "{{url_for('stats_generic', req="lecture_views", param=course.id)}}", url: "{{url_for('stats_generic', req="lecture_views", param=course.id)}}",
dataType: "json", dataType: "json",
error: function() {
var counter = $(".viewcounter");
for (var i=0; i<counter.length; i++) {
$(counter[i]).text("0");
}
},
success: function (traces) { success: function (traces) {
var dates={}; var dates={};
var t = traces[0] var t = traces[0];
if (!t.x) {
return;
}
for (var i=0; i<t.x.length; i++) { for (var i=0; i<t.x.length; i++) {
dates[t.x[i]] = t.y[i]; dates[t.x[i]] = t.y[i];
} }
......
...@@ -267,7 +267,7 @@ $('#embedcodebtn').popover( ...@@ -267,7 +267,7 @@ $('#embedcodebtn').popover(
{% macro moderator_editor (path,value,reload=false) %} {% macro moderator_editor (path,value,reload=false) %}
{% if ismod() %} {% if ismod() %}
<span class="moderator_editor" data-path="{{path|join('.')}}" data-reload="{{ reload|int }}" > <span class="moderator_editor" data-path="{{path|join('.')}}" data-reload="{{ reload|int }}" >
<a class="moderator_editor_sign btn btn-default" title="{{path|join('.')}}" data-toggle="tooltip" tabindex="0" style="padding: 3px; margin-right: 5px;"> <a class="moderator_editor_sign btn btn-default" title="{{path|join('.')}}{{ path|join('.')|getfielddescription }}" data-toggle="tooltip" tabindex="0" style="padding: 3px; margin-right: 5px;">
<span class="glyphicon glyphicon-pencil"></span> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
<span class="moderator_editor_value">{{ value|fixnl|safe }}</span> <span class="moderator_editor_value">{{ value|fixnl|safe }}</span>
...@@ -279,7 +279,7 @@ $('#embedcodebtn').popover( ...@@ -279,7 +279,7 @@ $('#embedcodebtn').popover(
{% macro moderator_checkbox (path,value) %} {% macro moderator_checkbox (path,value) %}
{% if ismod() %} {% if ismod() %}
<input title="{{path|join('.')}}" data-toggle="tooltip" type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderator.editor.changeboxclick(this)"/> <input title="{{path|join('.')}}{{ path|join('.')|getfielddescription }}" data-toggle="tooltip" type="checkbox" data-path="{{path|join('.')}}" {% if value %} checked {% endif %} onchange="moderator.editor.changeboxclick(this)"/>
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment