Skip to content

Commit

Permalink
Merge pull request #893 from ciudadanointeligente/bring-back-advanced…
Browse files Browse the repository at this point in the history
…-form

Split up admin pages
  • Loading branch information
tmtmtmtm committed Apr 13, 2015
2 parents bfd6789 + b08f407 commit 1b8dd29
Show file tree
Hide file tree
Showing 12 changed files with 502 additions and 151 deletions.
12 changes: 12 additions & 0 deletions nuntium/subdomain_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@
MessagesPerWriteItInstance,
NewAnswerNotificationTemplateUpdateView,
WriteItDeleteView,
WriteItInstanceAnswerNotificationView,
WriteItInstanceApiAutoconfirmView,
WriteItInstanceApiDocsView,
WriteItInstanceContactDetailView,
WriteItInstanceModerationView,
WriteItInstanceMaxRecipientsView,
WriteItInstanceRateLimiterView,
WriteItInstanceStatusView,
WriteItInstanceTemplateUpdateView,
WriteItInstanceUpdateView,
WriteItInstanceWebBasedView,
WriteitPopitRelatingView,
MessageTogglePublic,
RejectMessageView,
Expand All @@ -49,6 +55,12 @@

managepatterns = patterns('',
url(r'^$', WriteItInstanceUpdateView.as_view(), name='writeitinstance_basic_update'),
url(r'^settings/moderation/$', WriteItInstanceModerationView.as_view(), name='writeitinstance_moderation_update'),
url(r'^settings/maxrecipients/$', WriteItInstanceMaxRecipientsView.as_view(), name='writeitinstance_maxrecipients_update'),
url(r'^settings/ratelimiter/$', WriteItInstanceRateLimiterView.as_view(), name='writeitinstance_ratelimiter_update'),
url(r'^settings/answernotification/$', WriteItInstanceAnswerNotificationView.as_view(), name='writeitinstance_answernotification_update'),
url(r'^settings/apiautoconfirm/$', WriteItInstanceApiAutoconfirmView.as_view(), name='writeitinstance_api_autoconfirm_update'),
url(r'^settings/webbased/$', WriteItInstanceWebBasedView.as_view(), name='writeitinstance_webbased_update'),
url(r'^settings/api/$', WriteItInstanceApiDocsView.as_view(), name='writeitinstance_api_docs'),
url(r'^settings/sources/$', WriteitPopitRelatingView.as_view(), name='relate-writeit-popit'),
url(r'^settings/sources/resync/(?P<popit_api_pk>[-\d]+)/$', ReSyncFromPopit.as_view(), name='resync-from-popit'),
Expand Down
9 changes: 9 additions & 0 deletions nuntium/templates/nuntium/profiles/manager-navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
{% load staticfiles %}
<ul class="navigation__list">
<li class="{% if section == 'writeitinstance_basic_update' %}active{% endif %}"><a href="{% url 'writeitinstance_basic_update' subdomain=writeitinstance.slug %}">{% trans "Basic Update" %}</a></li>
<li class="{% if section == 'writeitinstance_advanced_update' %}active{% endif %}">{% trans "Advanced Update" %}</li>
<ul>
<li class="{% if section == 'writeitinstance_moderation_update' %}active{% endif %}"><a href="{% url 'writeitinstance_moderation_update' subdomain=writeitinstance.slug %}">{% trans "Moderation" %}</a></li>
<li class="{% if section == 'writeitinstance_maxrecipients_update' %}active{% endif %}"><a href="{% url 'writeitinstance_maxrecipients_update' subdomain=writeitinstance.slug %}">{% trans "Maxium Recipients" %}</a></li>
<li class="{% if section == 'writeitinstance_ratelimiter_update' %}active{% endif %}"><a href="{% url 'writeitinstance_ratelimiter_update' subdomain=writeitinstance.slug %}">{% trans "Rate Limiter" %}</a></li>
<li class="{% if section == 'writeitinstance_answernotification_update' %}active{% endif %}"><a href="{% url 'writeitinstance_answernotification_update' subdomain=writeitinstance.slug %}">{% trans "Answer Notification" %}</a></li>
<li class="{% if section == 'writeitinstance_apiautoconfirm_update' %}active{% endif %}"><a href="{% url 'writeitinstance_api_autoconfirm_update' subdomain=writeitinstance.slug %}">{% trans "API Autoconfirm" %}</a></li>
<li class="{% if section == 'writeitinstance_webbased_update' %}active{% endif %}"><a href="{% url 'writeitinstance_webbased_update' subdomain=writeitinstance.slug %}">{% trans "Web Based?" %}</a></li>
</ul>
<li class="{% if section == 'writeitinstance_template_update' %}active{% endif %}"><a href="{% url 'writeitinstance_template_update' subdomain=writeitinstance.slug %}">{% trans "Templates" %}</a></li>
<li class="{% if section == 'contacts-per-writeitinstance' %}active{% endif %}"><a href="{% url 'contacts-per-writeitinstance' subdomain=writeitinstance.slug %}">{% trans "Recipients" %}</a></li>
<li class="{% if section == 'messages_per_writeitinstance' %}active{% endif %}"><a href="{% url 'messages_per_writeitinstance' subdomain=writeitinstance.slug %}">{% trans "Messages" %}</a></li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'Answer Notification' %}</h2>
</div>

<p>{% blocktrans %}
If you turn on “Answer Notification”, you will receive copies of all
responses to messages to your email address.
{% endblocktrans %}</p>

<form role="form" action="" method="post">

