Commit 0a13b034 authored by Robert Lyon's avatar Robert Lyon

Bug 1734182: Displaying the existing site/institution privacy within table

Rather than loading page with just existing content we can load table
with table and content displayed together for easier comprehension of
which row relates to which statement

Also added the 'Cancel' link so one can cancel out of the form without
saving

behatnotneeded

Change-Id: Idae22c7659c5ea9f63e98e77b73abccaecd97462
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 45953f35
......@@ -62,8 +62,9 @@ if ($versionid) {
),
'submit' => array(
'class' => 'btn-primary',
'type' => 'submit',
'value' => get_string('savechanges', 'admin')
'type' => 'submitcancel',
'value' => array(get_string('savechanges', 'admin'), get_string('cancel')),
'goto' => get_config('wwwroot') . 'admin/site/privacy.php',
),
)
));
......
......@@ -92,8 +92,9 @@ if ($versionid !== null) {
),
'submit' => array(
'class' => 'btn-primary',
'type' => 'submit',
'value' => get_string('savechanges', 'admin')
'type' => 'submitcancel',
'value' => array(get_string('savechanges', 'admin'), get_string('cancel')),
'goto' => get_config('wwwroot') . 'admin/users/institutionprivacy.php?institution=' . $institution,
),
)
));
......
......@@ -1333,3 +1333,4 @@ $string['lastversion'] = 'Privacy statements must have unique version names of u
$string['versionalreadyexist'] = 'A privacy statement with the version name "%s" already exists.';
$string['siteprivacystatement'] = 'Site privacy statement';
$string['addoneversionlink'] = '<a href="%s">Add one</a> if you need it.';
$string['versionfor'] = 'Privacy statement for version "%s" is as follows:';
\ No newline at end of file
{include file="header.tpl"}
{if $versionid}
{if $version == $latestversion}
<div class="lead">{str tag="privacypagedescription" section="admin"}</div>
{if $versionid && $version == $latestversion}
<div class="lead">{str tag="privacypagedescription" section="admin"}</div>
{if $pageeditform}
<div class="col-md-9">
<div class="panel panel-default">
......@@ -11,10 +10,7 @@
</div>
</div>
{/if}
</div>
{else}
{$content|clean_html|safe}
{/if}
</div>
{else}
<div class="lead">{str tag="privacypagedescription" section="admin"}</div>
<div class="row">
......@@ -61,6 +57,14 @@
{/if}
</td>
</tr>
{if $result->version === $version}
<tr>
<td colspan="5">
<div>{str tag=versionfor section=admin arg1="$result->version"}</div>
{$result->content|clean_html|safe}
</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
......
......@@ -18,21 +18,13 @@
</fieldset>
</div>
</div>
{if $versionid !== null}
{if $version == $latestversion}
<div class="lead">{str tag="institutionprivacypagedescription" section="admin"}</div>
<div class="panel panel-default">
<div class="panel-body">
{$pageeditform|safe}
</div>
{if $versionid !== null && $version == $latestversion}
<div class="lead">{str tag="institutionprivacypagedescription" section="admin"}</div>
<div class="panel panel-default">
<div class="panel-body">
{$pageeditform|safe}
</div>
{else}
{foreach from=$privacies item=result key=key}
{if $result->version == $version}
{$result->content|clean_html|safe}
{/if}
{/foreach}
{/if}
</div>
{else}
{if $privacies}
<div class="lead">{str tag="institutionprivacypagedescription" section="admin"}</div>
......@@ -78,6 +70,14 @@
{/if}
</td>
</tr>
{if $result->version === $version}
<tr>
<td colspan="5">
<div>{str tag=versionfor section=admin arg1="$result->version"}</div>
{$result->content|clean_html|safe}
</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
......
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