{% extends "cosinnus_marketplace/base.html" %} {% load i18n static cosinnus_tags widget_tweaks thumbnail %} {% block extrahead %} {{ block.super }} {% include 'cosinnus/common/simplemde_dependencies.html' with element_id=form.form.obj.description.id_for_label %} {% endblock %} {% block page_title %} {% if form_view == "add" %} {% trans "Add Offer" %} {% elif form_view == "edit" %} {% trans "Edit" %}: {{ offer.title }} {% endif %} {{ block.super }} {% endblock page_title %} {% block breadcrumb %} {{ block.super }}
  • {% if form_view == "add" %} {% trans "Add Offer" %} {% elif form_view == "edit" %} {% trans "Edit" %}: {{ offer.title }} {% endif %}
  • {% endblock %} {% block leftnav %} {% include "cosinnus_marketplace/leftnav.html" with return_to="offers"%} {% include 'cosinnus/common/help_button_leftnav_for_popup.html' with help_text_id="helptext_3_marketplace" %} {% endblock leftnav %} {% block content %} {% if form.forms.obj.errors or form.forms.media_tag.errors %}

    {% trans "There was an error in one of the fields you entered. Please correct it before saving!" %}

    {% endif %}
    {% csrf_token %} {{ form.forms.obj.media }} {{ form.forms.obj.non_field_errors }} {{ form.forms.media_tag.non_field_errors }}
    {# Regular field with custom HTML #} {% trans "Offer type" as type_label %} {% captureas type_html %} {{ form.forms.obj.type.errors }}
    {# please keep this linebreak formatting so that no spaces exit between the
    {% endcaptureas %} {% include 'cosinnus/fields/default_field.html' with field_html=type_html label=type_label large_field=True first=True unstyled=True %} {% trans "Offer Title" as title_label %} {% include 'cosinnus/fields/default_field.html' with field=form.forms.obj.title label=title_label placeholder=title_label %} {# SimpleMDE Description Field (gets initialized in extrahead) #} {% trans "Description" as description_placeholder %} {% trans "Enter a description for your offer." as description_label %} {% include 'cosinnus/fields/default_field.html' with field=form.forms.obj.description legend=description_legend label=description_label placeholder=description_placeholder large_field=True %} {# Regular Field #} {% trans "Phone number" as phone_label %} {% trans "Your phone number is only visible for registered users" as phone_legend %} {% trans "Phone number" as phone_placeholder %} {% include 'cosinnus/fields/default_field.html' with field=form.forms.obj.phone_number label=phone_label legend=phone_legend placeholder=phone_placeholder %} {% if form.forms.obj.get_categories_grouped %} {# Regular field with custom HTML #} {% trans "Categories" as categories_label %} {% trans "Check all categories that fit your offer" as categories_legend %} {% captureas categories_html %} {{ form.forms.obj.categories.errors }}
    {% for group, categories in form.forms.obj.get_categories_grouped %}
    {% if group == 'zzz_misc' %}{% trans "Misc" %}{% else %}{{ group }}{% endif %} {% for category in categories %}
    {% endfor %}
    {% endfor %}
    {% endcaptureas %} {% include 'cosinnus/fields/default_field.html' with field_html=categories_html label=categories_label legend=categories_legend large_field=True unstyled=True %} {% endif %} {% captureas files_label %} {% trans "Upload a file or image or attach an existing one" %}. {% trans "The first uploaded image will be displayed as a wallpaper" %}{% endcaptureas %} {% include 'cosinnus/media_tags.html' with show_files=True disable_tags=True files_label=files_label %} {# Checkbox Field #} {% trans "Offer is active" as active_label %} {% trans "Only active offers will be listed in the Marketplace. Your offer will stay active for 4 weeks. After that, you can reactivate it at any time." as active_legend %} {% include 'cosinnus/fields/checkbox_field.html' with field=form.forms.obj.is_active label=active_label legend=active_legend checkbox_label=active_label %}
    {% endblock content %}