Commit a32894cc authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1714830: lang strings in group portfolios blocktype

also fixed behat tests
and comments

behatnotneeded

Change-Id: Ic56c1ccf652f00312c40e4093ec73666096ed80a
parent 16e75896
......@@ -20,7 +20,7 @@ function xmldb_blocktype_groupviews_upgrade($oldversion=0) {
$records = get_records_sql_array($sql, array());
if ($records) {
log_debug("Processing 'Group pages' blocks so they continue to display full list of pages/collections");
log_debug("Processing 'Group portfolios' blocks so they continue to display full list of pages/collections");
$count = 0;
$limit = 500;
$total = count($records);
......
......@@ -12,10 +12,10 @@
defined('INTERNAL') || die();
$string['title'] = 'Group pages';
$string['description'] = 'Display the pages related to the group';
$string['displaygroupviews'] = 'Display group pages';
$string['displaygroupviewsdesc'] = 'Group pages - portfolios created in the group';
$string['title1'] = 'Group portfolios';
$string['description1'] = 'Display the pages and collections related to this group';
$string['displaygroupviews1'] = 'Display group pages and collections';
$string['displaygroupviewsdesc1'] = 'Show a list of pages and collections created in this group.';
$string['displaysharedviews'] = 'Display shared pages';
$string['displaysharedviewsdesc1'] = 'Show a list of pages shared with this group (excluding pages in collections).';
$string['displaysharedcollections'] = 'Display shared collections';
......@@ -28,7 +28,7 @@ $string['itemstoshowdesc'] = 'The number of pages or collections shown for each
$string['showbyanybody'] = 'By anybody';
$string['showbygroupmembers'] = 'By members of this group';
$string['shownone'] = 'None';
$string['sortgroupviewstitle'] = 'Sort group pages by';
$string['sortgroupviewstitle1'] = 'Sort group pages and collections by';
$string['sortsharedviewstitle'] = 'Sort shared pages and collections by';
$string['sortsubmittedtitle'] = 'Sort submitted pages and collections by';
$string['sortviewsbyalphabetical'] = 'Alphabetical';
......
......@@ -20,11 +20,11 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
const SORTBY_TIMESUBMITTED = 2;
public static function get_title() {
return get_string('title', 'blocktype.groupviews');
return get_string('title1', 'blocktype.groupviews');
}
public static function get_description() {
return get_string('description', 'blocktype.groupviews');
return get_string('description1', 'blocktype.groupviews');
}
public static function single_only() {
......@@ -197,8 +197,8 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
return array(
'showgroupviews' => array(
'type' => 'select',
'description' => get_string('displaygroupviewsdesc', 'blocktype.groupviews'),
'title' => get_string('displaygroupviews', 'blocktype.groupviews'),
'description' => get_string('displaygroupviewsdesc1', 'blocktype.groupviews'),
'title' => get_string('displaygroupviews1', 'blocktype.groupviews'),
'options' => array(
1 => get_string('yes'),
0 => get_string('no'),
......@@ -207,7 +207,7 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
),
'sortgroupviewsby' => array(
'type' => 'select',
'title' => get_string('sortgroupviewstitle', 'blocktype.groupviews'),
'title' => get_string('sortgroupviewstitle1', 'blocktype.groupviews'),
'options' => array(
PluginBlocktypeGroupViews::SORTBY_TITLE => get_string('sortviewsbyalphabetical', 'blocktype.groupviews'),
PluginBlocktypeGroupViews::SORTBY_LASTUPDATE => get_string('sortviewsbylastupdate', 'blocktype.groupviews'),
......@@ -455,7 +455,7 @@ class PluginBlocktypeGroupViews extends MaharaCoreBlocktype {
}
public static function get_instance_title() {
return get_string('title', 'blocktype.groupviews');
return get_string('title1', 'blocktype.groupviews');
}
/**
......
......@@ -79,7 +79,7 @@ $string['blocktype_gallery'] = 'Block: Image gallery';
$string['blocktype_googleapps'] = 'Block: Google Apps';
$string['blocktype_groupinfo'] = 'Block: Group info';
$string['blocktype_groupmembers'] = 'Block: Group members';
$string['blocktype_groupviews'] = 'Block: Group pages';
$string['blocktype_groupviews'] = 'Block: Group portfolios';
$string['blocktype_html'] = 'Block: Some HTML';
$string['blocktype_pdf'] = 'Block: PDF';
$string['blocktype_image'] = 'Block: Image';
......@@ -147,7 +147,7 @@ $string['plugin_blocktype_gallery_version'] = 'Block type plugin Image gallery v
$string['plugin_blocktype_googleapps_version'] = 'Block type plugin Google Apps version';
$string['plugin_blocktype_groupinfo_version'] = 'Block type plugin Group info version';
$string['plugin_blocktype_groupmembers_version'] = 'Block type plugin Group members version';
$string['plugin_blocktype_groupviews_version'] = 'Block type plugin Group pages version';
$string['plugin_blocktype_groupviews_version'] = 'Block type plugin Group portfolios version';
$string['plugin_blocktype_html_version'] = 'Block type plugin Some HTML version';
$string['plugin_blocktype_html_version'] = 'Block type plugin PDF version';
$string['plugin_blocktype_image_version'] = 'Block type plugin Image version';
......
......@@ -65,7 +65,7 @@ $string['templateportfoliodescription'] = 'Set up the default layout for the pag
// my views
$string['artefacts'] = 'Artefacts';
$string['groupviews'] = 'Group pages';
$string['groupviews'] = 'Group pages and collections';
$string['institutionviews'] = 'Institution pages';
$string['institutionviewscollections'] = 'Institution pages and collections';
$string['reallyaddaccesstoemptyview'] = 'Your page contains no blocks. Do you really want to give these users access to the page?';
......
......@@ -523,7 +523,7 @@ function group_create($data) {
throw new NotFoundException("group_create: group homepage is not found");
}
// If 'Allow submissions' is true we need to update the 'Group pages' block to show
// If 'Allow submissions' is true we need to update the 'Group portfolios' block to show
// the 'Submissions to this group' section by default
if ($data['submittableto']) {
$groupview = get_record_sql("SELECT bi.id, bi.configdata
......@@ -773,7 +773,7 @@ function group_update($new, $create=false) {
}
}
// If 'Allow submissions' is changed we need to update the 'Group pages' block
// If 'Allow submissions' is changed we need to update the 'Group portfolios' block
// to reflect the change
$cansubmitto = 0;
if (isset($new->submittableto) && !empty($new->submittableto)) {
......
......@@ -6,11 +6,7 @@
<div class="clearfix">
<h5 class="pull-left list-group-item-heading">
{$view.title}
{if $view.collid}
<strong>
({str tag=nviews section=view arg1=$view.numpages})
</strong>
{/if}
<span class="text-small text-midtone">{if $view.collid}({str tag=nviews section=view arg1=$view.numpages}){/if}</span>
<br>
<span class="postedon text-small text-midtone">
{if $view.mtime == $view.ctime}
......
......@@ -1242,7 +1242,7 @@ Shows the secret URL button.
<section data-markdown data-category="icons">
### Group
As used for the "Group pages" block.
As used for the "Group portfolios" block.
```
<i class="icon icon-users" role="presentation"></i>
```
......
......@@ -1233,7 +1233,7 @@ Shows the secret URL button.
<section data-markdown data-category="icons">
### Group
As used for the "Group pages" block.
As used for the "Group portfolios" block.
```
<i class="icon icon-users" role="presentation"></i>
```
......
@javascript @core @core_group
Feature: Show the block "Group pages" in the group homepage
Feature: Show the block "Group portfolios" in the group homepage
In order to see group pages, shared and submitted pages/collections to a group
As a group member or group admin
So I can see these lists on the block "Group pages" in the group homepage
So I can see these lists on the block "Group portfolios" in the group homepage
Background:
Given the following "institutions" exist:
......@@ -129,7 +129,7 @@ These list must take into account the sort option chosen in the block config (Bu
And I should see "Group Z"
And I scroll to the base of id "groups"
And I follow "Group Z" in the "div#groups" "css_element"
# Group pages
# Group portfolios
And I should see "Page Group Z_01" in the "ul#groupviewlist" "css_element"
And I should see "Page Group Z_05" in the "ul#groupviewlist" "css_element"
And I should not see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
......@@ -167,15 +167,18 @@ These list must take into account the sort option chosen in the block config (Bu
Given I log in as "userB" with password "Kupuhipa1"
And I should see "Group Z"
And I choose "My groups" in "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I select "Page userB_01" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
And I select "Page userB_02" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
And I log out
# Change the sort options in the "Group pages" block
# Change the sort options in the "Group portfolios" block
Given I log in as "userA" with password "Kupuhipa1"
And I should see "Group Z"
And I follow "Group Z (Administrator)"
......@@ -185,9 +188,9 @@ These list must take into account the sort option chosen in the block config (Bu
And I click on "Edit" in "Group homepage" panel menu
And I scroll to the id "column-container"
And I configure the block "Group pages"
And I configure the block "Group portfolios"
And I set the following fields to these values:
| Sort group pages by | Most recently updated |
| Sort group pages and collections by | Most recently updated |
| Sort shared pages and collections by | Most recently updated |
| Sort submitted pages and collections by | Most recently submitted |
And I press "Save"
......@@ -198,10 +201,12 @@ These list must take into account the sort option chosen in the block config (Bu
And I click on "Edit" in "Page Group Z_06" panel menu
And I follow "Settings" in the "#toolbar-buttons" "css_element"
And I set the field "Page description" to "<p>Group page 06 (updated)</p>"
And I scroll to the id "settings_submit"
And I press "Save"
And I display the page
# Check if it is now in the first page of the list of group pages
And I choose "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I should see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
#And I follow "Next" in the "div#groupviews_pagination" "css_element"
......@@ -213,10 +218,12 @@ These list must take into account the sort option chosen in the block config (Bu
And I click on "Edit" in "Page userA_01" panel menu
And I follow "Settings" in the "#toolbar-buttons" "css_element"
And I set the field "Page description" to "<p>This is the page 01 (updated)</p>"
And I scroll to the id "settings_submit"
And I press "Save"
And I display the page
# Check if it is now in the first page of the list of shared pages
And I choose "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I should see "Page userA_01" in the "ul#sharedviewlist" "css_element"
#And I follow "2" in the "div#sharedviews_pagination" "css_element"
......@@ -227,9 +234,11 @@ These list must take into account the sort option chosen in the block config (Bu
And I click on "Collection userA_06" panel menu
And I click on "Edit" in "Collection userA_06" panel menu
And I fill in "Collection description" with "This is the collection 06 (updated)"
And I scroll to the id "edit_submit"
And I press "Save"
# Check if it is now in the first page of the list of shared collections
And I choose "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I should see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
#And I follow "2" in the "div#sharedcollections_pagination" "css_element"
......@@ -246,12 +255,15 @@ These list must take into account the sort option chosen in the block config (Bu
And I press "Submit"
And I press "Yes"
And I select "Collection userA_01" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
And I select "Collection userA_02" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
And I select "Collection userA_03" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
# Check the list of submitted pages/collections
......@@ -297,17 +309,21 @@ These list must take into account the sort option chosen in the block config (Bu
And I press "Submit"
And I press "Yes"
And I select "Collection userC_02" from "group_view_submission_form_3_options"
And I scroll to the id "group_view_submission_form_3_submit"
And I press "Submit"
And I press "Yes"
And I select "Collection userC_03" from "group_view_submission_form_3_options"
And I scroll to the id "group_view_submission_form_3_submit"
And I press "Submit"
And I press "Yes"
And I choose "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I select "Page userC_04" from "group_view_submission_form_2_options"
And I press "Submit"
And I press "Yes"
And I select "Collection userC_04" from "group_view_submission_form_2_options"
And I scroll to the id "group_view_submission_form_2_submit"
And I press "Submit"
And I press "Yes"
And I log out
......@@ -379,6 +395,7 @@ These list must take into account the sort option chosen in the block config (Bu
And I press "Submit"
And I press "Yes"
And I choose "Groups" from main menu
And I scroll to the base of id "mygroups"
And I follow "Group Z"
And I select "Page userC_12" from "group_view_submission_form_2_options"
And I press "Submit"
......
......@@ -27,7 +27,7 @@ Scenario: Displaying shared pages in most recently updated order (Bug 1490569)
And I follow "testgroup"
And I follow "Edit this page"
And I scroll to the id "column-container"
And I configure the block "Group pages"
And I configure the block "Group portfolios"
When I set the following fields to these values:
| Sort shared pages and collections by | Most recently updated |
And I click on "Save"
......
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