Commit 4ab5aade authored by Pat Kira's avatar Pat Kira

Fix radio input styling (bug: 1465107)

- Remove radio separator

behatnotneeded: styling only

Change-Id: I5d45e80b91edecafca21a91ca606cd6ea06f259f
parent 550d72fe
......@@ -75,8 +75,7 @@ $form = pieform(array(
'defaultvalue' => 1,
'disabled' => true,
),
),
'separator' => '<br />',
)
),
'consentmode' => array(
'type' => 'radio',
......@@ -87,8 +86,7 @@ $form = pieform(array(
'options' => array(
'explicit' => get_string('consentmodeexplicit','cookieconsent'),
'implicit' => get_string('consentmodeimplicit','cookieconsent'),
),
'separator' => '<br />',
)
),
),
),
......
......@@ -59,8 +59,7 @@ $form = pieform(array(
'options' => array(
'text' => get_string('headingandtext', 'skin'),
'heading' => get_string('headingonly', 'skin'),
),
'separator' => '<br />',
)
),
'genericfont' => array(
'type' => 'select',
......@@ -73,7 +72,6 @@ $form = pieform(array(
'cursive' => 'cursive',
'fantasy' => 'fantasy',
),
'separator' => '<br />',
'rules' => array('required' => true),
),
'submit' => array(
......
......@@ -67,7 +67,6 @@ $form = pieform(array(
'text' => get_string('headingandtext', 'skin'),
'heading' => get_string('headingonly', 'skin'),
),
'separator' => '<br />',
'rules' => array('required' => true),
),
'genericfont' => array(
......@@ -81,7 +80,6 @@ $form = pieform(array(
'cursive' => 'cursive',
'fantasy' => 'fantasy',
),
'separator' => '<br />',
'rules' => array('required' => true),
),
'uploadinstructions' => array(
......
......@@ -368,7 +368,6 @@ $siteoptionform = array(
'title' => get_string('defaultaccountlifetimeupdate', 'admin'),
'description' => get_string('defaultaccountlifetimeupdatedescription', 'admin'),
'defaultvalue' => get_config('defaultaccountlifetimeupdate'),
'separator' => '<br>',
'options' => array(
'none' => get_string('defaultaccountlifetimeupdatenone', 'admin'),
'some' => get_string('defaultaccountlifetimeupdatesome', 'admin'),
......
......@@ -568,7 +568,6 @@ class PluginBlocktypeGallery extends PluginBlocktype {
'title' => get_string('select', 'blocktype.file/gallery'),
'options' => $select_options,
'defaultvalue' => (isset($configdata['select'])) ? $configdata['select'] : 0,
'separator' => '<br>',
),
'images' => $imageselector,
'folder' => $folderselector,
......@@ -578,7 +577,6 @@ class PluginBlocktypeGallery extends PluginBlocktype {
'title' => get_string('style', 'blocktype.file/gallery'),
'options' => $style_options,
'defaultvalue' => (isset($configdata['style'])) ? $configdata['style'] : 2, // Square thumbnails should be default...
'separator' => '<br>',
),
'showdescription' => array(
'type' => 'switchbox',
......
......@@ -182,7 +182,6 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
'title' => get_string('profileicon', 'artefact.file'),
'options' => $iconoptions,
'defaultvalue' => (isset($configdata['profileicon'])) ? $configdata['profileicon'] : 0,
'separator' => '<br>',
);
}
......@@ -191,7 +190,6 @@ class PluginBlocktypeProfileinfo extends PluginBlocktype {
'title' => get_string('email', 'artefact.internal'),
'options' => $emailoptions,
'defaultvalue' => (isset($configdata['email'])) ? $configdata['email'] : 0,
'separator' => '<br>',
);
// Introduction
......
......@@ -2157,8 +2157,7 @@ function auth_generate_registration_form($formname, $authname='internal', $goto)
'defaultvalue' => 'no',
'rules' => array(
'required' => true
),
'separator' => ' &nbsp; '
)
);
}
......
......@@ -149,7 +149,6 @@ class PluginBlocktypeCreativecommons extends SystemBlocktype {
),
'onclick' => 'toggle_seal();',
'defaultvalue' => $noncommercial,
'separator' => '<br>',
'help' => true,
'rules' => array('required' => true),
),
......@@ -164,7 +163,6 @@ class PluginBlocktypeCreativecommons extends SystemBlocktype {
),
'onclick' => 'toggle_seal();',
'defaultvalue' => $noderivatives,
'separator' => '<br>',
'help' => true,
'rules' => array('required' => true),
),
......@@ -177,7 +175,6 @@ class PluginBlocktypeCreativecommons extends SystemBlocktype {
40 => get_string('version40', 'blocktype.creativecommons'),
),
'defaultvalue' => $version,
'separator' => '<br>',
'help' => true,
'rules' => array('required' => true),
),
......
......@@ -43,7 +43,6 @@ $elements = array(
'type' => 'radio',
'options' => $exportoptions,
'defaultvalue' => 'html',
'separator' => '</div><div>',
),
'what' => array(
'type' => 'radio',
......@@ -51,7 +50,6 @@ $elements = array(
'all' => get_string('allmydata', 'export'),
'views' => get_string('justsomeviews', 'export'),
),
'separator' => '</div><div>',
'defaultvalue' => 'all',
),
'includefeedback' => array(
......
......@@ -31,7 +31,6 @@
* @param array $element The element to render. In addition to the standard Pieform
* element attributes, it can also take the following optional
* attributes:
* - separator: The HTML string that should separate the radio
* buttons (defaults to \n, always has \n appended to it)
* - rowsize: How many radio buttons to print per row (defaults to 1)
* - nolabels: Don't print the labels next to the individual radio buttons.
......@@ -46,11 +45,6 @@ function pieform_element_radio(Pieform $form, $element) {
$form_value = $form->get_value($element);
$id = $element['id'];
$separator = "\n";
if (isset($element['separator'])) {
$separator = $element['separator'] . $separator;
}
$rowsize = isset($element['rowsize']) ? (int) $element['rowsize'] : 1;
$nolabels = isset($element['nolabels']) ? $element['nolabels'] : false;
$classname = '';
......@@ -64,6 +58,8 @@ function pieform_element_radio(Pieform $form, $element) {
}
$i = 0;
$result .= '<div class="radio-wrapper">';
foreach ($element['options'] as $value => $data) {
$idsuffix = substr(md5(microtime()), 0, 4);
$baseid = $element['id'];
......@@ -92,14 +88,8 @@ function pieform_element_radio(Pieform $form, $element) {
$result .= '</div>';
$i++;
if ($rowsize <= 1 || $i % $rowsize == 0) {
$result .= $separator;
}
}
// If there was a separator printed on the end, then remove it
if ($rowsize <= 1 || $i % $rowsize == 0) {
$result = substr($result, 0, -strlen($separator));
}
$result .= '</div>';
return $result;
}
......
......@@ -2124,7 +2124,6 @@ function friends_control_sideblock($returnto='myfriends') {
'friendscontrol' => array(
'type' => 'radio',
'defaultvalue' => $USER->get_account_preference('friendscontrol'),
'separator' => '<br>',
'options' => array(
'nobody' => get_string('friendsnobody', 'account'),
'auth' => get_string('friendsauth', 'account'),
......
......@@ -353,8 +353,7 @@ $elements['viewheader'] = array( // TODO remove this
'normal' => get_string('headerlogoimagenormal', 'skin'),
'light' => get_string('headerlogoimagelight1', 'skin'),
'dark' => get_string('headerlogoimagedark1', 'skin'),
),
'separator' => '<br />',
)
),
),
);
......
......@@ -440,9 +440,25 @@
}
}
.pseudolabel ~ .radio:not(.form-group){
&:nth-child(n+3) {
@extend .align-with-input;
&.radio {
.pseudolabel {
@media (max-width: $screen-sm-min) {
min-width: auto;
}
}
.pseudolabel,
.radio-wrapper {
@media (min-width: $screen-sm-min) {
display: table-cell;
}
}
.modal-docked & {
.pseudolabel,
.radio-wrapper {
@media (max-width: $screen-md-min) {
display: block;
}
}
}
}
......@@ -450,7 +466,6 @@
.radio {
@media (min-width: $screen-sm-min) {
margin-top: 0;
display: inline-block;
}
input[type=radio] {
margin-top: 5px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment