mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
Move default home page to template
This commit is contained in:
@@ -104,26 +104,15 @@ class Home extends Controller {
|
||||
goaway($frontpage);
|
||||
}
|
||||
|
||||
$o .= '<div class="generic-content-wrapper">';
|
||||
$sitename = Config::Get('system', 'sitename', 'Hubzilla');
|
||||
$welcome = sprintf(t('Welcome to %s'), $sitename);
|
||||
$login_on_homepage = Config::Get('system', 'login_on_homepage');
|
||||
|
||||
$sitename = Config::Get('system', 'sitename');
|
||||
if ($sitename) {
|
||||
$o .= '<div class="section-title-wrapper">';
|
||||
$o .= '<h2 class="">' . sprintf(t('Welcome to %s'), $sitename) . '</h2>';
|
||||
$o .= '</div>';
|
||||
|
||||
}
|
||||
|
||||
$o .= '<div class="section-content-wrapper">';
|
||||
|
||||
$loginbox = Config::Get('system', 'login_on_homepage');
|
||||
if (intval($loginbox) || $loginbox === false)
|
||||
$o .= login(true);
|
||||
|
||||
$o .= '</div>';
|
||||
$o .= '</div>';
|
||||
|
||||
return $o;
|
||||
$tpl = get_markup_template('home.tpl');
|
||||
return replace_macros($tpl, [
|
||||
'welcome' => $welcome,
|
||||
'loginbox' => $login_on_homepage ? login(true) : false,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
10
view/tpl/home.tpl
Normal file
10
view/tpl/home.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="generic-content-wrapper">
|
||||
{{if $welcome}}
|
||||
<div class="section-title-wrapper">
|
||||
<h2 class="">{{$welcome}}</h2>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="section-content-wrapper">
|
||||
{{if $loginbox}}{{$loginbox}}{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user