summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-20 23:38:32 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-04-20 23:38:32 -0400
commit065a92439cb788e0570dc2ebf749e4b7f7a36fed (patch)
tree3bab602fc93c80ccfc63d1cdcbc07e7f851a56d4
parent4d67a7f6e4b496af660bb289c876ca3654174ef5 (diff)
downloadaskbot-065a92439cb788e0570dc2ebf749e4b7f7a36fed.tar.gz
askbot-065a92439cb788e0570dc2ebf749e4b7f7a36fed.tar.bz2
askbot-065a92439cb788e0570dc2ebf749e4b7f7a36fed.zip
improved wording of the ask and edit question page
-rw-r--r--askbot/forms.py10
-rw-r--r--askbot/media/js/post.js16
-rw-r--r--askbot/media/style/style.css40
-rw-r--r--askbot/media/style/style.less53
-rw-r--r--askbot/templates/ask.html2
-rw-r--r--askbot/templates/embed/ask_by_widget.html2
-rw-r--r--askbot/templates/macros.html1
-rw-r--r--askbot/templates/question_edit.html11
-rw-r--r--askbot/templates/widgets/ask_form.html16
-rw-r--r--askbot/templates/widgets/edit_post.html13
10 files changed, 97 insertions, 67 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 0fafec53..e214e908 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -244,7 +244,7 @@ class TitleField(forms.CharField):
self.max_length = 255
self.label = _('title')
self.help_text = _(
- 'please enter a descriptive title for your question'
+ 'Please enter your question'
)
self.initial = ''
@@ -255,8 +255,8 @@ class TitleField(forms.CharField):
value = ''
if len(value) < askbot_settings.MIN_TITLE_LENGTH:
msg = ungettext_lazy(
- 'title must be > %d character',
- 'title must be > %d characters',
+ 'must have > %d character',
+ 'must have > %d characters',
askbot_settings.MIN_TITLE_LENGTH
) % askbot_settings.MIN_TITLE_LENGTH
raise forms.ValidationError(msg)
@@ -265,14 +265,14 @@ class TitleField(forms.CharField):
if len(value) > self.max_length:
raise forms.ValidationError(
_(
- 'The title is too long, maximum allowed size is '
+ 'The question is too long, maximum allowed size is '
'%d characters'
) % self.max_length
)
elif len(encoded_value) > self.max_length:
raise forms.ValidationError(
_(
- 'The title is too long, maximum allowed size is '
+ 'The question is too long, maximum allowed size is '
'%d bytes'
) % self.max_length
)
diff --git a/askbot/media/js/post.js b/askbot/media/js/post.js
index ada053c6..d0e23cec 100644
--- a/askbot/media/js/post.js
+++ b/askbot/media/js/post.js
@@ -130,9 +130,9 @@ var validateTagCount = function(value){
$.validator.addMethod('limit_tag_count', validateTagCount);
$.validator.addMethod('limit_tag_length', validateTagLength);
-var CPValidator = function(){
+var CPValidator = function() {
return {
- getQuestionFormRules : function(){
+ getQuestionFormRules : function() {
return {
tags: {
required: askbot['settings']['tagsAreRequired'],
@@ -157,22 +157,22 @@ var CPValidator = function(){
limit_tag_length: askbot['messages']['maxTagLength']
},
text: {
- required: " " + gettext('content cannot be empty'),
+ required: " " + gettext('details are required'),
minlength: interpolate(
ngettext(
- 'question body must be > %s character',
- 'question body must be > %s characters',
+ 'details must have > %s character',
+ 'details must have > %s characters',
askbot['settings']['minQuestionBodyLength']
),
[askbot['settings']['minQuestionBodyLength'], ]
)
},
title: {
- required: " " + gettext('please enter title'),
+ required: " " + gettext('enter your question'),
minlength: interpolate(
ngettext(
- 'title must be > %s character',
- 'title must be > %s characters',
+ 'question must have > %s character',
+ 'question must have > %s characters',
askbot['settings']['minTitleLength']
),
[askbot['settings']['minTitleLength'], ]
diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css
index 06de580a..0f873790 100644
--- a/askbot/media/style/style.css
+++ b/askbot/media/style/style.css
@@ -774,7 +774,7 @@ form.ajax-file-upload img.spinner {
}
.ask-page .search-drop-menu,
body.anon.ask-page .search-drop-menu {
- margin: 0;
+ margin: -9px 0 10px;
}
#scopeNav {
height: 41px;
@@ -1619,13 +1619,17 @@ ul#related-tags li {
height: 36px;
line-height: 36px;
margin: 0;
- padding: 0;
- /*-left: 5px;*/
-
+ padding-left: 5px;
border: #cce6ec 3px solid;
width: 100%;
/*719px;*/
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+}
+.ask-page #askFormBar {
+ padding: 0 0 10px 0;
}
.ask-page div#question-list,
.edit-question-page div#question-list {
@@ -1664,6 +1668,15 @@ ul#related-tags li {
-webkit-border-radius: 3px;
-khtml-border-radius: 3px;
}
+.ask-page label[for="editor"],
+.edit-question-page label[for="editor"],
+.ask-page label[for="id_title"],
+.edit-question-page label[for="id_title"],
+.ask-page span.form-error,
+.edit-question-page span.form-error {
+ font-size: 16px;
+ font-style: italic;
+}
.ask-page label,
.edit-question-page label {
color: #525252;
@@ -1709,6 +1722,7 @@ ul#related-tags li {
.edit-question-page table.proxy-user-info,
.edit-answer-page table.proxy-user-info {
border-spacing: 0px;
+ margin-bottom: 12px;
width: 100%;
}
.ask-page table.proxy-user-info .form-item,
@@ -1828,6 +1842,9 @@ ul#related-tags li {
.question-page .wmd-container,
.edit-question-page .wmd-container,
.edit-answer-page .wmd-container {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
width: 723px;
width: 100%;
}
@@ -1953,7 +1970,7 @@ ul#related-tags li {
margin-bottom: 5px;
}
.question-options label {
- vertical-align: text-bottom;
+ vertical-align: text-top;
}
.edit-content-html {
border-top: 1px dotted #D8D2A9;
@@ -1969,8 +1986,7 @@ ul#related-tags li {
#fmedit #id_revision,
.wmd-preview #id_revision {
font-size: 14px;
- margin-top: 5px;
- margin-bottom: 5px;
+ margin: 12px 0 5px 0;
width: 100%;
}
.edit-question-page #id_title,
@@ -1984,6 +2000,9 @@ ul#related-tags li {
border: #cce6ec 3px solid;
width: 100%;
margin-bottom: 10px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
}
.edit-question-page #id_summary,
#fmedit #id_summary,
@@ -3288,7 +3307,6 @@ span.text-counter {
span.form-error {
color: #990000;
font-weight: normal;
- margin-left: 5px;
}
ul.errorlist {
margin-bottom: 0;
@@ -3354,12 +3372,6 @@ label.retag-error {
margin-top: 10px;
padding: 10px;
}
-span.form-error {
- color: #990000;
- font-size: 90%;
- font-weight: normal;
- margin-left: 5px;
-}
/*
.favorites-count-off {
color: #919191;
diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less
index 23c172df..96b826cf 100644
--- a/askbot/media/style/style.less
+++ b/askbot/media/style/style.less
@@ -797,7 +797,7 @@ form.ajax-file-upload {
}
.ask-page .search-drop-menu,
body.anon.ask-page .search-drop-menu {
- margin: 0;
+ margin: -9px 0 10px;
}
#scopeNav {
height: 41px;
@@ -1708,7 +1708,7 @@ ul#related-tags li {
padding: 4px 0 0 0;
margin-top:0px;
width: 100%;
-
+
p {
margin:0 0 5px 0;
font-size:14px;
@@ -1720,13 +1720,23 @@ ul#related-tags li {
height: 36px;
line-height: 36px;
margin: 0;
- padding: 0;/*-left: 5px;*/
+ padding-left: 5px;
border:#cce6ec 3px solid;
width: 100%;/*719px;*/
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ }
+}
+
+.ask-page {
+ #askFormBar {
+ padding: 0 0 10px 0;
}
}
-.ask-page, .edit-question-page {
+.ask-page,
+.edit-question-page {
div#question-list {
border-bottom:#f0f0ec 1px solid;
@@ -1760,6 +1770,14 @@ ul#related-tags li {
background: #b8d0d5;
.rounded-corners(3px);
}
+
+ label[for="editor"],
+ label[for="id_title"],
+ span.form-error {
+ font-size: 16px;
+ font-style: italic;
+ }
+
label{
color:@info-text-dark;
font-size:13px;
@@ -1797,6 +1815,7 @@ ul#related-tags li {
}
table.proxy-user-info {
border-spacing: 0px;
+ margin-bottom: 12px;
width: 100%;
.form-item {
@@ -1930,6 +1949,9 @@ ul#related-tags li {
.edit-question-page,
.edit-answer-page {
.wmd-container {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
width: 723px;
width: 100%;
}
@@ -2061,9 +2083,10 @@ ul#related-tags li {
color: #666;
line-height: 13px;
margin-bottom:5px;
-}
-.question-options label {
- vertical-align: text-bottom;
+
+ label {
+ vertical-align: text-top;
+ }
}
.edit-content-html {
@@ -2077,8 +2100,7 @@ ul#related-tags li {
#id_revision{
font-size:14px;
- margin-top:5px;
- margin-bottom:5px;
+ margin: 12px 0 5px 0;
width: 100%;
}
#id_title{
@@ -2090,6 +2112,9 @@ ul#related-tags li {
border:#cce6ec 3px solid;
width: 100%;
margin-bottom:10px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
}
#id_summary{
border:#cce6ec 3px solid;
@@ -3416,7 +3441,6 @@ span.text-counter {
span.form-error {
color: #990000;
font-weight: normal;
- margin-left: 5px;
}
ul.errorlist {
@@ -3503,15 +3527,6 @@ label.retag-error {
padding: 10px;
}
-
-span.form-error {
- color: #990000;
- font-size: 90%;
- font-weight: normal;
- margin-left: 5px;
-}
-
-
/*
.favorites-count-off {
color: #919191;
diff --git a/askbot/templates/ask.html b/askbot/templates/ask.html
index 831b3a91..030780f6 100644
--- a/askbot/templates/ask.html
+++ b/askbot/templates/ask.html
@@ -22,7 +22,7 @@
{% else %}
{% if settings.EMAIL_VALIDATION %}
{% if not request.user.email_isvalid %}
- <li class="warning">{% trans email=request.user.email %}YYour email, %(email)s has not yet been validated. To post messages you must verify your email, please see <a href='%(email_validation_faq_url)s'>more details here</a>. You can submit your question now and validate email after that. Meanwhile, your question will saved as pending.{% endtrans %}</li>
+ <li class="warning">{% trans email=request.user.email %}Your email, %(email)s has not yet been validated. To post messages you must verify your email, please see <a href='%(email_validation_faq_url)s'>more details here</a>. You can submit your question now and validate email after that. Meanwhile, your question will saved as pending.{% endtrans %}</li>
{% endif %}
{% endif %}
{% endif %}
diff --git a/askbot/templates/embed/ask_by_widget.html b/askbot/templates/embed/ask_by_widget.html
index dae9f598..5060301c 100644
--- a/askbot/templates/embed/ask_by_widget.html
+++ b/askbot/templates/embed/ask_by_widget.html
@@ -167,7 +167,7 @@
<div class="title">{{widget.title}}</div>
<form action="." method="POST" accept-charset="utf-8">
{% csrf_token %}
- <label>{%trans%}Please enter a descriptive title for your question{%endtrans%}</label>
+ <label>{%trans%}Please enter your question{%endtrans%}</label>
<div class="input-title">
{{form.title}}
</div>
diff --git a/askbot/templates/macros.html b/askbot/templates/macros.html
index 6fd69647..9088618c 100644
--- a/askbot/templates/macros.html
+++ b/askbot/templates/macros.html
@@ -544,7 +544,6 @@ for the purposes of the AJAX comment editor #}
post_type = None,
post_html = None,
mandatory_tags = None,
- edit_title = False,
use_category_selector = False,
tag_names = None,
editor_type = None,
diff --git a/askbot/templates/question_edit.html b/askbot/templates/question_edit.html
index 1aaa972c..ee979fb8 100644
--- a/askbot/templates/question_edit.html
+++ b/askbot/templates/question_edit.html
@@ -16,13 +16,22 @@
name="select_revision"
value="false">
</div>
+ <div class="form-item">
+ <label for="id_title" >
+ {% trans %}Question - in one sentence{% endtrans %}
+ {% if form.title.errors %}
+ {{ form.title.errors }}
+ {% endif %}
+ </label>
+ {{ form.title }}
+ </div>
+ <label for="editor">{% trans %}Details{% endtrans %}</label>
{% set use_category_selector = (settings.TAG_SOURCE == 'category-tree') %}
{{
macros.edit_post(
form,
post_type = 'question',
post_html = revision.text,
- edit_title = True,
mandatory_tags = mandatory_tags,
use_category_selector = use_category_selector,
tag_names = tag_names,
diff --git a/askbot/templates/widgets/ask_form.html b/askbot/templates/widgets/ask_form.html
index 53b93158..e26ec771 100644
--- a/askbot/templates/widgets/ask_form.html
+++ b/askbot/templates/widgets/ask_form.html
@@ -1,20 +1,26 @@
{% import "macros.html" as macros %}
<form id="fmask" action="" method="post" >{% csrf_token %}
<div class="form-item ask-form-bar">
+ <label for="id_title">
+ {{ form.title.help_text }}
+ {% if form.title.errors %}
+ <span class="form-error">{{ form.title.errors }}</span>
+ {% endif %}
+ </label>
<div id="askFormBar">
<input id="id_title" class="questionTitleInput" name="title" autocomplete="off"
value="{% if form.initial.title %}{{form.initial.title|escape}}{% endif %}"/>
- <span class="form-error">{{ form.title.errors }}</span>
- </div>
- <div class="title-desc">
- {{ form.title.help_text }}
</div>
</div>
+ {% if settings.MIN_QUESTION_BODY_LENGTH == 0 %}
+ <label for="editor">{% trans %}Add details{% endtrans %}</label>
+ {% else %}
+ <label for="editor">{% trans %}Add details, if necessary{% endtrans %}</label>
+ {% endif %}
{{
macros.edit_post(
form,
post_type = 'question',
- edit_title = False,
mandatory_tags = mandatory_tags,
use_category_selector = (settings.TAG_SOURCE == 'category-tree'),
editor_type = settings.EDITOR_TYPE,
diff --git a/askbot/templates/widgets/edit_post.html b/askbot/templates/widgets/edit_post.html
index 9e9a3761..ad01cc68 100644
--- a/askbot/templates/widgets/edit_post.html
+++ b/askbot/templates/widgets/edit_post.html
@@ -1,12 +1,3 @@
-{% if edit_title %}
- <div class="form-item">
- <label for="id_title" ><strong>{{ post_form.title.label_tag() }}:</strong></label> <span class="form-error"></span><br/>
- {{ post_form.title }} {{ post_form.title.errors }}
- <div class="title-desc">
- {{ post_form.title.help_text }}
- </div>
- </div>
-{% endif %}
{% if editor_type == 'markdown' %}
<div class="wmd-container">
<div id="wmd-button-bar" class="wmd-panel"></div>
@@ -57,9 +48,7 @@
{% endif %}
<span class="form-error">{{ post_form.tags.errors }}</span><br/>
{{ post_form.tags }}
- <div class="title-desc">
- {{ post_form.tags.help_text }}
- </div>
+ <br/><label for="id_tags">{{ post_form.tags.help_text }}</label>
{% endif %}
</div>
{% endif %}