mirror of
https://github.com/typemill/typemill.git
synced 2025-07-26 00:31:38 +02:00
add restriction icon to editor navi
This commit is contained in:
2
cache/timer.yaml
vendored
2
cache/timer.yaml
vendored
@@ -1,2 +1,2 @@
|
||||
licenseupdate: 1751827655
|
||||
refreshnavi: 1752315754
|
||||
refreshnavi: 1752319250
|
||||
|
@@ -4,9 +4,9 @@ meta:
|
||||
description: 'In Typemill you can save drafts, publish pages, unpublish pages, and delete pages with a sticky publish panel at the bottom of each page. For published pages,'
|
||||
owner: typemill
|
||||
author: ''
|
||||
modified: '2024-03-19'
|
||||
modified: '2025-03-16'
|
||||
created: '2024-03-19'
|
||||
time: 18-40-10
|
||||
contains: pages
|
||||
hide: false
|
||||
noindex: false
|
||||
contains: pages
|
||||
|
@@ -17,11 +17,12 @@ const navigation = Vue.createApp({
|
||||
</a>
|
||||
</div>
|
||||
<div class="pl-2 pl-3 pl-4 pl-6 pl-8 pl-9 pl-10 pl-12 pl-15 pl-18 pl-21 pl-24 text-stone-50"></div>
|
||||
<navilevel :navigation="navigation" :expanded="expanded" />
|
||||
<navilevel :navigation="navigation" :expanded="expanded" :pageaccess="pageaccess" />
|
||||
</div>
|
||||
</div>`,
|
||||
data: function () {
|
||||
return {
|
||||
pageaccess: false,
|
||||
navigation: data.navigation,
|
||||
home: data.home,
|
||||
backup: false,
|
||||
@@ -31,6 +32,10 @@ const navigation = Vue.createApp({
|
||||
}
|
||||
},
|
||||
mounted: function(){
|
||||
if(data.settings.pageaccess)
|
||||
{
|
||||
this.pageaccess = true;
|
||||
}
|
||||
var expanded = localStorage.getItem('expanded');
|
||||
if(expanded !== null)
|
||||
{
|
||||
@@ -167,6 +172,7 @@ navigation.component('navilevel',{
|
||||
id: parentId ? parentId : false
|
||||
}"
|
||||
:expanded="expanded"
|
||||
:pageaccess="pageaccess"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<li :class="element.elementType" :id="element.keyPath" :data-url="element.urlRelWoF" :data-active="element.active" :data-hide="element.hide">
|
||||
@@ -181,18 +187,25 @@ navigation.component('navilevel',{
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="element.hide" class="p-1 absolute right-0">
|
||||
<svg class="icon icon-eye-blocked">
|
||||
<use xlink:href="#icon-eye-blocked"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="element.elementType == 'folder' && element.contains == 'pages'" class=" p-1 bg-transparent absolute right-0" @click="callToggle(element.urlRelWoF)">
|
||||
<svg v-if="isExpanded(element.urlRelWoF)" class="icon icon-cheveron-up">
|
||||
<use xlink:href="#icon-cheveron-up"></use>
|
||||
</svg>
|
||||
<svg v-else class="icon icon-cheveron-down">
|
||||
<use xlink:href="#icon-cheveron-down"></use>
|
||||
</svg>
|
||||
<div class="absolute right-0 flex">
|
||||
<div v-if="isRestricted(element)" class="p-1 transparent">
|
||||
<svg class="icon icon-blocked text-stone-500">
|
||||
<use xlink:href="#icon-blocked"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="element.hide" class="p-1 transparent">
|
||||
<svg class="icon icon-eye-blocked text-stone-500">
|
||||
<use xlink:href="#icon-eye-blocked"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div v-if="element.elementType == 'folder' && element.contains == 'pages'" class="p-1 bg-transparent" @click="callToggle(element.urlRelWoF)">
|
||||
<svg v-if="isExpanded(element.urlRelWoF)" class="icon icon-cheveron-up">
|
||||
<use xlink:href="#icon-cheveron-up"></use>
|
||||
</svg>
|
||||
<svg v-else class="icon icon-cheveron-down">
|
||||
<use xlink:href="#icon-cheveron-down"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<navilevel
|
||||
@@ -201,7 +214,8 @@ navigation.component('navilevel',{
|
||||
:list = "element.folderContent"
|
||||
:navigation = "element.folderContent"
|
||||
:parentId = "element.keyPath"
|
||||
:expanded = "expanded" />
|
||||
:expanded = "expanded"
|
||||
:pageaccess = "pageaccess" />
|
||||
</li>
|
||||
</template>
|
||||
<template #footer>
|
||||
@@ -229,6 +243,11 @@ navigation.component('navilevel',{
|
||||
</template>
|
||||
</draggable>`,
|
||||
props: {
|
||||
pageaccess: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
navigation: {
|
||||
type: Array,
|
||||
required: true
|
||||
@@ -359,6 +378,17 @@ navigation.component('navilevel',{
|
||||
return false;
|
||||
*/
|
||||
},
|
||||
isRestricted(element)
|
||||
{
|
||||
if(this.pageaccess)
|
||||
{
|
||||
if(element.allowedrole || element.alloweduser)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
onStart(evt)
|
||||
{
|
||||
eventBus.$emit('backupNavigation');
|
||||
|
@@ -9,6 +9,10 @@
|
||||
<title>{{ translate('ACCOUNT') }}</title>
|
||||
<path d="M18 22.082v-1.649c2.203-1.241 4-4.337 4-7.432 0-4.971 0-9-6-9s-6 4.029-6 9c0 3.096 1.797 6.191 4 7.432v1.649c-6.784 0.555-12 3.888-12 7.918h28c0-4.030-5.216-7.364-12-7.918z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-blocked" viewBox="0 0 32 32">
|
||||
<title>{{ translate('BLOCKED') }}</title>
|
||||
<path d="M27.314 4.686c-3.022-3.022-7.040-4.686-11.314-4.686s-8.292 1.664-11.314 4.686c-3.022 3.022-4.686 7.040-4.686 11.314s1.664 8.292 4.686 11.314c3.022 3.022 7.040 4.686 11.314 4.686s8.292-1.664 11.314-4.686c3.022-3.022 4.686-7.040 4.686-11.314s-1.664-8.292-4.686-11.314zM28 16c0 2.588-0.824 4.987-2.222 6.949l-16.727-16.727c1.962-1.399 4.361-2.222 6.949-2.222 6.617 0 12 5.383 12 12zM4 16c0-2.588 0.824-4.987 2.222-6.949l16.727 16.727c-1.962 1.399-4.361 2.222-6.949 2.222-6.617 0-12-5.383-12-12z"></path>
|
||||
</symbol>
|
||||
<symbol id="icon-cog" viewBox="0 0 32 32">
|
||||
<title>{{ translate('SYSTEM') }}</title>
|
||||
<path d="M29.181 19.070c-1.679-2.908-0.669-6.634 2.255-8.328l-3.145-5.447c-0.898 0.527-1.943 0.829-3.058 0.829-3.361 0-6.085-2.742-6.085-6.125h-6.289c0.008 1.044-0.252 2.103-0.811 3.070-1.679 2.908-5.411 3.897-8.339 2.211l-3.144 5.447c0.905 0.515 1.689 1.268 2.246 2.234 1.676 2.903 0.672 6.623-2.241 8.319l3.145 5.447c0.895-0.522 1.935-0.82 3.044-0.82 3.35 0 6.067 2.725 6.084 6.092h6.289c-0.003-1.034 0.259-2.080 0.811-3.038 1.676-2.903 5.399-3.894 8.325-2.219l3.145-5.447c-0.899-0.515-1.678-1.266-2.232-2.226zM16 22.479c-3.578 0-6.479-2.901-6.479-6.479s2.901-6.479 6.479-6.479c3.578 0 6.479 2.901 6.479 6.479s-2.901 6.479-6.479 6.479z"></path>
|
||||
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user