{# This template renders the web page used to modify an existing item, preview changes to a text item, or create a new wiki item. Based upon content type, the data_editor macro that is passed will generate a file upload option and/or a text editor, or specialized a drawing tool to create/modify svgdraw items. If a new item, this page is displayed after the user navigates through a series of web pages to: * select item type (modify_select_itemtype.html), user may select default, ticket, blog * select content type (modify_select_contenttype.html) * select edit "from scratch" or "from template" #} {% import "forms.html" as forms %} {% import "utils.html" as utils %} {% extends theme("show.html") %} {% from form.meta_template import meta_editor with context %} {# 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 with context %} {% set extra_head = content_template.extra_head %} {% set data_editor = content_template.data_editor %} {% set title = _("Modifying '{item_name}'").format(item_name=fqname|shorten_fqname) %} {% block head %} {{ super() }} {% if extra_head %} {{ extra_head() }} {% endif %} {% endblock %} {% block content %}

{{ title }}

{{ gen.form.open(form, method='post', enctype='multipart/form-data') }} {{ forms.render_errors(form) }} {# Workaround: For *Draw content, hide submit button and form['comment'], since *Draw POSTs originate from their respective applets. #} {% if not form['content_form'].is_draw %} {% if draft_data %} {% set warning = _("Clicking this button will delete draft!") %} {% endif %} {% endif %} {{ utils.help_on_editing(help) }} {{ data_editor(form['content_form'], item_name) }} {% set may_admin = user.may.admin(fqname) %} {% if item.meta['name'][0].endswith('Group') %}
{{ forms.render(form['usergroup']) }}
{{ _('Enter list of user names, one name per line.') }}
{% endif %} {% if item.meta['name'][0].endswith('Dict') %}
{{ forms.render(form['wikidict']) }}
{{ _('Enter "key=value" strings, one per line, no quotes, no blank lines.') }}
{% endif %} {# Workaround: For *Draw content, hide form['comment'], since *Draw POSTs originate from their respective applets. #} {% if not form['content_form'].is_draw %}
{{ forms.render(form['comment']) }}
{% endif %} {{ meta_editor(form['meta_form'], may_admin) }} {% block moin_flash %} {% endblock %} {# Workaround: For *Draw content, hide submit button, since *Draw POSTs originate from their respective applets. #} {% if not form['content_form'].is_draw %}
{% set warning = "" %} {{ gen.input(type='submit', id='moin-cancel-text-button', name='cancel', value=form.cancel_label, class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", title=warning) }} {{ gen.input(type='submit', id='moin-preview-text-button', name='preview', value=form.preview_label, class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", title=warning) }} {{ gen.input(type='submit', id='moin-save-text-button', value=form.submit_label, class='moin-button moin-modify-submit', title=warning) }}
{% endif %} {{ gen.form.close() }}
{% if preview_rendered %} {# user clicked Preview button, show diff and modified item as draft #} {{ utils.diff_table(preview_diffs) }}
{{ preview_rendered | safe }}
{% endif %} {% endblock %} {% block options_for_javascript %} {%- if user.scroll_page_after_edit -%}
{%- endif %} {%- if draft_data -%} {%- endif %} {%- if lock_duration -%} {%- endif %} {% endblock %}