changeset 1603:27827221d3ca

Foobar theme modify templates changed as per structural changes
author Jaiditya Mathur <jaiditya.mathur@gmail.com>
date Sat, 04 Aug 2012 18:32:06 +0530
parents 7fd50eb6eab4
children 199181f2de0d
files MoinMoin/themes/foobar/static/css/common.css MoinMoin/themes/foobar/static/css/stylus/main.styl MoinMoin/themes/foobar/templates/modify.html MoinMoin/themes/foobar/templates/modify_applet.html MoinMoin/themes/foobar/templates/modify_binary.html MoinMoin/themes/foobar/templates/modify_select_contenttype.html MoinMoin/themes/foobar/templates/modify_select_template.html MoinMoin/themes/foobar/templates/modify_show_template_selection.html MoinMoin/themes/foobar/templates/modify_show_type_selection.html MoinMoin/themes/foobar/templates/modify_svg-edit.html MoinMoin/themes/foobar/templates/modify_text.html MoinMoin/themes/foobar/templates/modify_text_html.html
diffstat 12 files changed, 107 insertions(+), 100 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/foobar/static/css/common.css	Sat Aug 04 12:00:37 2012 +0530
+++ b/MoinMoin/themes/foobar/static/css/common.css	Sat Aug 04 18:32:06 2012 +0530
@@ -407,6 +407,7 @@
 pre.comment{background-color:#2d2d2d;color:#fff;margin:0;padding:0;border:0;}
 pre.comment:before{content:url("../img/attention.png")}
 textarea{font-family:monospace;width:98%;border:1px solid #ccc;margin-left:.5em}
+#f_meta_text{margin-left:-.6em}
 input#f_comment{width:96%;border:1px solid #ccc;margin:.3em 0}
 .moin-subitem-navigation{overflow:hidden;word-wrap:break-word;}
 .moin-subitem-navigation ul{display:block;}
--- a/MoinMoin/themes/foobar/static/css/stylus/main.styl	Sat Aug 04 12:00:37 2012 +0530
+++ b/MoinMoin/themes/foobar/static/css/stylus/main.styl	Sat Aug 04 18:32:06 2012 +0530
@@ -989,6 +989,9 @@
     border border_style
     margin-left .5em
 
+#f_meta_text
+    margin-left -.6em
+
 input#f_comment
     width 96%
     border border_style
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/themes/foobar/templates/modify.html	Sat Aug 04 18:32:06 2012 +0530
@@ -0,0 +1,65 @@
+{% import "forms.html" as forms %}
+{% import "utils.html" as utils %}
+{% extends theme("local.html") %}
+
+{# Import macros data_editor and extra_head from content_form's template.
+   extra_head is optional, so instead of a simple "import from" we need to do
+   this manually #}
+{% import form['content_form'].template as content_template %}
+{% set extra_head = content_template.extra_head %}
+{% set data_editor = content_template.data_editor %}
+
+{% set title = _("Modifying %(item_name)s", item_name=item_name) %}
+
+{% block head %}
+    {{ super() }}
+    {% if extra_head %}
+        {{ extra_head() }}
+    {% endif %}
+{% endblock %}
+
+{% block subitem_navigation %}
+    {% call(fullname, shortname, contenttype, has_children) utils.render_subitem_navigation(item_name, True) %}
+        {% set shortname = shortname|json_dumps %}
+        {% set fullname = fullname|json_dumps %}
+        <button class="link-action" onclick='linkSubitem({{ shortname }}, {{ fullname }})'
+            title="{{ _('Link to Subitem') }}">{{ _('Link') }}</button>
+        <button class="transclude-action"
+            onclick='transcludeSubitem({{ shortname }}, {{ fullname }})'
+            title="{{ _('Transclude Subitem') }}">{{ _('Transclude') }}</button>
+    {% endcall %}
+{% endblock %}
+
+
+{% block content %}
+<h1>{{ title }}</h1>
+<div id="moin-modify" class="moin-form">
+    {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
+    {{ forms.render_errors(form) }}
+    {#
+       Workaround:
+       For *Draw content, hide form['submit'] and form['comment'], since *Draw
+       POSTs originate from their respective applets.
+    #}
+    {% if not form['content_form'].is_draw %}
+        {{ forms.render(form['submit']) }}
+        <dl>
+            {{ forms.render_textcha(gen, form) }}
+            {{ forms.render(form['comment']) }}
+        </dl>
+    {% endif %}
+    {{ data_editor(form['content_form']) }}
+    {% if form['content_form'].help %}
+        <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
+    {% endif %}
+    <dl>
+        {{ forms.render(form['meta_text']) }}
+    </dl>
+    {#
+    {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
+    <br />
+    {{ forms.render_errors(form['meta_text']) }}
+    #}
+    {{ gen.form.close() }}
+</div>
+{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_applet.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-{% import "forms.html" as forms %}
-{% extends theme("local.html") %}
-{% block content %}
-<h1>{{ _("Modifying %(item_name)s", item_name=item_name) }}</h1>
-<div id="moin-modify" class="moin-form">
-{{ gen.form.open(form, method='post', action='', enctype='multipart/form-data') }}
-{{ forms.render_errors(form) }}
-{% block extra_form %}{% endblock %}
-{% block data_editor %}{% endblock %}
-{{ forms.render(form['data_file']) }}
-<pre>{{ help }}</pre>
-{{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
-<br />
-{{ forms.render_errors(form['meta_text']) }}
-{{ gen.form.close() }}
-</div>
-{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_binary.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-{% import "forms.html" as forms %}
-{% extends theme("modify_applet.html") %}
-{% block extra_form %}
-{{ forms.render(form['submit']) }}
-{{ forms.render_textcha(gen, form) }}
-{{ forms.render(form['comment']) }}
-{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/themes/foobar/templates/modify_select_contenttype.html	Sat Aug 04 18:32:06 2012 +0530
@@ -0,0 +1,22 @@
+{% extends theme("local.html") %}
+{% block content %}
+<h1>{{ _("Create new item?") }}</h1>
+<p>
+{# XXX should show itemtype's display name #}
+{{ _("Please select the contenttype of the new %(itemtype)s item.", itemtype=itemtype) }}
+</p>
+<table id="moin-create-table" class="zebra">
+    {% for gname, contenttypes in contenttype_groups %}
+    <tr>
+        <th>{{ gname }}</th>
+    </tr>
+    <tr>
+        <td> |&nbsp
+        {% for ctname, ctlabel in contenttypes %}
+            <a href="{{ url_for('frontend.modify_item', item_name=item_name, itemtype=itemtype, contenttype=ctname) }}">{{ ctlabel }}</a> &nbsp|&nbsp
+        {% endfor %}
+        </td>
+    </tr>
+    {% endfor %}
+</table>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/themes/foobar/templates/modify_select_template.html	Sat Aug 04 18:32:06 2012 +0530
@@ -0,0 +1,16 @@
+{% extends theme("local.html") %}
+{% block content %}
+<h1>{{ _("Create new item?") }}</h1>
+<p>
+{{ _("You can either <a href='%(modifyhref)s'>create the item from scratch</a> or select a template.",
+modifyhref=url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template='') ) }}
+</p>
+<h2>{{ _("Available template items") }}</h2>
+<ul>
+    {% for template in templates %}
+    <li>
+    <a href="{{ url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template=template) }}">{{ template }}</a>
+    </li>
+    {% endfor %}
+</ul>
+{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_show_template_selection.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-{% extends theme("local.html") %}
-{% block content %}
-<h1>{{ _("Create new item?") }}</h1>
-<p>
-{{ _("You can either <a href='%(modifyhref)s'>create the item from scratch</a> or select a template.",
-modifyhref=url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template='') ) }}
-</p>
-<h2>{{ _("Available template items") }}</h2>
-<ul>
-    {% for template in templates %}
-    <li>
-    <a href="{{ url_for('frontend.modify_item', item_name=item_name, contenttype=contenttype, template=template) }}">{{ template }}</a>
-    </li>
-    {% endfor %}
-</ul>
-{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_show_type_selection.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-{% extends theme("local.html") %}
-{% block content %}
-<h1>{{ _("Create new item?") }}</h1>
-<p>
-{{ _("This item does not exist (yet), but you can try creating it now. Please select the type of the item you want to create.") }}
-</p>
-<table id="moin-create-table" class="zebra">
-    {% for gname, contenttypes in contenttype_groups %}
-    <tr>
-        <th>{{ gname }}</th>
-    </tr>
-    <tr>
-        <td> |&nbsp
-        {% for ctname, ctlabel in contenttypes %}
-            <a href="{{ url_for('frontend.modify_item', item_name=item_name, contenttype=ctname) }}">{{ ctlabel }}</a> &nbsp|&nbsp 
-        {% endfor %}
-        </td>
-    </tr>
-    {% endfor %}
-</table>
-{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_svg-edit.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-{% extends theme("modify_applet.html") %}
-{% block data_editor %}
-<p>
-<object data="{{ url_for('serve.files', name='svgedit_moin', filename='editor/svg-editor.html') }}?paramurl={{ url_for('frontend.get_item', item_name=item_name, member='drawing.svg') }}" width="100%" height="600">
-</object>
-</p>
-<br />
-{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_text.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-{% extends theme("modify_binary.html") %}
-{% import "utils.html" as utils %}
-
-{% block subitem_navigation %}
-        {% call(fullname, shortname, contenttype, has_children) utils.render_subitem_navigation(item_name, True) %}
-            {% set shortname = shortname|json_dumps %}
-            {% set fullname = fullname|json_dumps %}
-            <button class="link-action" onclick='linkSubitem({{ shortname }}, {{ fullname }})'
-                title="{{ _('Link to Subitem') }}">{{ _('Link') }}</button>
-            <button class="transclude-action"
-                onclick='transcludeSubitem({{ shortname }}, {{ fullname }})'
-                title="{{ _('Transclude Subitem') }}">{{ _('Transclude') }}</button>
-        {% endcall %}
-{% endblock %}
-
-{% block data_editor %}
-{{ gen.textarea(form['data_text'], lang=lang, dir=direction, rows=rows_data, cols=cols) }}
-<br />
-{% endblock %}
--- a/MoinMoin/themes/foobar/templates/modify_text_html.html	Sat Aug 04 12:00:37 2012 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-{% extends theme("modify_binary.html") %}
-
-{% block head %}
-{{ super() }}
-<script type="text/javascript" src="{{ url_for('serve.files', name='ckeditor', filename='ckeditor.js') }}"></script>
-{% endblock %}
-
-{% block data_editor %}
-<p>
-{{ gen.textarea(form['data_text'], class='ckeditor', lang=lang, dir=direction, rows=rows_data, cols=cols) }}
-</p>
-{% endblock %}