mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
ikiwiki: Update UI messages and minor refactoring
- In manage page, show a message to create new blog/wiki when there are none. - Elaborate on what gets deleted in delete page. - Add Ikiwiki in menu item label. This is in order to allow for other Wiki/Blog modules. - Indentation changes.
This commit is contained in:
parent
57e5799880
commit
9b674292c8
@ -30,4 +30,5 @@ depends = ['plinth.modules.apps']
|
||||
def init():
|
||||
"""Initialize the ikiwiki module."""
|
||||
menu = cfg.main_menu.get('apps:index')
|
||||
menu.add_urlname(_('Wiki & Blog'), 'glyphicon-edit', 'ikiwiki:index', 38)
|
||||
menu.add_urlname(_('Wiki & Blog (Ikiwiki)'), 'glyphicon-edit',
|
||||
'ikiwiki:index', 38)
|
||||
|
||||
@ -26,7 +26,7 @@ from gettext import gettext as _
|
||||
class IkiwikiForm(forms.Form):
|
||||
"""ikiwiki configuration form."""
|
||||
enabled = forms.BooleanField(
|
||||
label=_('Enable ikiwiki site'),
|
||||
label=_('Enable Ikiwiki'),
|
||||
required=False)
|
||||
|
||||
|
||||
@ -35,8 +35,11 @@ class IkiwikiCreateForm(forms.Form):
|
||||
type = forms.ChoiceField(
|
||||
label=_('Type'),
|
||||
choices=[('wiki', 'Wiki'), ('blog', 'Blog')])
|
||||
|
||||
name = forms.CharField(label=_('Name'))
|
||||
|
||||
admin_name = forms.CharField(label=_('Admin Account Name'))
|
||||
|
||||
admin_password = forms.CharField(
|
||||
label=_('Admin Account Password'),
|
||||
widget=forms.PasswordInput())
|
||||
|
||||
@ -22,15 +22,15 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<p>When enabled, the ikiwiki site will be available from <a href="/ikiwiki">
|
||||
/ikiwiki</a> path on the web server.</p>
|
||||
<p>When enabled, the blogs and wikis will be available
|
||||
from <a href="/ikiwiki">/ikiwiki</a>.</p>
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|bootstrap }}
|
||||
{{ form|bootstrap }}
|
||||
|
||||
<input type="submit" class="btn btn-primary" value="Update setup"/>
|
||||
</form>
|
||||
<input type="submit" class="btn btn-primary" value="Update setup"/>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@ -24,7 +24,9 @@
|
||||
|
||||
<h3>Delete Wiki/Blog <em>{{ name }}</em></h3>
|
||||
|
||||
<p>Delete this wiki/blog permanently?</p>
|
||||
<p>This action will remove all the posts, pages and comments
|
||||
including revision history. Delete this wiki/blog
|
||||
permanently?</p>
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
@ -36,25 +36,33 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="list-group">
|
||||
{% for site in sites %}
|
||||
<div class="list-group-item clearfix">
|
||||
<a href="{% url 'ikiwiki:delete' site %}"
|
||||
class="btn btn-default btn-sm pull-right"
|
||||
role="button" title="Delete site {{ site }}">
|
||||
<span class="glyphicon glyphicon-trash"
|
||||
aria-hidden="true"></span>
|
||||
</a>
|
||||
{% if not sites %}
|
||||
<p>No wikis or blogs available.</p>
|
||||
<p>
|
||||
<a class="btn btn-primary btn-md"
|
||||
href="{% url 'ikiwiki:create' %}">Create a Wiki or Blog</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<div class="list-group">
|
||||
{% for site in sites %}
|
||||
<div class="list-group-item clearfix">
|
||||
<a href="{% url 'ikiwiki:delete' site %}"
|
||||
class="btn btn-default btn-sm pull-right"
|
||||
role="button" title="Delete site {{ site }}">
|
||||
<span class="glyphicon glyphicon-trash"
|
||||
aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<a class="wiki-label"
|
||||
href="/ikiwiki/{{ site }}"
|
||||
title="Go to site {{ site }}">
|
||||
{{ site }}
|
||||
</a>
|
||||
<a class="wiki-label"
|
||||
href="/ikiwiki/{{ site }}"
|
||||
title="Go to site {{ site }}">
|
||||
{{ site }}
|
||||
</a>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user