option to add sidebar notice for logged out users

This commit is contained in:
Hannes Mannerheim 2015-08-12 11:36:57 +02:00
parent c8769aa9f3
commit 2142f290f3
3 changed files with 31 additions and 4 deletions

View File

@ -419,6 +419,7 @@ class QvitterAction extends ApiAction
<div class="signup-input-container"><input placeholder="" type="password" name="user[user_password]" class="text-input" id="signup-user-password"></div>
<button id="signup-btn-step1" class="signup-btn" type="submit"></button>
<div id="other-servers-link"></div>
<div id="qvitter-notice-logged-out"><?php print common_config('site', 'qvitternoticeloggedout'); ?></div>
</div><?php } ?>
<div id="user-header">
<div id="mini-edit-profile-button"></div>

View File

@ -85,15 +85,19 @@ class QvitterAdminSettingsAction extends AdminPanelAction
function saveSettings()
{
$qvitterNotice = $this->trimmed('qvitter-notice');
$qvitterNoticeLoggedOut = $this->trimmed('qvitter-notice-logged-out');
// assert(all values are valid);
// This throws an exception on validation errors
$this->validate($qvitterNotice);
$this->validate($qvitterNoticeLoggedOut);
$config = new Config();
$result = Config::save('site', 'qvitternotice', $qvitterNotice);
$result = Config::save('site', 'qvitternoticeloggedout', $qvitterNoticeLoggedOut);
if (!$result) {
// TRANS: Server error displayed when saving a sidebar notice was impossible.
@ -180,6 +184,21 @@ class QvitterNoticeAdminPanelForm extends AdminForm
$this->out->elementEnd('li');
$this->out->elementEnd('ul');
$this->out->elementStart('ul', 'form_data');
$this->out->elementStart('li');
$this->out->textarea(
'qvitter-notice-logged-out',
// TRANS: Label for sidebar notice text field in admin panel.
_('Qvitter sidebar notice text (logged out)'),
common_config('site', 'qvitternoticeloggedout'),
// TRANS: Tooltip for sidebar notice text field in admin panel.
_('Qvitter\'s sidebar notice text, when logged out (255 characters maximum; HTML allowed)')
);
$this->out->elementEnd('li');
$this->out->elementEnd('ul');
}
/**

View File

@ -1085,6 +1085,13 @@ button#submit-login:hover {
text-align:left;
}
#qvitter-notice-logged-out {
position: absolute;
bottom:-240px;
height:150px;
width:290px;
}
#page-container {
width:890px;
padding:17px 14px 0 14px;