i18n+filtering fork - fluent-templates v2

Fix corrupted templates for French Canadian locale

Changed files
+103 -67
templates
+103 -67
templates/create_event.fr-ca.partial.html
··· 63 63 {% endif %} 64 64 </div> 65 65 66 - {% if build_event_form.build_state == "Reset" %} 67 - 68 - <div class="field is-grouped"> 69 - <div class="control"> 70 - <button class="button is-link" type="submit" data-loading-disable> 71 - {{ t("form-next") }} 72 - </button> 73 - </div> 74 - </div> 75 - 76 - {% elif build_event_form.build_state == "Selecting" %} 77 - 78 66 <div class="field"> 79 - <label class="label">{{ t("label-location") }}</label> 80 - <div class="control"> 81 - <div class="subtitle has-text-weight-normal" style="margin-bottom: 4px"> 82 - {{ t("label-event-location-type") }} 67 + <div class="field-body"> 68 + <div class="field"> 69 + <label class="label" for="createEventStatus">{{ t("label-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 + {{ t("label-status-planned") }} 77 + </option> 78 + <option {% if build_event_form.status=='scheduled' %} selected="selected" {% endif %} 79 + value="scheduled"> 80 + {{ t("label-status-scheduled") }} 81 + </option> 82 + <option {% if build_event_form.status=='cancelled' %} selected="selected" {% endif %} 83 + value="cancelled"> 84 + {{ t("label-status-cancelled") }} 85 + </option> 86 + <option {% if build_event_form.status=='postponed' %} selected="selected" {% endif %} 87 + value="postponed"> 88 + {{ t("label-status-postponed") }} 89 + </option> 90 + <option {% if build_event_form.status=='rescheduled' %} selected="selected" {% endif %} 91 + value="rescheduled"> 92 + {{ t("label-status-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 %} 83 100 </div> 84 - 85 - <input type="radio" id="createEventPhysical" name="location_type" value="physical" 86 - {% if build_event_form.location_type == 'physical' %}checked{% endif %} data-loading-disable> 87 - <label for="createEventPhysical">{{ t("location-type-address") }}</label> 88 - <br> 89 - 90 - <input type="radio" id="createEventOnline" name="location_type" value="online" 91 - {% if build_event_form.location_type == 'online' %}checked{% endif %} data-loading-disable> 92 - <label for="createEventOnline">{{ t("location-type-online") }}</label> 93 - <br> 94 - 95 - <input type="radio" id="createEventOther" name="location_type" value="other" 96 - {% if build_event_form.location_type == 'other' %}checked{% endif %} data-loading-disable> 97 - <label for="createEventOther">{{ t("location-type-other") }}</label> 98 - </div> 99 - </div> 100 - 101 - <div class="field is-grouped"> 102 - <div class="control"> 103 - <button class="button is-link" type="submit" data-loading-disable> 104 - {{ t("form-next") }} 105 - </button> 101 + <div class="field pb-5"> 102 + <label class="label" for="createEventMode">{{ t("label-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 + {{ t("label-mode-virtual") }} 109 + </option> 110 + <option value="hybrid" {% if build_event_form.mode=='hybrid' %} selected{% endif %}> 111 + {{ t("label-mode-hybrid") }} 112 + </option> 113 + <option value="inperson" {% if build_event_form.mode=='inperson' or not 114 + build_event_form.mode %} selected{% endif %}>{{ t("label-mode-inperson") }}</option> 115 + </select> 116 + </div> 117 + </div> 118 + {% if build_event_form.mode_error %} 119 + <p class="help is-danger">{{ build_event_form.mode_error }}</p> 120 + {% endif %} 121 + </div> 106 122 </div> 107 123 </div> 108 124 109 - {% else %} 125 + {% include "create_event." + current_locale + ".starts_form.html" %} 110 126 111 - {% if build_event_form.location_type == 'online' %} 112 - {% include 'create_event.' + current_locale + '.link_form.html' %} 113 - {% elif build_event_form.location_type == 'physical' %} 114 - {% include 'create_event.' + current_locale + '.location_form.html' %} 127 + {% if locations_editable or create_event %} 128 + {% include "create_event." + current_locale + ".location_form.html" %} 115 129 {% else %} 116 - <div class="field"> 117 - <label class="label" for="createEventLocationName">{{ t("label-location-name") }}</label> 118 - <div class="control"> 119 - <input class="input" id="createEventLocationName" type="text" name="venue_name" 120 - placeholder="{{ t('placeholder-venue-name') }}" data-loading-disable 121 - {% if build_event_form.venue_name %}value="{{ build_event_form.venue_name }}"{% endif %}> 122 - </div> 130 + <div class="field"> 131 + <label class="label">{{ t("location") }}</label> 132 + <div class="notification is-warning"> 133 + <p><strong>{{ t("location-cannot-edit") }}</strong></p> 134 + <p>{{ location_edit_reason }}</p> 135 + <p>{{ t("location-edit-explanation") }}</p> 136 + </div> 137 + 138 + {% if location_display_info %} 139 + <!-- Display existing locations in read-only mode --> 140 + <div class="content"> 141 + <ul> 142 + {% for location in location_display_info %} 143 + <li> 144 + {% if location.type == "uri" %} 145 + <strong>{{ t("link-label") }}:</strong> 146 + {% if location.name %}{{ location.name }}{% endif %} 147 + <a href="{{ location.uri }}" target="_blank">{{ location.uri }}</a> 148 + {% elif location.type == "address" %} 149 + <strong>{{ t("address-label") }}:</strong> 150 + {% if location.name %}<div>{{ location.name }}</div>{% endif %} 151 + {% if location.street %}<div>{{ location.street }}</div>{% endif %} 152 + {% if location.locality %}{{ location.locality }}{% endif %}{% if location.region %}, {{ location.region }}{% endif %}{% if location.postal_code %} {{ location.postal_code }}{% endif %} 153 + {% if location.country %}<div>{{ location.country }}</div>{% endif %} 154 + {% else %} 155 + <strong>{{ t("other-location-type") }}</strong> 156 + {% endif %} 157 + </li> 158 + {% endfor %} 159 + </ul> 123 160 </div> 161 + {% else %} 162 + <p>No location information available.</p> 163 + {% endif %} 164 + </div> 124 165 {% endif %} 125 166 126 - {% include 'create_event.' + current_locale + '.starts_form.html' %} 167 + {% include "create_event." + current_locale + ".link_form.html" %} 127 168 128 - <div class="field is-grouped"> 169 + <hr /> 170 + <div class="field"> 129 171 <div class="control"> 130 - {% if create_event %} 131 - <button class="button is-link" type="submit" data-loading-disable> 132 - {{ t("create-event") }} 172 + <button data-loading-disable data-loading-aria-busy type="submit" id="createEventSubmit" 173 + class="button is-link" name="submit" value="Submit"> 174 + {% if create_event %}{{ t("create-event") }}{% else %}{{ t("update-event") }}{% endif %} 133 175 </button> 134 - {% else %} 135 - <button class="button is-link" type="submit" data-loading-disable> 136 - {{ t("update-event") }} 137 - </button> 176 + {% if cancel_url %} 177 + <a href="{{ cancel_url }}" class="button">{{ t("cancel") }}</a> 138 178 {% endif %} 139 179 </div> 140 - 141 - <div class="control"> 142 - <a href="{{ cancel_url }}" class="button is-link is-light" hx-boost="true"> 143 - {{ t("cancel") }} 144 - </a> 145 - </div> 146 180 </div> 147 181 182 + {% if is_development %} 183 + <pre><code>{{ build_event_form | tojson(indent=2) }}</code></pre> 148 184 {% endif %} 185 + </form> 149 186 150 - </form> 151 187 152 - {% endif %} 188 + {% endif %}