Implement a simple form to save custom markdown-enabled content in the
forge's admin area that is displayed instead of the default project list. Sanitize the URLs that we're using and make a redirect to the listProjects page when no custom forge page is enabled.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
{include 'idf/main-menu.html'}
|
||||
<div id="header">
|
||||
<div id="main-tabs">
|
||||
<a href="{url 'IDF_Views_Admin::forge'}"{block tabforge}{/block}>{trans 'Forge'}</a>
|
||||
<a href="{url 'IDF_Views_Admin::projects'}"{block tabprojects}{/block}>{trans 'Projects'}</a>
|
||||
<a href="{url 'IDF_Views_Admin::users'}"{block tabusers}{/block}>{trans 'People'}</a>
|
||||
{if $usherConfigured}
|
||||
|
5
src/IDF/templates/idf/gadmin/forge/base.html
Normal file
5
src/IDF/templates/idf/gadmin/forge/base.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{extends "idf/gadmin/base.html"}
|
||||
{block tabforge} class="active"{/block}
|
||||
{block subtabs}
|
||||
<a {if $inIndex}class="active" {/if}href="{url 'IDF_Views_Admin::forge'}">{trans 'Frontpage'}</a>
|
||||
{/block}
|
54
src/IDF/templates/idf/gadmin/forge/index.html
Normal file
54
src/IDF/templates/idf/gadmin/forge/index.html
Normal file
@@ -0,0 +1,54 @@
|
||||
{extends "idf/gadmin/forge/base.html"}
|
||||
|
||||
{block docclass}yui-t3{assign $inIndex=true}{/block}
|
||||
|
||||
{block body}
|
||||
<form method="post" action=".">
|
||||
<table class="form" summary="">
|
||||
<colgroup>
|
||||
<col width="20" />
|
||||
<col width="*" />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>{$form.f.enabled|unsafe}</td>
|
||||
<td>
|
||||
{$form.f.enabled.labelTag}
|
||||
{if $form.f.enabled.errors}{$form.f.enabled.fieldErrors}{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{if $form.f.content.errors}{$form.f.content.fieldErrors}{/if}
|
||||
{$form.f.content|unsafe}
|
||||
</td>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="{trans 'Save Changes'}" name="submit" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
// <!-- {literal}
|
||||
$(document).ready(function() {
|
||||
var handler = function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#id_content').removeAttr('readonly');
|
||||
} else {
|
||||
$('#id_content').attr('readonly', 'readonly');
|
||||
}
|
||||
};
|
||||
$('#id_enabled').bind('click', handler);
|
||||
handler.call($('#id_enabled'));
|
||||
});
|
||||
// {/literal} -->
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block context}
|
||||
<div class="issue-submit-info">
|
||||
<p>{blocktrans}You can define a custom forge start page that is displayed instead of the standard project listing.{/blocktrans}</p>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
|
@@ -1,14 +0,0 @@
|
||||
{extends "idf/gadmin/base.html"}
|
||||
{block docclass}yui-t2{/block}
|
||||
{block tabhome} class="active"{/block}
|
||||
{block subtabs}
|
||||
{trans 'Welcome'}
|
||||
{/block}
|
||||
{block body}
|
||||
<p>{blocktrans}You have here access to the administration of the forge.{/blocktrans}</p>
|
||||
{/block}
|
||||
{block context}
|
||||
|
||||
{/block}
|
||||
|
||||
{block foot}<div id="branding">Powered by <a href="http://www.indefero.net" title="InDefero, bug tracking and more">InDefero</a>,<br />a <a href="http://www.ceondo.com">Céondo Ltd</a> initiative.</div>{/block}
|
Reference in New Issue
Block a user