diff options
Diffstat (limited to 'livesettings')
-rw-r--r-- | livesettings/templates/livesettings/group_settings.html | 47 | ||||
-rw-r--r-- | livesettings/views.py | 3 |
2 files changed, 31 insertions, 19 deletions
diff --git a/livesettings/templates/livesettings/group_settings.html b/livesettings/templates/livesettings/group_settings.html index 069a3338..e56f764f 100644 --- a/livesettings/templates/livesettings/group_settings.html +++ b/livesettings/templates/livesettings/group_settings.html @@ -27,25 +27,34 @@ <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.errors %} - <tr class="error"> - <td colspan="2">{{ field.errors }}</td> - </tr> + {% 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 %} - <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> {% endfor %} </table> + {% for field in form %} + {% if field.is_hidden %} + {{field}} + {% endif %} + {% endfor %} </div> <input type="submit" value="Save" class="default" /> </form> @@ -59,7 +68,11 @@ <h2>{% trans "Setting groups" %}</h2> <ul> {% for g in all_groups %} - <li><a href="{% url group_settings g.key %}">{{g.name}}</a></li> + {% 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 %} {% endfor %} </ul> </div> diff --git a/livesettings/views.py b/livesettings/views.py index bf0fc707..c2a2ccdc 100644 --- a/livesettings/views.py +++ b/livesettings/views.py @@ -50,7 +50,7 @@ def group_settings(request, group, template='livesettings/group_settings.html'): return render_to_response(template, { 'all_groups': mgr.groups(), 'title': title, - 'group' : group, + 'group' : settings, 'form': form, 'use_db' : use_db }, context_instance=RequestContext(request)) @@ -61,7 +61,6 @@ group_settings = never_cache(staff_member_required(group_settings)) def site_settings(request): mgr = ConfigurationSettings() default_group= mgr.groups()[0].key - print default_group return HttpResponseRedirect(reverse('group_settings', args=[default_group])) #return group_settings(request, group=None, template='livesettings/site_settings.html') |