summaryrefslogtreecommitdiffstats
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
parentd0988dc33088b8aedb6e4b3ae2636b13c0d744f5 (diff)
downloadaskbot-00a6757866c433f90edb3bc9667dc41406fa1f65.tar.gz
askbot-00a6757866c433f90edb3bc9667dc41406fa1f65.tar.bz2
askbot-00a6757866c433f90edb3bc9667dc41406fa1f65.zip
ported livesettings app to askbot templates
-rw-r--r--askbot/conf/site_settings.py2
-rw-r--r--askbot/deps/livesettings/templates/livesettings/group_settings.html86
-rw-r--r--askbot/media/style/style.css93
-rw-r--r--askbot/media/style/style.less94
-rw-r--r--askbot/templates/livesettings/_admin_site_views.html (renamed from askbot/deps/livesettings/templates/livesettings/_admin_site_views.html)0
-rw-r--r--askbot/templates/livesettings/group_settings.html72
-rw-r--r--askbot/templates/livesettings/site_settings.html (renamed from askbot/deps/livesettings/templates/livesettings/site_settings.html)0
-rw-r--r--askbot/templates/livesettings/text.txt (renamed from askbot/deps/livesettings/templates/livesettings/text.txt)0
8 files changed, 260 insertions, 87 deletions
diff --git a/askbot/conf/site_settings.py b/askbot/conf/site_settings.py
index edd16c5c..0463b1a6 100644
--- a/askbot/conf/site_settings.py
+++ b/askbot/conf/site_settings.py
@@ -26,7 +26,7 @@ settings.register(
livesettings.StringValue(
QA_SITE_SETTINGS,
'APP_KEYWORDS',
- default=u'Askbot,CNPROG,forum,community',
+ default=u'Askbot,forum,community',
description=_('Comma separated list of Q&A site keywords')
)
)
diff --git a/askbot/deps/livesettings/templates/livesettings/group_settings.html b/askbot/deps/livesettings/templates/livesettings/group_settings.html
deleted file mode 100644
index 924f9309..00000000
--- a/askbot/deps/livesettings/templates/livesettings/group_settings.html
+++ /dev/null
@@ -1,86 +0,0 @@
-{% extends "admin/base_site.html" %}
-{% load i18n admin_modify config_tags static %}
-{% load url from future %}
-{% block extrastyle %}
-{{ block.super }}
-<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" />
-{% endblock %}
-
-{% block stylesheet %}{% static "admin/css/forms.css" %}{% 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 Group Settings" %}
-</div>
-{% endif %}{% endblock %}
-{% block content %}
-<div id="content-main">
-{% 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" enctype="multipart/form-data">{% csrf_token %}
- <div class="module">
- <table summary="{% filter capfirst %}{% blocktrans with group.name as name %}Settings included in {{ name }}.{% endblocktrans %}{% endfilter %}" width="100%">
- {% 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 style="width: 50%;">
- {{ 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>{{ field }}</td>
- </tr>
- {% endif %}
- {% endfor %}
- </table>
- {% for field in form %}
- {% if field.is_hidden %}
- {{field}}
- {% endif %}
- {% endfor %}
- </div>
- <input type="submit" value="Save" class="default" />
-</form>
-{% else %}
- <p>{% trans "You don't have permission to edit values." %}</p>
-{% endif %}
-</div>
-{% if all_super_groups %}
- <div id="content-related">
- {% for super_group in all_super_groups %}
- <div class="module">
- <h2>{{ super_group.name }}</h2>
- <ul>
- {% for g in super_group.groups %}
- {% if g.keys|length %}
- {% ifequal g.key group.key %}
- <li><b>{{g.name}}</b></li>
- {% else %}
- <li><a href="{% url "group_settings" g.key %}">{{g.name}}</a></li>
- {% endifequal %}
- {% endif %}
- {% endfor %}
- </ul>
- </div>
- {% endfor %}
- </div>
-{% endif %}
-{% endblock %}
diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css
index c98e6e36..af99c023 100644
--- a/askbot/media/style/style.css
+++ b/askbot/media/style/style.css
@@ -4227,6 +4227,99 @@ textarea.tipped-input {
width: auto;
margin-bottom: 0;
}
+.settings-nav,
+.settings-main {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ margin: 6px 0 10px;
+}
+.settings-nav *,
+.settings-main * {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+}
+.settings-main {
+ float: right;
+ padding: 11px 0 11px 15px;
+ width: 80%;
+}
+.settings-main .help {
+ font-size: 12px;
+ line-height: 1.3;
+ margin: 10px 0;
+}
+.settings-main label {
+ font-weight: bold;
+ line-height: 1.2;
+}
+.settings-main img {
+ margin: 0 0 10px 0;
+}
+.settings-nav {
+ background: #e9e9e1;
+ border: 1px solid #d3d3c2;
+ float: left;
+ padding: 0;
+ width: 20%;
+}
+.settings-nav h2 {
+ background: #777;
+ color: #eaeaea;
+ font-size: 16px;
+ font-weight: normal;
+ line-height: 1.35;
+ padding: 10px;
+}
+.settings-nav ul {
+ list-style: none;
+ margin: 10px 0;
+}
+.settings-nav li {
+ line-height: 1.45;
+ padding: 0 10px;
+}
+.settings-nav li.on,
+.settings-nav li:hover {
+ background: white;
+}
+.settings-nav li.on a,
+.settings-nav li:hover a {
+ text-decoration: none;
+}
+table.settings {
+ width: 100%;
+}
+table.settings td {
+ vertical-align: top;
+ padding-bottom: 10px;
+}
+td.setting-label {
+ width: 30%;
+}
+td.setting-input {
+ padding-left: 10px;
+ width: 70%;
+}
+td.setting-input input[type="text"] {
+ font-size: 13px;
+ height: 25px;
+ line-height: 25px;
+ padding-left: 5px;
+ width: 50%;
+}
+td.setting-input textarea {
+ width: 100%;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -o-transition: border linear 0.2s, box-shadow linear 0.2s;
+ transition: border linear 0.2s, box-shadow linear 0.2s;
+}
/* modifications for small screens */
@media screen and (max-width: 960px) {
/* content margins touch viewport */
diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less
index 03205f4e..b42941c9 100644
--- a/askbot/media/style/style.less
+++ b/askbot/media/style/style.less
@@ -4430,6 +4430,100 @@ textarea.tipped-input {
}
}
+.settings-nav,
+.settings-main {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ margin: 6px 0 10px;
+ * {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ }
+}
+
+.settings-main {
+ float: right;
+ padding: 11px 0 11px 15px;
+ width: 80%;
+ .help {
+ font-size: 12px;
+ line-height: 1.3;
+ margin: 10px 0;
+ }
+ label {
+ font-weight: bold;
+ line-height: 1.2;
+ }
+ img {
+ margin: 0 0 10px 0;
+ }
+}
+
+.settings-nav {
+ background: #e9e9e1;
+ border: 1px solid #d3d3c2;
+ float: left;
+ padding: 0;
+ width: 20%;
+ h2 {
+ background: #777;
+ color: #eaeaea;
+ font-size: 16px;
+ font-weight: normal;
+ line-height: 1.35;
+ padding: 10px;
+ }
+ ul {
+ list-style: none;
+ margin: 10px 0;
+ }
+ li {
+ line-height: 1.45;
+ padding: 0 10px;
+ }
+ li.on,
+ li:hover {
+ background: white;
+ a {
+ text-decoration: none;
+ }
+ }
+}
+table.settings {
+ width: 100%;
+ td {
+ vertical-align: top;
+ padding-bottom: 10px;
+ }
+}
+td.setting-label {
+ width: 30%;
+}
+td.setting-input {
+ padding-left: 10px;
+ width: 70%;
+ input[type="text"] {
+ font-size: 13px;
+ height: 25px;
+ line-height: 25px;
+ padding-left: 5px;
+ width: 50%;
+ }
+ textarea {
+ width: 100%;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+ -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
+ -o-transition: border linear 0.2s, box-shadow linear 0.2s;
+ transition: border linear 0.2s, box-shadow linear 0.2s;
+ }
+}
+
/* modifications for small screens */
@media screen and (max-width: 960px) {/* content margins touch viewport */
* {
diff --git a/askbot/deps/livesettings/templates/livesettings/_admin_site_views.html b/askbot/templates/livesettings/_admin_site_views.html
index 17d08f58..17d08f58 100644
--- a/askbot/deps/livesettings/templates/livesettings/_admin_site_views.html
+++ b/askbot/templates/livesettings/_admin_site_views.html
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/deps/livesettings/templates/livesettings/site_settings.html b/askbot/templates/livesettings/site_settings.html
index 13d8ea40..13d8ea40 100644
--- a/askbot/deps/livesettings/templates/livesettings/site_settings.html
+++ b/askbot/templates/livesettings/site_settings.html
diff --git a/askbot/deps/livesettings/templates/livesettings/text.txt b/askbot/templates/livesettings/text.txt
index d57a57e3..d57a57e3 100644
--- a/askbot/deps/livesettings/templates/livesettings/text.txt
+++ b/askbot/templates/livesettings/text.txt