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:
Sunil Mohan Adapa 2015-04-18 20:52:38 +05:30
parent 57e5799880
commit 9b674292c8
5 changed files with 41 additions and 27 deletions

View File

@ -30,4 +30,5 @@ depends = ['plinth.modules.apps']
def init(): def init():
"""Initialize the ikiwiki module.""" """Initialize the ikiwiki module."""
menu = cfg.main_menu.get('apps:index') 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)

View File

@ -26,7 +26,7 @@ from gettext import gettext as _
class IkiwikiForm(forms.Form): class IkiwikiForm(forms.Form):
"""ikiwiki configuration form.""" """ikiwiki configuration form."""
enabled = forms.BooleanField( enabled = forms.BooleanField(
label=_('Enable ikiwiki site'), label=_('Enable Ikiwiki'),
required=False) required=False)
@ -35,8 +35,11 @@ class IkiwikiCreateForm(forms.Form):
type = forms.ChoiceField( type = forms.ChoiceField(
label=_('Type'), label=_('Type'),
choices=[('wiki', 'Wiki'), ('blog', 'Blog')]) choices=[('wiki', 'Wiki'), ('blog', 'Blog')])
name = forms.CharField(label=_('Name')) name = forms.CharField(label=_('Name'))
admin_name = forms.CharField(label=_('Admin Account Name')) admin_name = forms.CharField(label=_('Admin Account Name'))
admin_password = forms.CharField( admin_password = forms.CharField(
label=_('Admin Account Password'), label=_('Admin Account Password'),
widget=forms.PasswordInput()) widget=forms.PasswordInput())

View File

@ -22,15 +22,15 @@
{% block content %} {% block content %}
<p>When enabled, the ikiwiki site will be available from <a href="/ikiwiki"> <p>When enabled, the blogs and wikis will be available
/ikiwiki</a> path on the web server.</p> from <a href="/ikiwiki">/ikiwiki</a>.</p>
<form class="form" method="post"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}
{{ form|bootstrap }} {{ form|bootstrap }}
<input type="submit" class="btn btn-primary" value="Update setup"/> <input type="submit" class="btn btn-primary" value="Update setup"/>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -24,7 +24,9 @@
<h3>Delete Wiki/Blog <em>{{ name }}</em></h3> <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"> <form class="form" method="post">
{% csrf_token %} {% csrf_token %}

View File

@ -36,25 +36,33 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="list-group"> {% if not sites %}
{% for site in sites %} <p>No wikis or blogs available.</p>
<div class="list-group-item clearfix"> <p>
<a href="{% url 'ikiwiki:delete' site %}" <a class="btn btn-primary btn-md"
class="btn btn-default btn-sm pull-right" href="{% url 'ikiwiki:create' %}">Create a Wiki or Blog</a>
role="button" title="Delete site {{ site }}"> </p>
<span class="glyphicon glyphicon-trash" {% else %}
aria-hidden="true"></span> <div class="list-group">
</a> {% 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" <a class="wiki-label"
href="/ikiwiki/{{ site }}" href="/ikiwiki/{{ site }}"
title="Go to site {{ site }}"> title="Go to site {{ site }}">
{{ site }} {{ site }}
</a> </a>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
</div> </div>
</div> </div>