Partial fix of issue 55, addition of a simple Wiki.
Added a base wiki, it is now possible to create wiki pages and update them. Revisions are kept also not used/displayed at the moment.
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
{block subtabs}
|
||||
<div id="sub-tabs">
|
||||
<a {if $inSummary}class="active" {/if}href="{url 'IDF_Views_Project::admin', array($project.shortname)}">{trans 'Project Summary'}</a> |
|
||||
<a {if $inIssueTracking}class="active" {/if}href="{url 'IDF_Views_Project::adminIssues', array($project.shortname)}">{trans 'Issue Tracking'}</a> |
|
||||
<a {if $inDownloads}class="active" {/if}href="{url 'IDF_Views_Project::adminDownloads', array($project.shortname)}">{trans 'Downloads'}</a> |
|
||||
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Project::adminWiki', array($project.shortname)}">{trans 'Documentation'}</a> |
|
||||
<a {if $inIssueTracking}class="active" {/if}href="{url 'IDF_Views_Project::adminIssues', array($project.shortname)}">{trans 'Issue Tracking'}</a> |
|
||||
<a {if $inSource}class="active" {/if}href="{url 'IDF_Views_Project::adminSource', array($project.shortname)}">{trans 'Source'}</a> |
|
||||
<a {if $inMembers}class="active" {/if}href="{url 'IDF_Views_Project::adminMembers', array($project.shortname)}">{trans 'Project Members'}</a> |
|
||||
<a {if $inTabs}class="active" {/if}href="{url 'IDF_Views_Project::adminTabs', array($project.shortname)}">{trans 'Tabs Access'}</a>
|
||||
|
@@ -18,6 +18,12 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.wiki_access_rights.labelTag}:</strong></th>
|
||||
<td>{if $form.f.wiki_access_rights.errors}{$form.f.wiki_access_rights.fieldErrors}{/if}
|
||||
{$form.f.wiki_access_rights|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.issues_access_rights.labelTag}:</strong></th>
|
||||
<td>{if $form.f.issues_access_rights.errors}{$form.f.issues_access_rights.fieldErrors}{/if}
|
||||
{$form.f.issues_access_rights|unsafe}
|
||||
|
34
src/IDF/templates/idf/admin/wiki.html
Normal file
34
src/IDF/templates/idf/admin/wiki.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{extends "idf/admin/base.html"}
|
||||
{block docclass}yui-t1{assign $inWiki = true}{/block}
|
||||
{block body}
|
||||
<form method="post" action=".">
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<td colspan="2"><strong>{$form.f.labels_wiki_predefined.labelTag}:</strong><br />
|
||||
{if $form.f.labels_wiki_predefined.errors}{$form.f.labels_wiki_predefined.fieldErrors}{/if}
|
||||
{$form.f.labels_wiki_predefined|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{$form.f.labels_wiki_one_max.labelTag}:<br />
|
||||
{if $form.f.labels_wiki_one_max.errors}{$form.f.labels_wiki_one_max.fieldErrors}{/if}
|
||||
{$form.f.labels_wiki_one_max|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="{trans 'Save Changes'}" name="submit" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
{blocktrans}
|
||||
<p><strong>Instructions:</strong></p>
|
||||
<p>List one status value per line in desired sort-order.</p>
|
||||
<p>Optionally, use an equals-sign to document the meaning of each status value.</p>
|
||||
{/blocktrans}
|
||||
</div>
|
||||
{/block}
|
@@ -43,8 +43,9 @@
|
||||
<div id="main-tabs">
|
||||
{if $project}
|
||||
<a accesskey="1" href="{url 'IDF_Views_Project::home', array($project.shortname)}"{block tabhome}{/block}>{trans 'Project Home'}</a>
|
||||
{if $hasIssuesAccess} <a href="{url 'IDF_Views_Issue::index', array($project.shortname)}"{block tabissues}{/block}>{trans 'Issues'}</a>{/if}
|
||||
{if $hasDownloadsAccess} <a href="{url 'IDF_Views_Download::index', array($project.shortname)}"{block tabdownloads}{/block}>{trans 'Downloads'}</a>{/if}
|
||||
{if $hasWikiAccess} <a href="{url 'IDF_Views_Wiki::index', array($project.shortname)}"{block tabwiki}{/block}>{trans 'Documentation'}</a>{/if}
|
||||
{if $hasIssuesAccess} <a href="{url 'IDF_Views_Issue::index', array($project.shortname)}"{block tabissues}{/block}>{trans 'Issues'}</a>{/if}
|
||||
{if $hasSourceAccess} <a href="{url 'IDF_Views_Source::treeBase', array($project.shortname, $project.getScmRoot())}"{block tabsource}{/block}>{trans 'Source'}</a>{/if}
|
||||
{if $isOwner}
|
||||
<a href="{url 'IDF_Views_Project::admin', array($project.shortname)}"{block tabadmin}{/block}>{trans 'Administer'}</a>{/if}{/if}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
{/block}
|
||||
{block body}
|
||||
{$project.description|markdown}
|
||||
{markdown $project.description, $request}
|
||||
{/block}
|
||||
{block context}
|
||||
{if count($downloads) > 0}
|
||||
|
10
src/IDF/templates/idf/wiki/base.html
Normal file
10
src/IDF/templates/idf/wiki/base.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{extends "idf/base.html"}
|
||||
{block tabwiki} class="active"{/block}
|
||||
{block subtabs}
|
||||
<div id="sub-tabs">
|
||||
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'List Pages'}</a>
|
||||
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Wiki::create', array($project.shortname)}">{trans 'New Page'}</a> {/if}
|
||||
{if !$user.isAnonymous() and $inView} | <a href="{url 'IDF_Views_Wiki::update', array($project.shortname, $page.title)}">{trans 'Update This Page'}</a> {/if}
|
||||
{superblock}
|
||||
</div>
|
||||
{/block}
|
68
src/IDF/templates/idf/wiki/create.html
Normal file
68
src/IDF/templates/idf/wiki/create.html
Normal file
@@ -0,0 +1,68 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
{block docclass}yui-t1{assign $inCreate = true}{/block}
|
||||
{block body}
|
||||
|
||||
{if $preview}
|
||||
<h2 class="top">{trans 'Preview of the Page'}</h2>
|
||||
|
||||
{markdown $preview, $request}
|
||||
{/if}
|
||||
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'The form contains some errors. Please correct them to create the page.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="post" enctype="multipart/form-data" action="." >
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th><strong>{$form.f.title.labelTag}:</strong></th>
|
||||
<td>{if $form.f.title.errors}{$form.f.title.fieldErrors}{/if}
|
||||
{$form.f.title|unsafe}<br />
|
||||
<span class="helptext">{$form.f.title.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.summary.labelTag}:</strong></th>
|
||||
<td>{if $form.f.summary.errors}{$form.f.summary.fieldErrors}{/if}
|
||||
{$form.f.summary|unsafe}<br />
|
||||
<span class="helptext">{$form.f.summary.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.content.labelTag}:</strong></th>
|
||||
<td>{if $form.f.content.errors}{$form.f.content.fieldErrors}{/if}
|
||||
{$form.f.content|unsafe}
|
||||
</td>
|
||||
</tr>{if $isOwner or $isMember}
|
||||
<tr>
|
||||
<th>{$form.f.label1.labelTag}:</th>
|
||||
<td>
|
||||
{if $form.f.label1.errors}{$form.f.label1.fieldErrors}{/if}{$form.f.label1|unsafe}
|
||||
{if $form.f.label2.errors}{$form.f.label2.fieldErrors}{/if}{$form.f.label2|unsafe}
|
||||
{if $form.f.label3.errors}{$form.f.label3.fieldErrors}{/if}{$form.f.label3|unsafe}
|
||||
</td>
|
||||
</tr>{/if}
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="{trans 'Preview'}" name="preview" /> <input type="submit" value="{trans 'Create Page'}" name="submit" /> | <a href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'Cancel'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
{include 'idf/wiki/edit-info.html'}
|
||||
</div>
|
||||
{/block}
|
||||
{block javascript}
|
||||
<script type="text/javascript">
|
||||
document.getElementById('id_title').focus()
|
||||
</script>
|
||||
{include 'idf/wiki/js-autocomplete.html'}{/block}
|
||||
|
6
src/IDF/templates/idf/wiki/edit-info.html
Normal file
6
src/IDF/templates/idf/wiki/edit-info.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{assign $url = 'http://daringfireball.net/projects/markdown/syntax'}
|
||||
{blocktrans}
|
||||
<p><strong>Instructions:</strong></p>
|
||||
<p>The content of the page can use the <a href="{$url}">Markdown syntax</a>.</p>
|
||||
<p>Website addresses are automatically linked and you can link to another page in the documentation using double square brackets like that [[AnotherPage]].</p>
|
||||
{/blocktrans}
|
13
src/IDF/templates/idf/wiki/index.html
Normal file
13
src/IDF/templates/idf/wiki/index.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
{block docclass}yui-t1{assign $inWiki=true}{/block}
|
||||
{block body}
|
||||
{$pages.render}
|
||||
{if !$user.isAnonymous()}
|
||||
{aurl 'url', 'IDF_Views_Wiki::create', array($project.shortname)}
|
||||
<p><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/add.png'}" alt="+" align="bottom" /></a> <a href="{$url}">{trans 'New Page'}</a></p>{/if}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Number of pages:'}</strong> {$pages.nb_items}</p>
|
||||
{/block}
|
||||
|
27
src/IDF/templates/idf/wiki/js-autocomplete.html
Normal file
27
src/IDF/templates/idf/wiki/js-autocomplete.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{if $isOwner or $isMember}
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.bgiframe.min.js'}"></script>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.autocomplete.min.js'}"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// <!-- {literal}
|
||||
$(document).ready(function(){
|
||||
var auto_labels = [{/literal}{$auto_labels|safe}{literal}];
|
||||
var j=0;
|
||||
for (j=1;j<4;j=j+1) {
|
||||
$("#id_label"+j).autocomplete(auto_labels, {
|
||||
minChars: 0,
|
||||
width: 310,
|
||||
matchContains: true,
|
||||
max: 50,
|
||||
highlightItem: false,
|
||||
formatItem: function(row, i, max, term) {
|
||||
return row.to.replace(new RegExp("(" + term + ")", "gi"), "<strong>$1</strong>") + " <span style='font-size: 80%;'>" + row.name + "</span>";
|
||||
},
|
||||
formatResult: function(row) {
|
||||
return row.to;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
{/literal} //-->
|
||||
</script>
|
||||
{/if}
|
72
src/IDF/templates/idf/wiki/update.html
Normal file
72
src/IDF/templates/idf/wiki/update.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block body}
|
||||
|
||||
{if $preview}
|
||||
<h2 class="top">{trans 'Preview of the Page'}</h2>
|
||||
|
||||
{markdown $preview, $request}
|
||||
{/if}
|
||||
|
||||
{if $form.errors}
|
||||
<div class="px-message-error">
|
||||
<p>{trans 'The form contains some errors. Please correct them to update the page.'}</p>
|
||||
{if $form.get_top_errors}
|
||||
{$form.render_top_errors|unsafe}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="post" enctype="multipart/form-data" action="." >
|
||||
<table class="form" summary="">{if $isOwner or $isMember}
|
||||
<tr>
|
||||
<th><strong>{$form.f.title.labelTag}:</strong></th>
|
||||
<td>{if $form.f.title.errors}{$form.f.title.fieldErrors}{/if}
|
||||
{$form.f.title|unsafe}<br />
|
||||
<span class="helptext">{$form.f.title.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.summary.labelTag}:</strong></th>
|
||||
<td>{if $form.f.summary.errors}{$form.f.summary.fieldErrors}{/if}
|
||||
{$form.f.summary|unsafe}<br />
|
||||
<span class="helptext">{$form.f.summary.help_text}</span>
|
||||
</td>
|
||||
</tr>{/if}
|
||||
<tr>
|
||||
<th><strong>{$form.f.content.labelTag}:</strong></th>
|
||||
<td>{if $form.f.content.errors}{$form.f.content.fieldErrors}{/if}
|
||||
{$form.f.content|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><strong>{$form.f.comment.labelTag}:</strong></th>
|
||||
<td>{if $form.f.comment.errors}{$form.f.comment.fieldErrors}{/if}
|
||||
{$form.f.comment|unsafe}<br />
|
||||
<span class="helptext">{$form.f.comment.help_text}</span>
|
||||
</td>
|
||||
</tr>{if $isOwner or $isMember}
|
||||
<tr>
|
||||
<th>{$form.f.label1.labelTag}:</th>
|
||||
<td>
|
||||
{if $form.f.label1.errors}{$form.f.label1.fieldErrors}{/if}{$form.f.label1|unsafe}
|
||||
{if $form.f.label2.errors}{$form.f.label2.fieldErrors}{/if}{$form.f.label2|unsafe}
|
||||
{if $form.f.label3.errors}{$form.f.label3.fieldErrors}{/if}{$form.f.label3|unsafe}
|
||||
</td>
|
||||
</tr>{/if}
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="{trans 'Preview'}" name="preview" /> <input type="submit" value="{trans 'Update Page'}" name="submit" /> | <a href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'Cancel'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{/block}
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
{include 'idf/wiki/edit-info.html'}
|
||||
</div>
|
||||
{/block}
|
||||
{block javascript}
|
||||
{include 'idf/wiki/js-autocomplete.html'}{/block}
|
||||
|
22
src/IDF/templates/idf/wiki/view.html
Normal file
22
src/IDF/templates/idf/wiki/view.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
{block docclass}yui-t3{assign $inView=true}{/block}
|
||||
{block body}
|
||||
|
||||
<p class="desc">{$page.summary}</p>
|
||||
|
||||
{markdown $rev.content, $request}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
{assign $submitter = $page.get_submitter()}
|
||||
<p><strong>{trans 'Created:'}</strong> <span class="nobrk">{$page.creation_dtime|dateago}</span><br /><span class="nobrk">{blocktrans}by {$submitter}{/blocktrans}</span></p>
|
||||
{if $rev.creation_dtime != $page.creation_dtime}<p>{assign $submitter = $rev.get_submitter()}
|
||||
<strong>{trans 'Updated:'}</strong> <span class="nobrk">{$rev.creation_dtime|dateago}</span><br /><span class="nobrk">{blocktrans}by {$submitter}{/blocktrans}</span></p>{/if}
|
||||
{if $tags.count()}
|
||||
<p>
|
||||
<strong>{trans 'Labels:'}</strong><br />
|
||||
{foreach $tags as $tag}
|
||||
<span class="label"><strong>{$tag.class}:</strong>{$tag.name}</span><br />
|
||||
{/foreach}
|
||||
</p>{/if}
|
||||
{/block}
|
Reference in New Issue
Block a user