Skip to content

Commit

Permalink
[#2375] Tidy up the admin config html
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Aug 1, 2012
1 parent dd7d8de commit e401e6e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
9 changes: 5 additions & 4 deletions ckan/controllers/admin.py
Expand Up @@ -52,10 +52,11 @@ def config(self):
# reset to values in config
app_globals.reset()

styles = [('Default', '/base/css/main.css'),
('Red', '/base/css/red.css'),
('Green', '/base/css/green.css'),
('Fuchsia', '/base/css/fuchsia.css')]
# Styles for use in the form.select() macro.
styles = [{'text': 'Default', 'value': '/base/css/main.css'},
{'text': 'Red', 'value': '/base/css/red.css'},
{'text': 'Green', 'value': '/base/css/green.css'},
{'text': 'Fuchsia', 'value': '/base/css/fuchsia.css'}]
data = {}

data['title'] = g.site_title
Expand Down
31 changes: 13 additions & 18 deletions ckan/templates/admin/config.html
Expand Up @@ -4,29 +4,24 @@

{% block title %}{{ _('Administration') }} - {{ super() }}{% endblock %}

{% block breadcrumb_content %}
{% endblock %}

{% block primary %}
<article class="module">
<div class="module-content">
<h1 class="page-heading">{{ _('Configuration Settings') }}</h1>

<form method='post' action="" class="form-horizontal">
<div class="control-group">
<label for="style" class="control-label">Style</label>
<div class="controls">
<select name="style">
{% for style, css in styles|sort %}
<option value="{{ css }}" {% if css == data.style %}selected="selected"{% endif %} >{{ style }}</option>
{% endfor %}
</select>
</div>
</div>
{{ form.input('title', id='field-title', label=_('Site Title'), placeholder=_('eg. CKAN'), value=data.title, error=errors.title) }}
{{ form.input('tagline', id='field-tagline', label=_('Tag Line'), placeholder=_('eg. The Open Source Data Portal'), value=data.tagline, error=errors.tagline) }}
{{ form.markdown('about', id='field-about', label=_('About Text'), placeholder=_('About contents'), value=data.about, error=errors.about) }}
<button type="submit" class="btn" name="reset">Reset</button>
<button type="submit" class="btn btn-primary" name="save">Update</button>
{{ form.select('style', id='field-style', label=_('Style'), options=styles, selected=data.style, error=errors.style) }}

{{ form.input('title', id='field-title', label=_('Site Title'), placeholder=_('eg. CKAN'), value=data.title, error=errors.title, classes=['control-medium']) }}

{{ form.input('tagline', id='field-tagline', label=_('Tag Line'), placeholder=_('eg. The Open Source Data Portal'), value=data.tagline, error=errors.tagline, classes=['control-medium']) }}

{{ form.markdown('about', id='field-about', label=_('About Text'), placeholder=_('About contents'), value=data.about, error=errors.about) }}

<div class="form-actions">
<button type="submit" class="btn" name="reset">Reset</button>
<button type="submit" class="btn btn-primary" name="save">Update</button>
</div>
</form>
</div>
</article>
Expand Down

0 comments on commit e401e6e

Please sign in to comment.