Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
9f41c70d
Commit
9f41c70d
authored
3 years ago
by
Jan Prachař
Browse files
Options
Downloads
Patches
Plain Diff
menu: Podpora pro ikony
parent
2f52573b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/menu.py
+6
-4
6 additions, 4 deletions
mo/web/menu.py
mo/web/templates/base.html
+6
-1
6 additions, 1 deletion
mo/web/templates/base.html
with
12 additions
and
5 deletions
mo/web/menu.py
+
6
−
4
View file @
9f41c70d
...
...
@@ -7,12 +7,14 @@ from mo.web import app
class
MenuItem
:
url
:
str
name
:
str
icon
:
str
active_prefix
:
str
classes
:
List
[
str
]
def
__init__
(
self
,
url
:
str
,
name
:
str
,
active_prefix
:
Optional
[
str
]
=
None
,
classes
:
Optional
[
List
[
str
]]
=
None
):
def
__init__
(
self
,
url
:
str
,
name
:
str
,
icon
:
Optional
[
str
]
=
None
,
active_prefix
:
Optional
[
str
]
=
None
,
classes
:
Optional
[
List
[
str
]]
=
None
):
self
.
url
=
url
self
.
name
=
name
self
.
icon
=
icon
self
.
active_prefix
=
active_prefix
or
url
self
.
classes
=
classes
or
[]
...
...
@@ -20,11 +22,11 @@ class MenuItem:
def
get_menu
():
if
not
g
.
user
:
items
=
[
MenuItem
(
url_for
(
'
index
'
),
"
D
om
ů
"
)
MenuItem
(
url_for
(
'
index
'
),
"
"
,
"
h
om
e
"
)
,
]
elif
g
.
user
.
is_org
or
g
.
user
.
is_admin
:
items
=
[
MenuItem
(
url_for
(
'
org_index
'
),
"
D
om
ů
"
),
MenuItem
(
url_for
(
'
org_index
'
),
"
"
,
"
h
om
e
"
),
MenuItem
(
url_for
(
'
org_place_root
'
),
"
Místa
"
),
MenuItem
(
url_for
(
'
org_rounds
'
),
"
Soutěž
"
),
MenuItem
(
url_for
(
'
org_users
'
),
"
Soutěžící
"
),
...
...
@@ -34,7 +36,7 @@ def get_menu():
]
else
:
items
=
[
MenuItem
(
url_for
(
'
user_index
'
),
"
D
om
ů
"
),
MenuItem
(
url_for
(
'
user_index
'
),
"
"
,
"
h
om
e
"
),
MenuItem
(
url_for
(
'
doc_index
'
),
"
Návod
"
),
]
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/base.html
+
6
−
1
View file @
9f41c70d
...
...
@@ -56,7 +56,12 @@
<ul
class=
"nav navbar-nav"
>
{% for item in get_menu() %}
<li
{%
if
item.classes
%}
class=
"{{ "
".
join
(
item.classes
)
}}"{%
endif
%}
>
<a
href=
"{{ item.url }}"
>
{{ item.name }}
</a>
<a
href=
"{{ item.url }}"
>
{% if item.icon %}
<span
class=
"glyphicon glyphicon-{{ item.icon }}"
></span>
{% endif %}
{{ item.name }}
</a>
</li>
{% endfor %}
</ul>
...
...
This diff is collapsed.
Click to expand it.
Jan Prachař
@pracj3am
mentioned in commit
9e37f7fe
·
3 years ago
mentioned in commit
9e37f7fe
mentioned in commit 9e37f7fe8e3746c8e8b34cca20b946880ec10e47
Toggle commit list
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