aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/class/art2.php2
-rw-r--r--app/class/modelhome.php2
-rw-r--r--app/class/modelrender.php11
-rw-r--r--app/view/templates/edit.php2
-rw-r--r--app/view/templates/editleftbar.php16
-rw-r--r--app/view/templates/edittopbar.php13
-rw-r--r--app/view/templates/home.php40
-rw-r--r--app/view/templates/info.php21
-rw-r--r--assets/css/edit.css33
-rw-r--r--assets/css/home.css25
10 files changed, 110 insertions, 55 deletions
diff --git a/app/class/art2.php b/app/class/art2.php
index 6a61687..2029895 100644
--- a/app/class/art2.php
+++ b/app/class/art2.php
@@ -169,6 +169,8 @@ class Art2
return $this->date->format('Y-m-d');
} elseif ($option == 'ptime') {
return $this->date->format('H:i');
+ } elseif ($option = 'dmy') {
+ return $this->date->format('d/m/Y');
}
diff --git a/app/class/modelhome.php b/app/class/modelhome.php
index 5d16062..bb271d6 100644
--- a/app/class/modelhome.php
+++ b/app/class/modelhome.php
@@ -11,7 +11,7 @@ class Modelhome extends Modeldb
{
$opt = new Opt(Art2::classvarlist());
- $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'secure']);
+ $opt->setcol(['id', 'tag', 'linkfrom', 'linkto', 'description', 'title', 'datemodif', 'datecreation', 'date', 'secure']);
$opt->settaglist($table);
$opt->submit();
diff --git a/app/class/modelrender.php b/app/class/modelrender.php
index d2cdbb4..c36417d 100644
--- a/app/class/modelrender.php
+++ b/app/class/modelrender.php
@@ -177,8 +177,8 @@ class Modelrender extends Modelart
public function parser(string $text)
{
- $text = str_replace('<a href="~', '<a class="media" target="_blank" href="' . Model::mediapath(), $text);
- $text = str_replace('<img src="~', '<img class="local" src="' . Model::mediapath(), $text);
+
+ $text = $this->media($text);
$text = $this->headerid($text);
@@ -197,6 +197,13 @@ class Modelrender extends Modelart
return $text;
}
+ public function media(string $text): string
+ {
+ $rend = $this;
+ $text = preg_replace('%(src|target)="((\/?[\w-_]+)+\.[a-z0-9]{1,5})"%', '$1="'.Model::mediapath() . '$2"', $text);
+ return $text;
+ }
+
public function autourl($text)
{
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index 973317a..4b2fa77 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -10,7 +10,7 @@
<body>
<section class="editor">
- <?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?>
+ <!-- <?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?> -->
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php
index 09c13f9..ff08bfc 100644
--- a/app/view/templates/editleftbar.php
+++ b/app/view/templates/editleftbar.php
@@ -56,20 +56,20 @@
if(!empty($art->templatecss())) {
?>
<div class="subtemplate">
- <input type="checkbox" name="ireccursivecss" id="ireccursivecss" <?= $art->template()['cssreccursive'] === true ? 'checked' : '' ?>>
- <label for="ireccursivecss">Reccursive template</label>
+ <input type="checkbox" name="templateoptions['reccursivecss']" id="oreccursivecss" <?= $art->template()['cssreccursive'] === true ? 'checked' : '' ?>>
+ <label for="oreccursivecss">Reccursive template</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="iquickcss" id="iquickcss" <?= $art->template()['cssquickcss'] === true ? 'checked' : '' ?>>
- <label for="iquickcss">Quickcss</label>
+ <input type="checkbox" name="templateoptions['quickcss']" id="oquickcss" <?= $art->template()['cssquickcss'] === true ? 'checked' : '' ?>>
+ <label for="oquickcss">Quickcss</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="iexternalcss" id="iexternalcss" <?= $art->template()['externalcss'] === true ? 'checked' : '' ?>>
- <label for="iexternalcss">External CSS</label>
+ <input type="checkbox" name="templateoptions['externalcss']" id="oexternalcss" <?= $art->template()['externalcss'] === true ? 'checked' : '' ?>>
+ <label for="pexternalcss">External CSS</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="ifavicon" id="ifavicon" <?= $art->template()['cssfavicon'] === true ? 'checked' : '' ?>>
- <label for="ifavicon">Favicon</label>
+ <input type="checkbox" name="templateoptions['favicon']" id="ofavicon" <?= $art->template()['cssfavicon'] === true ? 'checked' : '' ?>>
+ <label for="ofavicon">Favicon</label>
</div>
<?php
}
diff --git a/app/view/templates/edittopbar.php b/app/view/templates/edittopbar.php
index a1aba01..5c1e43c 100644
--- a/app/view/templates/edittopbar.php
+++ b/app/view/templates/edittopbar.php
@@ -14,18 +14,17 @@
<span>
- <a href="<?= $this->uart('artconfirmdelete', $art->id()) ?>">✖ delete</a>
+ <a href="<?= $this->uart('artconfirmdelete', $art->id()) ?>"><span class="symbol">✖</span><span class="text">delete</span></a>
</span>
<span>
<a href="<?= $this->uart('artread/', $art->id()) ?>" target="_blank" class="icon" >👁</a>
- <a href="<?= $this->uart('artlog', $art->id()) ?>" target="_blank" class="icon" >⁋</a>
</span>
<span id="headid"><?= $art->id() ?></span>
-<span>
+<span id="fontsize">
<label for="fontsize">Font-size</label>
<input type="number" name="fontsize" value="<?= Config::fontsize() ?>" id="fontsize">
@@ -33,14 +32,16 @@
-<span id="test">
+<span id="menu">
<?php if($user->iseditor()) { ?>
+ <a href="<?= $this->url('font') ?>"><span class="symbol">📝</span><span class="text">font</span></a>
+ <a href="<?= $this->url('media') ?>"><span class="symbol">📁</span><span class="text">media</span></a>
+
<?php
if($user->isadmin()) {
?>
- <a href="<?= $this->url('font') ?>">font</a>
- <a href="<?= $this->url('admin') ?>">admin</a>
+ <a href="<?= $this->url('admin') ?>"><span class="symbol">🔑</span><span class="text">admin</span></a>
<?php
}
}
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index ac4f158..9aa3d13 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -12,7 +12,7 @@
<?php if($user->iseditor()) { ?>
-<section>
+<section class="home">
@@ -68,15 +68,16 @@
<th><a href="<?= $opt->getadress('id') ?>">id</a></th>
<th>edit</th>
<th>see</th>
- <th>del</th>
- <th>log</th>
- <th><a href="<?= $opt->getadress('tag') ?>">tag</a></th>
- <th>summary</th>
- <th><a href="<?= $opt->getadress('linkto') ?>">link to</a></th>
- <th><a href="<?= $opt->getadress('linkfrom') ?>">linkfrom</a></th>
- <th><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th>
- <th><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th>
- <th><a href="<?= $opt->getadress('secure') ?>">privacy</a></th>
+ <th class="delete">del</th>
+ <th class="log">log</th>
+ <th class="tag"><a href="<?= $opt->getadress('tag') ?>">tag</a></th>
+ <th class="summary">summary</th>
+ <th class="linkto"><a href="<?= $opt->getadress('linkto') ?>">link to</a></th>
+ <th class="linkfrom"><a href="<?= $opt->getadress('linkfrom') ?>">linkfrom</a></th>
+ <th class="datemodif"><a href="<?= $opt->getadress('datemodif') ?>">last modification</a></th>
+ <th class="datecreation"><a href="<?= $opt->getadress('datecreation') ?>">date of creation</a></th>
+ <th class="date"><a href="<?= $opt->getadress('date') ?>">date</a></th>
+ <th class="secure"><a href="<?= $opt->getadress('secure') ?>">privacy</a></th>
</tr>
<?php foreach ($table2 as $item) { ?>
<tr>
@@ -84,15 +85,16 @@
<td><label title="<?= $item->title() ?>" for="<?= $item->id() ?>"><?= $item->id() ?></label></td>
<td><a href="<?= $this->uart('artedit', $item->id()) ?>">✏</a></td>
<td><a href="<?= $this->uart('artread/', $item->id()) ?>" target="_blank">👁</a></td>
- <td><a href="<?= $this->uart('artdelete', $item->id()) ?>" >✖</a></td>
- <td><a href="<?= $this->uart('artlog', $item->id()) ?>" target="_blank">⁋</a></td>
- <td><a title="<?= $item->tag('string') ?>"><?= $item->tag('sort') ?></a></td>
- <td><?= $item->description() ?></td>
- <td><?= $item->linkto('sort') ?></td>
- <td><a title="<?= $item->linkfrom('string') ?>" ><?= $item->linkfrom('sort') ?></a></td>
- <td><?= $item->datemodif('hrdi') ?></td>
- <td><?= $item->datecreation('hrdi') ?></td>
- <td><?= $item->secure('string') ?></td>
+ <td class="delete"><a href="<?= $this->uart('artdelete', $item->id()) ?>" >✖</a></td>
+ <td class="log"><a href="<?= $this->uart('artlog', $item->id()) ?>" target="_blank">⁋</a></td>
+ <td class="tag"><a title="<?= $item->tag('string') ?>"><?= $item->tag('sort') ?></a></td>
+ <td class="summary"><?= $item->description() ?></td>
+ <td class="linkto"><?= $item->linkto('sort') ?></td>
+ <td class="linkfrom"><a title="<?= $item->linkfrom('string') ?>" ><?= $item->linkfrom('sort') ?></a></td>
+ <td class="datemodif"><?= $item->datemodif('hrdi') ?></td>
+ <td class="datecreation"><?= $item->datecreation('hrdi') ?></td>
+ <td class="date"><?= $item->date('dmy') ?></td>
+ <td class="secure"><?= $item->secure('string') ?></td>
</tr>
<?php }?>
diff --git a/app/view/templates/info.php b/app/view/templates/info.php
index 334540b..638e2b5 100644
--- a/app/view/templates/info.php
+++ b/app/view/templates/info.php
@@ -38,6 +38,7 @@
<nav>
+SUMMARY
<ul>
<li><a href="#startup">Startup</a></li>
<ul>
@@ -50,8 +51,8 @@
</ul>
<li><a href="#editor">Editor</a></li>
<ul>
- <li><a href="#elementsynthax">Elements synthax</a></li>
- <li><a href="#bodysynthax">Body synthax</a></li>
+ <li><a href="#elementsyntax">Elements syntax</a></li>
+ <li><a href="#bodysyntax">Body syntax</a></li>
</ul>
</ul>
@@ -141,13 +142,13 @@
You can use any of them, only one or all at the same time, as you prefer.
-<h4 id="elementsynthax">Element synthax</h4>
+<h4 id="elementsyntax">Element syntax</h4>
-<p>In any of the five html element you can use to store content, you can use the following synthax, that is specific to W, extending the Markdown syntax :</p>
+<p>In any of the five html element you can use to store content, you can use the following syntax, that is specific to W, extending the Markdown syntax :</p>
<h5>quick internal link</h5>
-<p>You can create internal link very quickly, only by using the id of yout page. The link text will be remplaced by the title associated with this page.</p>
+<p>You can create internal link very quickly, only by using the id of your page. The link text will be remplaced by the title associated with this page.</p>
<blockquote>
[<i>page_id</i>]
@@ -174,7 +175,7 @@ You can use any of them, only one or all at the same time, as you prefer.
%DESCRIPTION%
</blockquote>
-<p>As for the title, this will output the <code>description</code> attribute od the page</p>
+<p>As for the title, this will output the <code>description</code> attribute of the page</p>
<h5>Date shortcut</h5>
@@ -187,13 +188,13 @@ You can use any of them, only one or all at the same time, as you prefer.
<h5>Automatic summary</h5>
-<p>You can generate summary automaticly, based on the page <code>&lt;h*&gt;</code> elements</p>
+<p>You can automatically generate summary, based on the page <code>&lt;h*&gt;</code> elements</p>
<blockquote>
%SUMMARY%
</blockquote>
-<p>This will generate a classic <code>ul</code> html list.</p>
+<p>This will generate a classic <code>&lt;ul&gt;</code> html list.</p>
<h5>Automatic list by tag</h5>
@@ -203,7 +204,7 @@ You can use any of them, only one or all at the same time, as you prefer.
%%<i>tag</i>%%
</blockquote>
-<p>Let's suppose we are in page3 and have page2, page3, page5, using this tag, this will output :</p>
+<p>Let's suppose we are in page3 and we have page2, page3, page5, using this tag, this will output :</p>
<blockquote>
&lt;ul id="<i>tag</i>"&gt;
@@ -238,7 +239,7 @@ You can use any of them, only one or all at the same time, as you prefer.
-<h4 id="bodysynthax">Body synthax</h4>
+<h4 id="bodysyntax">Body syntax</h4>
diff --git a/assets/css/edit.css b/assets/css/edit.css
index cb7b067..79b9dee 100644
--- a/assets/css/edit.css
+++ b/assets/css/edit.css
@@ -28,6 +28,8 @@ body {
position: relative;
height: 100%;
background-color: lightgrey;
+ display: flex;
+ overflow: hidden;
}
@@ -98,10 +100,12 @@ body {
position: relative;
}
+/* clip the tabs names */
.tabs .tab
{
- float: left;
+ min-width: 0;
+ overflow: hidden;
}
.tabs .tab .content
@@ -121,8 +125,8 @@ body {
.tab label
{
margin-right: 10px;
- border: solid rgba(0, 0, 0, 0);
- padding: 0px 2px;
+ border: solid rgba(0, 0, 0, 0);
+ padding: 0px 2px;
}
.tab label.edited {
@@ -136,6 +140,7 @@ body {
.checkboxtab:checked ~ label
{
border: solid 1px;
+ background: white;
}
.checkboxtab:checked ~ .content
@@ -164,6 +169,7 @@ html {
.editor .tabs label {
line-height: 30px;
+ overflow: hidden;
}
.editor #topbar {
@@ -227,7 +233,7 @@ form#update {
height: 30px;
}
-#update span {margin-right: 1%;}
+#update span {margin: 0 0.2%;}
.editor .panel input[type="checkbox"] {
width: auto;
@@ -246,4 +252,23 @@ form#update {
.panel summary {
background-color: grey;
color: lightgrey;
+}
+
+.panel summary:hover {
+ cursor: pointer;
+}
+
+@media (max-width: 600px) {
+ .bar {
+ display: none;
+ }
+
+ span#fontsize {
+ display: none;
+ }
+
+ #topbar .text {
+ display: none;
+ }
+
} \ No newline at end of file
diff --git a/assets/css/home.css b/assets/css/home.css
index 45afe58..c430b87 100644
--- a/assets/css/home.css
+++ b/assets/css/home.css
@@ -155,14 +155,17 @@ section.info article h2#manual {
}
section.info article h3 {
- border-top: solid 1px grey;
- margin-top: 60px;
+ border-bottom: solid 1px grey;
+ margin-top: 100px;
padding-top: 15px;
- font-size: xx-large;
+ font-size: 35px;
}
section.info article h4 {
background-color: darkgrey;
+ padding: 10px;
+ font-size: x-large;
+ margin-top: 70px;
}
section.info article h5 {
@@ -183,6 +186,20 @@ section.info blockquote {
section.info nav {
position: fixed;
- right: 0;
+ right: 3%;
top: 20%;
+}
+
+section.info article code i {
+ font-style: normal;
+ color: #7b97b9;
+}
+
+
+
+@media (max-width: 600px) {
+ section.home .summary, section.home .linkfrom, section.home .linkto, section.home .delete, section.home .datecreation, section.home .date, section.home .log, section.home .secure, section.home .tag {
+ display: none;
+ }
+
} \ No newline at end of file