Commit 4e8f69f7 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Bug 1565198: Allowing blogs to indicate what type in chooser"

parents 637a7057 2e598ab8
......@@ -46,6 +46,8 @@ $string['blogtitle'] = 'Title';
$string['blogtitledesc'] = 'e.g., ‘Jill’s Nursing Practicum Journal’.';
$string['border'] = 'Border';
$string['by'] = 'by';
$string['bygroup'] = 'by group <a href="%s">%s</a>';
$string['byinstitution'] = 'by institution <a href="%s">%s</a>';
$string['cancel'] = 'Cancel';
$string['createandpublishdesc'] = 'This will create the journal entry and make it available to others.';
$string['createasdraftdesc'] = 'This will create the journal entry, but it will not become available to others until you choose to publish it.';
......
......@@ -3233,7 +3233,21 @@ class View {
$formcontrols .= ' class="artefactid-checkbox checkbox">';
$formcontrols .= '<input type="hidden" name="' . hsc($elementname) . '_onpage[]" value="' . hsc($artefact->id) . '" class="artefactid-onpage">';
}
if (!empty($artefact->group)) {
$group = get_record('group', 'id', $artefact->group);
$artefact->groupname = !empty($group->shortname) ? $group->shortname : $group->name;
$artefact->groupurl = get_config('wwwroot') . 'group/view.php?id=' . $group->id;
}
else if (!empty($artefact->institution)) {
$institution = new Institution($artefact->institution);
if ($institution->name == 'mahara') {
$artefact->institutionname = get_config('sitename');
}
else {
$artefact->institutionname = $institution->displayname;
}
$artefact->institutionurl = get_config('wwwroot') . 'institution/index.php?institution=' . $institution->name;
}
$smarty = smarty_core();
$smarty->assign('artefact', $artefact);
$smarty->assign('elementname', $elementname);
......
......@@ -2,11 +2,13 @@
{$formcontrols|safe}
<label for="{$elementname}_{$artefact->id}">
{$artefact->title}
{if $artefact->draft}
{if $artefact->draft}
[{str tag=draft section=artefact.blog}]
{/if}
<span class="text-midtone text-small">{if $artefact->blog}({$artefact->blog}){/if}</span>
</label>
{if $artefact->group}({str tag="bygroup" section="artefact.blog" arg1="$artefact->groupurl" arg2="$artefact->groupname"}){/if}
{if $artefact->institution}({str tag="byinstitution" section="artefact.blog" arg1="$artefact->institutionurl" arg2="$artefact->institutionname"}){/if}
{if $artefact->description}
<div class="text-small detail">
{$artefact->description|clean_html|safe}</div>
......
......@@ -9,6 +9,10 @@ Background:
| title | description| ownertype | ownername |
| Page 01 | admins page 01 | admin | admin |
And the following "groups" exist:
| name | owner | description | grouptype | open | invitefriends | editroles |
| Groupies | admin | This is group for groupies | standard | ON | OFF | all |
Scenario: Turning on and of switches in Journal configuration block (Bug 1431569)
Given I log in as "admin" with password "Kupuhipa1"
# Navigating to switchbox in Journal block
......@@ -72,6 +76,21 @@ Scenario: Creating a Journal entry
And I fill in select2 input "editpost_tags" with "test" and select "test"
And I press "Save entry"
# Adding journal entry to group 'Groupies'
When I choose "My groups" in "Groups"
And I follow "Groupies"
And I follow "Journals" in the "div.arrow-bar" "css_element"
And I follow "Create journal"
And I set the following fields to these values:
| Title * | My group journal |
And I press "Create journal"
And I follow "New entry"
And I set the following fields to these values:
| Title * | My group entry one |
| Entry | I love my mum |
And I press "Save entry"
# Adding journal blocks to a page
And I choose "Pages" in "Portfolio"
And I follow "Page 01"
And I follow "Edit this page"
......@@ -88,3 +107,9 @@ Scenario: Creating a Journal entry
And I wait "1" seconds
And I clear value "one" from select2 field "instconf_tagselect"
And I press "Save"
And I follow "Recent journal entries" in the "div#blog" "css_element"
And I press "Add"
And I should see "by group Groupies"
And I check "Admin User's Journal"
And I press "Save"
\ 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