Enhance wording && multiselect css component

Fix typo
This commit is contained in:
Nicolas Le Goff
2013-06-13 11:14:03 +02:00
parent f30bca91a9
commit 7d0643150f
5 changed files with 37 additions and 26 deletions

View File

@@ -187,10 +187,11 @@ class Login implements ControllerProviderInterface
'validation_ip' => _('Please provide a valid IP address.'), 'validation_ip' => _('Please provide a valid IP address.'),
'validation_length_min' => _('Please provide a longer value. It should have %s character or more.'), 'validation_length_min' => _('Please provide a longer value. It should have %s character or more.'),
'password_match' => _('Please provide the same passwords.'), 'password_match' => _('Please provide the same passwords.'),
'accept_tou' => _('You must accept the terms of use.'), 'accept_tou' => _('Please accept the terms of use to register.'),
'none_selected' => _('None selected'), 'no_collection_selected' => _('No collection selected'),
'collections' => _('Collections'), 'one_collection_selected' => _('%d collection selected'),
'collection' => _('Collection'), 'collections_selected' => _('%d collections selected'),
'all_collections' => _('Select all collections')
)); ));
$response->setExpires(new \DateTime('+1 day')); $response->setExpires(new \DateTime('+1 day'));

View File

@@ -113,7 +113,7 @@ class PhraseaRegisterForm extends AbstractType
'constraints' => array( 'constraints' => array(
new Assert\Choice(array( new Assert\Choice(array(
'choices' => array_flip($baseIds), 'choices' => array_flip($baseIds),
'minMessage' => _('You must select at least {{ limit }} collection'), 'minMessage' => _('You must select at least {{ limit }} collection.'),
'multiple' => true, 'multiple' => true,
'min' => 1, 'min' => 1,
)), )),

View File

@@ -26,19 +26,18 @@ define([
$("select[multiple='multiple']").multiselect({ $("select[multiple='multiple']").multiselect({
buttonWidth : "100%", buttonWidth : "100%",
buttonClass: 'btn btn-inverse', buttonClass: 'btn btn-inverse',
maxHeight: 185,
includeSelectAllOption: true,
selectAllText: i18n.t("all_collections"),
buttonText: function(options, select) { buttonText: function(options, select) {
if (options.length === 0) { if (options.length === 0) {
return i18n.t("none_selected") + '<b class="caret"></b>'; return i18n.t("no_collection_selected") + '<b class="caret"></b>';
} } else {
else if (options.length > 4) { return i18n.t(
return options.length + (options.length > 1 ? i18n.t("collections") : i18n.t("collection")) + ' <b class="caret"></b>'; options.length === 1 ? "one_collection_selected": "collections_selected", {
} postProcess: "sprintf",
else { sprintf: [options.length]
var selected = ''; }) + ' <b class="caret"></b>';
options.each(function() {
selected += $(this).text() + ', ';
});
return selected.substr(0, selected.length -2) + ' <b class="caret"></b>';
} }
} }
}); });

View File

@@ -721,25 +721,36 @@ form[name=registerForm] .multiselect {
} }
form[name=registerForm] .multiselect-container { form[name=registerForm] .multiselect-container {
width: 99%; width: 100%;
z-index: 1020; z-index: 1020;
} }
form[name=registerForm] .multiselect-container input[type=checkbox] {
float: left;
margin-left: -20px;
}
form[name=registerForm] .multiselect-container li label {
margin: 0;
min-height: 20px;
padding-left: 20px;
}
form[name=registerForm] .multiselect-container li.active label { form[name=registerForm] .multiselect-container li.active label {
color: @black; margin: 0;
} }
form[name=registerForm] .multiselect b.caret { form[name=registerForm] .multiselect b.caret {
float: right; float: right;
} }
form[name=registerForm] .multiselect-group { form[name=registerForm] .multiselect-group {
font-weight: bold; font-weight: bold;
text-decoration: underline; padding-left: 20px;
} padding-top: 10px;
padding-bottom: 5px;
form[name=registerForm] .multiselect-all label { font-size: @fontSizeLarge;
font-weight: bold;
} }
/** IE Fixes */ /** IE Fixes */

View File

@@ -166,10 +166,10 @@
@dropdownDividerBottom: @white; @dropdownDividerBottom: @white;
@dropdownLinkColor: @white; @dropdownLinkColor: @white;
@dropdownLinkColorHover: @gray; @dropdownLinkColorHover: @white;
@dropdownLinkColorActive: @white; @dropdownLinkColorActive: @white;
@dropdownLinkBackgroundActive: @linkColor; @dropdownLinkBackgroundActive: lighten(@backgroundSideBar, 10%);
@dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive; @dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive;