Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some minor settings UI issues #10028

Merged
merged 6 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/systemtags/css/settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.systemtag-input {
display: flex;
max-width: 500px;
}
#systemtags .select2-container {
width: 100%;
max-width: 500px;
}
#systemtag_name {
flex-grow: 1;
}

#systemtag_delete,
#systemtag_reset,
#systemtag_submit {
padding: 8px;
}
6 changes: 4 additions & 2 deletions apps/systemtags/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@
if (tagId > 0) {
$('#systemtags').attr('data-systemtag-id', tagId);
$('#systemtag_delete').removeClass('hidden');
$('#systemtag_submit').val(t('systemtags_manager', 'Update'));
$('#systemtag_submit span').text(t('systemtags_manager', 'Update'));
$('#systemtag_create').addClass('hidden');
} else {
$('#systemtag').select2('val', '');
$('#systemtags').attr('data-systemtag-id', '');
$('#systemtag_delete').addClass('hidden');
$('#systemtag_submit').val(t('systemtags_manager', 'Create'));
$('#systemtag_submit span').text(t('systemtags_manager', 'Create'));
$('#systemtag_create').removeClass('hidden');
}
},

Expand Down
31 changes: 15 additions & 16 deletions apps/systemtags/templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,31 @@
]);

script('systemtags', 'admin');
style('systemtags', 'settings');

/** @var \OCP\IL10N $l */
?>

<form id="systemtags" class="section" data-systemtag-id="">
<h2><?php p($l->t('Collaborative tags')); ?></h2>
<p class="settings-hint"><?php p($l->t('Create and edit collaborative tags. These tags affect all users.')); ?></p>
<p class="settings-hint"><?php p($l->t('Collaborative tags are available for all users. Restricted tags are visible to users but cannot be assigned by them. Invisible tags are for internal use, since users cannot see or assign them.')); ?></p>

<input type="hidden" name="systemtag" id="systemtag" placeholder="<?php p($l->t('Select tag …')); ?>" style="width: 400px;" />
<input type="hidden" name="systemtag" id="systemtag" placeholder="<?php p($l->t('Select tag …')); ?>" />

<br><br>
<h3 id="systemtag_create"><?php p($l->t('Create a new tag')); ?></h3>

<input type="text" id="systemtag_name" name="systemtag_name" placeholder="<?php p($l->t('Name')); ?>" style="width: 200px;">
<div class="systemtag-input">
<input type="text" id="systemtag_name" name="systemtag_name" placeholder="<?php p($l->t('Name')); ?>">

<span id="systemtag_delete" class="hidden">
<img src="<?php p(\OCP\Template::image_path('core', 'actions/delete.svg')); ?>" alt="<?php p($l->t('Delete')); ?>">
</span>
<select id="systemtag_level">
<option value="3"><?php p($l->t('Public')); ?></option>
<option value="2"><?php p($l->t('Restricted')); ?></option>
<option value="0"><?php p($l->t('Invisible')); ?></option>
</select>

<br>
<a id="systemtag_delete" class="hidden icon-delete"><span class="hidden-visually"><?php p($l->t('Delete')); ?></span></a>
<a id="systemtag_reset" class="icon-close"><span class="hidden-visually"><?php p($l->t('Reset')); ?></span></a>
<a id="systemtag_submit" class="icon-confirm"><span class="hidden-visually"><?php p($l->t('Create')); ?></span></a>
</div>

<select id="systemtag_level">
<option value="3"><?php p($l->t('Public')); ?></option>
<option value="2"><?php p($l->t('Restricted')); ?></option>
<option value="0"><?php p($l->t('Invisible')); ?></option>
</select>

