Update global HTML architecture

This commit is contained in:
Kujiu 2021-12-04 20:04:51 +01:00
parent 8b596c0f6e
commit 5fcb946d10
Signed by: kujiu
GPG key ID: ABBB2CAC6855599F
18 changed files with 1689 additions and 1639 deletions

View file

@ -6,23 +6,36 @@ const {t} = useI18n({useScope: 'local'});
</script> </script>
<template> <template>
<div id="appflex">
<div id="page">
<div class="action-bar">
<router-view name="ActionBar"></router-view>
</div>
<main id="content">
<ReloadPWA/> <ReloadPWA/>
<main>
<router-view></router-view> <router-view></router-view>
</main> </main>
<header> </div>
<router-link to='/apps'> <div id="sidebar" class="sidebar">
<img alt="" src="./assets/logo.svg"/> <router-view name="Sidebar"></router-view>
{{ t('home.apps') }} </div>
</div>
<header class="navbar">
<router-link :to="{name: 'Apps'}" class="home-link">
<img id="main-logo" alt="" src="./assets/logo.svg"/>
<span id="site-name">{{ t('home.apps') }}</span>
</router-link> </router-link>
<div class="links">
<router-view name="Links"></router-view>
<select v-model="$i18n.locale" @change="$i18n.loadMessages()"> <select v-model="$i18n.locale" @change="$i18n.loadMessages()">
<option value="de">Deutsch</option> <option value="de">Deutsch</option>
<option value="en">English</option> <option value="en">English</option>
<option value="fr">Français</option> <option value="fr">Français</option>
<option value="nl">Nederlands</option> <option value="nl">Nederlands</option>
</select> </select>
</div>
</header> </header>
<footer> <footer class="footer">
</footer> </footer>
</template> </template>
@ -42,8 +55,5 @@ const {t} = useI18n({useScope: 'local'});
@import './assets/css/theme-dark-hc.less'; @import './assets/css/theme-dark-hc.less';
</style> </style>
<script>
</script>
<i18n lang="json" locale="en" src="./locale/en.json"/> <i18n lang="json" locale="en" src="./locale/en.json"/>
<i18n lang="json" locale="fr" src="./locale/fr.json"/> <i18n lang="json" locale="fr" src="./locale/fr.json"/>

View file

