From 00a6757866c433f90edb3bc9667dc41406fa1f65 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 5 May 2013 22:34:29 -0400 Subject: ported livesettings app to askbot templates --- askbot/conf/site_settings.py | 2 +- .../templates/livesettings/_admin_site_views.html | 15 --- .../templates/livesettings/group_settings.html | 86 ----------------- .../templates/livesettings/site_settings.html | 102 --------------------- .../livesettings/templates/livesettings/text.txt | 1 - askbot/media/style/style.css | 93 +++++++++++++++++++ askbot/media/style/style.less | 94 +++++++++++++++++++ .../templates/livesettings/_admin_site_views.html | 15 +++ askbot/templates/livesettings/group_settings.html | 72 +++++++++++++++ askbot/templates/livesettings/site_settings.html | 102 +++++++++++++++++++++ askbot/templates/livesettings/text.txt | 1 + 11 files changed, 378 insertions(+), 205 deletions(-) delete mode 100644 askbot/deps/livesettings/templates/livesettings/_admin_site_views.html delete mode 100644 askbot/deps/livesettings/templates/livesettings/group_settings.html delete mode 100644 askbot/deps/livesettings/templates/livesettings/site_settings.html delete mode 100644 askbot/deps/livesettings/templates/livesettings/text.txt create mode 100644 askbot/templates/livesettings/_admin_site_views.html create mode 100644 askbot/templates/livesettings/group_settings.html create mode 100644 askbot/templates/livesettings/site_settings.html create mode 100644 askbot/templates/livesettings/text.txt 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/_admin_site_views.html b/askbot/deps/livesettings/templates/livesettings/_admin_site_views.html deleted file mode 100644 index 17d08f58..00000000 --- a/askbot/deps/livesettings/templates/livesettings/_admin_site_views.html +++ /dev/null @@ -1,15 +0,0 @@ -{% load i18n %} - 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 }} - -{% endblock %} - -{% block stylesheet %}{% static "admin/css/forms.css" %}{% endblock %} -{% block coltype %}colMS{% endblock %} -{% block bodyclass %}dashboard{% endblock %} -{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} -{% block breadcrumbs %}{% if not is_popup %} - -{% endif %}{% endblock %} -{% block content %} -
-{% if form.errors %} -

- {% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} -

-{% endif %} -{% if form.fields %} -
{% csrf_token %} -
- - {% for field in form %} - {% if field.is_hidden %} - - {% else %} - {% if field.errors %} - - - - {% endif %} - - - - - {% endif %} - {% endfor %} -
{{ field.errors }}
- {{ field.label_tag }} - {% if field.help_text %} -

{{ field.help_text|safe }}

- {% endif %} - {% if field.field.default_text %} -

{{ field.field.default_text|safe }}

- {% endif %} -
{{ field }}
- {% for field in form %} - {% if field.is_hidden %} - {{field}} - {% endif %} - {% endfor %} -
- -
-{% else %} -

{% trans "You don't have permission to edit values." %}

-{% endif %} -
-{% if all_super_groups %} - -{% endif %} -{% endblock %} diff --git a/askbot/deps/livesettings/templates/livesettings/site_settings.html b/askbot/deps/livesettings/templates/livesettings/site_settings.html deleted file mode 100644 index 13d8ea40..00000000 --- a/askbot/deps/livesettings/templates/livesettings/site_settings.html +++ /dev/null @@ -1,102 +0,0 @@ -{% 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 %} - - - -{% endblock %} -{% block extrastyle %} -{{ block.super }} - - -{% endblock %} -{% block coltype %}colMS{% endblock %} -{% block bodyclass %}dashboard{% endblock %} -{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} -{% block breadcrumbs %}{% if not is_popup %} - -{% endif %}{% endblock %} -{% block content %} -{% comment %} -
- -
-{% endcomment %} - -
-{% if not use_db %} -

{% trans "Livesettings are disabled for this site." %}

-

{% trans "All configuration options must be edited in the site settings.py file" %}

-
- {% admin_site_views 'satchmo_site_settings' %} -{% else %} - {% if form.errors %} -

- {% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} -

- {% endif %} - {% if form.fields %} -
- {% for field in form %} - {% if field.is_hidden %} - {{ field }} - {% else %} - {% ifchanged field.field.group %}{% with field.field.group as group %} - {% if not forloop.first %} - - - {% endif %} -
-

