ForgeDiscussion/forgediscussion/templates/admin_forums.html to ForgeDiscussion/forgediscussion/templates/discussionforums/admin_forums.html
--- a/ForgeDiscussion/forgediscussion/templates/admin_forums.html +++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/admin_forums.html @@ -1,117 +1,109 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> - - <xi:include href="master.html" /> - <xi:include href="${app.templates}/lib.html" /> +{% extends 'jinja_master/master.html' %} - <?python from allura.lib.security import has_artifact_access ?> - - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>$c.project.name / $app.config.options.mount_label Admin Forums</title> - </head> - - <body> - <h1 class="title">$app.config.options.mount_point Admin Forums</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - <form method="POST" action="update_forums" enctype="multipart/form-data"> - <table id="forums"> - <thead> - <tr> - <th/> - <th>Forum</th><th>Topics</th><th>Posts</th><th>Last Post</th> - <th/> - </tr> - </thead> - <tbody> - <tr py:for="i, forum in enumerate(app.forums)" class="${i%2 and ' even' or ''}"> - <td> - <div class="editable viewing"> - <span class="viewer"> - <img py:if="forum.icon" src="${forum.url()}/icon"/> - <img py:if="not forum.icon" src="${g.forge_static('images/project_default.png')}"/> - </span> - <span class="editor">${file_field('forum-%s.icon' % i, '')}</span> - </div> - </td> - <td> - <div class="editable viewing"> - <span class="viewer"><a href="${forum.url()}">$forum.name</a>($forum.shortname)</span> - <span class="editor"> - ${text_field('forum-%s.name' % i, 'Forum Name', forum.name)} - </span> - </div> - <div class="editable viewing"> - <span class="viewer">${Markup(g.markdown.convert(forum.description))}</span> - <span class="editor multiline"> - ${text_area('forum-%s.description' % i, 'Description', forum.description)} - </span> - </div> - <py:if test="forum.subforums"> - <b>Subforums:</b> - <span py:for="j, sf in enumerate(forum.subforums)"> - <py:if test="j != 0">, </py:if> - <a href="${sf.url()}">$sf.name</a> - </span> - </py:if> - </td> - <td>${forum.num_topics}</td> - <td>${forum.num_posts}</td> - <td>${post_summary(forum.last_post)}</td> - <td> - <input name="forum-${i}.id" type="hidden" value="$forum._id"/> - <py:if test="forum.deleted">${submit_button('Undelete', 'forum-%s.undelete' % i)}</py:if> - <py:if test="not forum.deleted">${submit_button('Delete', 'forum-%s.delete' % i)}</py:if> - </td> - </tr> - </tbody> - </table> - <input type="button" id="add_forum" value="Add another forum" - /> - <div id="add_forum_form" style="display:none"> - <ol> - <li> - <label>Name:</label> - <input type="text" name="new_forum.name"/> - </li> - <li> - <label>Short Name:</label> - <input type="text" name="new_forum.shortname"/> - </li> - <li> - <label>Parent Forum:</label> - <select name="new_forum.parent"> - <option value="">None</option> - <option py:for="f in app.forums" value="$f._id">$f.name</option> - </select> - </li> - <li> - <label>Description:</label> - <textarea name="new_forum.description" style="height:50px;"/> - </li> - <li> - <label>Icon:</label> - ${file_field('new_forum.icon', '')} - </li> - <li> - <label> </label> - <input type="submit" id="new_forum.create" name="new_forum.create" value="Create Forum" - /> - <input type="button" id="add_forum_cancel" value="Cancel" - /> - </li> - </ol> +{% block title %}{{c.project.name}} / {{app.config.options.mount_label}} / Admin Forums{% endblock %} + +{% block header %}{{app.config.options.mount_label}} Admin Forums{% endblock %} + +{% block content %} +<form method="POST" action="update_forums" enctype="multipart/form-data"> + <table id="forums"> + <thead> + <tr> + <th/> + <th>Forum</th><th>Topics</th><th>Posts</th><th>Last Post</th> + <th/> + </tr> + </thead> + <tbody> + {% for forum in app.forums %} + <tr class="{{loop.index0%2 and ' even' or ''}}"> + <td> + <div class="editable viewing"> + <span class="viewer"> + {% if forum.icon %} + <img src="{{forum.url()}}/icon"/> + {% else %} + <img src="{{g.forge_static('images/project_default.png')}}"/> + {% endif %} + </span> + <span class="editor">{{lib.file_field('forum-%s.icon' % loop.index0, '')}}</span> </div> - </form> - </div> - </div> + </td> + <td> + <div class="editable viewing"> + <span class="viewer"><a href="{{forum.url()}}">{{forum.name}}</a>({{forum.shortname}})</span> + <span class="editor"> + {{lib.text_field('forum-%s.name' % loop.index0, 'Forum Name', forum.name)}} + </span> + </div> + <div class="editable viewing"> + <span class="viewer">{{g.markdown.convert(forum.description)|safe}}</span> + <span class="editor multiline"> + {{lib.text_area('forum-%s.description' % loop.index0, 'Description', forum.description)}} + </span> + </div> + {% if forum.subforums %} + <b>Subforums:</b> + {% for sf in forum.subforums %} + <span> + {% if loop.index1 != 0 %}, {% endif %} + <a href="{{sf.url()}}">{{sf.name}}</a> + </span> + {% endfor %} + {% endif %} + </td> + <td>{{forum.num_topics}}</td> + <td>{{forum.num_posts}}</td> + <td>{{lib.post_summary(forum.last_post)}}</td> + <td> + <input name="forum-{{i}}.id" type="hidden" value="{{forum._id}}"/> + {% if forum.deleted %} + <input type="submit" name="{{'forum-%s.undelete' % loop.index0}}" value="Undelete"/><br/> + {% else %} + <input type="submit" name="{{'forum-%s.delete' % loop.index0}}" value="Delete"/><br/> + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> + </table> + <input type="button" id="add_forum" value="Add another forum"/> + <div id="add_forum_form" style="display:none"> + <ol> + <li> + <label>Name:</label> + <input type="text" name="new_forum.name"/> + </li> + <li> + <label>Short Name:</label> + <input type="text" name="new_forum.shortname"/> + </li> + <li> + <label>Parent Forum:</label> + <select name="new_forum.parent"> + <option value="">None</option> + {% for f in app.forums %}<option value="{{f._id}}">{{f.name}}</option>{% endfor %} + </select> + </li> + <li> + <label>Description:</label> + <textarea name="new_forum.description" style="height:50px;"></textarea> + </li> + <li> + <label>Icon:</label> + {{lib.file_field('new_forum.icon', '')}} + </li> + <li> + <label> </label> + <input type="submit" id="new_forum.create" name="new_forum.create" value="Create Forum"/> + <input type="button" id="add_forum_cancel" value="Cancel"/> + </li> + </ol> </div> - </body> +</form> +{% endblock %} + +{% block extra_js %} <script type="text/javascript"> $(function() { $("#add_forum").click(function(){ @@ -126,4 +118,4 @@ }); }); </script> -</html> +{% endblock %}
ForgeDiscussion/forgediscussion/templates/admin_options.html to ForgeDiscussion/forgediscussion/templates/discussionforums/search.html
--- a/ForgeDiscussion/forgediscussion/templates/admin_options.html +++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/search.html @@ -1,22 +1,30 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> - <xi:include href="master.html" /> - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>$c.project.name / $app.config.options.mount_label / Admin Options</title> - </head> +{% extends 'jinja_master/master.html' %} - <body> - <h1 class="title">$app.config.options.mount_point Admin Options</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - ${c.options_admin.display(value=form_value, action="configure")} - </div> +{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Search{% endblock %} + +{% block header %}Search {{c.app.config.options.mount_point}}: {{q}}{% endblock %} + +{% block content %} + <form method="GET" action="."> + <input type="text" name="q" value="{{q}}" class="defaultText" title="Search App"/><br/> + <input type="submit" value="Search App"/> + <input type="submit" name="project" value="Search Entire Project"/><br/> + Search history? <input type="checkbox" name="history"{% if history %} checked="checked"{% endif %}/><br/> + </form> + {% if q %} + {% if count == 0 %} + <p>No results.</p> + {% elif count==1 %} + <p>{{count}} result.</p> + {% elif count > 1 %} + <p>{{count}} results.</p> + {% endif %} + {% endif %} + {% for doc in results %} + <div> + <a href="{{doc['url_s']}}">{{doc.title_s}}</a><br/> + {% if doc.get('snippet') %}<p>{{doc.snippet}}</p>{% endif %} + <hr/> </div> - </div> - </body> -</html> + {% endfor %} +{% endblock %}
ForgeDiscussion/forgediscussion/templates/artifact.html to ForgeDiscussion/forgediscussion/templates/discussionforums/index.html
--- a/ForgeDiscussion/forgediscussion/templates/artifact.html +++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/index.html @@ -1,59 +1,84 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> - <xi:include href="${g.allura_templates}/master.html"/> - <xi:include href="${c.app.templates}/lib.html" /> +{% extends 'jinja_master/master.html' %} - <?python from pprint import pformat ?> +{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Forums{% endblock %} - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>$c.project.name / $c.app.config.options.mount_label / ${artifact.shorthand_id()}</title> - <style> - .hidden { display: None } - </style> - </head> - - <body> - <h1 class="title">${artifact.shorthand_id()}</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - <div> - <a href="..">ToolRoot</a> - <form style="display:inline; float:right" - method="GET" - action="../search"> - Search: <input name="q"/> - </form> - </div> - <a py:if="prev is not None" href=".?version=1">First</a> - <a py:if="prev is not None" href=".?version=$prev"><</a> - Version $cur - <a py:if="next is not None" href=".?version=$ next">></a> - <a href=".">Latest</a> - <hr/> - <div> - <pre py:content="pformat(artifact)"/> - </div> +{% block header %}{{c.app.config.options.mount_label}}{% endblock %} - <hr/> - <h2>Comments</h2> - <div class="reply"> - <h3>Make a comment</h3> - <form class="hidden" method="post" action="comments/reply"> - <textarea rows="4" cols="60" name="text"></textarea><br/> - <input type="submit"/> - </form> - </div> - <py:for each="cmt in artifact.root_comments()"> - ${display_comment(cmt)} - </py:for> - </div> +{% block content %} + {% if announcements %} + <h3>Announcements</h3> + {{c.announcements_table.display(value=announcements)}} + {% endif %} + {% for forum in forums %} + {% if not forum.deleted or h.has_artifact_access('configure', app=c.app)() %} + <div> + <h2><a href="{{forum.url()}}">{{forum.name}}</a></h2> + {% if forum.deleted %} + <div class="notice">This forum has been deleted and is not visible to non-admin users</div> + {% endif %} + {{c.subscription_form.display(value=forum, threads=threads[forum._id], action=forum.url() + 'subscribe')}} + + <div class="clear"></div> </div> - </div> - </body> - <script type="text/javascript" src="${g.app_static('js/comments.js')}"/> -</html> + {% endif %} + {% endfor %} + {% if h.has_artifact_access('configure', app=c.app)() %} + <form method="POST" enctype="multipart/form-data" id="new_forum_form" + action="{{c.project.url()}}admin/{{c.app.config.options.mount_point}}/update_forums"> + <input type="button" id="add_forum" value="Add another forum"/> + <div id="add_forum_form" style="display:none"> + <ol> + <li> + <label>Name:</label> + <input type="text" name="new_forum.name"/> + </li> + <li> + <label>Short Name:</label> + <input type="text" name="new_forum.shortname"/> + </li> + <li> + <label>Parent Forum:</label> + <select name="new_forum.parent"> + <option value="">None</option> + {% for f in forums %}<option value="{{f._id}}">{{f.name}}</option>{% endfor %} + </select> + </li> + <li> + <label>Description:</label> + <textarea name="new_forum.description" style="height:50px;"></textarea> + </li> + <li> + <label>Icon:</label> + {{lib.file_field('new_forum.icon', '')}} + </li> + <li> + <label> </label> + <input type="submit" id="new_forum.create" name="new_forum.create" value="Create Forum"/> + <input type="button" id="add_forum_cancel" value="Cancel"/> + </li> + </ol> + </div> + <div class="clear"></div> + </form> + {% endif %} +{% endblock %} + +{% block extra_js %} + {% if h.has_artifact_access('configure', app=c.app)() %} + <script type="text/javascript"> + console.debug('aaa') + $(function() { + $("#add_forum").click(function(){ + $("#add_forum_form").show(); + $(this).hide(); + return false; + }); + $("#add_forum_cancel").click(function(){ + $("#add_forum_form").hide(); + $("#add_forum").show(); + return false; + }); + }); + </script> + {% endif %} +{% endblock %}
ForgeDiscussion/forgediscussion/templates/deleted.html to ForgeDiscussion/forgediscussion/templates/discussionforums/markdown_syntax.html
--- a/ForgeDiscussion/forgediscussion/templates/deleted.html +++ b/ForgeDiscussion/forgediscussion/templates/discussionforums/markdown_syntax.html @@ -1,26 +1,30 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> +{% extends 'jinja_master/master.html' %} - <xi:include href="${g.allura_templates}/master.html"/> - <xi:include href="${c.app.templates}/lib.html" /> - <?python from allura.lib.security import has_artifact_access?> +{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Markdown Syntax{% endblock %} - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>This forum has been deleted</title> - </head> +{% block header %}Markdown Syntax{% endblock %} - <body> - <h1 class="title">This forum has been deleted</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - The forum you are trying to access no longer exists. - </div> - </div> - </div> - </body> -</html> +{% block content %} + <p>You can use + <a href="http://daringfireball.net/projects/markdown/">MarkDown</a> + Syntax here</p> + <h4>Example Input</h4> + <pre style="background-color:#fff"> +# First-level heading + +Some *emphasized* and **strong** text + +#### Fourth-level heading + +</pre> + <h4>Example Rendering</h4> + <div style="background-color:#fff">{{g.markdown.convert(''' +# First-level heading + +Some *emphasized* and **strong** text + +#### Fourth-level heading + +''')|safe}}</div> + <a href="http://daringfireball.net/projects/markdown/syntax">More Examples</a> +{% endblock %}
ForgeDiscussion/forgediscussion/templates/forum.html to ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/thread_header.html
--- a/ForgeDiscussion/forgediscussion/templates/forum.html +++ b/ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/thread_header.html @@ -1,58 +1,21 @@ -asdfasdf<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> +{% import 'jinja_master/lib.html' as lib with context %} - <xi:include href="${g.allura_templates}/master.html"/> - <xi:include href="${c.app.templates}/lib.html" /> +<div class="actions"> + {% if show_moderate and h.has_artifact_access('moderate', value)() %} + <a href="#" class="btn ico-l" id="mod_thread_link"><b class="ui-icon ui-icon-pencil"></b> <span>Moderate</span></a> + {% endif %} +</div> - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>$c.project.name / $c.app.config.options.mount_label / $forum.name</title> - </head> - - <body> - <h1 class="title">$forum.name</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - <p>Forum Shortlink: [${forum.shorthand_id()}]</p> - <div>${Markup(g.markdown.convert(forum.description))}</div> - <a href="mailto:$forum.email_address">Post via Email</a> - <div py:if="has_artifact_access('moderate', forum)()"> - <a href="moderate/">Moderate Messages</a> - </div> - <div py:if="forum.parent" class="breadcrumbs" > - <ul>${crumbs(forum.breadcrumbs())}</ul> - </div> +<div class="breadcrumbs">{{lib.crumbs(value.discussion.breadcrumbs())}}</div> - <py:if test="forum.subforums"> - <h2>SubForums</h2> - ${forums_table(parent_id=forum._id)} - </py:if> - - <h2>Topics</h2> - <py:if test="announcements"> - <h3>Announcements</h3> - ${c.announcements_table(value=announcements)} - </py:if> - <form method="post" action="${c.app.script_name}subscribe"> - ${threads_table(threads)} - ${submit_button('Update Subscriptions')} - </form> - <div class="title-pane closed"> - <h2 class="title">New Topic</h2> - <div class="content"> - <form method="post" action="thread/new"> - ${text_field('subject', 'Subject')} - ${text_area('content', 'Content')} - ${submit_button('Create new topic')} - </form> - </div> - </div> - </div> - </div> - </div> - </body> -</html> +{% if value.discussion.announcements %} + <h3>Announcements</h3> + {{widgets.announcements_table.display(value=value.discussion.announcements)}} +{% endif %} +{% if show_moderate and h.has_artifact_access('moderate', value)() %} + <div id="mod_thread_form" style="display: none;"> + <h2>Moderate Thread</h2> + {{widgets.moderate_thread.display(value=value, action=value.url()+'moderate')}} + <div style="clear: both;"> </div> + </div> +{% endif %}
ForgeDiscussion/forgediscussion/templates/help.html to ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/forum_header.html
--- a/ForgeDiscussion/forgediscussion/templates/help.html +++ b/ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/forum_header.html @@ -1,25 +1,17 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> +{% if value.announcements %} + <h3>Announcements</h3> + {{widgets.announcements_table.display(value=value.announcements)}} +{% endif %} - <xi:include href="${g.allura_templates}/master.html"/> - <xi:include href="lib.html"/> +{% if value.parent %} +<div class="breadcrumbs" > + <ul>{{crumbs(value.breadcrumbs())}}</ul> +</div> +{% endif %} - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>$c.project.name / $c.app.config.options.mount_label / Forum Permissions</title> - </head> - - <body> - <h1 class="title">Forum Permissions</h1> - <div class="content"> - <div class="row"> - <div class="column grid_12"> - <p>Help is coming soon.</p> - </div> - </div> - </div> - </body> -</html> +{% if value.subforums %} + {{widgets.forum_subscription_form.display( + threads=value.threads, + value=dict(forums=value.subforums), + action=value.url() + 'subscribe_subforum')}} +{% endif %}
ForgeDiscussion/forgediscussion/widgets/templates/forum_summary.html to ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/forum_summary.html
--- a/ForgeDiscussion/forgediscussion/widgets/templates/forum_summary.html +++ b/ForgeDiscussion/forgediscussion/widgets/templates/discussion_widgets/forum_summary.html @@ -1,13 +1,11 @@ -<div xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - py:strip="True"> - <a href="${value.url()}">$value.name</a>($value.shortname)<br/> - ${Markup(g.markdown.convert(value.description))} - <py:if test="value.subforums"> - <b>Subforums:</b> - <span py:for="i, sf in enumerate(value.subforums)"> - <py:if test="i != 0">, </py:if> - <a href="${sf.url()}">$sf.name</a> +<a href="{{value.url()}}">{{value.name}}</a>({{value.shortname}})<br/> +{{g.markdown.convert(value.description)|safe}} +{% if value.subforums %} + <b>Subforums:</b> + {% for sf in value.subforums %} + <span> + {% if loop.index0 != 0 %}, {% endif %} + <a href="{{sf.url()}}">{{sf.name}}</a> </span> - </py:if> -</div> + {% endfor %} +{% endif %}