Skip to content

Commit

Permalink
Improve the appearance of the form to add a resource
Browse files Browse the repository at this point in the history
  • Loading branch information
e2jk committed Sep 21, 2012
1 parent ff79e36 commit 1691152
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 9 deletions.
91 changes: 85 additions & 6 deletions flosstalks_app/templates/project_add_resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,90 @@ <h1>{%blocktrans with project_name=project.name%}Add a resource to {{project_nam
</div>
<p>{%blocktrans with project_name=project.name%}By suggesting a new resource for {{project_name}} you are helping us provider better information on the site!{%endblocktrans%}</p>

<form action="{%url flosstalks:project_add_resource project.pk%}" method="post">{% csrf_token %}
{%comment%}TODO: Improve the appearance of the form{%endcomment%}
{%comment%}TODO: Better display error messages{%endcomment%}
{{ resource_form.as_p }}
{{ resource_download_url_form.as_p }}
<input type="submit" value="{%trans "Suggest new resource"%}" />
<form action="{%url flosstalks:project_add_resource project.pk%}" method="post" class="form-horizontal">
{% csrf_token %}
<div class="row">
<div class="span5">
<div class="control-group{%if resource_form.name.errors%} error{%endif%}">
<label class="control-label" for="id_resource-name">{%trans "Name:"%}</label>
<div class="controls">
{{resource_form.name}}
{%if resource_form.name.errors%}
<span class="help-inline">
<strong>{% for error in resource_form.name.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
<div class="control-group{%if resource_form.description.errors%} error{%endif%}">
<label class="control-label" for="id_resource-description">{%trans "Description:"%}</label>
<div class="controls">
<textarea id="id_resource-description" rows="3" cols="40" name="resource-description">{%if resource_form.description.value%}{{resource_form.description.value}}{%endif%}</textarea>
{%if resource_form.description.errors%}
<span class="help-inline">
<strong>{% for error in resource_form.description.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
<div class="control-group{%if resource_form.url.errors%} error{%endif%}">
<label class="control-label" for="id_resource-url">{%trans "Resource web page:"%}</label>
<div class="controls">
{{resource_form.url}}
{%if resource_form.url.errors%}
<span class="help-inline">
<strong>{% for error in resource_form.url.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
</div>
<div class="span5">
<div class="control-group{%if resource_download_url_form.media_type.errors and not resource_form.errors%} error{%endif%}">
<label class="control-label" for="id_download-media_type">{%trans "Media type:"%}</label>
<div class="controls">
{{resource_download_url_form.media_type}}
{%if resource_download_url_form.media_type.errors and not resource_form.errors%}
<span class="help-inline">
<strong>{% for error in resource_download_url_form.media_type.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
<div class="control-group{%if resource_download_url_form.format.errors and not resource_form.errors%} error{%endif%}">
<label class="control-label" for="id_download-format">{%trans "Format:"%}</label>
<div class="controls">
{{resource_download_url_form.format}}
{%if resource_download_url_form.format.errors and not resource_form.errors%}
<span class="help-inline">
<strong>{% for error in resource_download_url_form.format.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
<div class="control-group{%if resource_download_url_form.url.errors and not resource_form.errors%} error{%endif%}">
<label class="control-label" for="id_download-url">{%trans "Address to download the resource:"%}</label>
<div class="controls">
{{resource_download_url_form.url}}
{%if resource_download_url_form.url.errors and not resource_form.errors%}
<span class="help-inline">
<strong>{% for error in resource_download_url_form.url.errors %}{{ error|escape }}
{% endfor %}</strong>
</span>
{%endif%}
</div>
</div>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="submit" value="{%trans "Suggest new resource"%}" class="btn btn-primary" />
</div>
</div>
</form>
{%endif%}{% endblock %}
30 changes: 27 additions & 3 deletions i18n/flosstalks.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-09-16 18:16+0200\n"
"POT-Creation-Date: 2012-09-21 19:09+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -154,7 +154,7 @@ msgstr ""
msgid "Get the code!"
msgstr ""

#: flosstalks_app/templates/base.html:78
#: flosstalks_app/templates/base.html:79
msgid "Change language"
msgstr ""

Expand Down Expand Up @@ -238,7 +238,31 @@ msgid ""
"provider better information on the site!"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:27
#: flosstalks_app/templates/project_add_resource.html:25
msgid "Name:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:37
msgid "Description:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:49
msgid "Resource web page:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:63
msgid "Media type:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:75
msgid "Format:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:87
msgid "Address to download the resource:"
msgstr ""

#: flosstalks_app/templates/project_add_resource.html:102
msgid "Suggest new resource"
msgstr ""

Expand Down

0 comments on commit 1691152

Please sign in to comment.