Commit d6cf7b73 authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon

Bug 1674808 - Removed advanced search options on Shared with me

- Added checkboxes element option of hideselectorbuttons and for this
  instance we set it to true.
- Added a condition to checkout if hideselectorbuttons is set.
- Minor style fix to make checkboxes align with their labels.

Note: The style fix is only a quick fix, we might need to consider
consolidating some form styling to ensure that they are consistent and
easier to read/change in the future.

behatnotneeded

Change-Id: I0519223ea80f295f09ee49bbfd96cb1234da8436
parent 805490e8
......@@ -19,7 +19,7 @@ function pieform_element_checkboxes(Pieform $form, $element) {/*{{{*/
$result = '';
if (count($element['elements']) > 1) {
if (empty($element['hideselectorbuttons']) && count($element['elements']) > 1) {
$id = hsc($form->get_name() . '_' . $element['name']) . '_container';
$result .= '<div class="btn-group"><a href="" class="btn btn-default btn-xs" onclick="pieform_element_checkboxes_update(\'' . $id . '\', true); return false;">' . get_string('selectall') . '</a>'
. '&nbsp;'
......
......@@ -203,6 +203,7 @@
display: block;
}
input[type=checkbox] {
top: 3px;
margin-left: 0;
}
&.stacked {
......
......@@ -128,18 +128,13 @@ $searchform = pieform(array(
'advanced' => array(
'type' => 'fieldset',
'legend' => get_string('moreoptions', 'view'),
'class' => 'advanced last as-link link-expand-right',
'collapsible' => true,
'collapsed' => true,
'elements' => array(
'share' => array(
'class' => 'fullwidth',
'type' => 'checkboxes',
'class' => 'stacked',
'title' => get_string('sharedwith', 'view') . ': ',
'elements' => $shareoptions,
'labelwidth' => 0,
'hideselectorbuttons' => true,
),
),
),
......
......@@ -44,8 +44,8 @@
And I log out
And I log in as "userB" with password "Kupuhipa1"
And I choose "Shared with me" in "Portfolio" from Main menu
And I click on "Advanced options"
And I click on "Select all"
And I check "Registered users"
And I check "Public"
And I select "title" from "sort"
And I press "search_submit"
And I should see "Results per page:"
......
......@@ -81,10 +81,7 @@ Scenario: Create users and search for them (Bug 897586)
# Entering Bob name in the search box
And I fill in the following:
| Search: | Bob |
And I follow "Advanced options"
# Searching for public pages
And I fill in the following:
| Public | 1 |
And I check "Public"
And I press "search_submit"
# Veryfing I have seen Bobs pages
Then I should see "page 1"
......
......@@ -84,8 +84,8 @@ Scenario: Making sure that the max items per page drop down limits to correct am
And I log out
And I log in as "userB" with password "Kupuhipa1"
And I choose "Shared with me" in "Portfolio" from Main menu
And I click on "Advanced options"
And I click on "Select all"
And I check "Registered users"
And I check "Public"
And I select "title" from "sort"
And I press "search_submit"
Then I should see "Results per page:"
......
......@@ -68,8 +68,7 @@ Scenario: Testing that views & collections are collated properly
And I should see "I am on P2"
# Allow user to see institution/group pages
When I follow "Advanced options"
And I check "Registered users"
When I check "Registered users"
And I press "Search"
Then I should see "iPage"
And I should see "gPage"
\ No newline at end of file
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