Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
tabs as spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
highstrike committed Feb 21, 2018
1 parent 06496ec commit 22022b9
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/Template/Backend/Login/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<fieldset>
<legend><?= __d('Unimatrix/backend', 'Authentication') ?></legend>
<?= $this->Form->control('username', ['label' => __d('Unimatrix/backend', 'Username')]); ?>
<?= $this->Form->control('password', ['label' => __d('Unimatrix/backend', 'Password')]); ?>
<?= $this->Form->control('remember', ['type' => 'checkbox', 'label' => __d('Unimatrix/backend', 'Remember me'), 'checked' => true]); ?>
<?= $this->Form->control('password', ['label' => __d('Unimatrix/backend', 'Password')]); ?>
<?= $this->Form->control('remember', ['type' => 'checkbox', 'label' => __d('Unimatrix/backend', 'Remember me'), 'checked' => true]); ?>
</fieldset>
<?= $this->Form->button(__d('Unimatrix/backend', 'Login')) ?>
<?= $this->Form->end() ?>
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Layout/backend.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $project = [
<div class="top-bar-right">
<ul class="menu">
<?php if($auth) { ?>
<li><?= $this->Html->link('<i class="fa fa-sign-out" aria-hidden="true"></i>' . __d('Unimatrix/backend', 'Logout'), ['controller' => 'Login', 'action' => 'logout', 'plugin' => 'Unimatrix/Backend'], ['escape' => false]) ?></li>
<li><?= $this->Html->link('<i class="fa fa-sign-out" aria-hidden="true"></i>' . __d('Unimatrix/backend', 'Logout'), ['controller' => 'Login', 'action' => 'logout', 'plugin' => 'Unimatrix/Backend'], ['escape' => false]) ?></li>
<?php } else { ?>
<li><?= $this->Html->link('<i class="fa fa-sign-in" aria-hidden="true"></i>' . __d('Unimatrix/backend', 'Please login to continue'), ['controller' => 'Login', 'action' => 'index', 'plugin' => 'Unimatrix/Backend'], ['escape' => false]) ?></li>
<?php } ?>
Expand Down
60 changes: 30 additions & 30 deletions webroot/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,47 @@ var Backend = function() { 'use strict';
window.setTimeout(function() { collapse.call(self); }, 3000);
});

// mobile side nav expansion
// mobile side nav expansion
}, _sidenav = function() {
var b = $('div.arrow-expand > i');
var b = $('div.arrow-expand > i');

// on event click
b.on('click', function() {
var self = $(this);
self.closest('#actions-sidebar').toggleClass('open');
});
// on event click
b.on('click', function() {
var self = $(this);
self.closest('#actions-sidebar').toggleClass('open');
});

// check form errors and blink the corresponding tab
// check form errors and blink the corresponding tab
}, _checkerrors = function() {
// check first error
var e = $('form div.input.error');
if(!e.length > 0)
return false;
// check first error
var e = $('form div.input.error');
if(!e.length > 0)
return false;

// go through each error field
e.each(function() {
var self = $(this);
// go through each error field
e.each(function() {
var self = $(this);

// got tabpanel?
var panel = self.closest('div.tabs-panel');
if(!panel.length > 0)
return false;
// got tabpanel?
var panel = self.closest('div.tabs-panel');
if(!panel.length > 0)
return false;

// error the tab for a visual notification
var tab = $('form ul.tabs a#' + panel.attr('aria-labelledby')).parent();
if(!tab.hasClass('error'))
tab.addClass('error');
});
// error the tab for a visual notification
var tab = $('form ul.tabs a#' + panel.attr('aria-labelledby')).parent();
if(!tab.hasClass('error'))
tab.addClass('error');
});

// init
}, __construct = function() {
// initiate foundation
$(document).foundation();
// initiate foundation
$(document).foundation();

// handle things
_flash();
_sidenav();
_checkerrors();
// handle things
_flash();
_sidenav();
_checkerrors();
};

// public, yay
Expand Down
44 changes: 22 additions & 22 deletions webroot/js/widgets/picky.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ Widgets.picky = function() { 'use strict';

// handle binds
}, _bind = function() {
// go through each picky
$('div.picky-widget').each(function() {
var container = $(this),
list = container.find('div.list'),
name = list.siblings('input[type="hidden"]:first').attr('name');
// go through each picky
$('div.picky-widget').each(function() {
var container = $(this),
list = container.find('div.list'),
name = list.siblings('input[type="hidden"]:first').attr('name');

// on click event
list.find('pick').on('click', function() {
// visual only
$(this).toggleClass('active');
// on click event
list.find('pick').on('click', function() {
// visual only
$(this).toggleClass('active');

// recalculate what is selected
var values = [];
list.children('pick.active').each(function() {
values.push($(this).text());
});
// recalculate what is selected
var values = [];
list.children('pick.active').each(function() {
values.push($(this).text());
});

// change inputs
list.siblings('input[type="hidden"]').remove();
if(values.length > 0)
for(let i = 0; i < values.length; i++)
container.append($('<input/>', {type: 'hidden', name: name, value: values[i]}));
else container.append($('<input/>', {type: 'hidden', name: name, value: store.empty}));
})
});
// change inputs
list.siblings('input[type="hidden"]').remove();
if(values.length > 0)
for(let i = 0; i < values.length; i++)
container.append($('<input/>', {type: 'hidden', name: name, value: values[i]}));
else container.append($('<input/>', {type: 'hidden', name: name, value: store.empty}));
})
});

// init
}, __construct = function() {
Expand Down
4 changes: 2 additions & 2 deletions webroot/js/widgets/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Widgets.wysiwyg = function() { 'use strict';
['Maximize']
], stylesSet: [
{ name: 'Blockquote', element: 'p', attributes: {'class': 'blockquote'} },
]
};
]
};

// init
}, __construct = function() {
Expand Down

0 comments on commit 22022b9

Please sign in to comment.