Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
c48327c9
Commit
c48327c9
authored
May 21, 2017
by
Andreas Valder
Browse files
added hints to some edit options, closes
#105
parent
d754741f
Changes
4
Hide whitespace changes
Inline
Side-by-side
edit.py
View file @
c48327c9
...
...
@@ -14,19 +14,19 @@ editable_tables = {
'idcolumn'
:
'id'
,
'editable_fields'
:
{
'visible'
:
{
'type'
:
'boolean'
},
'listed'
:
{
'type'
:
'boolean'
},
'listed'
:
{
'type'
:
'boolean'
,
'description'
:
'Soll die Veranstaltung auf der Hauptseite gelistet werden?'
},
'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'
},
'organizer'
:
{
'type'
:
'shortstring'
},
'subject'
:
{
'type'
:
'shortstring'
},
'semester'
:
{
'type'
:
'shortstring'
},
'downloadable'
:
{
'type'
:
'boolean'
},
'downloadable'
:
{
'type'
:
'boolean'
,
'description'
:
'Hiermit kann der Download-Button disabled werden'
},
'internal'
:
{
'type'
:
'text'
},
'responsible'
:
{
'type'
:
'shortstring'
},
'deleted'
:
{
'type'
:
'boolean'
},
'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'
]
},
'lectures'
:
{
'table'
:
'lectures_data'
,
...
...
@@ -42,7 +42,7 @@ editable_tables = {
'duration'
:
{
'type'
:
'duration'
},
'jumplist'
:
{
'type'
:
''
},
'deleted'
:
{
'type'
:
'boolean'
},
'live'
:
{
'type'
:
'boolean'
},
'live'
:
{
'type'
:
'boolean'
,
'description'
:
'Ist ein Livestream geplant?'
},
'norecording'
:
{
'type'
:
'boolean'
}},
'creationtime_fields'
:
[
'course_id'
,
'time_created'
,
'time_updated'
]
},
'videos'
:
{
...
...
@@ -110,6 +110,13 @@ def parseeditpath(path):
assert
column
in
editable_tables
[
table
][
'editable_fields'
]
type
=
editable_tables
[
table
][
'editable_fields'
][
column
][
'type'
]
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'
])
@
mod_required
...
...
templates/base.html
View file @
c48327c9
...
...
@@ -202,7 +202,11 @@
{% endif %}
<script>
$
(
function
()
{
$
(
'
[data-toggle="tooltip"]
'
).
tooltip
({
'
trigger
'
:
'
hover
'
});
$
(
'
[data-toggle="tooltip"]
'
).
tooltip
(
{
trigger
:
'
hover
'
,
html
:
true
});
});
</script>
</body>
...
...
templates/course.html
View file @
c48327c9
...
...
@@ -103,9 +103,18 @@ $.ajax({
method
:
"
GET
"
,
url
:
"
{{url_for('stats_generic', req=
"
lecture_views
"
, param=course.id)}}
"
,
dataType
:
"
json
"
,
error
:
function
()
{
var
counter
=
$
(
"
.viewcounter
"
);
for
(
var
i
=
0
;
i
<
counter
.
length
;
i
++
)
{
$
(
counter
[
i
]).
text
(
"
0
"
);
}
},
success
:
function
(
traces
)
{
var
dates
=
{};
var
t
=
traces
[
0
]
var
t
=
traces
[
0
];
if
(
!
t
.
x
)
{
return
;
}
for
(
var
i
=
0
;
i
<
t
.
x
.
length
;
i
++
)
{
dates
[
t
.
x
[
i
]]
=
t
.
y
[
i
];
}
...
...
templates/macros.html
View file @
c48327c9
...
...
@@ -267,7 +267,7 @@ $('#embedcodebtn').popover(
{% macro moderator_editor (path,value,reload=false) %}
{% if ismod() %}
<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>
</a>
<span
class=
"moderator_editor_value"
>
{{ value|fixnl|safe }}
</span>
...
...
@@ -279,13 +279,13 @@ $('#embedcodebtn').popover(
{% macro moderator_checkbox (path,value) %}
{% 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 %}
{% endmacro %}
{% macro moderator_delete (path) %}
{% if ismod() %}
<button
class=
"btn btn-default"
style=
"background-color: red;"
data-path=
"{{path|join('.')}}"
onclick=
"moderator.editor.deletebtnclick(this)"
>
<button
class=
"btn btn-default"
style=
"background-color: red;"
data-path=
"{{path|join('.')}}"
onclick=
"moderator.editor.deletebtnclick(this)"
>
<span
class=
"glyphicon glyphicon-trash"
></span>
</button>
{% endif %}
...
...
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