feat: VivesPOS landing on Winter CMS 1.2 — theme + plugin + Dockerfile
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
.permissioneditor{position:relative;margin:0 -20px}
|
||||
.permissioneditor.control-disabled .permissions-overlay{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255,255,255,0.01);cursor:not-allowed}
|
||||
.permissioneditor.control-disabled table{opacity:0.5;filter:alpha(opacity=50)}
|
||||
.permissioneditor table{width:100%}
|
||||
.permissioneditor table th{padding:30px 4px 8px 4px;color:#2A3E51;font-weight:normal;border-bottom:1px solid #DBE1E3}
|
||||
.permissioneditor table th.tab{font-size:13px}
|
||||
.permissioneditor table th.permission-type{text-transform:uppercase;font-size:11px;text-align:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:2px;transition:background-color 0.15s ease, color 0.15s ease}
|
||||
.permissioneditor table th.permission-type:hover{background-color:#48b2ce;color:#fff}
|
||||
.permissioneditor table td{padding:10px 4px;vertical-align:top;border-bottom:1px solid #ECF0F1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
||||
.permissioneditor table td.permission-value{text-align:center}
|
||||
.permissioneditor table td.permission-name{font-size:13px;cursor:pointer;color:#777}
|
||||
.permissioneditor table td p.comment{margin-top:5px;margin-bottom:0}
|
||||
.permissioneditor table td p.comment:empty{display:none}
|
||||
.permissioneditor table tr:hover td{background:#48b2ce}
|
||||
.permissioneditor table tr:hover td.permission-name{color:#fff !important}
|
||||
.permissioneditor table th:first-child,
|
||||
.permissioneditor table td:first-child{padding-left:20px}
|
||||
.permissioneditor table th:last-child,
|
||||
.permissioneditor table td:last-child{padding-right:5px}
|
||||
.permissioneditor table .custom-radio,
|
||||
.permissioneditor table .custom-checkbox,
|
||||
.permissioneditor table .custom-switch{display:inline-block;padding-left:0}
|
||||
.permissioneditor table .custom-radio,
|
||||
.permissioneditor table .custom-checkbox,
|
||||
.permissioneditor table .custom-switch,
|
||||
.permissioneditor table .custom-radio label,
|
||||
.permissioneditor table .custom-checkbox label,
|
||||
.permissioneditor table .custom-switch label{margin-bottom:0}
|
||||
.permissioneditor table .custom-radio label,
|
||||
.permissioneditor table .custom-checkbox label,
|
||||
.permissioneditor table .custom-switch label{padding:0 0 0 14px;margin:0;top:0}
|
||||
.permissioneditor table .custom-radio label span,
|
||||
.permissioneditor table .custom-checkbox label span,
|
||||
.permissioneditor table .custom-switch label span{text-indent:-10000em;display:block}
|
||||
.permissioneditor table .custom-radio label:before,
|
||||
.permissioneditor table .custom-checkbox label:before,
|
||||
.permissioneditor table .custom-switch label:before{margin-right:0}
|
||||
.permissioneditor table tr:last-child td{border-bottom:none}
|
||||
.permissioneditor table tr:first-child th{padding-top:0}
|
||||
.permissioneditor table tr.disabled td.permission-name{color:#AAA}
|
||||
.permissioneditor table tr.last-section-row td{border-bottom:none}
|
||||
@@ -0,0 +1,105 @@
|
||||
+function ($) { "use strict";
|
||||
|
||||
var Base = $.wn.foundation.base,
|
||||
BaseProto = Base.prototype
|
||||
|
||||
var PermissionEditor = function() {
|
||||
Base.call(this)
|
||||
|
||||
this.init()
|
||||
}
|
||||
|
||||
PermissionEditor.prototype = Object.create(BaseProto)
|
||||
PermissionEditor.prototype.constructor = PermissionEditor
|
||||
|
||||
PermissionEditor.prototype.init = function() {
|
||||
$(document).on('click', '.permissioneditor table th.permission-type', this.proxy(this.onPermissionTypeClick))
|
||||
$(document).on('click', '.permissioneditor table td.permission-name', this.proxy(this.onPermissionNameClick))
|
||||
$(document).on('click', '.permissioneditor table tr.mode-checkbox input[type=checkbox]', this.proxy(this.onPermissionCheckboxClick))
|
||||
$(document).on('click', '.permissioneditor table tr.mode-radio input[type=radio]', this.proxy(this.onPermissionRadioClick))
|
||||
}
|
||||
|
||||
// EVENT HANDLERS
|
||||
// ============================
|
||||
|
||||
PermissionEditor.prototype.onPermissionTypeClick = function (ev) {
|
||||
var $rows = $(ev.target).closest('tr').nextUntil('tr.section')
|
||||
var index = $(ev.target).index()
|
||||
|
||||
var allChecked = true
|
||||
|
||||
for (let i = 0; i < $rows.length; i++) {
|
||||
var $row = $rows.eq(i)
|
||||
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)
|
||||
|
||||
if ($check.length > 0) {
|
||||
if (!$check[0].checked) {
|
||||
allChecked = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < $rows.length; i++) {
|
||||
var $row = $rows.eq(i)
|
||||
var $check = $row.find('td:nth-child(' + (index + 1) + ') input[type=radio], td:nth-child(' + (index + 1) + ') input[type=checkbox]').eq(0)
|
||||
if ($check.length > 0) {
|
||||
if ($check.is('input[type=checkbox]')) {
|
||||
$check.prop('checked', !allChecked)
|
||||
} else {
|
||||
$check.prop('checked', true)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PermissionEditor.prototype.onPermissionNameClick = function(ev) {
|
||||
var $row = $(ev.target).closest('tr'),
|
||||
$checkbox = $row.find('input[type=checkbox]')
|
||||
|
||||
if ($checkbox.length) {
|
||||
$checkbox.trigger('click')
|
||||
}
|
||||
else {
|
||||
var $radios = $row.find('input[type=radio]')
|
||||
|
||||
if ($radios.length != 3) {
|
||||
return
|
||||
}
|
||||
|
||||
var nextIndex = 0
|
||||
for (var i=2; i>=0; i--) {
|
||||
if ($radios.get(i).checked) {
|
||||
nextIndex = i+1;
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (nextIndex > 2) {
|
||||
nextIndex = 0
|
||||
}
|
||||
|
||||
$($radios.get(nextIndex)).trigger('click')
|
||||
}
|
||||
}
|
||||
|
||||
PermissionEditor.prototype.onPermissionCheckboxClick = function(ev) {
|
||||
var $row = $(ev.target).closest('tr')
|
||||
|
||||
$row.toggleClass('disabled', !ev.target.checked)
|
||||
}
|
||||
|
||||
PermissionEditor.prototype.onPermissionRadioClick = function(ev) {
|
||||
var $row = $(ev.target).closest('tr')
|
||||
|
||||
$row.toggleClass('disabled', ev.target.value == -1)
|
||||
}
|
||||
|
||||
// INITIALIZATION
|
||||
// ============================
|
||||
|
||||
$(document).ready(function(){
|
||||
new PermissionEditor()
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
@@ -0,0 +1,148 @@
|
||||
@import "../../../../assets/less/core/boot.less";
|
||||
|
||||
@color-permissioneditor-section-border: #DBE1E3;
|
||||
@color-permissioneditor-permission-border: #ECF0F1;
|
||||
|
||||
.permissioneditor {
|
||||
position: relative;
|
||||
|
||||
margin: 0 -(@padding-standard);
|
||||
|
||||
&.control-disabled {
|
||||
.permissions-overlay {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.01);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
table {
|
||||
.opacity(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
|
||||
th {
|
||||
padding: 30px 4px 8px 4px;
|
||||
color: @color-label;
|
||||
font-weight: normal;
|
||||
border-bottom: 1px solid @color-permissioneditor-section-border;
|
||||
|
||||
&.tab {
|
||||
font-size: @font-size-base - 1;
|
||||
}
|
||||
|
||||
&.permission-type {
|
||||
text-transform: uppercase;
|
||||
font-size: @font-size-base - 3;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
border-radius: 2px;
|
||||
transition: background-color 0.15s ease, color 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: @color-list-hover-bg;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 10px 4px;
|
||||
vertical-align: top;
|
||||
border-bottom: 1px solid @color-permissioneditor-permission-border;
|
||||
.user-select(none);
|
||||
|
||||
&.permission-value{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&.permission-name {
|
||||
font-size: @font-size-base - 1;
|
||||
cursor: pointer;
|
||||
color: @color-help-block-text;
|
||||
}
|
||||
|
||||
p.comment {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 0;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tr:hover {
|
||||
td {
|
||||
background: @color-list-hover-bg;
|
||||
|
||||
&.permission-name {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
th, td {
|
||||
&:first-child {
|
||||
padding-left: @padding-standard;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.custom-radio,
|
||||
.custom-checkbox,
|
||||
.custom-switch {
|
||||
display: inline-block;;
|
||||
padding-left: 0;
|
||||
|
||||
&, label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
padding: 0 0 0 14px;
|
||||
margin: 0;
|
||||
top: 0;
|
||||
|
||||
span {
|
||||
text-indent: -10000em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:before {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
tr:first-child th {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
tr.disabled {
|
||||
td.permission-name {
|
||||
color: #AAA;
|
||||
}
|
||||
}
|
||||
|
||||
tr.last-section-row {
|
||||
td {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
<div class="permissioneditor <?= $this->previewMode ? 'control-disabled' : '' ?>" <?= $field->getAttributes() ?>>
|
||||
<table>
|
||||
<?php
|
||||
$globalIndex = 0;
|
||||
$checkboxMode = !($this->mode === 'radio');
|
||||
?>
|
||||
<?php foreach ($permissions as $tab => $tabPermissions): ?>
|
||||
<tr class="section">
|
||||
<th class="tab"><?= e(trans($tab)) ?></th>
|
||||
|
||||
<th class="permission-type" title="<?= e(trans('backend::lang.user.permissions_toggle_section_allow')) ?>"><?= e(trans('backend::lang.user.allow')) ?></th>
|
||||
|
||||
<?php if ($this->mode === 'radio'): ?>
|
||||
<th class="permission-type" title="<?= e(trans('backend::lang.user.permissions_toggle_section_inherit')) ?>"><?= e(trans('backend::lang.user.inherit')) ?></th>
|
||||
<th class="permission-type" title="<?= e(trans('backend::lang.user.permissions_toggle_section_deny')) ?>"><?= e(trans('backend::lang.user.deny')) ?></th>
|
||||
<?php endif; ?>
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$lastIndex = count($tabPermissions) - 1;
|
||||
?>
|
||||
<?php foreach ($tabPermissions as $index => $permission): ?>
|
||||
|
||||
<?php
|
||||
$globalIndex++;
|
||||
|
||||
switch ($this->mode) {
|
||||
case 'radio':
|
||||
$permissionValue = array_key_exists($permission->code, $permissionsData)
|
||||
? $permissionsData[$permission->code]
|
||||
: 0;
|
||||
break;
|
||||
case 'switch':
|
||||
$isChecked = !((int) @$permissionsData[$permission->code] === -1);
|
||||
break;
|
||||
case 'checkbox':
|
||||
default:
|
||||
$isChecked = array_key_exists($permission->code, $permissionsData);
|
||||
break;
|
||||
}
|
||||
|
||||
$allowId = $this->getId('permission-' . $globalIndex . '-allow');
|
||||
$inheritId = $this->getId('permission-' . $globalIndex . '-inherit');
|
||||
$denyId = $this->getId('permission-' . $globalIndex . '-deny');
|
||||
?>
|
||||
|
||||
<tr class="<?= $lastIndex == $index ? 'last-section-row' : '' ?>
|
||||
<?= $checkboxMode ? 'mode-checkbox' : 'mode-radio' ?>
|
||||
<?= $checkboxMode && !$isChecked ? 'disabled' : '' ?>
|
||||
<?= !$checkboxMode && $permissionValue == -1 ? 'disabled' : '' ?>
|
||||
">
|
||||
|
||||
<td class="permission-name">
|
||||
<?= e(trans($permission->label)) ?>
|
||||
<?php if ($permission->comment): ?>
|
||||
<span
|
||||
class="text-info wn-icon-circle-info"
|
||||
data-toggle="tooltip"
|
||||
title="<?= e(trans($permission->comment)) ?>"
|
||||
tabindex="0"
|
||||
role="img"
|
||||
aria-label="<?= e(trans($permission->comment)) ?>"
|
||||
></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<?php if ($this->mode === 'radio'): ?>
|
||||
<td class="permission-value">
|
||||
<div class="radio custom-radio">
|
||||
<input
|
||||
id="<?= $allowId ?>"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="1"
|
||||
type="radio"
|
||||
<?= $permissionValue == 1 ? 'checked="checked"' : '' ?>
|
||||
data-radio-color="green"
|
||||
>
|
||||
|
||||
<label for="<?= $allowId ?>"><span>Allow</span></label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="permission-value">
|
||||
<div class="radio custom-radio">
|
||||
<input
|
||||
id="<?= $inheritId ?>"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="0"
|
||||
<?= $permissionValue == 0 ? 'checked="checked"' : '' ?>
|
||||
type="radio"
|
||||
>
|
||||
|
||||
<label for="<?= $inheritId ?>"><span>Inherit</span></label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="permission-value">
|
||||
<div class="radio custom-radio">
|
||||
<input
|
||||
id="<?= $denyId ?>"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="-1"
|
||||
<?= $permissionValue == -1 ? 'checked="checked"' : '' ?>
|
||||
type="radio"
|
||||
data-radio-color="red"
|
||||
>
|
||||
|
||||
<label for="<?= $denyId ?>"><span>Deny</span></label>
|
||||
</div>
|
||||
</td>
|
||||
<?php elseif ($this->mode === 'switch'): ?>
|
||||
<td class="permission-value">
|
||||
<input
|
||||
type="hidden"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="-1"
|
||||
>
|
||||
|
||||
<label class="custom-switch">
|
||||
<input
|
||||
id="<?= $allowId ?>"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="1"
|
||||
type="checkbox"
|
||||
<?= $isChecked ? 'checked="checked"' : '' ?>
|
||||
>
|
||||
<span><span><?= e(trans('backend::lang.list.column_switch_true')) ?></span><span><?= e(trans('backend::lang.list.column_switch_false')) ?></span></span>
|
||||
<a class="slide-button"></a>
|
||||
</label>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class="permission-value">
|
||||
<div class="checkbox custom-checkbox">
|
||||
<input
|
||||
id="<?= $allowId ?>"
|
||||
name="<?= e($baseFieldName) ?>[<?= e($permission->code) ?>]"
|
||||
value="1"
|
||||
type="checkbox"
|
||||
<?= $isChecked ? 'checked="checked"' : '' ?>
|
||||
>
|
||||
|
||||
<label for="<?= $allowId ?>"><span>Allow</span></label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<div class="permissions-overlay"></div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user