Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
djnro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
djnro
Commits
326279fe
Commit
326279fe
authored
Sep 01, 2016
by
Zenon Mousmoulas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditionally show Service Locations in edumanage menu and home page, if the
institution type permits
parent
89cdc495
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
djnro/templates/edumanage/welcome.html
djnro/templates/edumanage/welcome.html
+5
-1
edumanage/views.py
edumanage/views.py
+6
-0
No files found.
djnro/templates/edumanage/welcome.html
View file @
326279fe
...
...
@@ -22,9 +22,11 @@
</li>
{% endif %}
{% if institutiondetails %}
{% if institution_canhaveservicelocs %}
<li
{%
block
servicesactive
%}{%
endblock
%}
>
<a
href=
"{% url services %}"
>
{% trans "Locations" %} ({{services_num}})
</a>
</li>
{% endif %}
<li
{%
block
serversactive
%}{%
endblock
%}
>
<a
href=
"{% url servers %}"
>
{% trans "Servers" %} ({{servers_num}})
</a>
</li>
...
...
@@ -56,17 +58,19 @@
<tr
class=
"error"
><td>
You are not associated with any institution. Please contact your administrator
<td></tr>
</table>
{% else %}
<h4>
{% trans "Home" %}
- {% trans "Service Locations"
%}
</h4>
<h4>
{% trans "Home" %}
{% if institution_canhaveservicelocs %} - {% trans "Service Locations" %}{% endif
%}
</h4>
<hr>
{% if services %}
<div
id=
"map_canvas"
data-group=
"{% static 'img/edugroup.png' %}"
data-pin=
"{% static 'img/edupin.png' %}"
data-center-lat=
"{{MAP_CENTER.0}}"
data-center-lng=
"{{MAP_CENTER.1}}"
data-service=
"{% url get-service-points %}"
data-service-edit=
"{% url edit-services %}"
style=
"width:100%; height:450px;"
></div>
{% else %}
<div>
{% if institutiondetails %}
{% if institution_canhaveservicelocs %}
{% trans "No services defined yet"%}!
<a
href=
"{% url edit-services %}"
class=
"btn btn-primary"
>
{% trans "Add new service" %}
</a>
{% endif %}
{% else %}
Specify your institution details to proceed
<a
class=
"btn btn-small btn-primary"
href=
"{% url edit-institution institution.pk %}"
>
{% trans "Edit" %}
</a>
{% endif %}
...
...
edumanage/views.py
View file @
326279fe
...
...
@@ -1398,6 +1398,7 @@ def base_response(request):
contacts
=
[]
institution
=
False
institution_exists
=
False
institution_canhaveservicelocs
=
False
try
:
profile
=
user
.
get_profile
()
institution
=
profile
.
institution
...
...
@@ -1422,6 +1423,10 @@ def base_response(request):
instututiondetails
=
institution
.
institutiondetails
except
:
instututiondetails
=
False
try
:
institution_canhaveservicelocs
=
institution
.
ertype
in
[
2
,
3
]
except
:
pass
return
{
'inst_num'
:
len
(
inst
),
'servers_num'
:
len
(
server
),
...
...
@@ -1432,6 +1437,7 @@ def base_response(request):
'institution'
:
institution
,
'institutiondetails'
:
instututiondetails
,
'institution_exists'
:
institution_exists
,
'institution_canhaveservicelocs'
:
institution_canhaveservicelocs
,
}
...
...
Write
Preview
Markdown
is supported
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