UI improvements, comments refactor for lint

This commit is contained in:
Diego Najar 2021-06-07 19:52:26 +02:00
parent ad0c024362
commit ed1edb902f
9 changed files with 70 additions and 66 deletions

View file

@ -36,5 +36,11 @@ div.sidebar .nav-item h4 {
text-decoration: underline;
}
/** Tables
*/
tr.disabled{
filter: blur(1px);
pointer-events: none;
}

View file

@ -2,12 +2,16 @@ body {
background-color: #f1f1f1;
}
a {
a,
a.nav-link,
.link {
color: #555;
}
a.nav-link {
color: #555;
a:hover,
a.nav-link:hover,
.link:hover {
color: #0a58ca;
}
.form-control:focus,

View file

@ -7,25 +7,25 @@
</div>
<script>
function showAlert(text, background='primary') {
$('#alert').removeClass('bg-danger bg-warning bg-primary').addClass('bg-'+background);
$('#alert').html(text);
$('#alert').toast('show');
}
function showAlert(text, background='primary') {
$('#alert').removeClass('bg-danger bg-warning bg-primary').addClass('bg-'+background);
$('#alert').html(text);
$('#alert').toast('show');
}
function showAlertError(text) {
showAlert(text, 'danger');
}
function showAlertError(text) {
showAlert(text, 'danger');
}
function showAlertWarning(text) {
showAlert(text, 'warning');
}
function showAlertWarning(text) {
showAlert(text, 'warning');
}
function showAlertInfo(text) {
showAlert(text, 'primary');
}
function showAlertInfo(text) {
showAlert(text, 'primary');
}
function hideAlert(text) {
$('#alert').toast('hide');
}
function hideAlert(text) {
$('#alert').toast('hide');
}
</script>

View file

@ -347,8 +347,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelDescription" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveDescription" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelDescription" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveDescription" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>
@ -367,8 +367,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelDate" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveDate" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelDate" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveDate" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>
@ -397,8 +397,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelFriendlyURL" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveFriendlyURL" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelFriendlyURL" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveFriendlyURL" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>
@ -441,8 +441,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelType" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveType" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelType" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveType" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>
@ -474,8 +474,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelSeo" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveSeo" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelSeo" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveSeo" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>
@ -494,8 +494,8 @@
</div>
</div>
<div class="modal-footer ps-2 pe-2 pt-1 pb-1">
<button id="btnCancelParent" type="button" class="btn btn-cancel fw-bold me-auto"><i class="bi bi-x-square"></i>Cancel</button>
<button id="btnSaveParent" type="button" class="btn btn-save fw-bold text-success"><i class="bi bi-check-square"></i>Save</button>
<button id="btnCancelParent" type="button" class="btn btn-sm btn-secondary"><i class="bi bi-x"></i>Cancel</button>
<button id="btnSaveParent" type="button" class="btn btn-sm btn-primary"><i class="bi bi-check"></i>Save</button>
</div>
</div>
</div>

View file

@ -66,6 +66,6 @@ echo Bootstrap::formOpen(array('name'=>'login'));
echo '</form>';
echo '<p class="mt-5 text-end">Powered by <a href="https://www.bludit.com">Bludit</a></p>'
echo '<p class="mt-5 text-end">'.$L->g('Powered by Bludit').'</p>'
?>

View file

@ -41,7 +41,7 @@ if ($pages->scheduler()) {
execPluginsByHook('afterPageCreate');
reindexTags();
reindexCategories();
reindexCategories();
// Add to syslog
$syslog->add(array(

View file

@ -215,6 +215,7 @@
"new-user-created": "New user created",
"user-edited": "User edited",
"user-deleted": "User deleted",
"page-deleted": "Page deleted",
"recommended-for-recovery-password-and-notifications": "Recommended for recovery password and notifications.",
"authentication-token": "Authentication Token",
"token": "Token",
@ -399,5 +400,6 @@
"are-you-sure-you-want-to-delete-this-category?": "Are you sure you want to delete this category?",
"are-you-sure-you-want-to-change-the-password?": "Are you sure you want to change the password?",
"website-plugins": "Website plugins",
"dashboard-plugins": "Dashboard plugins"
"dashboard-plugins": "Dashboard plugins",
"powered-by-bludit": "Powered by <a href='https:\/\/www.bludit.com'>Bludit</a>"
}

View file

@ -14,11 +14,7 @@ class pluginAbout extends Plugin {
{
global $L;
$html = '<div class="alert alert-primary" role="alert">';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html = '<div>';
$html .= '<label>'.$L->get('Label').'</label>';
$html .= '<input name="label" type="text" value="'.$this->getValue('label').'">';
$html .= '<span class="tip">'.$L->get('This title is almost always used in the sidebar of the site').'</span>';

View file

@ -152,16 +152,8 @@ class pluginAPI extends Plugin {
// /api/pages/:key
// /api/pages/:parent/:key
// (GET) /api/pages
if ( ($method==='GET') && ($parmA==='pages') && empty($parmB) ) {
$data = $this->getPages($inputs);
}
// (POST) /api/pages
elseif ( ($method==='POST') && ($parmA==='pages') && empty($parmB) && $writePermissions ) {
$data = $this->createPage($inputs);
}
// (GET) /api/pages/files/:key
elseif ( ($method==='GET') && ($parmA==='pages') && ($parmB==='files') && !empty($parmC) ) {
if ( ($method==='GET') && ($parmA==='pages') && ($parmB==='files') && !empty($parmC) ) {
$key = $parmC;
if (!empty($parmD)) {
$key = $parmC.'/'.$parmD;
@ -192,6 +184,10 @@ class pluginAPI extends Plugin {
}
$data = $this->getPage($key);
}
// (POST) /api/pages
elseif ( ($method==='POST') && ($parmA==='pages') && empty($parmB) && $writePermissions ) {
$data = $this->createPage($inputs);
}
// (PUT) /api/pages/:key
elseif ( ($method==='PUT') && ($parmA==='pages') && !empty($parmB) && $writePermissions ) {
$inputs['key'] = $parmB;
@ -554,28 +550,31 @@ class pluginAPI extends Plugin {
);
}
/**
* Delete a page
* @param array $args Parameters for the function
* @return array
*/
private function deletePage($args)
{
if (deletePage($args)) {
return array(
'status'=>'0',
'message'=>'Page deleted.'
'message'=>'Page deleted.',
'data'=>array('key'=>$args['key'])
);
}
return array(
'status'=>'1',
'message'=>'Error trying to delete the page.'
'message'=>'An error occurred while trying to delete the page.'
);
}
/*
| Get the settings
|
| @args array
|
| @return array
*/
/**
* Get settings
* @return array
*/
private function getSettings()
{
global $site;
@ -586,14 +585,11 @@ class pluginAPI extends Plugin {
);
}
/*
| Edit the settings
| You can edit any field defined in the class site.class.php variable $dbFields
|
| @args array
|
| @return array
*/
/**
* Edit settings.
* @param array $args Keys defined in the class site.class.php variable $dbFields
* @return array
*/
private function editSettings($args)
{
if (editSettings($args)) {