at main 8.5 kB view raw
1{% if operation_completed %} 2<article class="message is-success"> 3 <div class="message-header"> 4 {% if create_event %} 5 <p>The event has been created!</p> 6 {% else %} 7 <p>The event has been updated!</p> 8 {% endif %} 9 </div> 10 <div class="message-body"> 11 <p class="buttons"> 12 <a class="button" href="{{ event_url }}"> 13 <span class="icon"> 14 <i class="fas fa-file"></i> 15 </span> 16 <span>View Event</span> 17 </a> 18 </p> 19 </div> 20</article> 21{% else %} 22 23{% from "form_include.html" import text_input %} 24<form hx-post="{{ submit_url }}" hx-swap="outerHTML" class="my-5"> 25 26 {% if build_event_form.build_state == "Reset" %} 27 <input type="hidden" name="build_state" value="Selecting"> 28 {% elif build_event_form.build_state == "Selecting" %} 29 <input type="hidden" name="build_state" value="Selected"> 30 {% elif build_event_form.build_state == "Selected" %} 31 <input type="hidden" name="build_state" value="Selected"> 32 {% endif %} 33 34 35 <div class="field"> 36 <label class="label" for="createEventNameInput">Name (required)</label> 37 <div class="control {% if build_event_form.name_error %} has-icons-right{% endif %}" 38 data-loading-class="is-loading"> 39 <input type="text" class="input {% if build_event_form.name_error %} is-danger{% endif %}" 40 id="createEventNameInput" name="name" minlength="10" maxlength="500" placeholder="My Awesome Event" {% 41 if build_event_form.name %}value="{{ build_event_form.name }}" {% endif %} required 42 data-loading-disable> 43 </div> 44 {% if build_event_form.name_error %} 45 <p class="help is-danger">{{ build_event_form.name_error }}</p> 46 {% else %} 47 <p class="help">Must be at least 10 characters and no more than 500 characters.</p> 48 {% endif %} 49 </div> 50 51 <div class="field"> 52 <label class="label" for="createEventTextInput">Text (required)</label> 53 <div class="control"> 54 <textarea class="textarea{% if build_event_form.description_error %} is-danger{% endif %}" 55 id="createEventTextInput" name="description" maxlength="3000" rows="10" 56 placeholder="A helpful, brief description of the event." required 57 data-loading-disable>{% if build_event_form.description %}{{ build_event_form.description }}{% endif %}</textarea> 58 </div> 59 {% if build_event_form.description_error %} 60 <p class="help is-danger">{{ build_event_form.description_error }}</p> 61 {% else %} 62 <p class="help">Must be at least 10 characters and no more than 3000 characters.</p> 63 {% endif %} 64 </div> 65 66 <div class="field"> 67 <div class="field-body"> 68 <div class="field"> 69 <label class="label" for="createEventStatus">Status</label> 70 <div class="control"> 71 <div class="select"> 72 <select id="createEventStatus" name="status" 73 class="{% if build_event_form.status_error %}is-danger{% endif %}"> 74 <option {% if build_event_form.status=='planned' or not build_event_form.status %} 75 selected="selected" {% endif %} value="planned"> 76 Planned 77 </option> 78 <option {% if build_event_form.status=='scheduled' %} selected="selected" {% endif %} 79 value="scheduled"> 80 Scheduled 81 </option> 82 <option {% if build_event_form.status=='cancelled' %} selected="selected" {% endif %} 83 value="cancelled"> 84 Cancelled 85 </option> 86 <option {% if build_event_form.status=='postponed' %} selected="selected" {% endif %} 87 value="postponed"> 88 Postponed 89 </option> 90 <option {% if build_event_form.status=='rescheduled' %} selected="selected" {% endif %} 91 value="rescheduled"> 92 Rescheduled 93 </option> 94 </select> 95 </div> 96 </div> 97 {% if build_event_form.status_error %} 98 <p class="help is-danger">{{ build_event_form.status_error }}</p> 99 {% endif %} 100 </div> 101 <div class="field pb-5"> 102 <label class="label" for="createEventMode">Mode</label> 103 <div class="control"> 104 <div class="select"> 105 <select id="createEventMode" name="mode" 106 class="{% if build_event_form.mode_error %}is-danger{% endif %}"> 107 <option value="virtual" {% if build_event_form.mode=='virtual' %} selected{% endif %}> 108 Virtual 109 </option> 110 <option value="hybrid" {% if build_event_form.mode=='hybrid' %} selected{% endif %}>Hybrid 111 </option> 112 <option value="inperson" {% if build_event_form.mode=='inperson' or not 113 build_event_form.mode %} selected{% endif %}>In Person</option> 114 </select> 115 </div> 116 </div> 117 {% if build_event_form.mode_error %} 118 <p class="help is-danger">{{ build_event_form.mode_error }}</p> 119 {% endif %} 120 </div> 121 </div> 122 </div> 123 124 {% include "create_event.en-us.starts_form.html" %} 125 126 {% if locations_editable or create_event %} 127 {% include "create_event.en-us.location_form.html" %} 128 {% else %} 129 <div class="field"> 130 <label class="label">Location</label> 131 <div class="notification is-warning"> 132 <p><strong>Location cannot be edited</strong></p> 133 <p>{{ location_edit_reason }}</p> 134 <p>Only events with a single location of type "Address" can be edited through this form.</p> 135 </div> 136 137 {% if location_display_info %} 138 <!-- Display existing locations in read-only mode --> 139 <div class="content"> 140 <ul> 141 {% for location in location_display_info %} 142 <li> 143 {% if location.type == "uri" %} 144 <strong>Link:</strong> 145 {% if location.name %}{{ location.name }}{% endif %} 146 <a href="{{ location.uri }}" target="_blank">{{ location.uri }}</a> 147 {% elif location.type == "address" %} 148 <strong>Address:</strong> 149 {% if location.name %}<div>{{ location.name }}</div>{% endif %} 150 {% if location.street %}<div>{{ location.street }}</div>{% endif %} 151 {% if location.locality %}{{ location.locality }}{% endif %}{% if location.region %}, {{ location.region }}{% endif %}{% if location.postal_code %} {{ location.postal_code }}{% endif %} 152 {% if location.country %}<div>{{ location.country }}</div>{% endif %} 153 {% else %} 154 <strong>Other location type</strong> 155 {% endif %} 156 </li> 157 {% endfor %} 158 </ul> 159 </div> 160 {% else %} 161 <p>No location information available.</p> 162 {% endif %} 163 </div> 164 {% endif %} 165 166 {% include "create_event.en-us.link_form.html" %} 167 168 <hr /> 169 <div class="field"> 170 <div class="control"> 171 <button data-loading-disable data-loading-aria-busy type="submit" id="createEventSubmit" 172 class="button is-link" name="submit" value="Submit"> 173 {% if create_event %}Create{% else %}Update{% endif %} 174 Event 175 </button> 176 {% if cancel_url %} 177 <a href="{{ cancel_url }}" class="button">Cancel</a> 178 {% endif %} 179 </div> 180 </div> 181 182 {% if is_development %} 183 <pre><code>{{ build_event_form | tojson(indent=2) }}</code></pre> 184 {% endif %} 185</form> 186 187 188{% endif %}