Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
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
Roman Karwacik
website
Commits
c48327c9
Commit
c48327c9
authored
8 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
added hints to some edit options, closes #105
parent
d754741f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
edit.py
+12
-5
12 additions, 5 deletions
edit.py
templates/base.html
+5
-1
5 additions, 1 deletion
templates/base.html
templates/course.html
+10
-1
10 additions, 1 deletion
templates/course.html
templates/macros.html
+3
-3
3 additions, 3 deletions
templates/macros.html
with
30 additions
and
10 deletions
edit.py
+
12
−
5
View file @
c48327c9
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
templates/base.html
+
5
−
1
View file @
c48327c9
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
templates/course.html
+
10
−
1
View file @
c48327c9
...
@@ -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
];
}
}
...
...
This diff is collapsed.
Click to expand it.
templates/macros.html
+
3
−
3
View file @
c48327c9
...
@@ -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 %}
...
...
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