<input type="button" id="systemtag_submit" value="<?php p($l->t('Create')); ?>">
<input type="button" id="systemtag_reset" value="<?php p($l->t('Reset')); ?>">
</form>
19 changes: 18 additions & 1 deletion apps/workflowengine/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
.workflowengine .operation button {
margin-bottom: 0;
}
.workflowengine .operation-name {
width: 100%;
max-width: 500px;
}
.workflowengine .operation span.info {
padding: 7px;
color: #eee;
Expand All @@ -34,10 +38,23 @@
background-color: #f8f8f8;
}

.workflowengine .operation-header .operation-name {
align-self: flex-start;
padding: 10px;
}
.workflowengine .operation-header {
display: flex;
}
.workflowengine .operation-header .select2-container {
align-self: flex-end;
}
.workflowengine .operation-header .icon-delete {
margin-left: auto;
}
.workflowengine .operation .button-delete,
.workflowengine .operation .button-delete-check {
opacity: 0.5;
padding: 7px;
padding: 11px;
}
.workflowengine .operation .button-delete:hover,
.workflowengine .operation .button-delete:focus,
Expand Down
16 changes: 9 additions & 7 deletions apps/workflowengine/templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@

<script type="text/template" id="operation-template">
<div class="operation{{#if hasChanged}} modified{{/if}}">
<input type="text" class="operation-name" placeholder="<?php p($l->t('Short rule description')); ?>" value="{{operation.name}}">
{{! delete only makes sense if the operation is already saved }}
{{#if operation.id}}
<span class="button-delete pull-right icon-delete"></span>
{{/if}}
<input type="text" class="pull-right operation-operation" value="{{operation.operation}}">
<div class="operation-header">
<input type="text" class="operation-name" placeholder="<?php p($l->t('Short rule description')); ?>" value="{{operation.name}}" />
<input type="text" class="operation-operation" value="{{operation.operation}}" />
{{! delete only makes sense if the operation is already saved }}
{{#if operation.id}}
<span class="button-delete icon-delete"></span>
{{/if}}
</div>

<div class="checks">
{{#each operation.checks}}
Expand All @@ -67,7 +69,7 @@
{{/each}}
</select>
<input type="text" class="check-value" value="{{value}}">
<span class="button-delete-check pull-right icon-delete"></span>
<span class="button-delete-check icon-delete"></span>
</div>
{{/each}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,6 @@
'OC\\Settings\\Admin\\Mail' => $baseDir . '/lib/private/Settings/Admin/Mail.php',
'OC\\Settings\\Admin\\Overview' => $baseDir . '/lib/private/Settings/Admin/Overview.php',
'OC\\Settings\\Admin\\Server' => $baseDir . '/lib/private/Settings/Admin/Server.php',
'OC\\Settings\\Admin\\ServerDevNotice' => $baseDir . '/lib/private/Settings/Admin/ServerDevNotice.php',
'OC\\Settings\\Admin\\Sharing' => $baseDir . '/lib/private/Settings/Admin/Sharing.php',
'OC\\Settings\\Application' => $baseDir . '/settings/Application.php',
'OC\\Settings\\BackgroundJobs\\VerifyUserData' => $baseDir . '/settings/BackgroundJobs/VerifyUserData.php',
Expand All @@ -958,6 +957,7 @@
'OC\\Settings\\Personal\\Additional' => $baseDir . '/lib/private/Settings/Personal/Additional.php',
'OC\\Settings\\Personal\\PersonalInfo' => $baseDir . '/lib/private/Settings/Personal/PersonalInfo.php',
'OC\\Settings\\Personal\\Security' => $baseDir . '/lib/private/Settings/Personal/Security.php',
'OC\\Settings\\Personal\\ServerDevNotice' => $baseDir . '/lib/private/Settings/Personal/ServerDevNotice.php',
'OC\\Settings\\Section' => $baseDir . '/lib/private/Settings/Section.php',
'OC\\Setup' => $baseDir . '/lib/private/Setup.php',
'OC\\Setup\\AbstractDatabase' => $baseDir . '/lib/private/Setup/AbstractDatabase.php',
Expand Down
2 changes: 1 addition & 1 deletion lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,6 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Settings\\Admin\\Mail' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Mail.php',
'OC\\Settings\\Admin\\Overview' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Overview.php',
'OC\\Settings\\Admin\\Server' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Server.php',
'OC\\Settings\\Admin\\ServerDevNotice' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/ServerDevNotice.php',
'OC\\Settings\\Admin\\Sharing' => __DIR__ . '/../../..' . '/lib/private/Settings/Admin/Sharing.php',
'OC\\Settings\\Application' => __DIR__ . '/../../..' . '/settings/Application.php',
'OC\\Settings\\BackgroundJobs\\VerifyUserData' => __DIR__ . '/../../..' . '/settings/BackgroundJobs/VerifyUserData.php',
Expand All @@ -988,6 +987,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Settings\\Personal\\Additional' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/Additional.php',
'OC\\Settings\\Personal\\PersonalInfo' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/PersonalInfo.php',
'OC\\Settings\\Personal\\Security' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/Security.php',
'OC\\Settings\\Personal\\ServerDevNotice' => __DIR__ . '/../../..' . '/lib/private/Settings/Personal/ServerDevNotice.php',
'OC\\Settings\\Section' => __DIR__ . '/../../..' . '/lib/private/Settings/Section.php',
'OC\\Setup' => __DIR__ . '/../../..' . '/lib/private/Setup.php',
'OC\\Setup\\AbstractDatabase' => __DIR__ . '/../../..' . '/lib/private/Setup/AbstractDatabase.php',
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Settings/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ private function getBuiltInAdminSettings($section): array {
/** @var ISettings $form */
$form = new Admin\Overview($this->config);
$forms[$form->getPriority()] = [$form];
$form = new Admin\ServerDevNotice();
$forms[$form->getPriority()] = [$form];
}
if ($section === 'server') {
/** @var ISettings $form */
Expand Down Expand Up @@ -305,6 +303,8 @@ private function getBuiltInPersonalSettings($section): array {
$this->l
);
$forms[$form->getPriority()] = [$form];
$form = new Personal\ServerDevNotice();
$forms[$form->getPriority()] = [$form];
}
if($section === 'security') {
/** @var ISettings $form */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OC\Settings\Admin;
namespace OC\Settings\Personal;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
Expand All @@ -31,14 +31,14 @@ class ServerDevNotice implements ISettings {
* @return TemplateResponse
*/
public function getForm() {
return new TemplateResponse('settings', 'settings/admin/server.development.notice');
return new TemplateResponse('settings', 'settings/personal/development.notice');
}

/**
* @return string the section ID, e.g. 'sharing'
*/
public function getSection() {
return 'server';
return 'personal-info';
}

/**
Expand Down
9 changes: 6 additions & 3 deletions settings/css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ input {
#personal-settings-avatar-container {
display: inline-grid;
grid-template-columns: 1fr;
grid-template-rows: 2fr 1fr 1fr;
grid-template-rows: 2fr 1fr;
vertical-align: top;
}

.profile-settings-container {
display: inline-grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
}

.personal-show-container {
Expand Down Expand Up @@ -216,7 +216,7 @@ input {
.personal-settings-container {
display: inline-grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr;
&:after {
clear: both;
}
Expand Down Expand Up @@ -405,6 +405,9 @@ table.nostyle {
}
td {
padding: 10px 10px 10px 0;
&:first-child {
padding: 10px;
}
}
}
.token-list td {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div class="followupsection">
<p>
<?php print_unescaped(str_replace(
[
Expand Down Expand Up @@ -62,3 +63,4 @@
{newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}'
)); ?>
</p>
</div>
2 changes: 1 addition & 1 deletion tests/Settings/Controller/AdminSettingsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
namespace Tests\Settings\Controller;

use OC\Settings\Admin\ServerDevNotice;
use OC\Settings\Personal\ServerDevNotice;
use OC\Settings\Controller\AdminSettingsController;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\INavigationManager;
Expand Down