<div class="form-group">
{{form.notify_owner_when_new_answer.label_tag}}
{{form.notify_owner_when_new_answer}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
36 changes: 36 additions & 0 deletions nuntium/templates/nuntium/writeitinstance_autoconfirm_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'API Autoconfirm' %}</h2>
</div>

<p>{% blocktrans %}
If you turn on “API Autoconfirm”, any messages created through the
API will be automatically Confirmed. If you do this, please ensure
that you confirm the sender's contact details in your application.
{% endblocktrans %}</p>

<form role="form" action="" method="post">

<div class="form-group">
{{form.autoconfirm_api_messages.label_tag}}
{{form.autoconfirm_api_messages}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
42 changes: 42 additions & 0 deletions nuntium/templates/nuntium/writeitinstance_max_recipients_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'Maximum Recipients' %}</h2>
</div>

<p>{% blocktrans %}
Select the maximum number of recipients any individual message can
be sent to.
{% endblocktrans %}</p>

<p>{% blocktrans %}
This is limited to a maximum of ten recipients per message. If you
want to enable sending messages to more people at once, please
contact us.
{% endblocktrans %}</p>

<form role="form" action="" method="post">

<div class="form-group">
{{form.maximum_recipients.errors}}
{{form.maximum_recipients.label_tag}}
{{form.maximum_recipients}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
36 changes: 36 additions & 0 deletions nuntium/templates/nuntium/writeitinstance_moderation_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'Moderation' %}</h2>
</div>

<p>{% blocktrans %}
If you turn on “Moderation” for the site, messages will be sent
to you for approval, before being sent to the intended
Recipient(s).
{% endblocktrans %}</p>

<form role="form" action="" method="post">

<div class="form-group">
{{form.moderation_needed_in_all_messages.label_tag}}
{{form.moderation_needed_in_all_messages}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
40 changes: 40 additions & 0 deletions nuntium/templates/nuntium/writeitinstance_ratelimiter_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'Rate Limiting' %}</h2>
</div>

<p>{% blocktrans %}
If you set a “rate limit” for your site, no-one will be able to
send more messages than that per day.
{% endblocktrans %}</p>

<p>{% blocktrans %}
Set this to zero for to allow unlimited messages.
{% endblocktrans %}</p>


<form role="form" action="" method="post">

<div class="form-group">
{{form.rate_limiter.label_tag}}
{{form.rate_limiter}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
50 changes: 7 additions & 43 deletions nuntium/templates/nuntium/writeitinstance_update_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@
{% load staticfiles %}


{% block extrascripts %}
<link rel="stylesheet" href="{% static 'css/chosen.css' %}">
<script src="{% static 'js/chosen.jquery.min.js' %}"></script>
{% endblock extrascripts %}
{% block extrajs %}
$(".chosen-person-select").chosen();
{% endblock extrajs %}

{% block header %}

{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_basic_update' %}

{% endblock header %}

{% block content %}

{% if form.errors %}
<div class="alert alert-error">
{% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
</div>
{% endif %}


<div class="page-header">
<h2>
{% blocktrans with writeitinstance=writeitinstance %}Editing {{ writeitinstance }}{% endblocktrans %}
Expand All @@ -39,39 +36,6 @@ <h2>
{{ form.description }}
</div>

<div class="form-group">
{{advanced_form.testing_mode.label_tag}}
<a href="/en/help/glossary/#testing-mode" class="help-loader">[?]</a>
{{advanced_form.testing_mode}}
</div>
<div class="form-group">
{{advanced_form.moderation_needed_in_all_messages.label_tag}}
<a href="/en/help/glossary/#help-moderation" class="help-loader">[?]</a>
{{advanced_form.moderation_needed_in_all_messages}}
</div>
<div class="form-group">
{{advanced_form.allow_messages_using_form.label_tag}}
{{advanced_form.allow_messages_using_form}}
</div>
<div class="form-group">
{{advanced_form.rate_limiter.errors}}
{{advanced_form.rate_limiter.label_tag}}
{{advanced_form.rate_limiter}}
</div>
<div class="form-group">
{{advanced_form.notify_owner_when_new_answer.label_tag}}
{{advanced_form.notify_owner_when_new_answer}}
</div>
<div class="form-group">
{{advanced_form.autoconfirm_api_messages.label_tag}}
{{advanced_form.autoconfirm_api_messages}}
</div>
<div class="form-group">
{{advanced_form.maximum_recipients.errors}}
{{advanced_form.maximum_recipients.label_tag}}
{{advanced_form.maximum_recipients}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
Expand Down
35 changes: 35 additions & 0 deletions nuntium/templates/nuntium/writeitinstance_web_based_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends "base_manager.html" %}
{% load i18n %}
{% load subdomainurls %}
{% load staticfiles %}


{% block header %}
{% include 'nuntium/profiles/per_instance_top_menu.html' with section='writeitinstance_advanced_update' %}
{% endblock header %}

{% block content %}

<div class="page-header">
<h2>{% trans 'Allow Form?' %}</h2>
</div>

<p>{% blocktrans %}
If this is turned off, messages cannot be created via the web-based
form.
{% endblocktrans %}</p>

<form role="form" action="" method="post">

<div class="form-group">
{{form.allow_messages_using_form.label_tag}}
{{form.allow_messages_using_form}}
</div>

<div class="save-bar">
<input type="submit" class='btn btn-primary' value="{% trans 'Save changes' %}" />
</div>
{% csrf_token %}
</form>

{% endblock content %}
Loading

0 comments on commit 1b8dd29

Please sign in to comment.