firstboot: Dont show normal mainmenu in help pages

- plus some minor adaptions like titles and using cfg.box_name
This commit is contained in:
fonfon 2015-12-25 20:39:44 +00:00 committed by Sunil Mohan Adapa
parent a25f73005c
commit 0f742d704b
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
11 changed files with 150 additions and 60 deletions

View File

@ -17,9 +17,11 @@
#
{% endcomment %}
{% load i18n %}
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{% url 'help:index' %}">
<a href="{% url 'help:index' %}" title="{% trans "Help" %}">
<span class="glyphicon-question-sign glyphicon nav-icon"></span>
</a>
</li>

View File

@ -30,14 +30,14 @@
</style>
{% endblock %}
{% block add_nav_and_login %}
{% block mainmenu_right %}
{% include "firstboot_navbar.html" %}
{% endblock %}
{% block content_row %}
<p class="text-center">
<img src="{% static 'theme/img/FreedomBox-logo-standard.png' %}"
alt="FreedomBox" width="640"/>
alt="{{ cfg.box_name }}" width="640"/>
</p>
<p class="text-center">

View File

@ -30,7 +30,7 @@
</style>
{% endblock %}
{% block add_nav_and_login %}
{% block mainmenu_right %}
{% include "firstboot_navbar.html" %}
{% endblock %}

View File

@ -30,7 +30,7 @@
<p>
{% blocktrans trimmed with box_name=cfg.box_name %}
{{ box_name }} setup is now complete. To make your FreedomBox
{{ box_name }} setup is now complete. To make your {{ box_name }}
functional, you need some applications. Applications will be
installed the first time you access them.
{% endblocktrans %}

View File

@ -0,0 +1,28 @@
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django import template
from plinth import kvstore
register = template.Library()
@register.simple_tag
def firstboot_is_finished():
state = kvstore.get_default('firstboot_state', 0)
return state >= 10

View File

@ -1,5 +1,4 @@
{% extends 'base.html' %}
{% load static %}
{% extends 'help_base.html' %}
{% comment %}
#
# This file is part of Plinth.
@ -20,6 +19,7 @@
{% endcomment %}
{% load i18n %}
{% load static %}
{% block content %}

View File

@ -0,0 +1,58 @@
{% extends 'base.html' %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load i18n %}
{% load firstboot_extras %}
{% load static %}
{# Adapt mainmenu-links during firstboot #}
{% block mainmenu_left %}
{% firstboot_is_finished as firstboot_finished %}
{% if not firstboot_finished %}
<span class="navbar-brand">
<img src="{% static 'theme/img/freedombox-logo-32px.png' %}"
alt="{{ cfg.box_name }}" />
<a href="{% url 'index' %}">
{% blocktrans trimmed with box_name=cfg.box_name %}
{{ box_name }} Setup
{% endblocktrans %}
</a>
</span>
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}
{% block mainmenu_right %}
{% firstboot_is_finished as firstboot_finished %}
{% if not firstboot_finished %}
{% include "firstboot_navbar.html" %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'help_base.html' %}
{% comment %}
#
# This file is part of Plinth.

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'help_base.html' %}
{% comment %}
#
# This file is part of Plinth.

View File

@ -83,67 +83,69 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<img src="{% static 'theme/img/freedombox-logo-32px.png' %}"
alt="{% trans "FreedomBox" %}" />
</span>
<a href="{% url 'index' %}" class="navbar-brand" title="{% trans "Applications" %}">
<span class="glyphicon glyphicon-th"></span>
</a>
{% block mainmenu_left %}
<span class="navbar-brand">
<img src="{% static 'theme/img/freedombox-logo-32px.png' %}"
alt="{% trans "FreedomBox" %}" />
</span>
<a href="{% url 'index' %}" class="navbar-brand" title="{% trans "Applications" %}">
<span class="glyphicon glyphicon-th"></span>
</a>
{% endblock %}
</div>
<div class="collapse navbar-collapse">
{% block add_nav_and_login %}
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{% url 'help:index' %}" title="{% trans "Help" %}">
<span class="glyphicon-question-sign glyphicon nav-icon"></span>
</a>
</li>
{% if user.is_authenticated %}
{% block mainmenu_right %}
<li>
<a href="{% url 'system:index' %}" title="{% trans "System Configuration" %}">
<span class="glyphicon-cog glyphicon nav-icon"></span>
<a href="{% url 'help:index' %}" title="{% trans "Help" %}">
<span class="glyphicon-question-sign glyphicon nav-icon"></span>
</a>
</li>
<li class="dropdown">
<a href="{% url 'users:edit' user.username %}"
class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-expanded="false">
<i class="glyphicon glyphicon-user nav-icon"></i>
{{ user.username }}
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'users:edit' user.username %}"
title="{% trans "Edit"%}">{% trans "Edit" %}</a></li>
<li><a href="{% url 'users:change_password' user.username %}"
title="{% trans "Change password" %}">
{% trans "Change password" %}</a></li>
<li class="divider"></li>
<li><a href="{% url 'users:logout' %}"
title="{% trans "Log out" %}">
{% trans "Log out" %}</a></li>
</ul>
</li>
{% else %}
<li>
<a href="{% url 'users:login' %}" title="{% trans "Log in" %}">
<i class="glyphicon glyphicon-user nav-icon"></i>
{% trans "Log in" %}</a>
</li>
{% endif %}
{% if user.is_authenticated %}
<li>
<a href="{% url 'system:index' %}" title="{% trans "System Configuration" %}">
<span class="glyphicon-cog glyphicon nav-icon"></span>
</a>
</li>
{% if user.is_authenticated %}
<li id="logout-nojs">
<a href="{% url 'users:logout' %}" title="{% trans "Log out" %}">
<i class="glyphicon glyphicon-remove-circle nav-icon"></i>
{% trans "Log out" %}</a>
</li>
{% endif %}
<li class="dropdown">
<a href="{% url 'users:edit' user.username %}"
class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-expanded="false">
<i class="glyphicon glyphicon-user nav-icon"></i>
{{ user.username }}
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="{% url 'users:edit' user.username %}"
title="{% trans "Edit"%}">{% trans "Edit" %}</a></li>
<li><a href="{% url 'users:change_password' user.username %}"
title="{% trans "Change password" %}">
{% trans "Change password" %}</a></li>
<li class="divider"></li>
<li><a href="{% url 'users:logout' %}"
title="{% trans "Log out" %}">
{% trans "Log out" %}</a></li>
</ul>
</li>
{% else %}
<li>
<a href="{% url 'users:login' %}" title="{% trans "Log in" %}">
<i class="glyphicon glyphicon-user nav-icon"></i>
{% trans "Log in" %}</a>
</li>
{% endif %}
{% if user.is_authenticated %}
<li id="logout-nojs">
<a href="{% url 'users:logout' %}" title="{% trans "Log out" %}">
<i class="glyphicon glyphicon-remove-circle nav-icon"></i>
{% trans "Log out" %}</a>
</li>
{% endif %}
{% endblock %}
</ul>
{% endblock %}
</div>
</div>
</div>