Skip to content

Commit

Permalink
[#2302] config add about text to form
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jul 26, 2012
1 parent 14d7046 commit e5ec5e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ckan/controllers/admin.py
Expand Up @@ -41,6 +41,9 @@ def config(self):
tag_line = data.get('tagline')
app_globals.set_global('site_description', tag_line)

about = data.get('about')
app_globals.set_global('site_about', about)

styles = [('Default', '/base/css/main.css'),
('Red', '/base/css/red.css'),
('Green', '/base/css/green.css'),
Expand All @@ -50,6 +53,7 @@ def config(self):
data['title'] = app_globals.site_title
data['style'] = app_globals.main_css
data['tagline'] = app_globals.site_description
data['about'] = app_globals.site_about

vars = {'data': data, 'errors': {}, 'styles': styles}
return base.render('admin/config.html',
Expand Down
3 changes: 2 additions & 1 deletion ckan/templates/admin/config.html
Expand Up @@ -24,7 +24,8 @@ <h1 class="page-heading">{{ _('Configuration Settings') }}</h1>
</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) }}
<button type="submit" class="btn btn-primary" >Update</button>
{{ form.markdown('about', id='field-about', label=_('About Text'), placeholder=_('About contents'), value=data.about, error=errors.about) }}
<button type="submit" class="btn btn-primary" name="save">Update</button>
</form>
</div>
</article>
Expand Down
6 changes: 5 additions & 1 deletion ckan/templates/home/about.html
Expand Up @@ -11,7 +11,11 @@
<div class="module-content">
<h1 class="page-heading">{{ _('About') }}</h1>
{% block about %}
{% snippet 'home/snippets/about_text.html' %}
{% if g.site_about %}
{{ h.markdown_extract(g.site_about) }}
{% else %}
{% snippet 'home/snippets/about_text.html' %}
{% endif %}
{% endblock %}
</div>
</article>
Expand Down

0 comments on commit e5ec5e2

Please sign in to comment.