summaryrefslogtreecommitdiffstats
path: root/askbot/templates
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-05 22:34:29 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-05 22:34:29 -0400
commit00a6757866c433f90edb3bc9667dc41406fa1f65 (patch)
tree58aa73f85ec4f86d533c219817ea1da87058cebe /askbot/templates
parentd0988dc33088b8aedb6e4b3ae2636b13c0d744f5 (diff)
downloadaskbot-00a6757866c433f90edb3bc9667dc41406fa1f65.tar.gz
askbot-00a6757866c433f90edb3bc9667dc41406fa1f65.tar.bz2
askbot-00a6757866c433f90edb3bc9667dc41406fa1f65.zip
ported livesettings app to askbot templates
Diffstat (limited to 'askbot/templates')
-rw-r--r--askbot/templates/livesettings/_admin_site_views.html15
-rw-r--r--askbot/templates/livesettings/group_settings.html72
-rw-r--r--askbot/templates/livesettings/site_settings.html102
-rw-r--r--askbot/templates/livesettings/text.txt1
4 files changed, 190 insertions, 0 deletions
diff --git a/askbot/templates/livesettings/_admin_site_views.html b/askbot/templates/livesettings/_admin_site_views.html
new file mode 100644
index 00000000..17d08f58
--- /dev/null
+++ b/askbot/templates/livesettings/_admin_site_views.html
@@ -0,0 +1,15 @@
+{% load i18n %}
+<div id="content-related">
+ <div class="module" id="sites-module">
+ <h2 class="module-title">{% trans 'Sites' %}</h2>
+ <div class="module-content">
+ <ul>
+ {% for label, link in links %}
+ <li>
+ <a href="{{ link }}">{{ label }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+</div>
diff --git a/askbot/templates/livesettings/group_settings.html b/askbot/templates/livesettings/group_settings.html
new file mode 100644
index 00000000..a8baa47f
--- /dev/null
+++ b/askbot/templates/livesettings/group_settings.html
@@ -0,0 +1,72 @@
+{% extends "one_column_body.html" %}
+{% block content %}
+<h1 class="section-title">
+ {% trans %}Settings{% endtrans %} &rarr; {{ group.super_group.name }} &rarr; {{ group.name }}
+</h1>
+<div class="settings-main">
+{% if form.errors %}
+ <p class="errornote">
+ {% trans counter = form.errors|length %}Please correct the error below.{% pluralize %}Please correct the errors below.{% endtrans %}
+ </p>
+{% endif %}
+{% if form.fields %}
+<form method="post" enctype="multipart/form-data">{% csrf_token %}
+ <table
+ class="settings"
+ summary="{% trans name = group.name %}Settings included in {{ name }}.{% endtrans %}"
+ >
+ {% for field in form %}
+ {% if field.is_hidden %}
+ <!-- skip hidden field {{field.key}} -->
+ {% else %}
+ {% if field.errors %}
+ <tr class="error">
+ <td colspan="2">{{ field.errors }}</td>
+ </tr>
+ {% endif %}
+ <tr{% if field.errors %} class="error"{% endif %}>
+ <td class="setting-label">
+ {{ field.label_tag() }}
+ {% if field.help_text %}
+ <p class="help">{{ field.help_text|safe }}</p>
+ {% endif %}
+ {% if field.field.default_text %}
+ <p class="help">{{ field.field.default_text|safe }}</p>
+ {% endif %}
+ </td>
+ <td class="setting-input">{{ field }}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ {% for field in form %}
+ {% if field.is_hidden %}
+ {{field}}
+ {% endif %}
+ {% endfor %}
+ <input type="submit" value="Save" class="default" />
+</form>
+{% else %}
+ <p>{% trans %}You don't have permission to edit values.{% endtrans %}</p>
+{% endif %}
+</div>
+{% if all_super_groups %}
+ <div class="settings-nav">
+ {% for super_group in all_super_groups %}
+ <h2>{{ super_group.name }}</h2>
+ <ul>
+ {% for g in super_group.groups %}
+ {% if g.keys %}
+ {% if g.key == group.key %}
+ <li class="on">{{g.name}}</li>
+ {% else %}
+ <li><a href="{% url "group_settings" g.key %}">{{g.name}}</a></li>
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ </ul>
+ {% endfor %}
+ </div>
+{% endif %}
+<div class="clearfix"></div>
+{% endblock %}
diff --git a/askbot/templates/livesettings/site_settings.html b/askbot/templates/livesettings/site_settings.html
new file mode 100644
index 00000000..13d8ea40
--- /dev/null
+++ b/askbot/templates/livesettings/site_settings.html
@@ -0,0 +1,102 @@
+{% extends "admin/base_site.html" %}
+{% load i18n admin_modify config_tags static %}
+{% load url from future %}
+
+{% block stylesheet %}{% static "admin/css/forms.css" %}{% endblock %}
+{% block extrahead %}
+<script type="text/javascript" src="{% url "admin:jsi18n" %}"></script>
+<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
+<script type="text/javascript" src="{% static "admin/js/CollapsedFieldsets.js" %}"></script>
+{% endblock %}
+{% block extrastyle %}
+{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" />
+<style type="text/css">
+ul.fieldref { margin: 0; padding: 0; font-size: 9px; }
+ul.fieldref li { float: left; margin: 0 10px 0 0; list-style: none; }
+fieldset.collapsed h2 { display: block !important; }
+fieldset.collapsed h2 a { display: inline !important; }
+div.fieldcontainer { float: left; margin-right: 0; }
+</style>
+{% endblock %}
+{% block coltype %}colMS{% endblock %}
+{% block bodyclass %}dashboard{% endblock %}
+{% block userlinks %}<a href="/admin/doc/">{% trans 'Documentation' %}</a> / <a href="/admin/password_change/">{% trans 'Change password' %}</a> / <a href="/admin/logout/">{% trans 'Log out' %}</a>{% endblock %}
+{% block breadcrumbs %}{% if not is_popup %}
+<div class="breadcrumbs">
+ <a href="/admin/">{% trans "Home" %}</a> &rsaquo;
+ {% trans "Edit Site Settings" %}
+</div>
+{% endif %}{% endblock %}
+{% block content %}
+{% comment %}
+<div class="fieldcontainer">
+<ul class="fieldref">
+{% for group in form.groups %}
+ <li><a onclick="javascript:CollapsedFieldsets.show({{ forloop.counter0 }});" href="#{{ group.key }}">{{ group.name }}</a></li>
+{% endfor %}
+</ul>
+</div>
+{% endcomment %}
+<span style="clear: both;" />
+<div id="content-main">
+{% if not use_db %}
+ <p>{% trans "Livesettings are disabled for this site." %}</p>
+ <p>{% trans "All configuration options must be edited in the site settings.py file" %}</p>
+ </div>
+ {% admin_site_views 'satchmo_site_settings' %}
+{% else %}
+ {% if form.errors %}
+ <p class="errornote">
+ {% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+ </p>
+ {% endif %}
+ {% if form.fields %}
+ <form method="post">
+ {% for field in form %}
+ {% if field.is_hidden %}
+ {{ field }}
+ {% else %}
+ {% ifchanged field.field.group %}{% with field.field.group as group %}
+ {% if not forloop.first %}
+ </table>
+ </fieldset>
+ {% endif %}
+ <fieldset class="module collapse">
+ <h2 id="{{ group.key }}">{{ group.name }}</h2>
+ <table summary="{% blocktrans with group.name as name %}Group settings: {{ name }}{% endblocktrans %}" style="width: 100%">
+ {% endwith %}{% endifchanged %}
+
+ {% if field.errors %}
+ <tr class="error">
+ <td colspan="2">{{ field.errors }}</td>
+ </tr>
+ {% endif %}
+ <tr{% if field.errors %} class="error"{% endif %}>
+ <td style="width: 50%;">
+ {{ field.label_tag }}
+ {% if field.help_text %}
+ <p class="help">{{ field.help_text|break_at:40|safe }}</p>
+ {% endif %}
+ {% if field.field.default_text %}
+ <p class="help">{{ field.field.default_text|break_at:40}}</p>
+ {% endif %}
+ </td>
+ <td>{{ field }}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ </div>
+ {% admin_site_views 'satchmo_site_settings' %}
+ <br class="clear:both;" />
+ <input type="submit" value="Save" class="default" />
+ <p><a onclick="javascript:CollapsedFieldsets.uncollapse_all(); return false;" href="#">{% trans 'Uncollapse all' %}</a></p>
+ <p><a href="{% url settings_export %}">Export</a></p>
+ </form>
+ {% else %}
+ <p>{% trans "You don't have permission to edit values." %}</p>
+ {% endif %}
+{% endif %}
+</div>
+{% endblock %}
diff --git a/askbot/templates/livesettings/text.txt b/askbot/templates/livesettings/text.txt
new file mode 100644
index 00000000..d57a57e3
--- /dev/null
+++ b/askbot/templates/livesettings/text.txt
@@ -0,0 +1 @@
+{{ text|safe }} \ No newline at end of file