Finish issue #7. Theme the legal page and replace all the links pointing to the old one.

This commit is contained in:
Mike Macgirvin 2022-08-29 22:06:51 -07:00
parent fbe31cef60
commit d4ae75bb95
23 changed files with 33 additions and 51 deletions

View file

@ -9,6 +9,7 @@ use Code\Access\PermissionRoles;
use Code\Lib\Channel; use Code\Lib\Channel;
use Code\Render\Theme; use Code\Render\Theme;
use Code\Lib\Addon; use Code\Lib\Addon;
use Code\Module\Legal;
class Site class Site
{ {
@ -262,7 +263,7 @@ class Site
$legal = PConfig::Get(App::$sys_channel['channel_id'], 'system', 'legal'); $legal = PConfig::Get(App::$sys_channel['channel_id'], 'system', 'legal');
if (!$legal) { if (!$legal) {
$legal = file_get_contents('doc/en/TermsOfService.mc'); $legal = file_get_contents(Legal::LEGAL_SOURCE);
} }
$homelogin = get_config('system', 'login_on_homepage'); $homelogin = get_config('system', 'login_on_homepage');

View file

@ -4,19 +4,20 @@ namespace Code\Module;
use App; use App;
use Code\Lib\PConfig; use Code\Lib\PConfig;
use Code\Web\Controller; use Code\Web\Controller;
use Code\Render\Theme;
class Legal extends Controller class Legal extends Controller
{ {
const LEGAL_SOURCE = 'doc/en/TermsOfService.mc'; const LEGAL_SOURCE = 'doc/src/TermsOfService.mc';
public function get() { public function get() {
$sys_channel = App::$sys_channel; $sys_channel = App::$sys_channel;
$site_document = PConfig::Get($sys_channel['channel_id'],'system', 'legal'); $site_document = PConfig::Get($sys_channel['channel_id'],'system', 'legal');
if (!$site_document) { if (!$site_document) {
$site_document = file_get_contents($this::LEGAL_SOURCE); $site_document = file_get_contents(self::LEGAL_SOURCE);
} }
$html = bbcode($site_document); return replace_macros(Theme::get_template('legal.tpl'), ['$content' => bbcode($site_document)]);
return $html;
} }
} }

View file

@ -247,7 +247,7 @@ class Register extends Controller
$tosurl = get_config('system', 'tos_url'); $tosurl = get_config('system', 'tos_url');
if (!$tosurl) { if (!$tosurl) {
$tosurl = z_root() . '/help/TermsOfService'; $tosurl = z_root() . '/legal';
} }
$toslink = '<a href="' . $tosurl . '" target="_blank">' . t('Terms of Service') . '</a>'; $toslink = '<a href="' . $tosurl . '" target="_blank">' . t('Terms of Service') . '</a>';

View file

@ -1,5 +1 @@
The site directory is for local modifications of documentation files. The site directory is for local modifications of documentation files.
Please copy the file doc/en/TermsOfService.mc to doc/site/en/TermsOfService.mc and add
the contact details for the site owner per the GDPR. You may also translate documentation
into other languages as desired.

View file

@ -31,5 +31,5 @@ Atentament,
-- --
Condicions del servei: Condicions del servei:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -21,4 +21,4 @@ Atentament,
-- --
Condicions del servei: Condicions del servei:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,4 +31,4 @@ Gràcies.
-- --
Condicions del servei: Condicions del servei:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@ Thank you.
-- --
Terms Of Service: Terms Of Service:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@ Thank you.
-- --
Terms Of Service: Terms Of Service:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@ Sincerely,
-- --
Terms Of Service: Terms Of Service:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -21,5 +21,5 @@ Sincerely,
-- --
Terms Of Service: Terms Of Service:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@ Thank you.
-- --
Terms Of Service: Terms Of Service:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@ Atentamente,
-- --
Términos del servicio Términos del servicio
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -21,4 +21,4 @@ Atentamente,
-- --
Términos del servicio Términos del servicio
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,4 +31,4 @@ Gracias.
-- --
Términos del servicio Términos del servicio
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -18,4 +18,4 @@ Z poważaniem,
-- --
Warunki świadczenia usług: Warunki świadczenia usług:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -29,5 +29,5 @@ Dziękjemy.
-- --
Warunki świadczenia usług: Warunki świadczenia usług:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,5 +31,5 @@
-- --
Условия использования сервиса: Условия использования сервиса:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -21,4 +21,4 @@
-- --
Условия предоставления услуг: Условия предоставления услуг:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

View file

@ -31,4 +31,4 @@
-- --
Условия предоставления услуг: Условия предоставления услуг:
{{$siteurl}}/help/TermsOfService {{$siteurl}}/legal

5
view/tpl/legal.tpl Normal file
View file

@ -0,0 +1,5 @@
<div class="generic-content-wrapper">
<div class="section-content-wrapper">
{{$content}}
</div>
</div>

View file

@ -1,21 +0,0 @@
<div class="generic-content-wrapper-styled">
<h2>{{$title}}</h2>
<img src="{{$prj_icon}}" alt="project icon" style="max-height: 150px; max-width: 150px;"/><br><br>
<h3>{{$sitenametxt}}</h3>
<div><a href="{{$url}}">{{$sitename}}</a></div><br>
<h3>{{$headline}}</h3>
<div>{{if $site_about}}{{$site_about}}{{else}}--{{/if}}</div><br>
<h3>{{$admin_headline}}</h3>
<div>{{if $admin_about}}{{$admin_about}}{{else}}--{{/if}}</div><br>
<div><i class="fa fa-fw fa-legal"></i>&nbsp;<a href="help/TermsOfService">{{$terms}}</a></div>
</div>