diff MoinMoin/templates/modify.html @ 1451:c32ff2e07e7a

Introduce itemtype. itemtype is used to affect the overall frontend view of an item, and to affect the indexer by offering a set of metadata keys. The original items.Item hierarchy was mosted turned into the new Content hierarchy, leaving code affecting the overview in the new Item and Default (which is an Item descent) classes. Item instances now have a `content` property which is what used to be an Item instance (now a Content instance). This is the first itemtype changeset which just moves codes around ensure they are not broken. More changesets follow soon.
author Cheer Xiao <xiaqqaix@gmail.com>
date Sat, 28 Jul 2012 01:22:44 +0800
parents MoinMoin/templates/modify_applet.html@100197cb69ab
children 48bcafd8f5ec c6974ba2e2b2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/templates/modify.html	Sat Jul 28 01:22:44 2012 +0800
@@ -0,0 +1,65 @@
+{% import "forms.html" as forms %}
+{% import "utils.html" as utils %}
+{% extends theme("layout.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 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 %}