Skip to content

Commit

Permalink
save home view params in workspace
Browse files Browse the repository at this point in the history
- store showoptionspanel display setting
- new default bookmark : all pages
  • Loading branch information
vincent-peugnet committed Aug 5, 2023
1 parent e541ec0 commit 52a2a2a
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
6 changes: 5 additions & 1 deletion app/class/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,17 @@ protected function defaultbookmarks()
$emptytagbookmark->init(
'notags',
$emptytag->getaddress(),
'',
'🏷️',
'No tags',
'Pages that does\'nt have any tag'
);
$all = new Opt();
$allbookmark = new Bookmark();
$allbookmark->init('all', $all->getaddress(), '', 'All', 'Show all pages');
$bookmarkmanager->add($lasteditedbookmark);
$bookmarkmanager->add($lastcreatedbookmark);
$bookmarkmanager->add($emptytagbookmark);
$bookmarkmanager->add($allbookmark);
} catch (RuntimeException $e) {
}
}
Expand Down
11 changes: 11 additions & 0 deletions app/class/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Workspace extends Item
{
protected bool $showeditorleftpanel = true;
protected bool $showeditorrightpanel = false;
protected bool $showeoptionspanel = false;
protected int $fontsize = 15;
protected string $mediadisplay = self::LIST;
protected string $highlighttheme = self::THEME_DEFAULT;
Expand Down Expand Up @@ -37,6 +38,11 @@ public function showeditorrightpanel(): bool
return $this->showeditorrightpanel;
}

public function showeoptionspanel(): bool
{
return $this->showeoptionspanel;
}

public function fontsize(): int
{
return $this->fontsize;
Expand All @@ -62,6 +68,11 @@ public function setshoweditorrightpanel($show)
$this->showeditorrightpanel = boolval($show);
}

public function setshoweoptionspanel($show)
{
$this->showeoptionspanel = boolval($show);
}

public function setfontsize($fontsize)
{
$fontsize = intval($fontsize);
Expand Down
2 changes: 1 addition & 1 deletion app/view/templates/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<?php $this->insert('homebookmark', ['publicbookmarks' => $publicbookmarks, 'personalbookmarks' => $personalbookmarks, 'queryaddress' => $queryaddress]) ?>


<?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user, 'display' => $display]) ?>
<?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user, 'display' => $display, 'workspace' => $workspace]) ?>

<section class="pages">

Expand Down
11 changes: 10 additions & 1 deletion app/view/templates/homemenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,15 @@
</div>
</details>


<span id="save-workspace">

<form action="<?= $this->url('workspaceupdate') ?>" method="post" id="workspace-form">
<input type="hidden" name="showeoptionspanel" value="0">
<button type="submit">
<i class="fa fa-edit"></i>
<span class="text">save workspace</span>
</button>
</form>
</span>

</aside>
2 changes: 1 addition & 1 deletion app/view/templates/homeopt.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="bar">


<input id="showeoptionspanel" name="showeoptionspanel" value="1" class="toggle" type="checkbox" form="workspace-form" checked="">
<input id="showeoptionspanel" name="showeoptionspanel" value="1" class="toggle" type="checkbox" form="workspace-form" <?= $workspace->showeoptionspanel() === true ? 'checked' : '' ?>>
<label for="showeoptionspanel" class="toogle">◧</label>

<div class="panel" id="optionspanel">
Expand Down
5 changes: 5 additions & 0 deletions assets/css/back.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ aside .submenu {
z-index: 10000;
}

aside #save-workspace {
position: absolute;
right: 0;
}


.submenu h2 {
font-size: medium;
Expand Down
4 changes: 0 additions & 4 deletions assets/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,4 @@ div#geomap {
.bookmarks tbody {
display: flex;
}

.bookmarks .block {
/*! flex-direction: row; */
}
}

0 comments on commit 52a2a2a

Please sign in to comment.