Overview
Comment: | Page historique des révisions + déplacement des libs externes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
58530c4937a58fe4c80f47bd18f9f4b8 |
User & Date: | bohwaz on 2012-05-21 00:41:58 |
Other Links: | manifest | tags |
Context
2012-05-21
| ||
00:44 | Déplacement des libs externes check-in: ae17321cab user: bohwaz tags: trunk | |
00:41 | Page historique des révisions + déplacement des libs externes check-in: 58530c4937 user: bohwaz tags: trunk | |
2012-05-20
| ||
23:51 | + Affichage du nom du dernier auteur de la page wiki + Barre d'actions sur le wiki + bouton "voir sur le site" pour les pages publiques + correction pour empêcher qu'une page soit parente d'elle-même (ça n'aurait pas de sens) + recherche de page check-in: d330e190f0 user: bohwaz tags: trunk | |
Changes
Modified include/class.wiki.php from [7b3fe9e89e] to [75991e702d].
︙ | ︙ | |||
147 148 149 150 151 152 153 154 155 156 157 158 159 160 | } public function getTitle($id) { $db = Garradin_DB::getInstance(); return $db->simpleQuerySingle('SELECT titre FROM wiki_pages WHERE id = ? LIMIT 1;', false, (int)$id); } public function editRevision($id, $revision_edition = 0, $data) { $db = Garradin_DB::getInstance(); $revision = $db->simpleQuerySingle('SELECT revision FROM wiki_pages WHERE id = ?;', false, (int)$id); | > > > > > > > > > > > > > > > > > > > > > > | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | } public function getTitle($id) { $db = Garradin_DB::getInstance(); return $db->simpleQuerySingle('SELECT titre FROM wiki_pages WHERE id = ? LIMIT 1;', false, (int)$id); } public function getRevision($id, $rev) { $db = Garradin_DB::getInstance(); // FIXME pagination au lieu de bloquer à 1000 return $db->simpleQuerySingle('SELECT r.revision, r.modification, r.id_auteur, r.contenu, strftime(\'%s\', r.date) AS date, LENGTH(r.contenu) AS taille, m.nom AS nom_auteur FROM wiki_revisions AS r LEFT JOIN membres AS m ON m.id = r.id_auteur WHERE r.id_page = ? AND revision = ? LIMIT 1;', true, (int) $id, (int) $rev); } public function listRevisions($id) { $db = Garradin_DB::getInstance(); // FIXME pagination au lieu de bloquer à 1000 return $db->simpleStatementFetch('SELECT r.revision, r.modification, r.id_auteur, strftime(\'%s\', r.date) AS date, LENGTH(r.contenu) AS taille, m.nom AS nom_auteur, LENGTH(r.contenu) - (SELECT LENGTH(contenu) FROM wiki_revisions WHERE id_page = r.id_page AND revision < r.revision ORDER BY revision DESC LIMIT 1) AS diff_taille FROM wiki_revisions AS r LEFT JOIN membres AS m ON m.id = r.id_auteur WHERE r.id_page = ? ORDER BY r.revision DESC LIMIT 1000;', SQLITE3_ASSOC, (int) $id); } public function editRevision($id, $revision_edition = 0, $data) { $db = Garradin_DB::getInstance(); $revision = $db->simpleQuerySingle('SELECT revision FROM wiki_pages WHERE id = ?;', false, (int)$id); |
︙ | ︙ |
Modified setup_dependencies.sh from [ff5358ace7] to [e7aef380cc].
1 2 3 4 5 | #!/bin/sh # Mise en place/à jour des dépendances # Template Lite | > > | | | > | > | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/bin/sh # Mise en place/à jour des dépendances KEYWORD="checkout" # Template Lite svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/template_lite/ include/libs/template_lite/ # Liste des pays svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/i18n/countries/ include/libs/countries/ # Passphrase svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/i18n/passphrase/ include/libs/passphrase/ # Garbage2xhtml svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/garbage2xhtml/ include/libs/garbage2xhtml/ # MiniSkel svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/miniskel/ include/libs/miniskel/ # Diff svn ${KEYWORD} https://svn.kd2.org/svn/misc/libs/diff/ include/libs/diff/ |
Modified templates/admin/wiki/chercher.tpl from [1aaac63fec] to [b1c27a7981].
︙ | ︙ | |||
18 19 20 21 22 23 24 | {if !$recherche} <p class="alert"> Aucun terme recherché. </p> {else} <p class="alert"> | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {if !$recherche} <p class="alert"> Aucun terme recherché. </p> {else} <p class="alert"> <strong>{$nb_resultats|escape}</strong> pages trouvées pour « {$recherche|escape} » </p> <div class="wikiResults"> {foreach from=$resultats item="page"} <h3><a href="./?{$page.uri|escape}">{$page.titre|escape}</a></h3> <p>{$page.snippet|escape|clean_snippet}</p> {/foreach} </div> {/if} {include file="admin/_foot.tpl"} |
Added templates/admin/wiki/historique.tpl version [1a2084526b].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | {include file="admin/_head.tpl" title="Historique : `$page.titre`" current="wiki"} <ul class="actions"> <li><a href="{$www_url}admin/wiki/"><strong>Wiki</strong></a></li> <li><a href="{$www_url}admin/wiki/chercher.php">Rechercher</a></li> <li><a href="{$www_url}admin/wiki/?{$page.uri|escape}">Voir la page</a></li> {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id|escape}">Éditer</a></li> {/if} </ul> {if !empty($revisions)} <table class="list wikiRevisions"> {foreach from=$revisions item="rev"} <tr> <td> {if $rev.revision == $page.revision} actu {else} <a href="?id={$page.id|escape}&diff={$rev.revision|escape}.{$page.revision|escape}">actu</a> {/if} | {if $rev.revision == 1} diff {else} <a href="?id={$page.id|escape}&diff={math equation="x+1" x=$rev.revision}.{$rev.revision|escape}">diff</a> {/if} </td> <th>{$rev.date|date_fr:'d/m/Y à H:i'}</th> <td> {if $user.droits.membres >= Garradin_Membres::DROIT_ACCES} <a href="{$www_url}admin/membres/fiche.php?id={$rev.id_auteur|escape}">{$rev.nom_auteur|escape}</a> {/if} </td> <td class="length"> {$rev.taille|escape} octets {if $rev.revision > 1} {if $rev.diff_taille > 0} <ins>(+{$rev.diff_taille|escape})</ins> {elseif $rev.diff_taille < 0} <del>({$rev.diff_taille|escape})</del> {else} <i>({$rev.diff_taille|escape})</i> {/if} {/if} </td> <td> <em>{$rev.modification|escape}</em> </td> </tr> {/foreach} </table> {elseif !empty($diff)} {else} <p class="alert"> Cette page n\'a pas d\'historique. </p> {/if} {include file="admin/_foot.tpl"} |
Modified templates/admin/wiki/page.tpl from [512190e9d6] to [5e080d4fb4].
1 2 3 4 5 6 7 8 9 10 11 12 13 | {if !empty($page.titre) && $can_read} {include file="admin/_head.tpl" title=$page.titre current="wiki"} {else} {include file="admin/_head.tpl" title="Wiki" current="wiki"} {/if} <ul class="actions"> <li><a href="{$www_url}admin/wiki/"><strong>Wiki</strong></a></li> <li><a href="{$www_url}admin/wiki/chercher.php">Rechercher</a></li> {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id|escape}">Éditer</a></li> {/if} {if $can_read && $page && $page.contenu} | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {if !empty($page.titre) && $can_read} {include file="admin/_head.tpl" title=$page.titre current="wiki"} {else} {include file="admin/_head.tpl" title="Wiki" current="wiki"} {/if} <ul class="actions"> <li><a href="{$www_url}admin/wiki/"><strong>Wiki</strong></a></li> <li><a href="{$www_url}admin/wiki/chercher.php">Rechercher</a></li> {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id|escape}">Éditer</a></li> {/if} {if $can_read && $page && $page.contenu} <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id|escape}">Historique</a> {if $page.droit_lecture == Garradin_Wiki::LECTURE_PUBLIC} <li><a href="{$www_url}{$page.uri|escape}">Voir sur le site</a> {/if} {/if} </ul> {if !$can_read} |
︙ | ︙ | |||
75 76 77 78 79 80 81 | <div class="wikiContent"> {$page.contenu.contenu|format_wiki|liens_wiki:'?'} </div> {/if} <p class="wikiFooter"> Dernière modification le {$page.date_modification|date_fr:'d/m/Y à H:i'} | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | <div class="wikiContent"> {$page.contenu.contenu|format_wiki|liens_wiki:'?'} </div> {/if} <p class="wikiFooter"> Dernière modification le {$page.date_modification|date_fr:'d/m/Y à H:i'} {if $user.droits.membres >= Garradin_Membres::DROIT_ACCES} par <a href="{$www_url}admin/membres/fiche.php?id={$page.contenu.id_auteur|escape}">{$auteur|escape}</a> {/if} </p> {/if} {/if} {/if} {include file="admin/_foot.tpl"} |
Added www/admin/wiki/historique.php version [90c578f1da].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php require_once __DIR__ . '/_inc.php'; if (!trim(utils::get('id'))) { throw new UserException("Page inconnue."); } $page = $wiki->getByID(utils::get('id')); if (!$page) { throw new UserException("Cette page n'existe pas."); } if (!$wiki->canReadPage($page['droit_lecture'])) { throw new UserException("Vous n'avez pas le droit de voir cette page."); } if (utils::get('diff')) { $revs = explode('.', utils::get('diff')); if (count($revs) != 2) { throw new UserException("Erreur de paramètre."); } $rev1 = $wiki->getRevision($page['id'], (int)$rev[0]) $rev2 = $wiki->getRevision($page['id'], (int)$rev[1]) $tpl->assign('rev1', $rev1); $tpl->assign('rev2', $rev2); //$tpl->assign('diff', } else { $tpl->assign('revisions', $wiki->listRevisions($page['id'])); } $tpl->assign('can_edit', $wiki->canWritePage($page['droit_ecriture'])); $tpl->assign('page', $page); $tpl->display('admin/wiki/historique.tpl'); ?> |
Modified www/style/admin.css from [9d69f08da5] to [d89bbd3c82].
︙ | ︙ | |||
530 531 532 533 534 535 536 | margin-bottom: .3em; } .wikiResults p { margin-bottom: .8em; font-size: .9em; } | > > > > > > > > > > > > > > > | 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | margin-bottom: .3em; } .wikiResults p { margin-bottom: .8em; font-size: .9em; } .wikiRevisions .length ins { text-decoration: none; color: green; } .wikiRevisions .length del { text-decoration: none; color: red; } .wikiRevisions .length i { font-style: normal; color: gray; } |