aboutsummaryrefslogtreecommitdiff
path: root/w/view
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-11-02 02:03:52 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-11-02 02:03:52 +0100
commit85824de70ded75c98bd50220160e2171fdc8df41 (patch)
tree11480f65ff97ddbb3ea4806ff1f313628ced15a0 /w/view
parent36ef34af2abcdea63a73b578208f20ca40b52f49 (diff)
downloadwcms-85824de70ded75c98bd50220160e2171fdc8df41.tar.gz
wcms-85824de70ded75c98bd50220160e2171fdc8df41.zip
render working and url auto link
Diffstat (limited to 'w/view')
-rw-r--r--w/view/templates/connect.php30
-rw-r--r--w/view/templates/delete.php44
-rw-r--r--w/view/templates/edit.php2
-rw-r--r--w/view/templates/edittopbar.php15
-rw-r--r--w/view/templates/home.php26
5 files changed, 112 insertions, 5 deletions
diff --git a/w/view/templates/connect.php b/w/view/templates/connect.php
new file mode 100644
index 0000000..3e2aeba
--- /dev/null
+++ b/w/view/templates/connect.php
@@ -0,0 +1,30 @@
+<?php $this->layout('layout', ['title' => 'Connect', 'description' => 'connect']) ?>
+
+
+
+
+<?php $this->start('page') ?>
+
+<span>
+<?= $user->level() ?>
+</span>
+
+<?php if($user->isvisitor()) { ?>
+
+<form action="./?action=login" method="post">
+<input type="password" name="pass" id="loginpass" placeholder="password">
+<input type="submit" value="login">
+</form>
+
+
+<?php } else { ?>
+
+<form action="./?action=logout" method="post">
+<input type="submit" value="logout">
+</form>
+
+
+
+<?php } ?>
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/w/view/templates/delete.php b/w/view/templates/delete.php
new file mode 100644
index 0000000..be54451
--- /dev/null
+++ b/w/view/templates/delete.php
@@ -0,0 +1,44 @@
+<?php $this->layout('layout', ['title' => 'delete', 'description' => 'delete']) ?>
+
+
+<?php $this->start('page') ?>
+
+
+<?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?>
+
+<div>
+
+<h1>Delete</h1>
+
+<ul>
+<li>Id : <?= $art->title() ?></li>
+<li>Title : <?= $art->title() ?></li>
+<li>Article(s) linked to this one : <?= $art->linkto('sort') ?></li>
+<li>Article(s) linked from this one : <?= $art->linkfrom('sort') ?></li>
+<li>Number of edits : <?= $art->editcount() ?></li>
+</ul>
+
+<?php if (!empty($art->linkto())) { ?>
+
+<h2>Article linked to :</h2>
+
+<ul>
+<?php foreach ($art->linkto('array') as $linkto) {
+ echo '<li><a href="./?id=' . $linkto . '">' . $linkto . '</a></li>';
+} ?>
+</ul>
+
+<?php
+} ?>
+
+</div>
+
+
+<form action="./?id=<?= $art->id() ?>&action=delete" method="post">
+<input type="hidden" name="deleteconfirm" value="true">
+<input type="submit" value="confirm delete">
+</form>
+
+
+
+<?php $this->stop() ?> \ No newline at end of file
diff --git a/w/view/templates/edit.php b/w/view/templates/edit.php
index 4db6706..ee231cd 100644
--- a/w/view/templates/edit.php
+++ b/w/view/templates/edit.php
@@ -20,8 +20,6 @@
<?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?>
-<form action="?id=<?= $art->id() ?>&action=update" method="post" id="artedit">
-
<?php $this->insert('edittopbar', ['art' => $art]) ?>
<?php $this->insert('editsidebar', ['art' => $art]) ?>
diff --git a/w/view/templates/edittopbar.php b/w/view/templates/edittopbar.php
index ffd1c0f..9973335 100644
--- a/w/view/templates/edittopbar.php
+++ b/w/view/templates/edittopbar.php
@@ -1,12 +1,23 @@
<div id="submit">
<!-- <input type="submit" name="action" value="home" accesskey="w" onclick="document.getElementById('artedit').submit();" form="artedit"> -->
- <input type="submit" name="action" value="update" accesskey="x" onclick="document.getElementById('artedit').submit();" form="artedit">
+ <input type="submit" name="action" value="update" accesskey="x" form="update">
<!-- <input type="submit" name="action" value="display" accesskey="c" onclick="document.getElementById('artedit').submit();" form="artedit"> -->
- <!-- <input type="submit" name="action" value="delete" onclick="confirmSubmit(event, 'Delete this article', 'artedit')" form="artedit"> -->
+
+
+
+ <form id="delete" action="./" method="get">
+ <input type="hidden" name="id" value="<?= $art->id() ?>">
+ <input type="submit" name="action" value="delete" form="delete">
+ </form>
+
+
<a href="?id=<?= $art->id() ?>" target="_blank">πŸ‘</a>
<a href="?id=<?= $art->id() ?>&aff=log" target="_blank">ΒΆ</a>
<span id="headid"><?= $art->id() ?></span>
+
+ <form action="?id=<?= $art->id() ?>&action=update" method="post" id="update">
+
<label for="fontsize">Font-size</label>
<input type="number" name="fontsize" value="<?= Config::fontsize() ?>" id="fontsize">
</div> \ No newline at end of file
diff --git a/w/view/templates/home.php b/w/view/templates/home.php
index 34bac1a..2303f0f 100644
--- a/w/view/templates/home.php
+++ b/w/view/templates/home.php
@@ -10,8 +10,28 @@
<?php $this->insert('navback', ['user' => $user]) ?>
+<?php if($user->canedit()) { ?>
<section>
+
+<div>
+
+<form id="goto" action="./" method="get">
+<input type="text" name="id" placeholder="id" required>
+<input type="submit" name="aff" value="read">
+<input type="submit" name="aff" value="edit">
+<input type="submit" name="action" value="add">
+</form>
+
+
+<form action="./" method="get">
+<input type="submit" name="action" value="analyseall">
+</form>
+
+
+</div>
+
+
<div id="flex">
@@ -55,13 +75,14 @@
<table id="home2table">
- <tr><th>x</th><th>id</th><th>edit</th><th>see</th><th>log</th><th>tag</th><th>summary</th><th>β†˜ to</th><th>β†— from</th><th>last modification</th><th>date of creation</th><th>privacy</th></tr>
+ <tr><th>x</th><th>id</th><th>edit</th><th>see</th><th>del</th><th>log</th><th>tag</th><th>summary</th><th>β†˜ to</th><th>β†— from</th><th>last modification</th><th>date of creation</th><th>privacy</th></tr>
<?php foreach ($table2 as $item) { ?>
<tr>
<td><input type="checkbox" name="id[]" value="<?= $item->id() ?>" id="<?= $item->id() ?>"></td>
<td><label title="<?= $item->title() ?>" for="<?= $item->id() ?>"><?= $item->id() ?></label></td>
<td><a href="?id=<?= $item->id() ?>&aff=edit">✏</a></td>
<td><a href="?id=<?= $item->id() ?>" target="_blank">πŸ‘</a></td>
+ <td><a href="?id=<?= $item->id() ?>&action=delete" >πŸ—‘</a></td>
<td><a href="?id=<?= $item->id() ?>&aff=log" target="_blank">ΒΆ</a></td>
<td><?= $item->tag('sort') ?></td>
<td><?= $item->description() ?></td>
@@ -78,6 +99,9 @@
</div>
</div>
</section>
+
+<?php } ?>
+
</body>