{{ group.name }}

- - {% endwith %}{% endifchanged %} - - {% if field.errors %} - - - - {% endif %} - - - - - {% endif %} - {% endfor %} -
{{ field.errors }}
- {{ field.label_tag }} - {% if field.help_text %} -

{{ field.help_text|break_at:40|safe }}

- {% endif %} - {% if field.field.default_text %} -

{{ field.field.default_text|break_at:40}}

- {% endif %} -
{{ field }}
- - {% admin_site_views 'satchmo_site_settings' %} -
- -

{% trans 'Uncollapse all' %}

-

Export

- - {% else %} -

{% trans "You don't have permission to edit values." %}

- {% endif %} -{% endif %} - -{% endblock %} diff --git a/askbot/deps/livesettings/templates/livesettings/text.txt b/askbot/deps/livesettings/templates/livesettings/text.txt deleted file mode 100644 index d57a57e3..00000000 --- a/askbot/deps/livesettings/templates/livesettings/text.txt +++ /dev/null @@ -1 +0,0 @@ -{{ text|safe }} \ No newline at end of file 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/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 %} + 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 %} +

+ {% trans %}Settings{% endtrans %} → {{ group.super_group.name }} → {{ group.name }} +

+
+{% if form.errors %} +

+ {% trans counter = form.errors|length %}Please correct the error below.{% pluralize %}Please correct the errors below.{% endtrans %} +

+{% endif %} +{% if form.fields %} +
{% csrf_token %} + + {% for field in form %} + {% if field.is_hidden %} + + {% else %} + {% if field.errors %} + + + + {% endif %} + + + + + {% endif %} + {% endfor %} +
{{ field.errors }}
+ {{ field.label_tag() }} + {% if field.help_text %} +

{{ field.help_text|safe }}

+ {% endif %} + {% if field.field.default_text %} +

{{ field.field.default_text|safe }}

+ {% endif %} +
{{ field }}
+ {% for field in form %} + {% if field.is_hidden %} + {{field}} + {% endif %} + {% endfor %} + +
+{% else %} +

{% trans %}You don't have permission to edit values.{% endtrans %}

+{% endif %} +
+{% if all_super_groups %} +
+ {% for super_group in all_super_groups %} +

{{ super_group.name }}

+
    + {% for g in super_group.groups %} + {% if g.keys %} + {% if g.key == group.key %} +
  • {{g.name}}
  • + {% else %} +
  • {{g.name}}
  • + {% endif %} + {% endif %} + {% endfor %} +
+ {% endfor %} +
+{% endif %} +
+{% 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 %} + + + +{% endblock %} +{% block extrastyle %} +{{ block.super }} + + +{% endblock %} +{% block coltype %}colMS{% endblock %} +{% block bodyclass %}dashboard{% endblock %} +{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} +{% block breadcrumbs %}{% if not is_popup %} + +{% endif %}{% endblock %} +{% block content %} +{% comment %} +
+ +
+{% endcomment %} + +
+{% if not use_db %} +

{% trans "Livesettings are disabled for this site." %}

+

{% trans "All configuration options must be edited in the site settings.py file" %}

+
+ {% admin_site_views 'satchmo_site_settings' %} +{% else %} + {% if form.errors %} +

+ {% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} +

+ {% endif %} + {% if form.fields %} +
+ {% for field in form %} + {% if field.is_hidden %} + {{ field }} + {% else %} + {% ifchanged field.field.group %}{% with field.field.group as group %} + {% if not forloop.first %} + +
+ {% endif %} +
+

{{ group.name }}

+ + {% endwith %}{% endifchanged %} + + {% if field.errors %} + + + + {% endif %} + + + + + {% endif %} + {% endfor %} +
{{ field.errors }}
+ {{ field.label_tag }} + {% if field.help_text %} +

{{ field.help_text|break_at:40|safe }}

+ {% endif %} + {% if field.field.default_text %} +

{{ field.field.default_text|break_at:40}}

+ {% endif %} +
{{ field }}
+ + {% admin_site_views 'satchmo_site_settings' %} +
+ +

{% trans 'Uncollapse all' %}

+

Export

+ + {% else %} +

{% trans "You don't have permission to edit values." %}

+ {% endif %} +{% endif %} + +{% 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 -- cgit v1.2.3-1-g7c22