Enh: Fixed accessibility issues in Dashboard/Login/Profile

This commit is contained in:
buddh4 2017-05-01 16:01:04 +02:00
parent 145dac697e
commit 27c7e2afcd
25 changed files with 120 additions and 88 deletions

View File

@ -3,6 +3,7 @@ HumHub Change Log
1.2.1 (in developement)
- Fix: Invite error in french language
- Fix #2518: ActivityStreamWidget::EVENT_INIT is missed (githubjeka)
- Enh: Fixed accessibility issues in Dashboard/Login/Profile
1.2.0 (April 16, 2017)
--------------------------------

View File

@ -15,7 +15,9 @@ use humhub\modules\like\widgets\LikeLink;
<div class="comment-entry-loader pull-right"></div>
<ul class="nav nav-pills preferences">
<li class="dropdown ">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-angle-down"></i></a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-label="<?= Yii::t('base', 'Toggle comment menu'); ?>" aria-haspopup="true">
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu pull-right">
<?php if ($canWrite): ?>

View File

@ -59,7 +59,7 @@ $this->registerJsConfig('content.form', [
<?= humhub\modules\file\widgets\FileHandlerButtonDropdown::widget(['primaryButton' => $uploadButton, 'handlers' => $fileHandlers, 'cssButtonClass' => 'btn-default']); ?>
<!-- public checkbox -->
<?php echo Html::checkbox("visibility", "", array('id' => 'contentForm_visibility', 'class' => 'contentForm hidden')); ?>
<?= Html::checkbox("visibility", "", ['id' => 'contentForm_visibility', 'class' => 'contentForm hidden', 'aria-hidden' => 'true', 'title' => Yii::t('ContentModule.widgets_views_contentForm', 'Content visibility') ]); ?>
<!-- content sharing -->
<div class="pull-right">
@ -68,8 +68,8 @@ $this->registerJsConfig('content.form', [
<ul class="nav nav-pills preferences" style="right: 0; top: 5px;">
<li class="dropdown">
<a class="dropdown-toggle" style="padding: 5px 10px;" data-toggle="dropdown" href="#"><i
class="fa fa-cogs"></i></a>
<a class="dropdown-toggle" style="padding: 5px 10px;" data-toggle="dropdown" href="#" aria-label="<?= Yii::t('base', 'Toggle post menu'); ?>" aria-haspopup="true">
<i class="fa fa-cogs"></i></a>
<ul class="dropdown-menu pull-right">
<li>
<a data-action-click="notifyUser">
@ -79,7 +79,7 @@ $this->registerJsConfig('content.form', [
<?php if ($canSwitchVisibility): ?>
<li>
<a id="contentForm_visibility_entry" data-action-click="changeVisibility">
<i class="fa fa-unlock"></i> <?php echo Yii::t('ContentModule.widgets_views_contentForm', 'Make public'); ?>
<i class="fa fa-unlock"></i> <?= Yii::t('ContentModule.widgets_views_contentForm', 'Make public'); ?>
</a>
</li>
<?php endif; ?>

View File

@ -20,7 +20,9 @@ use humhub\modules\content\widgets\WallEntryLabels;
<!-- start: show wall entry options -->
<ul class="nav nav-pills preferences">
<li class="dropdown ">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-angle-down"></i></a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-label="<?= Yii::t('base', 'Toggle stream entry menu'); ?>" aria-haspopup="true">
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu pull-right">
<?= WallEntryControls::widget(['object' => $object, 'wallEntryWidget' => $wallEntryWidget]); ?>
</ul>

View File

@ -44,9 +44,19 @@ class PreviewImage extends BaseConverter
if ($file) {
$this->applyFile($file);
}
// Provide the natural height so the browser will include a placeholder height. Todo: smooth image loading
return \yii\helpers\Html::img($this->getUrl(), ['class' => 'animated fadeIn', 'height' => $this->height]);
return \yii\helpers\Html::img($this->getUrl(), ['class' => 'animated fadeIn', 'height' => $this->height, 'alt' => $this->getAltText()]);
}
protected function getAltText($file = null)
{
if ($file) {
return Html::encode($file->file_name);
} else if($this->file) {
return Html::encode($this->file->file_name);
}
return '';
}
/**

View File

@ -130,7 +130,8 @@ class UploadInput extends \humhub\widgets\JsWidget
public function getAttributes()
{
return [
'multiple' => 'multiple'
'multiple' => 'multiple',
'title' => Yii::t('base', 'Upload file')
];
}

View File

@ -13,7 +13,7 @@ $this->registerJsConfig('notification', [
?>
<div id="notification_widget" data-ui-widget="notification.NotificationDropDown" data-ui-init='<?= \yii\helpers\Json::encode($update); ?>' class="btn-group">
<a href="#" id="icon-notifications" data-action-click='toggle' data-toggle="dropdown" >
<a href="#" id="icon-notifications" data-action-click='toggle' aria-label="<?= Yii::t('NotificationModule.widgets_views_list', 'Open the notification dropdown menu')?>" data-toggle="dropdown" >
<i class="fa fa-bell"></i>
</a>

View File

@ -21,7 +21,8 @@ humhub\modules\stream\assets\StreamAsset::register($this);
<div class="col-md-6">
<?php $form = ActiveForm::begin(['action' => Url::to(['index']), 'method' => 'GET']); ?>
<div class="form-group form-group-search">
<?= $form->field($model, 'keyword')->textInput(['placeholder' => Yii::t('SearchModule.views_search_index', 'Search for user, spaces and content'), 'class' => 'form-control form-search', 'id' => 'search-input-field'])->label(false); ?>
<?= $form->field($model, 'keyword')->textInput(['placeholder' => Yii::t('SearchModule.views_search_index', 'Search for user, spaces and content'),
'title' => Yii::t('SearchModule.views_search_index', 'Search for user, spaces and content'), 'class' => 'form-control form-search', 'id' => 'search-input-field'])->label(false); ?>
<?php echo Html::submitButton(Yii::t('base', 'Search'), ['class' => 'btn btn-default btn-sm form-button-search', 'data-ui-loader' => '']); ?>
</div>

View File

@ -5,8 +5,9 @@ use yii\helpers\Url;
?>
<li class="dropdown">
<a href="<?php echo Url::to(['/search/search/index']); ?>" id="search-menu" class="dropdown-toggle" >
<i class="fa fa-search"></i></a>
<a href="<?php echo Url::to(['/search/search/index']); ?>" id="search-menu" class="dropdown-toggle" aria-label="<?= Yii::t('SearchModule.views_search_index', 'Search for user, spaces and content') ?>">
<i class="fa fa-search"></i>
</a>
</li>
<script type="text/javascript">

View File

@ -46,7 +46,9 @@ $this->registerJsConfig('space.chooser', [
<li>
<form action="" class="dropdown-controls">
<div class="input-group">
<input type="text" id="space-menu-search" class="form-control" autocomplete="off" placeholder="<?php echo Yii::t('SpaceModule.widgets_views_spaceChooser', 'Search'); ?>">
<input type="text" id="space-menu-search" class="form-control" autocomplete="off"
placeholder="<?= Yii::t('SpaceModule.widgets_views_spaceChooser', 'Search'); ?>"
title="<?= Yii::t('SpaceModule.widgets_views_spaceChooser', 'Search for spaces'); ?>">
<span id="space-directory-link" class="input-group-addon" >
<a href="<?= Url::to(['/directory/directory/spaces']); ?>">
<i class="fa fa-book"></i>

View File

@ -15,7 +15,7 @@ $this->pageTitle = Yii::t('UserModule.views_auth_login', 'Login');
<div class="panel panel-default animated bounceIn" id="login-form"
style="max-width: 300px; margin: 0 auto 20px; text-align: left;">
<div class="panel-heading"><?php echo Yii::t('UserModule.views_auth_login', '<strong>Please</strong> sign in'); ?></div>
<div class="panel-heading"><?= Yii::t('UserModule.views_auth_login', '<strong>Please</strong> sign in'); ?></div>
<div class="panel-body">
@ -29,26 +29,26 @@ $this->pageTitle = Yii::t('UserModule.views_auth_login', 'Login');
<?= AuthChoice::widget([]) ?>
<?php else: ?>
<?php if ($canRegister) : ?>
<p><?php echo Yii::t('UserModule.views_auth_login', "If you're already a member, please login with your username/email and password."); ?></p>
<p><?= Yii::t('UserModule.views_auth_login', "If you're already a member, please login with your username/email and password."); ?></p>
<?php else: ?>
<p><?php echo Yii::t('UserModule.views_auth_login', "Please login with your username/email and password."); ?></p>
<p><?= Yii::t('UserModule.views_auth_login', "Please login with your username/email and password."); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php $form = ActiveForm::begin(['id' => 'account-login-form', 'enableClientValidation' => false]); ?>
<?php echo $form->field($model, 'username')->textInput(['id' => 'login_username', 'placeholder' => $model->getAttributeLabel('username')])->label(false); ?>
<?php echo $form->field($model, 'password')->passwordInput(['id' => 'login_password', 'placeholder' => $model->getAttributeLabel('password')])->label(false); ?>
<?php echo $form->field($model, 'rememberMe')->checkbox(); ?>
<?= $form->field($model, 'username')->textInput(['id' => 'login_username', 'placeholder' => $model->getAttributeLabel('username'), 'aria-label' => $model->getAttributeLabel('username')])->label(false); ?>
<?= $form->field($model, 'password')->passwordInput(['id' => 'login_password', 'placeholder' => $model->getAttributeLabel('password'), 'aria-label' => $model->getAttributeLabel('password')])->label(false); ?>
<?= $form->field($model, 'rememberMe')->checkbox(); ?>
<hr>
<div class="row">
<div class="col-md-4">
<?php echo CHtml::submitButton(Yii::t('UserModule.views_auth_login', 'Sign in'), array('id' => 'login-button', 'data-ui-loader' => "", 'class' => 'btn btn-large btn-primary')); ?>
<?= CHtml::submitButton(Yii::t('UserModule.views_auth_login', 'Sign in'), array('id' => 'login-button', 'data-ui-loader' => "", 'class' => 'btn btn-large btn-primary')); ?>
</div>
<div class="col-md-8 text-right">
<small>
<?php echo Yii::t('UserModule.views_auth_login', 'Forgot your password?'); ?>
<a id="password-recovery-link" href="<?php echo Url::toRoute('/user/password-recovery'); ?>" data-pjax-prevent><br><?php echo Yii::t('UserModule.views_auth_login', 'Create a new one.') ?></a>
<?= Yii::t('UserModule.views_auth_login', 'Forgot your password?'); ?>
<a id="password-recovery-link" href="<?= Url::toRoute('/user/password-recovery'); ?>" data-pjax-prevent><br><?= Yii::t('UserModule.views_auth_login', 'Create a new one.') ?></a>
</small>
</div>
</div>
@ -65,16 +65,16 @@ $this->pageTitle = Yii::t('UserModule.views_auth_login', 'Login');
class="panel panel-default animated bounceInLeft"
style="max-width: 300px; margin: 0 auto 20px; text-align: left;">
<div class="panel-heading"><?php echo Yii::t('UserModule.views_auth_login', '<strong>Sign</strong> up') ?></div>
<div class="panel-heading"><?= Yii::t('UserModule.views_auth_login', '<strong>Sign</strong> up') ?></div>
<div class="panel-body">
<p><?php echo Yii::t('UserModule.views_auth_login', "Don't have an account? Join the network by entering your e-mail address."); ?></p>
<p><?= Yii::t('UserModule.views_auth_login', "Don't have an account? Join the network by entering your e-mail address."); ?></p>
<?php $form = ActiveForm::begin(['id' => 'invite-form']); ?>
<?php echo $form->field($invite, 'email')->input('email', ['id' => 'register-email', 'placeholder' => $invite->getAttributeLabel('email')])->label(false); ?>
<?= $form->field($invite, 'email')->input('email', ['id' => 'register-email', 'placeholder' => $invite->getAttributeLabel('email'), 'aria-label' => $invite->getAttributeLabel('email')])->label(false); ?>
<hr>
<?php echo CHtml::submitButton(Yii::t('UserModule.views_auth_login', 'Register'), array('class' => 'btn btn-primary', 'data-ui-loader' => '')); ?>
<?= CHtml::submitButton(Yii::t('UserModule.views_auth_login', 'Register'), ['class' => 'btn btn-primary', 'data-ui-loader' => '']); ?>
<?php ActiveForm::end(); ?>
</div>

View File

@ -8,6 +8,7 @@
namespace humhub\modules\user\widgets;
use Yii;
use humhub\libs\Html;
use humhub\components\Widget;
@ -79,7 +80,7 @@ class Image extends Widget
{
Html::addCssClass($this->imageOptions, 'img-rounded');
Html::addCssStyle($this->imageOptions, 'width: ' . $this->width . 'px; height: ' . $this->height . 'px');
if ($this->showTooltip) {
$this->imageOptions['data-toggle'] = 'tooltip';
$this->imageOptions['data-placement'] = 'top';
@ -87,6 +88,7 @@ class Image extends Widget
Html::addCssClass($this->imageOptions, 'tt');
}
$this->imageOptions['alt'] = Yii::t('base', 'Profile picture of {displayName}', ['displayName' => Html::encode($this->user->displayName)]);
$html = Html::img($this->user->getProfileImage()->getUrl(), $this->imageOptions);
if ($this->link) {

View File

@ -18,15 +18,15 @@ if ($allowModifyProfileBanner || $allowModifyProfileImage) {
<div class="image-upload-container" style="width: 100%; height: 100%; overflow:hidden;">
<!-- profile image output-->
<img class="img-profile-header-background" id="user-banner-image"
src="<?php echo $user->getProfileBannerImage()->getUrl(); ?>"
<img class="img-profile-header-background" id="user-banner-image" alt="<?= Yii::t('base', 'Profile image of {displayName}', ['displayName' => Html::encode($user->displayName)]); ?>"
src="<?= $user->getProfileBannerImage()->getUrl(); ?>"
width="100%" style="width: 100%; max-height: 192px;">
<!-- check if the current user is the profile owner and can change the images -->
<?php if ($allowModifyProfileBanner) : ?>
<form class="fileupload" id="bannerfileupload" action="" method="POST" enctype="multipart/form-data"
style="position: absolute; top: 0; left: 0; opacity: 0; width: 100%; height: 100%;">
<input type="file" name="images[]">
<input type="file" name="images[]" aria-hidden="true">
</form>
<?php
@ -54,30 +54,28 @@ if ($allowModifyProfileBanner || $allowModifyProfileImage) {
<!-- show user name and title -->
<div class="img-profile-data">
<h1><?php echo Html::encode($user->displayName); ?></h1>
<h1><?= Html::encode($user->displayName); ?></h1>
<h2><?php echo Html::encode($user->profile->title); ?></h2>
<h2><?= Html::encode($user->profile->title); ?></h2>
</div>
<!-- check if the current user is the profile owner and can change the images -->
<?php if ($allowModifyProfileBanner): ?>
<div class="image-upload-buttons" id="banner-image-upload-buttons">
<a href="#" onclick="javascript:$('#bannerfileupload input').click();"
class="btn btn-info btn-sm"><i
class="fa fa-cloud-upload"></i></a>
<a href="#" onclick="javascript:$('#bannerfileupload input').click();" class="btn btn-info btn-sm" aria-label="<?= Yii::t('UserModule.base', 'Upload profile banner'); ?>">
<i class="fa fa-cloud-upload"></i>
</a>
<a id="banner-image-upload-edit-button"
style="<?php
if (!$user->getProfileBannerImage()->hasImage()) {
echo 'display: none;';
}
?>"
href="<?php echo Url::to(['/user/image/crop', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_BANNER_IMAGE]); ?>"
class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static"><i
class="fa fa-edit"></i></a>
style="<?= (!$user->getProfileBannerImage()->hasImage()) ? 'display: none;' : '' ?>"
href="<?= Url::to(['/user/image/crop', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_BANNER_IMAGE]); ?>"
class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static" aria-label="<?= Yii::t('UserModule.base', 'Crop profile background'); ?>">
<i class="fa fa-edit"></i>
</a>
<?php
echo \humhub\widgets\ModalConfirm::widget(array(
'uniqueID' => 'modal_bannerimagedelete',
'linkOutput' => 'a',
'ariaLabel' => Yii::t('UserModule.widgets_views_deleteBanner', 'Delete profile banner'),
'title' => Yii::t('UserModule.widgets_views_deleteBanner', '<strong>Confirm</strong> image deleting'),
'message' => Yii::t('UserModule.widgets_views_deleteBanner', 'Do you really want to delete your title image?'),
'buttonTrue' => Yii::t('UserModule.widgets_views_deleteBanner', 'Delete'),
@ -111,7 +109,7 @@ if ($allowModifyProfileBanner || $allowModifyProfileImage) {
<?php if ($allowModifyProfileImage) : ?>
<form class="fileupload" id="profilefileupload" action="" method="POST" enctype="multipart/form-data"
style="position: absolute; top: 0; left: 0; opacity: 0; height: 140px; width: 140px;">
<input type="file" name="images[]">
<input type="file" aria-hidden="true" name="images[]">
</form>
<div class="image-upload-loader" id="profile-image-upload-loader" style="padding-top: 60px;">
@ -124,8 +122,9 @@ if ($allowModifyProfileBanner || $allowModifyProfileImage) {
</div>
<div class="image-upload-buttons" id="profile-image-upload-buttons">
<a href="#" onclick="javascript:$('#profilefileupload input').click();" class="btn btn-info btn-sm"><i
class="fa fa-cloud-upload"></i></a>
<a href="#" onclick="javascript:$('#profilefileupload input').click();" class="btn btn-info btn-sm" aria-label="<?= Yii::t('UserModule.base', 'Upload profile image'); ?>">
<i class="fa fa-cloud-upload"></i>
</a>
<a id="profile-image-upload-edit-button"
style="<?php
if (!$user->getProfileImage()->hasImage()) {
@ -133,12 +132,13 @@ if ($allowModifyProfileBanner || $allowModifyProfileImage) {
}
?>"
href="<?php echo Url::to(['/user/image/crop', 'userGuid' => $user->guid, 'type' => ImageController::TYPE_PROFILE_IMAGE]); ?>"
class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static"><i
class="fa fa-edit"></i></a>
class="btn btn-info btn-sm" data-target="#globalModal" data-backdrop="static" aria-label="<?= Yii::t('UserModule.base', 'Crop profile image'); ?>">
<i class="fa fa-edit"></i></a>
<?php
echo \humhub\widgets\ModalConfirm::widget(array(
'uniqueID' => 'modal_profileimagedelete',
'linkOutput' => 'a',
'ariaLabel' => Yii::t('UserModule.base', 'Delete profile image'),
'title' => Yii::t('UserModule.widgets_views_deleteImage', '<strong>Confirm</strong> image deleting'),
'message' => Yii::t('UserModule.widgets_views_deleteImage', 'Do you really want to delete your profile image?'),
'buttonTrue' => Yii::t('UserModule.widgets_views_deleteImage', 'Delete'),

View File

@ -318,6 +318,9 @@ abstract class BasePickerField extends InputWidget
return $itemClass::find()->where([$this->itemKey => $selection])->all();
}
/*
* @inheritdoc
*/
protected function getAttributes()
{
return [
@ -325,6 +328,7 @@ abstract class BasePickerField extends InputWidget
'size' => '1',
'class' => 'form-control',
'style' => 'width:100%',
'title' => $this->placeholder
];
}

View File

@ -38,7 +38,7 @@ class LanguageChooser extends \yii\base\Widget
{
$model = new \humhub\models\forms\ChooseLanguage();
$model->language = Yii::$app->language;
return $this->render('languageChooser', array('model' => $model, 'languages' => Yii::$app->i18n->getAllowedLanguages()));
return $this->render('languageChooser', ['model' => $model, 'languages' => Yii::$app->i18n->getAllowedLanguages()]);
}
}

View File

@ -99,6 +99,8 @@ class ModalConfirm extends \yii\base\Widget
* @var String contains optional JavaScript code to execute after modal has been made visible to the user
*/
public $modalShownJS = "";
public $ariaLabel = "";
/**
* Displays / Run the Widgets
@ -110,6 +112,7 @@ class ModalConfirm extends \yii\base\Widget
'linkOutput' => $this->linkOutput,
'title' => $this->title,
'message' => $this->message,
'ariaLabel' => $this->ariaLabel,
'buttonTrue' => $this->buttonTrue,
'buttonFalse' => $this->buttonFalse,
'class' => $this->cssClass,

View File

@ -149,6 +149,7 @@ class RichtextField extends JsWidget
$inputOptions = $this->getAttributes();
$inputOptions['id'] = $this->getId(true) . '_input';
$inputOptions['style'] = 'display:none;color';
$inputOptions['title'] = $this->placeholder;
unset($inputOptions['contenteditable']);
$modelAttribute = $this->attribute;

View File

@ -11,10 +11,7 @@ class SiteLogo extends \yii\base\Widget
public function run()
{
return $this->render('logo', array('logo' => new LogoImage(), 'place' => $this->place));
return $this->render('logo', ['logo' => new LogoImage(), 'place' => $this->place]);
}
}
?>
}

View File

@ -1,6 +1,6 @@
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
<div class="slides"></div>
<h3 class="title"></h3>
<h3 class="title">Hidden Gallery</h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>

View File

@ -4,10 +4,10 @@ use \humhub\compat\CActiveForm;
?>
<div class="text text-center animated fadeIn">
<?php if (count($languages) > 1) : ?>
<?php echo Yii::t('base', "Choose language:"); ?> &nbsp;
<?= Yii::t('base', "Choose language:"); ?> &nbsp;
<div class="langSwitcher inline-block">
<?php $form = CActiveForm::begin(['id' => 'choose-language-form']); ?>
<?php echo $form->dropDownList($model, 'language', $languages, array('onChange' => 'this.form.submit()')); ?>
<?= $form->dropDownList($model, 'language', $languages, ['onChange' => 'this.form.submit()', 'aria-label' => Yii::t('base', "Choose language:")]); ?>
<?php CActiveForm::end(); ?>
</div>
<?php endif; ?>

View File

@ -4,27 +4,23 @@ use yii\helpers\Html;
?>
<?php if ($place == "topMenu") : ?>
<?php if ($logo->hasImage()) : ?>
<a class="navbar-brand hidden-xs" style="height: 50px; padding:5px;"
href="<?php echo Yii::$app->homeUrl; ?>">
<img class="img-rounded" src="<?php echo $logo->getUrl(); ?>"
id="img-logo"/>
<a class="navbar-brand hidden-xs" style="height: 50px; padding:5px;" href="<?= Yii::$app->homeUrl; ?>">
<img class="img-rounded" src="<?= $logo->getUrl(); ?>" alt="<?= Yii::t('base', 'Logo of {appName}', ['appName' => Html::encode(Yii::$app->name)])?>" id="img-logo"/>
</a>
<?php endif; ?>
<a class="navbar-brand" style="<?php if ($logo->hasImage()) : ?>display:none;<?php endif; ?> "
href="<?php echo Yii::$app->homeUrl; ?>" id="text-logo">
<?php echo Html::encode(Yii::$app->name); ?>
<a class="navbar-brand" style="<?php if ($logo->hasImage()) : ?>display:none;<?php endif; ?> " href="<?= Yii::$app->homeUrl; ?>" id="text-logo">
<?= Html::encode(Yii::$app->name); ?>
</a>
<?php endif; ?>
<?php if ($place == "login") : ?>
<?php if ($logo->hasImage()) : ?>
<a href="<?php echo Yii::$app->homeUrl; ?>">
<img class="img-rounded" src="<?php echo $logo->getUrl(); ?>"
id="img-logo"/>
<a href="<?= Yii::$app->homeUrl; ?>">
<img class="img-rounded" src="<?= $logo->getUrl(); ?>" id="img-logo" alt="<?= Yii::t('base', 'Logo of {appName}', ['appName' => Html::encode(Yii::$app->name)]) ?>"/>
</a>
<br>
<?php else: ?>
<h1 id="app-title" class="animated fadeIn"><?php echo Html::encode(Yii::$app->name); ?></h1>
<h1 id="app-title" class="animated fadeIn"><?= Html::encode(Yii::$app->name); ?></h1>
<?php endif; ?>
<?php endif; ?>

View File

@ -1,8 +1,3 @@
<?php
?>
<!-- add Tooltip to link -->
<?php
$tooltip = "";
@ -27,7 +22,7 @@ if ($confirmJS != "") {
<?php if ($linkOutput == 'button') { ?>
<!-- create button element -->
<button class="<?php echo $class; ?> <?php if ($tooltip != "") : ?>tt<?php endif;?>" style="<?php echo $style; ?>"
<button class="<?php echo $class; ?> <?= ($ariaLabel) ? ' aria-label="'.$ariaLabel.'"' : '' ?> <?php if ($tooltip != "") : ?>tt<?php endif;?>" style="<?php echo $style; ?>"
data-toggle="modal" data-target="#confirmModal_<?php echo $uniqueID; ?>" <?php echo $tooltip; ?>>
<?php echo $linkContent; ?>
</button>
@ -35,7 +30,7 @@ if ($confirmJS != "") {
<?php } else if ($linkOutput == 'a') { ?>
<!-- create normal link element -->
<a id="deleteLinkPost_<?php echo $uniqueID; ?>" class="<?php echo $class; ?> <?php if ($tooltip != "") : ?>tt<?php endif;?>" style="<?php echo $style; ?>" href="#"
<a id="deleteLinkPost_<?php echo $uniqueID; ?>" <?= ($ariaLabel) ? ' aria-label="'.$ariaLabel.'"' : '' ?> class="<?php echo $class; ?> <?php if ($tooltip != "") : ?>tt<?php endif;?>" style="<?php echo $style; ?>" href="#"
data-toggle="modal" data-target="#confirmModal_<?php echo $uniqueID; ?>" <?php echo $tooltip; ?>>
<?php echo $linkContent; ?>
</a>

View File

@ -3,13 +3,18 @@ $this->registerJsFile("@web-static/js/panelMenu.js", ['position' => yii\web\View
?>
<ul class="nav nav-pills preferences">
<li class="dropdown ">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-angle-down"></i></a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-label="<?= Yii::t('base', 'Toggle panel menu'); ?>" aria-haspopup="true"><i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu pull-right">
<li><a href="javascript:togglePanelUp('<?php echo $id; ?>');" class="panel-collapse"><i
class="fa fa-minus-square"></i> <?php echo Yii::t('base', 'Collapse'); ?></a></li>
<li><a href="javascript:togglePanelDown('<?php echo $id; ?>');" class="panel-expand" style="display:none;"><i
class="fa fa-plus-square"></i> <?php echo Yii::t('base', 'Expand'); ?></a></li>
<li>
<a href="javascript:togglePanelUp('<?= $id; ?>');" class="panel-collapse">
<i class="fa fa-minus-square"></i> <?= Yii::t('base', 'Collapse'); ?>
</a>
</li>
<li>
<a href="javascript:togglePanelDown('<?= $id; ?>');" class="panel-expand" style="display:none;">
<i class="fa fa-plus-square"></i> <?= Yii::t('base', 'Expand'); ?>
</a>
</li>
<?php
echo $this->context->extraMenus;
?>

View File

@ -56,7 +56,7 @@ humhub.module('ui.modal', function (module, require, $) {
* Template for the modal splitted into different parts. Those can be overwritten my changing or overwriting module.template.
*/
Modal.template = {
container: '<div class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none; background:rgba(0,0,0,0.1)"><div class="modal-dialog"><div class="modal-content"></div></div></div>',
container: '<div class="modal" tabindex="-1" role="dialog" aria-hidden="true" style="display: none; background:rgba(0,0,0,0.1)"><div class="modal-dialog"><div class="modal-content"></div></div></div>',
header: '<div class="modal-header"><button type="button" class="close" data-modal-close="true" aria-hidden="true">×</button><h4 class="modal-title"></h4></div>',
body: '<div class="modal-body"></div>',
footer: '<div class="modal-footer"></div>',
@ -92,8 +92,16 @@ humhub.module('ui.modal', function (module, require, $) {
});
this.set(options);
this.$.attr('aria-labelledby', this.getTitleId());
};
Modal.prototype.checkAriaLabel = function () {
var $title = this.$.find('.modal-title');
if($title.length) {
$title.attr('id', this.getTitleId());
this.$.attr('aria-labelledby', this.getTitleId());
} else {
this.$.removeAttr('aria-labelledby');
}
};
Modal.prototype.getTitleId = function () {
@ -418,6 +426,7 @@ humhub.module('ui.modal', function (module, require, $) {
this.$.empty().append(content);
this.applyAdditions();
this.$.find('input[type="text"]:visible, textarea:visible, [contenteditable="true"]:visible').first().focus();
this.checkAriaLabel();
return this;
};

View File

@ -184,11 +184,11 @@ humhub.module('ui.picker', function (module, require, $) {
}
if (this.$.children(':selected').length >= this.$.data('maximum-selection-length')) {
this.$.data('select2').$selection.find('input').attr('placeholder', null);
this.$.data('select2').$selection.find('input').attr('placeholder', null).attr('title', null);
} else if (this.$.val()) {
this.$.data('select2').$selection.find('input').attr('placeholder', this.options.placeholderMore);
this.$.data('select2').$selection.find('input').attr('placeholder', this.options.placeholderMore).attr('title', this.options.placeholderMore);
} else {
this.$.data('select2').$selection.find('input').attr('placeholder', this.options.placeholder);
this.$.data('select2').$selection.find('input').attr('placeholder', this.options.placeholder).attr('title', this.options.placeholderMore);
}
};