diaspora: Update menu use to match other modules

- Remove extra global line to avoid warning.

- Fix comment and indentation.
This commit is contained in:
James Valleroy 2017-05-06 07:21:33 -04:00
parent 3a6dc03ee9
commit 2f13946517
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 12 additions and 12 deletions

View File

@ -20,9 +20,10 @@ from django.utils.translation import ugettext_lazy as _
from plinth.modules import names
from plinth.utils import format_lazy
from plinth import actions, action_utils, cfg, frontpage, \
from plinth import actions, action_utils, frontpage, \
service as service_module
from plinth.errors import DomainNotRegisteredError
from plinth.menu import main_menu
domain_name_file = "/etc/diaspora/domain_name"
lazy_domain_name = None # To avoid repeatedly reading from file
@ -41,7 +42,6 @@ def get_configured_domain_name():
raise DomainNotRegisteredError()
with open(domain_name_file) as dnf:
global lazy_domain_name
lazy_domain_name = dnf.read().rstrip()
return lazy_domain_name
@ -74,7 +74,7 @@ description = [
def init():
"""Initialize the Diaspora module."""
menu = cfg.main_menu.get('apps:index')
menu = main_menu.get('apps')
menu.add_urlname(title, 'glyphicon-thumbs-up', 'diaspora:index')
global service

View File

@ -16,7 +16,7 @@
#
"""
Views for the Matrix Synapse module
Views for the diaspora module
"""
from django.shortcuts import redirect
from django.urls import reverse_lazy

View File

@ -29,20 +29,20 @@
{% for shortcut in shortcuts %}
{% if not shortcut.hidden %}
{% if user.is_authenticated or not shortcut.login_required %}
<div class="col-sm-3">
<ul class="nav nav-pills nav-stacked">
{% if selected_id == shortcut.id %}
<div class="col-sm-3">
<ul class="nav nav-pills nav-stacked">
{% if selected_id == shortcut.id %}
<li class="active">
<a href="{{ shortcut.url }}" class="active">
{% else %}
<li>
<a href="{{ shortcut.url }}">
{% endif %}
<center>
<img src="{% static 'theme/icons/' %}{{ shortcut.icon }}.png" style="max-width: 100px; height: 100px" />
<br>
{{ shortcut.label|linebreaks }}
</center>
<center>
<img src="{% static 'theme/icons/' %}{{ shortcut.icon }}.png" style="max-width: 100px; height: 100px" />
<br>
{{ shortcut.label|linebreaks }}
</center>
</a>
</li>
</ul>