diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-04-14 16:36:45 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-04-14 16:36:45 +0200 |
commit | 8ccc4ac00c974ba3659762e6c67f75ed82020e37 (patch) | |
tree | fc9a5b656ca13b34cb2eaac6e909b0b59ca839e8 /app/view/templates/home.php | |
parent | ce3fcb72f2d5d154461a14183069bf87db1e5776 (diff) | |
download | wcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.tar.gz wcms-8ccc4ac00c974ba3659762e6c67f75ed82020e37.zip |
finish flashmessages implementation
+ clean css
Diffstat (limited to 'app/view/templates/home.php')
-rw-r--r-- | app/view/templates/home.php | 392 |
1 files changed, 194 insertions, 198 deletions
diff --git a/app/view/templates/home.php b/app/view/templates/home.php index d6d1f51..387ef0c 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -6,243 +6,239 @@ <?php $this->start('page') ?> -<body> - <?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'home', 'pagelist' => $pagelist]) ?> +<?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'home', 'pagelist' => $pagelist]) ?> - <?php if ($user->iseditor()) { ?> +<?php if ($user->iseditor()) { ?> - <?php - $optlist = $optlist ?? null; - $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist, 'pagelist' => $pagelist, 'faviconlist' => $faviconlist, 'thumbnaillist' => $thumbnaillist, 'editorlist' => $editorlist, 'colors' => $colors]); - ?> +<?php + $optlist = $optlist ?? null; + $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist, 'pagelist' => $pagelist, 'faviconlist' => $faviconlist, 'thumbnaillist' => $thumbnaillist, 'editorlist' => $editorlist, 'colors' => $colors]); +?> - <main class="home"> +<main class="home"> - <?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user, 'display' => $display]) ?> + <?php $this->insert('homeopt', ['opt' => $opt, 'user' => $user, 'display' => $display]) ?> - <section class="pages"> + <section class="pages"> - <div class="block"> + <div class="block"> - <h2 class="hidephone">Pages (<?= count($pagelistopt) ?>) <span class="right"><a href="?display=list" <?= $display === 'list' ? 'style="color: white"' : '' ?> >list</a> / <a href="?display=map" <?= $display === 'map' ? 'style="color: white"' : '' ?> >map</a></span> </h2> + <h2 class="hidephone">Pages (<?= count($pagelistopt) ?>) <span class="right"><a href="?display=list" <?= $display === 'list' ? 'style="color: white"' : '' ?> >list</a> / <a href="?display=map" <?= $display === 'map' ? 'style="color: white"' : '' ?> >map</a></span> </h2> - <?php if($display === 'map') { ?> + <?php if($display === 'map') { ?> - <!-- ___________________ M A P _________________________ --> + <!-- ___________________ M A P _________________________ --> - <div id="deepsearchbar"> - <form action="" method="get"> - <input type="hidden" name="display" value="map"> - <input type="checkbox" name="showorphans" value="1" id="showorphans" <?= $showorphans ? 'checked' : '' ?>> - <label for="showorphans">show orphans pages</label> - <input type="checkbox" name="showredirection" value="1" id="showredirection" <?= $showredirection ? 'checked' : '' ?>> - <label for="showredirection">show redirections</label> - <select name="layout" id="layout"> - <?= options(Wcms\Model::MAP_LAYOUTS, $layout) ?> - </select> - <label for="layout">graph layout</label> - <input type="submit" value="update"> - </form> - </div> - - <div id="graph"></div> - - <script> - var data = <?= $json ?>; - console.log(data); - </script> - - <script src="<?= Wcms\Model::jspath() ?>map.bundle.js"></script> - - <?php } else { ?> - - <!-- ___________________ D E E P _________________________ --> - - <div id="deepsearchbar" class="hidephone"> - <form action="<?= $this->url('home') ?>" method="get"> - <input type="text" name="search" value="<?= $deepsearch ?>" id="deepsearch" placeholder="deep search"> - <input type="checkbox" name="id" id="deepid" value="1" <?= $searchopt['id'] ? 'checked' : '' ?>> - <label for="deepid">id</label> - <input type="checkbox" name="title" id="deeptitle" value="1" <?= $searchopt['title'] ? 'checked' : '' ?>> - <label for="deeptitle">title</label> - <input type="checkbox" name="description" id="deepdescription" value="1" <?= $searchopt['description'] ? 'checked' : '' ?>> - <label for="deepdescription">description</label> - <input type="checkbox" name="content" id="deepcontent" value="1" <?= $searchopt['content'] ? 'checked' : '' ?>> - <label for="deepcontent" title="Markdown content : MAIN, HEADER, NAV, ASIDE, FOOTER">content</label> - <input type="checkbox" name="other" id="deepother" value="1" <?= $searchopt['other'] ? 'checked' : '' ?>> - <label for="deepother" title="Structure content : BODY, CSS, Javascript">other</label> - <input type="checkbox" name="case" id="deepcase" value="1" <?= $searchopt['casesensitive'] ? 'checked' : '' ?>> - <label for="deepcase" title="Case sensitive or not">case sensitive</label> - <input type="submit" value="search"> - </form> - </div> - - - <!-- ___________________ T A B L E _______________________ --> + <div id="deepsearchbar"> + <form action="" method="get"> + <input type="hidden" name="display" value="map"> + <input type="checkbox" name="showorphans" value="1" id="showorphans" <?= $showorphans ? 'checked' : '' ?>> + <label for="showorphans">show orphans pages</label> + <input type="checkbox" name="showredirection" value="1" id="showredirection" <?= $showredirection ? 'checked' : '' ?>> + <label for="showredirection">show redirections</label> + <select name="layout" id="layout"> + <?= options(Wcms\Model::MAP_LAYOUTS, $layout) ?> + </select> + <label for="layout">graph layout</label> + <input type="submit" value="update"> + </form> + </div> + <div id="graph"></div> + + <script> + var data = <?= $json ?>; + console.log(data); + </script> + + <script src="<?= Wcms\Model::jspath() ?>map.bundle.js"></script> + + <?php } else { ?> + + <!-- ___________________ D E E P _________________________ --> + + <div id="deepsearchbar" class="hidephone"> + <form action="<?= $this->url('home') ?>" method="get"> + <input type="text" name="search" value="<?= $deepsearch ?>" id="deepsearch" placeholder="deep search"> + <input type="checkbox" name="id" id="deepid" value="1" <?= $searchopt['id'] ? 'checked' : '' ?>> + <label for="deepid">id</label> + <input type="checkbox" name="title" id="deeptitle" value="1" <?= $searchopt['title'] ? 'checked' : '' ?>> + <label for="deeptitle">title</label> + <input type="checkbox" name="description" id="deepdescription" value="1" <?= $searchopt['description'] ? 'checked' : '' ?>> + <label for="deepdescription">description</label> + <input type="checkbox" name="content" id="deepcontent" value="1" <?= $searchopt['content'] ? 'checked' : '' ?>> + <label for="deepcontent" title="Markdown content : MAIN, HEADER, NAV, ASIDE, FOOTER">content</label> + <input type="checkbox" name="other" id="deepother" value="1" <?= $searchopt['other'] ? 'checked' : '' ?>> + <label for="deepother" title="Structure content : BODY, CSS, Javascript">other</label> + <input type="checkbox" name="case" id="deepcase" value="1" <?= $searchopt['casesensitive'] ? 'checked' : '' ?>> + <label for="deepcase" title="Case sensitive or not">case sensitive</label> + <input type="submit" value="search"> + </form> + </div> - <div class="scroll"> - <table id="home2table"> - <thead> - <tr> - <?php if($user->issupereditor()) { ?><th id="checkall" class="hidephone">x</th> <?php } ?> - <?php if($columns['favicon']) { ?> - <th class="favicon"><a href="<?= $opt->sortbyorder('favicon') ?>">ico</a></th> - <?php } ?> - <th class="id"><a href="<?= $opt->sortbyorder('id') ?>">id</a></th> - <th>edit</th> - <th>see</th> - <th class="delete" title="delete page">del</th> - <?php if ($user->issupereditor()) { ?> - <th class="download hidephone" title="download page as json">dl</th> - <?php } + <!-- ___________________ T A B L E _______________________ --> + + + <div class="scroll"> + + <table id="home2table"> + <thead> + <tr> + <?php if($user->issupereditor()) { ?><th id="checkall" class="hidephone">x</th> <?php } ?> + <?php if($columns['favicon']) { ?> + <th class="favicon"><a href="<?= $opt->sortbyorder('favicon') ?>">ico</a></th> + <?php } ?> + <th class="id"><a href="<?= $opt->sortbyorder('id') ?>">id</a></th> + <th>edit</th> + <th>see</th> + <th class="delete" title="delete page">del</th> + <?php if ($user->issupereditor()) { ?> + <th class="download hidephone" title="download page as json">dl</th> + <?php } + if ($columns['tag']) { ?> + <th class="tag"><a href="<?= $opt->sortbyorder('tag') ?>">tag</a></th> + <?php } + if ($columns['title']) { ?> + <th class="title"><a href="<?= $opt->sortbyorder('title') ?>">title</a></th> + <?php } + if ($columns['description']) { ?> + <th class="summary">summary</th> + <?php } + if ($columns['linkto']) { ?> + <th class="linkto"><a href="<?= $opt->sortbyorder('linkto') ?>">linkto</a></th> + <?php } + if ($columns['datemodif']) { ?> + <th class="datemodif"><a href="<?= $opt->sortbyorder('datemodif') ?>">last modification</a></th> + <?php } + if ($columns['datecreation']) { ?> + <th class="datecreation"><a href="<?= $opt->sortbyorder('datecreation') ?>">date of creation</a></th> + <?php } + if ($columns['date']) { ?> + <th class="date"><a href="<?= $opt->sortbyorder('date') ?>">date</a></th> + <?php } + if ($columns['secure']) { ?> + <th class="secure"><a href="<?= $opt->sortbyorder('secure') ?>">privacy</a></th> + <?php } + if ($columns['authors']) { ?> + <th class="authors"><a href="<?= $opt->sortbyorder('authors') ?>">authors</a></th> + <?php } + if ($columns['visitcount']) { ?> + <th class="visitcount"><a href="<?= $opt->sortbyorder('visitcount') ?>">visit</a></th> + <?php } + if ($columns['editcount']) { ?> + <th class="editcount"><a href="<?= $opt->sortbyorder('editcount') ?>">edit</a></th> + <?php } + if ($columns['affcount']) { ?> + <th class="affcount"><a href="<?= $opt->sortbyorder('affcount') ?>">aff</a></th> + <?php } ?> + </tr> + </thead> + <tbody> + <?php foreach ($pagelistopt as $item) { ?> + <tr> + <?php if($user->issupereditor()) { ?><td class="hidephone"><input type="checkbox" name="pagesid[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>" form="multi"></td><?php } ?> + <?php if($columns['favicon']) { ?> + <td class="favicon"><img class="favicon" src="<?= Wcms\Model::faviconpath() . $item->favicon() ?>" alt="<?= $item->favicon() ?>" title="<?= $item->favicon() ?>"></td> + <?php } ?> + <td class="id"><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td> + <td><?php if($user->issupereditor() || in_array($user->id(), $item->authors())) { ?><a href="<?= $this->upage('pageedit', $item->id()) ?>"><img src="<?= Wcms\Model::iconpath() ?>edit.png" class="icon"></a><?php } ?></td> + <td><a href="<?= $this->upage('pageread/', $item->id()) ?>" target="_blank"><img src="<?= Wcms\Model::iconpath() ?>read.png" class="icon"></a></td> + <td class="delete"><?php if($user->issupereditor() || $item->authors() === [$user->id()]) { ?><a href="<?= $this->upage('pagedelete', $item->id()) ?>">✖</a><?php } ?></td> + <?php if ($user->issupereditor()) { ?> + <td class="hidephone"><a href="<?= $this->upage('pagedownload', $item->id()) ?>" download><img src="<?= Wcms\Model::iconpath() ?>download.png" class="icon"></a></td> + <?php } if ($columns['tag']) { ?> - <th class="tag"><a href="<?= $opt->sortbyorder('tag') ?>">tag</a></th> - <?php } + <td class="tag"><?= $opt->taglinks($item->tag('array')) ?></td> + <?php } if ($columns['title']) { ?> - <th class="title"><a href="<?= $opt->sortbyorder('title') ?>">title</a></th> - <?php } + <td class="title" title="<?= $item->title() ?>"><label for="id_<?= $item->id() ?>"><?= $item->title() ?></label></td> + <?php } if ($columns['description']) { ?> - <th class="summary">summary</th> - <?php } + <td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td> + <?php } if ($columns['linkto']) { ?> - <th class="linkto"><a href="<?= $opt->sortbyorder('linkto') ?>">linkto</a></th> - <?php } + <td class="linkto"><?= $opt->linktolink($item->linkto('array')) ?></td> + <?php } if ($columns['datemodif']) { ?> - <th class="datemodif"><a href="<?= $opt->sortbyorder('datemodif') ?>">last modification</a></th> - <?php } + <td class="datemodif" <?= $item->datemodif('dmy') ?> <?= $item->datemodif('ptime') ?>><time datetime="<?= $item->datemodif('string') ?>" title="<?= $item->datemodif('dmy') . ' ' . $item->datemodif('ptime') ?>"><?= $item->datemodif('hrdi') ?></time></td> + <?php } if ($columns['datecreation']) { ?> - <th class="datecreation"><a href="<?= $opt->sortbyorder('datecreation') ?>">date of creation</a></th> - <?php } + <td class="datecreation" <?= $item->datecreation('dmy') ?> <?= $item->datecreation('ptime') ?>><time datetime="<?= $item->datecreation('string') ?>" title="<?= $item->datecreation('dmy') . ' ' . $item->datecreation('ptime') ?>"><?= $item->datecreation('hrdi') ?></time></td> + <?php } if ($columns['date']) { ?> - <th class="date"><a href="<?= $opt->sortbyorder('date') ?>">date</a></th> - <?php } + <td class="date" <?= $item->date('dmy') ?> <?= $item->date('ptime') ?>><time datetime="<?= $item->date('string') ?>" title="<?= $item->date('dmy') . ' ' . $item->date('ptime') ?>"><?= $item->date('dmy') ?></time></td> + <?php } if ($columns['secure']) { ?> - <th class="secure"><a href="<?= $opt->sortbyorder('secure') ?>">privacy</a></th> - <?php } + <td class="secure"><?= $opt->securelink($item->secure('int') , $item->secure('string')) ?></td> + <?php } if ($columns['authors']) { ?> - <th class="authors"><a href="<?= $opt->sortbyorder('authors') ?>">authors</a></th> - <?php } + <td class="authors"><?= $opt->authorlinks($item->authors('array')) ?></td> + <?php } if ($columns['visitcount']) { ?> - <th class="visitcount"><a href="<?= $opt->sortbyorder('visitcount') ?>">visit</a></th> - <?php } + <td class="visitcount"><?= $item->visitcount() ?></td> + <?php } if ($columns['editcount']) { ?> - <th class="editcount"><a href="<?= $opt->sortbyorder('editcount') ?>">edit</a></th> - <?php } + <td class="editcount"><?= $item->editcount() ?></td> + <?php } if ($columns['affcount']) { ?> - <th class="affcount"><a href="<?= $opt->sortbyorder('affcount') ?>">aff</a></th> - <?php } ?> - </tr> - </thead> - <tbody> - <?php foreach ($pagelistopt as $item) { ?> - <tr> - <?php if($user->issupereditor()) { ?><td class="hidephone"><input type="checkbox" name="pagesid[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>" form="multi"></td><?php } ?> - <?php if($columns['favicon']) { ?> - <td class="favicon"><img class="favicon" src="<?= Wcms\Model::faviconpath() . $item->favicon() ?>" alt="<?= $item->favicon() ?>" title="<?= $item->favicon() ?>"></td> - <?php } ?> - <td class="id"><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td> - <td><?php if($user->issupereditor() || in_array($user->id(), $item->authors())) { ?><a href="<?= $this->upage('pageedit', $item->id()) ?>"><img src="<?= Wcms\Model::iconpath() ?>edit.png" class="icon"></a><?php } ?></td> - <td><a href="<?= $this->upage('pageread/', $item->id()) ?>" target="_blank"><img src="<?= Wcms\Model::iconpath() ?>read.png" class="icon"></a></td> - <td class="delete"><?php if($user->issupereditor() || $item->authors() === [$user->id()]) { ?><a href="<?= $this->upage('pagedelete', $item->id()) ?>">✖</a><?php } ?></td> - <?php if ($user->issupereditor()) { ?> - <td class="hidephone"><a href="<?= $this->upage('pagedownload', $item->id()) ?>" download><img src="<?= Wcms\Model::iconpath() ?>download.png" class="icon"></a></td> - <?php } - if ($columns['tag']) { ?> - <td class="tag"><?= $opt->taglinks($item->tag('array')) ?></td> - <?php } - if ($columns['title']) { ?> - <td class="title" title="<?= $item->title() ?>"><label for="id_<?= $item->id() ?>"><?= $item->title() ?></label></td> - <?php } - if ($columns['description']) { ?> - <td class="summary" title="<?= $item->description() ?>"><?= $item->description('short') ?></td> - <?php } - if ($columns['linkto']) { ?> - <td class="linkto"><?= $opt->linktolink($item->linkto('array')) ?></td> - <?php } - if ($columns['datemodif']) { ?> - <td class="datemodif" <?= $item->datemodif('dmy') ?> <?= $item->datemodif('ptime') ?>><time datetime="<?= $item->datemodif('string') ?>" title="<?= $item->datemodif('dmy') . ' ' . $item->datemodif('ptime') ?>"><?= $item->datemodif('hrdi') ?></time></td> - <?php } - if ($columns['datecreation']) { ?> - <td class="datecreation" <?= $item->datecreation('dmy') ?> <?= $item->datecreation('ptime') ?>><time datetime="<?= $item->datecreation('string') ?>" title="<?= $item->datecreation('dmy') . ' ' . $item->datecreation('ptime') ?>"><?= $item->datecreation('hrdi') ?></time></td> - <?php } - if ($columns['date']) { ?> - <td class="date" <?= $item->date('dmy') ?> <?= $item->date('ptime') ?>><time datetime="<?= $item->date('string') ?>" title="<?= $item->date('dmy') . ' ' . $item->date('ptime') ?>"><?= $item->date('dmy') ?></time></td> - <?php } - if ($columns['secure']) { ?> - <td class="secure"><?= $opt->securelink($item->secure('int') , $item->secure('string')) ?></td> - <?php } - if ($columns['authors']) { ?> - <td class="authors"><?= $opt->authorlinks($item->authors('array')) ?></td> - <?php } - if ($columns['visitcount']) { ?> - <td class="visitcount"><?= $item->visitcount() ?></td> - <?php } - if ($columns['editcount']) { ?> - <td class="editcount"><?= $item->editcount() ?></td> - <?php } - if ($columns['affcount']) { ?> - <td class="affcount"><?= $item->affcount() ?></td> - <?php } ?> - </tr> - - <?php } ?> - </tbody> - </table> - </div> - - <?php } ?> - - </div> + <td class="affcount"><?= $item->affcount() ?></td> + <?php } ?> + </tr> - </section> - - - <?php if($user->display()['bookmark'] && (!empty(Wcms\Config::bookmark()) || !empty($user->bookmark()))) { ?> - - <section class="hidephone" id="bookmark"> - <div class="block"> - <h2>Bookmarks</h2> - <div class="scroll"> - <strong>Public</strong> - <ul> - <?php foreach (Wcms\Config::bookmark() as $id => $query) { ?> - <li> - <a href="<?= $query ?>"><?= $id ?></a> - </li> - <?php } ?> - </ul> - <strong><?= $user->id() ?></strong> - <ul> - <?php foreach ($user->bookmark() as $id => $query) { ?> - <li> - <a href="<?= $query ?>"><?= $id ?></a> - </li> - <?php } ?> - </ul> - </section> + <?php } ?> + </tbody> + </table> </div> - </nav> - <?php } ?> + <?php } ?> + + </div> + + </section> + + + <?php if($user->display()['bookmark'] && (!empty(Wcms\Config::bookmark()) || !empty($user->bookmark()))) { ?> + + <section class="hidephone" id="bookmark"> + <div class="block"> + <h2>Bookmarks</h2> + <div class="scroll"> + <strong>Public</strong> + <ul> + <?php foreach (Wcms\Config::bookmark() as $id => $query) { ?> + <li> + <a href="<?= $query ?>"><?= $id ?></a> + </li> + <?php } ?> + </ul> + <strong><?= $user->id() ?></strong> + <ul> + <?php foreach ($user->bookmark() as $id => $query) { ?> + <li> + <a href="<?= $query ?>"><?= $id ?></a> + </li> + <?php } ?> + </ul> + </section> + </div> + </nav> - </main> - - <?php $this->insert('footer', ['footer' => $footer]) ?> + <?php } ?> - <script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script> +</main> - <?php } ?> +<?php $this->insert('footer', ['footer' => $footer]) ?> -</body> +<script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script> +<?php } ?> <?php $this->stop() ?>
\ No newline at end of file |