Skip to content

Commit

Permalink
MDL-62852 policy: Display policy audience in the viewall.php page
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Jul 25, 2018
1 parent 99d1a03 commit 783f2a8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions admin/tool/policy/classes/output/page_viewalldoc.php
Expand Up @@ -102,6 +102,7 @@ public function export_for_template(renderer_base $output) {

array_walk($data->policies, function($item, $key) {
$item->policytypestr = get_string('policydoctype'.$item->type, 'tool_policy');
$item->policyaudiencestr = get_string('policydocaudience'.$item->audience, 'tool_policy');
});

return $data;
Expand Down
1 change: 1 addition & 0 deletions admin/tool/policy/lang/en/tool_policy.php
Expand Up @@ -84,6 +84,7 @@
$string['inactivatingconfirmyes'] = 'Inactivate';
$string['invalidversionid'] = 'There is no policy with this identifier!';
$string['irevokethepolicy'] = 'Withdraw user consent';
$string['listactivepolicies'] = 'List of active policies';
$string['minorchange'] = 'Minor change';
$string['minorchangeinfo'] = 'A minor change does not alter the meaning of the policy. Users are not required to agree to the policy again if the edit is marked as a minor change.';
$string['managepolicies'] = 'Manage policies';
Expand Down
34 changes: 25 additions & 9 deletions admin/tool/policy/templates/page_viewalldoc.mustache
Expand Up @@ -36,26 +36,42 @@
"name": "Terms & conditions",
"summary": "Policy <u>summary</u>",
"content": "Policy <em>content</em>",
"policytypestr": "Site policy"
"policytypestr": "Site policy",
"policyaudiencestr": "All users"
},
{
"id": "5",
"name": "Privacy",
"summary": "We keep your information private",
"content": "Very private",
"policytypestr": "Privacy policy"
"policytypestr": "Privacy policy",
"policyaudiencestr": "Authenticated users"
}
]
}
}}

<a id="top"></a>
<div id="policies_index" class="m-b-3">
<ul>
<div id="policies_index">
<h1>{{# str }} listactivepolicies, tool_policy {{/ str }}</h1>
<table class="table">
<thead>
<tr>
<th scope="col">{{# str }}policydocname, tool_policy {{/ str }}</th>
<th scope="col">{{# str }}policydoctype, tool_policy {{/ str }}</th>
<th scope="col">{{# str }}policydocaudience, tool_policy {{/ str }}</th>
</tr>
</thead>
<tbody>
{{#policies }}
<li><a href="#policy-{{id}}">{{{name}}} ({{{policytypestr}}})</a></li>
<tr>
<td><a href="#policy-{{id}}">{{{name}}}</a></td>
<td>{{{ policytypestr }}}</td>
<td>{{{ policyaudiencestr }}}</td>
</tr>
{{/policies }}
</ul>
</tbody>
</table>
</div>

{{^policies }}
Expand All @@ -66,14 +82,14 @@
<hr>
<div class="policy_version m-b-3">
<div class="clearfix m-t-2">
<h1><a id="policy-{{id}}">{{{name}}}</a></h1>
<h2><a id="policy-{{id}}">{{{name}}}</a></h2>
</div>
<div class="policy_document_summary clearfix m-b-1">
<h2>{{# str }} policydocsummary, tool_policy {{/ str }}</h2>
<h3>{{# str }} policydocsummary, tool_policy {{/ str }}</h3>
{{{summary}}}
</div>
<div class="policy_document_content m-t-2">
<h2>{{# str }} policydoccontent, tool_policy {{/ str }}</h2>
<h3>{{# str }} policydoccontent, tool_policy {{/ str }}</h3>
{{{content}}}
</div>
<div class="pull-right">
Expand Down

0 comments on commit 783f2a8

Please sign in to comment.