Compare commits

..

10 Commits

Author SHA1 Message Date
Simon Vieille d0c072bee5 release v1.3.3 2020-04-25 14:30:02 +02:00
Simon Vieille 95f7eb5980 add options to select the size of icons and texts or hide them 2020-04-25 14:25:51 +02:00
Simon Vieille 18314b260f add 2nd background color 2020-04-25 13:25:41 +02:00
Simon Vieille e3c159b4d6 add 2nd background color 2020-04-25 13:05:01 +02:00
Simon Vieille a48611edf4 indentation 2020-04-22 19:35:56 +02:00
Simon Vieille 5dde7ca850 add padding on icons 2020-04-22 19:30:04 +02:00
Simon Vieille db2f7becae add documentation 2020-04-22 00:42:47 +02:00
Simon Vieille 1715ae5d52 release v1.3.2 2020-04-20 19:52:02 +02:00
Simon Vieille 847fa23345 add support message 2020-04-20 19:51:54 +02:00
Simon Vieille 0495046d02 fix #9: apply a patch to correctly generate an image path 2020-04-20 19:24:37 +02:00
10 changed files with 202 additions and 38 deletions
+33
View File
@@ -0,0 +1,33 @@
## Feature
### Description
...
### Benefits
...
---
## Issue
### Environment
* Side menu version: ...
* PHP version: ...
* Web server (Nginx, Apache2): ...
### Steps to reproduce
* ...
* ...
* ...
### Observed Results
...
### Expected Results
...
+11 -4
View File
@@ -1,8 +1,8 @@
🤙 Nextcloud app / Side menu 🎨 🤙 Nextcloud app / Side menu 🎨
=============================== ===============================
Side menu allows you to modify the position of the main menu by creating a panel on the left of the interface.
This application moves the top menu of Nextcloud to the left side. This application is rather suitable for instances that activate a lot of applications.
Comptatible with AppOrder. Comptatible with AppOrder.
@@ -39,13 +39,20 @@ $ unzip -d side_menu /path/to/side_menu_vX.Y.Z.zip
![](https://upload.deblan.org/u/2020-03/5e81b219.jpg) ![](https://upload.deblan.org/u/2020-03/5e81b219.jpg)
![](https://upload.deblan.org/u/2020-04/5e9d9058.png) ![](https://upload.deblan.org/u/2020-04/5ea42d1a.png)
How to contribute? How to contribute?
------------------ ------------------
Fork the repository, go to `apps/`, clone your repository and run `npm install` inside. You can report a bug or request a feature by opening an issue: https://gitnet.fr/deblan/side_menu/issues
If you are a developer:
* fork the repository
* install an instance of Nextcloud
* go to `apps/` and clone your repository
* go to `apps/side_menu` and run `npm install`
Build javascripts using `webpack --config ./webpack.js` (add `-w` to build them in real time). Build javascripts using `webpack --config ./webpack.js` (add `-w` to build them in real time).
+10 -3
View File
@@ -3,10 +3,17 @@
<id>side_menu</id> <id>side_menu</id>
<name>Side menu</name> <name>Side menu</name>
<summary>Move the top menu to the left side.</summary> <summary>Move the top menu to the left side.</summary>
<description>Move the top menu to the left side.</description> <description><![CDATA[Side menu allows you to modify the position of the main menu by creating a panel on the left of the interface.
This application is rather suitable for instances that activate a lot of applications.
Comptatible with AppOrder.
You can report a bug or request a feature by opening an issue
]]></description>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="dev+sidemenu@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author> <author mail="dev+sidemenu@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<version>1.3.1</version> <version>1.3.3</version>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
<category>customization</category> <category>customization</category>
<website>https://gitnet.fr/deblan/side_menu</website> <website>https://gitnet.fr/deblan/side_menu</website>
@@ -14,7 +21,7 @@
<repository type="git">https://gitnet.fr/deblan/side_menu</repository> <repository type="git">https://gitnet.fr/deblan/side_menu</repository>
<screenshot>https://upload.deblan.org/u/2020-03/5e7fab2b.jpg</screenshot> <screenshot>https://upload.deblan.org/u/2020-03/5e7fab2b.jpg</screenshot>
<screenshot>https://upload.deblan.org/u/2020-03/5e81b219.jpg</screenshot> <screenshot>https://upload.deblan.org/u/2020-03/5e81b219.jpg</screenshot>
<screenshot>https://upload.deblan.org/u/2020-04/5e9d9058.png</screenshot> <screenshot>https://upload.deblan.org/u/2020-04/5ea42d1a.png</screenshot>
<dependencies> <dependencies>
<nextcloud min-version="18" max-version="18"/> <nextcloud min-version="18" max-version="18"/>
</dependencies> </dependencies>
+3 -3
View File
@@ -26,7 +26,7 @@
height: 100vh; height: 100vh;
width: 100%; width: 100%;
max-width: 250px; max-width: 250px;
background: var(--side-menu-background-color, #333); background: linear-gradient(90deg, var(--side-menu-background-color, #333) 0%, var(--side-menu-background-color-to, #333) 100%);
z-index: 3000; z-index: 3000;
color: var(--side-menu-text-color, #fff); color: var(--side-menu-text-color, #fff);
box-shadow: rgba(0, 0, 0, 0.22) 0px 25.6px 57.6px 0px, rgba(0, 0, 0, 0.18) 0px 4.8px 14.4px 0px; box-shadow: rgba(0, 0, 0, 0.22) 0px 25.6px 57.6px 0px, rgba(0, 0, 0, 0.18) 0px 4.8px 14.4px 0px;
@@ -63,13 +63,14 @@
width: 20px; width: 20px;
vertical-align: middle; vertical-align: middle;
margin-right: 10px; margin-right: 10px;
padding-top: 3px;
} }
.side-menu-app a { .side-menu-app a {
line-height: 30px; line-height: 30px;
color: var(--side-menu-text-color, #fff); color: var(--side-menu-text-color, #fff);
display: block; display: block;
padding: 7px 0 7px 15px; padding: 7px 0 5px 15px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@@ -93,7 +94,6 @@
width: 100%; width: 100%;
z-index: 2300; z-index: 2300;
max-width: 250px; max-width: 250px;
background: var(--side-menu-background-color, #333);
position: fixed; position: fixed;
padding-top: 2px; padding-top: 2px;
top: 0; top: 0;
+6 -5
View File
@@ -51,19 +51,20 @@ class CssController extends Controller
*/ */
public function stylesheet() public function stylesheet()
{ {
$requestUri = $this->request->server['REQUEST_URI']; $backgroundColor = $this->config->getAppValue('side_menu', 'background-color', '#333333');
$assetsRoot = str_replace('/index.php', '', $requestUri); $backgroundColorTo = $this->config->getAppValue('side_menu', 'background-color-to', $backgroundColor);
$assetsRoot = preg_replace('#apps/side_menu/.*#s', 'apps/side_menu', $assetsRoot);
$parameters = [ $parameters = [
'vars' => [ 'vars' => [
'background-color' => $this->config->getAppValue('side_menu', 'background-color', '#333333'), 'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'), 'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'), 'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'), 'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
], ],
'display-logo' => (bool) $this->config->getAppValue('side_menu', 'display-logo', 1), 'display-logo' => (bool) $this->config->getAppValue('side_menu', 'display-logo', 1),
'assetsRoot' => $assetsRoot, 'size-icon' => $this->config->getAppValue('side_menu', 'size-icon', 'normal'),
'size-text' => $this->config->getAppValue('side_menu', 'size-text', 'normal'),
]; ];
$response = new TemplateResponse('side_menu', 'css/stylesheet', $parameters, 'blank'); $response = new TemplateResponse('side_menu', 'css/stylesheet', $parameters, 'blank');
+7 -1
View File
@@ -47,8 +47,12 @@ class Admin implements ISettings
*/ */
public function getForm() public function getForm()
{ {
$backgroundColor = $this->config->getAppValue('side_menu', 'background-color', '#333333');
$backgroundColorTo = $this->config->getAppValue('side_menu', 'background-color-to', $backgroundColor);
$parameters = [ $parameters = [
'background-color' => $this->config->getAppValue('side_menu', 'background-color', '#333333'), 'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'), 'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'), 'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'), 'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
@@ -56,6 +60,8 @@ class Admin implements ISettings
'display-logo' => $this->config->getAppValue('side_menu', 'display-logo', '1'), 'display-logo' => $this->config->getAppValue('side_menu', 'display-logo', '1'),
'opener-position' => $this->config->getAppValue('side_menu', 'opener-position', 'before'), 'opener-position' => $this->config->getAppValue('side_menu', 'opener-position', 'before'),
'opener-hover' => $this->config->getAppValue('side_menu', 'opener-hover', '0'), 'opener-hover' => $this->config->getAppValue('side_menu', 'opener-hover', '0'),
'size-icon' => $this->config->getAppValue('side_menu', 'size-icon', 'normal'),
'size-text' => $this->config->getAppValue('side_menu', 'size-text', 'normal'),
]; ];
return new TemplateResponse('side_menu', 'settings/admin-form', $parameters, ''); return new TemplateResponse('side_menu', 'settings/admin-form', $parameters, '');
+6 -3
View File
@@ -28,8 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<li v-for="app in apps" v-bind:class="{'side-menu-app': true, 'active': app.active}"> <li v-for="app in apps" v-bind:class="{'side-menu-app': true, 'active': app.active}">
<a v-bind:href="app.href"> <a v-bind:href="app.href">
<span class="side-menu-app-icon" v-html="app.icon"></span> <span class="side-menu-app-icon" v-html="app.icon"></span>
<span class="side-menu-app-text" v-html="app.name"></span>
{{ app.name }}
</a> </a>
</li> </li>
</ul> </ul>
@@ -54,10 +53,14 @@ export default {
let href = element.getAttribute('href') let href = element.getAttribute('href')
if (href !== '#') { if (href !== '#') {
let svg = element.querySelector('svg').outerHTML
svg = svg.replace(/(height|width)="20"/, '')
this.apps.push({ this.apps.push({
href: href, href: href,
name: element.querySelector('span').innerHTML, name: element.querySelector('span').innerHTML,
icon: element.querySelector('svg').outerHTML, icon: svg,
active: element.classList.contains('active') active: element.classList.contains('active')
}); });
} }
+3
View File
@@ -17,12 +17,15 @@
const elements = [ const elements = [
'side-menu-background-color', 'side-menu-background-color',
'side-menu-background-color-to',
'side-menu-current-app-background-color', 'side-menu-current-app-background-color',
'side-menu-text-color', 'side-menu-text-color',
'side-menu-opener', 'side-menu-opener',
'side-menu-opener-position', 'side-menu-opener-position',
'side-menu-opener-hover', 'side-menu-opener-hover',
'side-menu-display-logo', 'side-menu-display-logo',
'side-menu-size-icon',
'side-menu-size-text',
'side-menu-cache', 'side-menu-cache',
]; ];
+71 -18
View File
@@ -1,7 +1,7 @@
:root { :root {
<?php foreach ($_['vars'] as $key => $value): ?> <?php foreach ($_['vars'] as $key => $value): ?>
<?php if ($key === 'opener'): ?> <?php if ($key === 'opener'): ?>
--side-menu-<?php echo $key ?>: url('<?php echo $_['assetsRoot'] ?>/img/<?php echo $value ?>.svg'); --side-menu-<?php echo $key ?>: url('<?php print_unescaped(image_path('side_menu', $value.'.svg')); ?>');
<?php else: ?> <?php else: ?>
--side-menu-<?php echo $key ?>: <?php echo $value ?>; --side-menu-<?php echo $key ?>: <?php echo $value ?>;
<?php endif; ?> <?php endif; ?>
@@ -9,25 +9,78 @@
} }
<?php if ($_['display-logo'] === false): ?> <?php if ($_['display-logo'] === false): ?>
.side-menu-logo { .side-menu-logo {
display: none; display: none;
} }
.side-menu-header { .side-menu-header {
height: 50px; height: 50px;
} }
.side-menu-apps-list { .side-menu-apps-list {
height: calc(100vh - 60px); height: calc(100vh - 60px);
top: 60px; top: 60px;
} }
#side-menu.hide-opener .side-menu-header { #side-menu.hide-opener .side-menu-header {
display: none; display: none;
} }
#side-menu.hide-opener .side-menu-apps-list { #side-menu.hide-opener .side-menu-apps-list {
height: calc(100vh); height: calc(100vh);
top: 0; top: 0;
} }
<?php if ($_['size-text'] === 'hidden'): ?>
#side-menu, .side-menu-apps-list {
<?php if ($_['size-icon'] === 'big'): ?>
width: 55px;
<?php else: ?>
width: 52px;
<?php endif; ?>
}
#side-menu .side-menu-opener {
<?php if ($_['size-icon'] === 'big'): ?>
margin-left: 6px;
<?php else: ?>
margin-left: 4px;
<?php endif; ?>
}
<?php endif; ?>
<?php endif; ?>
<?php if ($_['size-icon'] === 'hidden'): ?>
.side-menu-app-icon {
display: none;
}
<?php elseif ($_['size-icon'] === 'small'): ?>
.side-menu-app-icon svg {
width: 15px;
height: 15px;
}
<?php elseif ($_['size-icon'] === 'normal'): ?>
.side-menu-app-icon svg {
width: 20px;
height: 20px;
}
<?php elseif ($_['size-icon'] === 'big'): ?>
.side-menu-app-icon svg {
width: 23px;
height: 23px;
}
<?php endif; ?>
<?php if ($_['size-text'] === 'hidden'): ?>
.side-menu-app-text {
display: none;
}
<?php elseif ($_['size-text'] === 'small'): ?>
.side-menu-app-text {
font-size: 12px;
}
<?php elseif ($_['size-text'] === 'big'): ?>
.side-menu-app-text {
font-size: 16px;
}
<?php endif; ?> <?php endif; ?>
+52 -1
View File
@@ -18,11 +18,19 @@
script('side_menu', 'admin'); script('side_menu', 'admin');
style('side_menu', 'admin'); style('side_menu', 'admin');
style('side_menu', 'support');
$choicesYesNo = [ $choicesYesNo = [
'No' => '0', 'No' => '0',
'Yes' => '1', 'Yes' => '1',
]; ];
$choicesSizes = [
'Hidden' => 'hidden',
'Small' => 'small',
'Normal' => 'normal',
'Big' => 'big',
];
?> ?>
<div id="side-menu-section"> <div id="side-menu-section">
@@ -42,6 +50,11 @@ $choicesYesNo = [
name="background-color" name="background-color"
type="color" type="color"
value="<?php print_unescaped($_['background-color']); ?>"> value="<?php print_unescaped($_['background-color']); ?>">
<input
id="side-menu-background-color-to"
name="background-color-to"
type="color"
value="<?php print_unescaped($_['background-color-to']); ?>">
</div> </div>
<div> <div>
@@ -70,7 +83,7 @@ $choicesYesNo = [
value="<?php print_unescaped($_['text-color']); ?>"> value="<?php print_unescaped($_['text-color']); ?>">
</div> </div>
</div> </div>
<div class="section"> <div class="section">
<h2> <h2>
<?php p($l->t('Opener')); ?> <?php p($l->t('Opener')); ?>
@@ -159,6 +172,30 @@ $choicesYesNo = [
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div>
<label class="settings-hint">
<?php p($l->t('Icons and texts')); ?>
</label>
</div>
<div>
<select id="side-menu-size-icon" name="size-icon">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> icon
</option>
<?php endforeach; ?>
</select>
<select id="side-menu-size-text" name="size-text">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-text']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> text
</option>
<?php endforeach; ?>
</select>
</div>
</div> </div>
<div class="section"> <div class="section">
@@ -167,5 +204,19 @@ $choicesYesNo = [
<button id="side-menu-save" class="btn btn-primary"><?php p($l->t('Save')); ?></button> <button id="side-menu-save" class="btn btn-primary"><?php p($l->t('Save')); ?></button>
<span id="side-menu-message" class="msg"></span> <span id="side-menu-message" class="msg"></span>
<div style="height: 30px"></div>
<div>
<span for="side-menu-opener" class="settings-hint">
<?php p($l->t('You like this app and you want to support me?')); ?>
<a style="margin-left: 10px" target="_blank" href="https://www.buymeacoffee.com/deblan">
<button>
<?php p($l->t('Buy me a coffe ☕')); ?>
</button>
</a>
</span>
</div>
</div> </div>
</div> </div>