@ -3,7 +3,7 @@ pre {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.content { #content {
td.linenos, td.code { td.linenos, td.code {
border: none; border: none;
padding: 0; padding: 0;

View file

@ -85,9 +85,11 @@ body {
#app { #app {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
min-height: 100vh;
.navbar { > .navbar {
z-index: 20; z-index: 20;
order: 1;
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
justify-content: space-between; justify-content: space-between;
@ -124,7 +126,8 @@ body {
} }
} }
footer.footer { > footer.footer {
order: 3;
padding: 0.3em;; padding: 0.3em;;
box-sizing: border-box; box-sizing: border-box;
border-top: 0.3em solid var(--FoBClr); border-top: 0.3em solid var(--FoBClr);
@ -146,18 +149,23 @@ body {
list-style-position: outside; list-style-position: outside;
} }
#appflex { > #appflex {
order: 2;
display: flex; display: flex;
flex-flow: row; flex-flow: row;
flex-grow: 1; flex-grow: 1;
> #sidebar {
order: 1;
}
.page { > #page {
width: 100%; width: 100%;
order: 2;
} }
} }
} }
.content:not(.custom) { #content:not(.custom) {
.wrapper(); .wrapper();
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
@ -172,7 +180,7 @@ body {
} }
} }
.content.custom { #content.custom {
padding: 0; padding: 0;
margin: 0; margin: 0;
img { img {
@ -299,7 +307,7 @@ th, td {
.theme-container { .theme-container {
&.no-navbar { &.no-navbar {
.content:not(.custom) > h1, h2, h3, h4, h5, h6 { #content:not(.custom) > h1, h2, h3, h4, h5, h6 {
margin-top: 1.5rem; margin-top: 1.5rem;
padding-top: 0; padding-top: 0;
} }
@ -593,19 +601,13 @@ button, a.btn, a:visited.btn {
} }
} }
#mainlogo { img#main-logo {
text-align: center;
width: 100%;
img {
text-align: center; text-align: center;
width: 2rem;
border-radius: 50%; border-radius: 50%;
width: 90%;
max-width: 15ex;
}
} }
.content:not(.custom) { #content:not(.custom) {
max-width: 90%; max-width: 90%;
} }
@ -704,7 +706,7 @@ blockquote h2 {
} }
/* THE SECTION BELOW FIXES A SPHINX-MERMAID OPACITY PROBLEM */ /* THE SECTION BELOW FIXES A SPHINX-MERMAID OPACITY PROBLEM */
.content .section { #content .section {
opacity: 1.0 !important; opacity: 1.0 !important;
} }
.section { .section {

View file

@ -4,7 +4,7 @@
font-size: 1.1rem; font-size: 1.1rem;
width: var(--sidebarWidth); width: var(--sidebarWidth);
} }
.page { #page {
padding-left: 0; padding-left: 0;
} }
} }
@ -17,7 +17,7 @@
transition: transform .2s ease; transition: transform .2s ease;
margin-right: calc(0rem - var(--sidebarWidth)); margin-right: calc(0rem - var(--sidebarWidth));
} }
.page { #page {
padding-left: 0; padding-left: 0;
margin-left: 0; margin-left: 0;
} }
@ -44,7 +44,7 @@
h1 { h1 {
font-size: 1.9rem; font-size: 1.9rem;
} }
.content { #content {
div[class*="language-"] { div[class*="language-"] {
margin: 0.85rem -1.5rem; margin: 0.85rem -1.5rem;
border-radius: 0; border-radius: 0;

View file

@ -16,7 +16,7 @@
} }
} }
main.content { main#content {
width: 100%; width: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;

View file

@ -11,7 +11,7 @@
margin-right: 0.8rem; margin-right: 0.8rem;
vertical-align: top; vertical-align: top;
} }
.site-name { #site-name {
font-size: 1.3rem; font-size: 1.3rem;
font-weight: 600; font-weight: 600;
color: var(--NvTClr); color: var(--NvTClr);
@ -59,7 +59,7 @@
display: inline-block; display: inline-block;
} }
.page { #page {
padding-top: 0rem; padding-top: 0rem;
padding-bottom: 2rem; padding-bottom: 2rem;
} }
@ -433,7 +433,7 @@ a.sidebar-link, a:visited.sidebar-link {
.sidebar { .sidebar {
display: none; display: none;
} }
.page { #page {
padding-left: 0; padding-left: 0;
} }
img.align-right, figure.align-right { img.align-right, figure.align-right {

View file

@ -1,4 +1,4 @@
.content .section { #content .section {
margin-bottom: 0; margin-bottom: 0;
&:hover { &:hover {
.headerlink { .headerlink {
@ -7,7 +7,7 @@
} }
} }
.content { #content {
// FIXME: sphinx should provide a citation-reference? // FIXME: sphinx should provide a citation-reference?
& a:focus { & a:focus {
// remove outline because padding mess it up // remove outline because padding mess it up
@ -41,7 +41,7 @@ ul.page-nav {
} }
} }
.body-header { .action-bar {
display: flex; display: flex;
& ul.page-nav { & ul.page-nav {
flex-grow: 1; flex-grow: 1;
@ -89,16 +89,16 @@ ul.breadcrumbs {
/** pygments style **/ /** pygments style **/
.content .highlight { #content .highlight {
border-radius: 0.5em; border-radius: 0.5em;
} }
// force background color from pygments // force background color from pygments
.content .highlight pre { #content .highlight pre {
background-color: inherit; background-color: inherit;
} }
.content .highlighted { #content .highlighted {
background-color: var(--AClr); //#fbe54e; background-color: var(--AClr); //#fbe54e;
font-weight: bold; font-weight: bold;
padding: 0 4px; padding: 0 4px;

View file

@ -5,6 +5,12 @@ const {t} = useI18n({useScope: 'local'});
</script> </script>
<template> <template>
<div class="admonition danger" v-if="$route.params.errorPath" role="alert">
<p class="admonition-title">{{ t('apps.not_found') }}</p>
<p>
{{ t('apps.route_not_found', {route: $route.params.errorPath.join('/')}) }}
</p>
</div>
<h1>{{ t('apps.communication') }}</h1> <h1>{{ t('apps.communication') }}</h1>
<h1>{{ t('apps.accounting') }}</h1> <h1>{{ t('apps.accounting') }}</h1>
<h1>{{ t('apps.ordering') }}</h1> <h1>{{ t('apps.ordering') }}</h1>

View file

@ -1,13 +1,12 @@
<template> <template>
<div v-if="offlineReady || needRefresh" role="alert"> <div v-if="offlineReady || needRefresh" role="alert">
<div class="admonition warning"> <div class="admonition warning">
<span v-if="offlineReady"> <p v-if="offlineReady">
{{ t('pwa.ready') }} {{ t('pwa.ready') }}
</span> </p>
<span v-else> <p v-else>
{{ t('pwa.new_content') }} {{ t('pwa.new_content') }}
</span> </p>
</div>
<div class=""> <div class="">
<button v-if="needRefresh" @click="updateServiceWorker()"> <button v-if="needRefresh" @click="updateServiceWorker()">
{{ t('pwa.reload') }} {{ t('pwa.reload') }}
@ -17,6 +16,7 @@
</button> </button>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>

View file

@ -1,10 +1,12 @@
{ {
"apps": { "apps": {
"communication": "", "communication": "Communication",
"accounting": "", "accounting": "Accounting",
"ordering": "", "ordering": "Ordering",
"stocks": "", "stocks": "Stocks",
"monitoring": "" "monitoring": "Monitoring",
"not_found": "Page not found",
"route_not_found": "Url {route} does not exist."
}, },
"home": { "home": {
"apps": "Applications" "apps": "Applications"

View file

@ -4,7 +4,9 @@
"accounting": "Comptabilité", "accounting": "Comptabilité",
"ordering": "Commande", "ordering": "Commande",
"stocks": "Stocks", "stocks": "Stocks",
"monitoring": "Veille" "monitoring": "Veille",
"not_found": "Page introuvable",
"route_not_found": "La route {route} n'existe pas."
}, },
"home": { "home": {
"apps": "Applications" "apps": "Applications"

View file

@ -7,8 +7,36 @@ const Apps = () => import('./components/NervTNApps.vue');
const Dashboard = () => import('./components/Dashboard.vue'); const Dashboard = () => import('./components/Dashboard.vue');
const routes = [ const routes = [
{path: '/', component: Dashboard}, {
{path: '/apps', component: Apps} path: '/',
name: "Dashboard",
components: {
default: Dashboard,
//Links: {},
//Sidebar: {},
//ActionBar: {}
}
},
{
path: '/apps',
name: "Apps",
components: {
default: Apps,
//Links: {},
//Sidebar: {},
//ActionBar: {}
}
},
{
path: '/:errorPath(.*)*',
name: "NotFound",
components: {
default: Apps,
//Links: {},
//Sidebar: {},
//ActionBar: {}
}
}
]; ];
const router = VueRouter.createRouter({ const router = VueRouter.createRouter({