diff --git a/cypress/integration/event.js b/cypress/integration/event.js index 280e415..a045b4e 100644 --- a/cypress/integration/event.js +++ b/cypress/integration/event.js @@ -8,6 +8,9 @@ describe("Event", () => { cy.get("#name").type("Stadtfest"); cy.checkEventStartEnd(false, test.recurrence, "date_definitions-0-"); + cy.get("#add-date-defintion-btn").click(); + cy.checkEventStartEnd(false, test.recurrence, "date_definitions-1-"); + cy.select2("event_place_id", "Neu"); cy.get("#new_event_place-location-city").type("Goslar"); cy.get("#new_place_container_search_link").click(); @@ -28,6 +31,9 @@ describe("Event", () => { cy.contains("a", "Veranstaltung bearbeiten").click(); cy.url().should("include", "/update"); cy.checkEventStartEnd(true, test.recurrence, "date_definitions-0-"); + + cy.get('div[data-prefix=date_definitions-1-] .remove-date-defintion-btn:visible').click() + cy.get("#submit").click(); cy.url().should( "include", diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 3aa1d7b..fc6ce26 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -223,7 +223,7 @@ Cypress.Commands.add( if (update && recurrence) { cy.get('#' + prefix + 'single-event-container').should("not.be.visible"); cy.get('#' + prefix + 'recc-event-container').should("be.visible"); - cy.get('[name="riedit"]').click(); + cy.get('div[data-prefix=' + prefix + '] [name="riedit"]').click(); } else { cy.checkEventAllday(prefix); @@ -233,8 +233,8 @@ Cypress.Commands.add( cy.get("#ui-datepicker-div").should("not.be.visible"); cy.get('#' + prefix + 'start-time').click(); - cy.get(".ui-timepicker-wrapper").should("be.visible"); - cy.get(".ui-timepicker-wrapper .ui-timepicker-am[data-time=0]").click(); // select 00:00 + cy.get(".ui-timepicker-wrapper:visible").should("be.visible"); + cy.get(".ui-timepicker-wrapper:visible .ui-timepicker-am[data-time=0]").click(); // select 00:00 cy.get("#ui-datepicker-div").should("not.be.visible"); cy.get('#' + prefix + 'end-container').should("not.be.visible"); @@ -254,17 +254,17 @@ Cypress.Commands.add( } cy.get(".modal-recurrence").should("be.visible"); - cy.inputsShouldHaveSameValue('#' + prefix + 'start-user', "#recc-start-user"); - cy.inputsShouldHaveSameValue('#' + prefix + 'start-time', "#recc-start-time"); - cy.get("#rirtemplate option").should("have.length", 4); - cy.get(".modal-recurrence input[value=BYENDDATE]").should("be.checked"); - cy.get(".modal-recurrence .modal-footer .btn-primary").click(); + cy.inputsShouldHaveSameValue('#' + prefix + 'start-user', '#' + prefix + 'recc-start-user'); + cy.inputsShouldHaveSameValue('#' + prefix + 'start-time', '#' + prefix + 'recc-start-time'); + cy.get('#' + prefix + 'rirtemplate option').should("have.length", 4); + cy.get(".modal-recurrence:visible input[value=BYENDDATE]").should("be.checked"); + cy.get(".modal-recurrence:visible .modal-footer .btn-primary").click(); cy.get('#' + prefix + 'single-event-container').should("not.be.visible"); cy.get('#' + prefix + 'recc-event-container').should("be.visible"); if (recurrence == false) { - cy.get('[name="ridelete"]').click(); + cy.get('[name="ridelete"]:visible').click(); cy.get('#' + prefix + 'single-event-container').should("be.visible"); cy.get('#' + prefix + 'recc-event-container').should("not.be.visible"); cy.get('#' + prefix + 'end-container').should("not.be.visible"); @@ -284,14 +284,14 @@ Cypress.Commands.add( // Recurrence cy.get('#' + prefix + 'recc-button').click(); cy.get(".modal-recurrence").should("be.visible"); - cy.get('#recc-allday').should("be.checked"); - cy.get('#recc-start-time').should("not.be.visible"); - cy.get('#recc-fo-end-time').should("not.be.visible"); + cy.get('#' + prefix + 'recc-allday').should("be.checked"); + cy.get('#' + prefix + 'recc-start-time').should("not.be.visible"); + cy.get('#' + prefix + 'recc-fo-end-time').should("not.be.visible"); - cy.get('#recc-allday').click(); - cy.get('#recc-start-time').should("be.visible"); - cy.get('#recc-fo-end-time').should("be.visible"); - cy.get(".modal-recurrence .modal-footer .btn-secondary").click(); + cy.get('#' + prefix + 'recc-allday').click(); + cy.get('#' + prefix + 'recc-start-time').should("be.visible"); + cy.get('#' + prefix + 'recc-fo-end-time').should("be.visible"); + cy.get(".modal-recurrence:visible .modal-footer .btn-secondary").click(); // Turn off cy.get('#' + prefix + 'allday').click(); diff --git a/messages.pot b/messages.pot index 987a0aa..5108d9c 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2021-11-04 16:04+0100\n" +"POT-Creation-Date: 2021-11-14 16:26+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -204,7 +204,7 @@ msgstr "" msgid "Legal notice" msgstr "" -#: project/forms/admin.py:12 project/templates/_macros.html:1412 +#: project/forms/admin.py:12 project/templates/_macros.html:1383 #: project/templates/layout.html:317 #: project/templates/widget/event_suggestion/create.html:204 #: project/views/admin_unit.py:73 project/views/root.py:53 @@ -307,12 +307,11 @@ msgstr "" msgid "Longitude" msgstr "" -#: project/forms/admin_unit.py:29 project/forms/event.py:36 -#: project/forms/event.py:65 project/forms/event.py:398 -#: project/forms/event_place.py:25 project/forms/event_place.py:50 -#: project/forms/event_suggestion.py:26 project/forms/oauth2_client.py:66 -#: project/forms/organizer.py:25 project/forms/organizer.py:52 -#: project/forms/reference_request.py:23 project/templates/_macros.html:135 +#: project/forms/admin_unit.py:29 project/forms/event.py:85 +#: project/forms/event.py:114 project/forms/event_place.py:25 +#: project/forms/event_place.py:50 project/forms/event_suggestion.py:26 +#: project/forms/oauth2_client.py:66 project/forms/organizer.py:25 +#: project/forms/organizer.py:52 project/forms/reference_request.py:23 #: project/templates/admin/admin_units.html:19 #: project/templates/event_place/list.html:19 #: project/templates/oauth2_client/list.html:25 @@ -327,32 +326,32 @@ msgstr "" msgid "The short name is used to create a unique identifier for your events" msgstr "" -#: project/forms/admin_unit.py:41 project/templates/_macros.html:1548 +#: project/forms/admin_unit.py:41 project/templates/_macros.html:1519 msgid "Short name must contain only letters numbers or underscore" msgstr "" -#: project/forms/admin_unit.py:47 project/forms/event.py:57 -#: project/forms/event.py:95 project/forms/event_place.py:26 +#: project/forms/admin_unit.py:47 project/forms/event.py:106 +#: project/forms/event.py:124 project/forms/event_place.py:26 #: project/forms/organizer.py:26 msgid "Link URL" msgstr "" #: project/forms/admin_unit.py:48 project/forms/admin_unit_member.py:11 #: project/forms/admin_unit_member.py:23 project/forms/admin_unit_member.py:28 -#: project/forms/event.py:58 project/forms/event_suggestion.py:38 -#: project/forms/organizer.py:27 project/templates/_macros.html:262 -#: project/templates/_macros.html:1508 project/templates/admin/users.html:19 +#: project/forms/event.py:107 project/forms/event_suggestion.py:38 +#: project/forms/organizer.py:27 project/templates/_macros.html:226 +#: project/templates/_macros.html:1479 project/templates/admin/users.html:19 msgid "Email" msgstr "" -#: project/forms/admin_unit.py:49 project/forms/event.py:59 +#: project/forms/admin_unit.py:49 project/forms/event.py:108 #: project/forms/event_suggestion.py:31 project/forms/organizer.py:28 -#: project/templates/_macros.html:315 +#: project/templates/_macros.html:279 msgid "Phone" msgstr "" -#: project/forms/admin_unit.py:50 project/forms/event.py:60 -#: project/forms/organizer.py:29 project/templates/_macros.html:323 +#: project/forms/admin_unit.py:50 project/forms/event.py:109 +#: project/forms/organizer.py:29 project/templates/_macros.html:287 msgid "Fax" msgstr "" @@ -439,467 +438,468 @@ msgstr "" msgid "Image" msgstr "" -#: project/forms/common.py:72 +#: project/forms/common.py:71 #, python-format msgid "" "I read and accept %(tos_open)sTerms of Service%(tos_close)s and " "%(privacy_open)sPrivacy%(privacy_close)s." msgstr "" -#: project/forms/common.py:83 +#: project/forms/common.py:82 msgid "0 (Little relevant)" msgstr "" -#: project/forms/common.py:88 +#: project/forms/common.py:87 msgid "5 (Default)" msgstr "" -#: project/forms/common.py:93 +#: project/forms/common.py:92 msgid "10 (Highlight)" msgstr "" -#: project/forms/common.py:97 +#: project/forms/common.py:96 msgid "Monday" msgstr "" -#: project/forms/common.py:98 +#: project/forms/common.py:97 msgid "Tueday" msgstr "" -#: project/forms/common.py:99 +#: project/forms/common.py:98 msgid "Wednesday" msgstr "" -#: project/forms/common.py:100 +#: project/forms/common.py:99 msgid "Thursday" msgstr "" -#: project/forms/common.py:101 +#: project/forms/common.py:100 msgid "Friday" msgstr "" -#: project/forms/common.py:102 +#: project/forms/common.py:101 msgid "Saturday" msgstr "" -#: project/forms/common.py:103 +#: project/forms/common.py:102 msgid "Sunday" msgstr "" -#: project/forms/common.py:107 +#: project/forms/common.py:106 msgid "500 m" msgstr "" -#: project/forms/common.py:108 +#: project/forms/common.py:107 msgid "5 km" msgstr "" -#: project/forms/common.py:109 +#: project/forms/common.py:108 msgid "10 km" msgstr "" -#: project/forms/common.py:110 +#: project/forms/common.py:109 msgid "20 km" msgstr "" -#: project/forms/common.py:111 +#: project/forms/common.py:110 msgid "50 km" msgstr "" -#: project/forms/common.py:112 +#: project/forms/common.py:111 msgid "100 km" msgstr "" -#: project/forms/event.py:54 -msgid "Organizator" -msgstr "" - -#: project/forms/event.py:67 -msgid "Enter a short, meaningful name for the event." -msgstr "" - -#: project/forms/event.py:70 +#: project/forms/event.py:38 msgid "Start" msgstr "" -#: project/forms/event.py:72 -msgid "Indicate when the event will take place." +#: project/forms/event.py:40 +msgid "Indicate when the event date will start." msgstr "" -#: project/forms/event.py:75 +#: project/forms/event.py:43 msgid "End" msgstr "" -#: project/forms/event.py:77 -msgid "Indicate when the event will end. An event can last a maximum of 14 days." +#: project/forms/event.py:45 +msgid "" +"Indicate when the event date will end. An event can last a maximum of 14 " +"days." msgstr "" -#: project/forms/event.py:82 project/templates/planing/list.html:75 +#: project/forms/event.py:50 project/templates/planing/list.html:75 msgid "All-day" msgstr "" -#: project/forms/event.py:86 project/templates/event/create.html:274 -#: project/templates/event/update.html:165 +#: project/forms/event.py:54 project/templates/_macros.html:1699 #: project/templates/widget/event_suggestion/create.html:240 msgid "Recurring event" msgstr "" -#: project/forms/event.py:90 project/forms/event_place.py:28 +#: project/forms/event.py:61 project/templates/_macros.html:1240 +msgid "The start must be before the end." +msgstr "" + +#: project/forms/event.py:67 project/templates/_macros.html:1257 +msgid "An event can last a maximum of 14 days." +msgstr "" + +#: project/forms/event.py:103 +msgid "Organizator" +msgstr "" + +#: project/forms/event.py:116 +msgid "Enter a short, meaningful name for the event." +msgstr "" + +#: project/forms/event.py:119 project/forms/event_place.py:28 msgid "Description" msgstr "" -#: project/forms/event.py:92 +#: project/forms/event.py:121 msgid "Add an description of the event." msgstr "" -#: project/forms/event.py:97 +#: project/forms/event.py:126 msgid "" "Enter a link to an external website containing more information about the" " event." msgstr "" -#: project/forms/event.py:102 +#: project/forms/event.py:131 msgid "Ticket Link URL" msgstr "" -#: project/forms/event.py:104 +#: project/forms/event.py:133 msgid "Enter a link where tickets can be purchased." msgstr "" -#: project/forms/event.py:107 project/templates/_macros.html:244 +#: project/forms/event.py:136 project/templates/_macros.html:208 msgid "Tags" msgstr "" -#: project/forms/event.py:109 +#: project/forms/event.py:138 msgid "" "Enter keywords with which the event should be found. Words do not need to" " be entered if they are already in the name or description." msgstr "" -#: project/forms/event.py:114 +#: project/forms/event.py:143 msgid "Kid friendly" msgstr "" -#: project/forms/event.py:116 +#: project/forms/event.py:145 msgid "If the event is particularly suitable for children." msgstr "" -#: project/forms/event.py:119 +#: project/forms/event.py:148 msgid "Accessible for free" msgstr "" -#: project/forms/event.py:121 +#: project/forms/event.py:150 msgid "If the event is accessible for free." msgstr "" -#: project/forms/event.py:124 +#: project/forms/event.py:153 msgid "Typical Age from" msgstr "" -#: project/forms/event.py:126 +#: project/forms/event.py:155 msgid "The minimum age that participants should be." msgstr "" -#: project/forms/event.py:129 +#: project/forms/event.py:158 msgid "Typical Age to" msgstr "" -#: project/forms/event.py:131 +#: project/forms/event.py:160 msgid "The maximum age that participants should be." msgstr "" -#: project/forms/event.py:134 +#: project/forms/event.py:163 msgid "Registration required" msgstr "" -#: project/forms/event.py:136 +#: project/forms/event.py:165 msgid "If the participants needs to register for the event." msgstr "" -#: project/forms/event.py:141 project/templates/_macros.html:276 +#: project/forms/event.py:170 project/templates/_macros.html:240 #: project/templates/layout.html:128 msgid "Booked up" msgstr "" -#: project/forms/event.py:143 +#: project/forms/event.py:172 msgid "If the event is booked up or sold out." msgstr "" -#: project/forms/event.py:146 +#: project/forms/event.py:175 msgid "Expected number of participants" msgstr "" -#: project/forms/event.py:148 +#: project/forms/event.py:177 msgid "The estimated expected attendance." msgstr "" -#: project/forms/event.py:151 +#: project/forms/event.py:180 msgid "Price info" msgstr "" -#: project/forms/event.py:153 +#: project/forms/event.py:182 msgid "" "Enter price information in textual form. E.g., different prices for " "adults and children." msgstr "" -#: project/forms/event.py:158 +#: project/forms/event.py:187 msgid "Target group origin" msgstr "" -#: project/forms/event.py:163 +#: project/forms/event.py:192 msgid "EventTargetGroupOrigin.both" msgstr "" -#: project/forms/event.py:167 +#: project/forms/event.py:196 msgid "EventTargetGroupOrigin.tourist" msgstr "" -#: project/forms/event.py:171 +#: project/forms/event.py:200 msgid "EventTargetGroupOrigin.resident" msgstr "" -#: project/forms/event.py:174 +#: project/forms/event.py:203 msgid "" "Choose whether the event is particularly suitable for tourists or " "residents." msgstr "" -#: project/forms/event.py:179 +#: project/forms/event.py:208 msgid "Attendance mode" msgstr "" -#: project/forms/event.py:184 +#: project/forms/event.py:213 msgid "EventAttendanceMode.offline" msgstr "" -#: project/forms/event.py:188 project/templates/layout.html:116 +#: project/forms/event.py:217 project/templates/layout.html:116 msgid "EventAttendanceMode.online" msgstr "" -#: project/forms/event.py:190 project/templates/layout.html:119 +#: project/forms/event.py:219 project/templates/layout.html:119 msgid "EventAttendanceMode.mixed" msgstr "" -#: project/forms/event.py:192 +#: project/forms/event.py:221 msgid "Choose how people can attend the event." msgstr "" -#: project/forms/event.py:196 project/forms/event_place.py:27 +#: project/forms/event.py:225 project/forms/event_place.py:27 #: project/templates/widget/event_suggestion/create.html:258 msgid "Photo" msgstr "" -#: project/forms/event.py:198 +#: project/forms/event.py:227 msgid "" "We recommend uploading a photo for the event. It looks a lot more, but of" " course it works without it." msgstr "" -#: project/forms/event.py:208 project/templates/_macros.html:1269 -msgid "The start must be before the end." -msgstr "" - -#: project/forms/event.py:214 project/templates/_macros.html:1286 -msgid "An event can last a maximum of 14 days." -msgstr "" - -#: project/forms/event.py:222 project/templates/_macros.html:423 -#: project/templates/_macros.html:586 +#: project/forms/event.py:242 project/templates/_macros.html:387 +#: project/templates/_macros.html:550 msgid "Previous start date" msgstr "" -#: project/forms/event.py:224 +#: project/forms/event.py:244 msgid "Enter when the event should have taken place before it was postponed." msgstr "" -#: project/forms/event.py:229 project/forms/event_suggestion.py:71 +#: project/forms/event.py:249 project/forms/event_suggestion.py:71 msgid "Categories" msgstr "" -#: project/forms/event.py:232 project/forms/event_suggestion.py:74 +#: project/forms/event.py:252 project/forms/event_suggestion.py:74 msgid "Choose categories that fit the event." msgstr "" -#: project/forms/event.py:235 project/forms/reference.py:14 +#: project/forms/event.py:255 project/forms/reference.py:14 #: project/forms/reference.py:27 project/forms/reference_request.py:76 -#: project/templates/event/create.html:390 -#: project/templates/event/update.html:246 +#: project/templates/event/create.html:379 +#: project/templates/event/update.html:235 msgid "Rating" msgstr "" -#: project/forms/event.py:239 project/forms/reference.py:18 +#: project/forms/event.py:259 project/forms/reference.py:18 #: project/forms/reference.py:31 project/forms/reference_request.py:80 msgid "" "Choose how relevant the event is to your organization. The value is not " "visible and is used for sorting." msgstr "" -#: project/forms/event.py:244 +#: project/forms/event.py:264 msgid "Co-organizers" msgstr "" -#: project/forms/event.py:247 +#: project/forms/event.py:267 msgid "" "Select optional co-organizers. You can add and modify organizers at " "Organization > Organizers." msgstr "" -#: project/forms/event.py:257 +#: project/forms/event.py:277 msgid "Invalid co-organizer." msgstr "" -#: project/forms/event.py:266 project/forms/event.py:275 -#: project/forms/event.py:344 project/forms/event_suggestion.py:50 -#: project/templates/_macros.html:463 project/templates/_macros.html:623 -#: project/templates/event/create.html:315 -#: project/templates/event/update.html:196 +#: project/forms/event.py:286 project/forms/event.py:295 +#: project/forms/event.py:368 project/forms/event_suggestion.py:50 +#: project/templates/_macros.html:427 project/templates/_macros.html:587 +#: project/templates/event/create.html:304 +#: project/templates/event/update.html:185 #: project/templates/event_place/create.html:31 #: project/templates/event_place/delete.html:13 #: project/templates/event_place/update.html:31 msgid "Place" msgstr "" -#: project/forms/event.py:268 +#: project/forms/event.py:288 msgid "Select existing place" msgstr "" -#: project/forms/event.py:269 +#: project/forms/event.py:289 msgid "Enter new place" msgstr "" -#: project/forms/event.py:282 project/forms/event.py:291 -#: project/forms/event.py:352 project/forms/event.py:414 -#: project/forms/event_suggestion.py:60 project/templates/_macros.html:500 -#: project/templates/_macros.html:660 project/templates/event/create.html:284 -#: project/templates/event/update.html:186 +#: project/forms/event.py:302 project/forms/event.py:311 +#: project/forms/event.py:376 project/forms/event.py:439 +#: project/forms/event_suggestion.py:60 project/templates/_macros.html:464 +#: project/templates/_macros.html:624 project/templates/event/create.html:273 +#: project/templates/event/update.html:175 #: project/templates/organizer/create.html:27 #: project/templates/organizer/delete.html:13 #: project/templates/organizer/update.html:27 msgid "Organizer" msgstr "" -#: project/forms/event.py:284 +#: project/forms/event.py:304 msgid "Select existing organizer" msgstr "" -#: project/forms/event.py:285 +#: project/forms/event.py:305 msgid "Enter new organizer" msgstr "" -#: project/forms/event.py:297 +#: project/forms/event.py:317 msgid "Save as draft" msgstr "" -#: project/forms/event.py:298 +#: project/forms/event.py:318 msgid "Publish event" msgstr "" -#: project/forms/event.py:328 +#: project/forms/event.py:350 msgid "Select existing place or enter new place" msgstr "" -#: project/forms/event.py:335 +#: project/forms/event.py:358 msgid "Select existing organizer or enter new organizer" msgstr "" -#: project/forms/event.py:347 +#: project/forms/event.py:371 msgid "" "Choose where the event takes place. You can add and modify places at " "Organization > Places." msgstr "" -#: project/forms/event.py:355 +#: project/forms/event.py:379 msgid "" "Select the organizer. You can add and modify organizers at Organization >" " Organizers." msgstr "" -#: project/forms/event.py:361 project/templates/event/update.html:175 +#: project/forms/event.py:385 project/templates/event/update.html:164 #: project/templates/oauth2_token/list.html:21 msgid "Status" msgstr "" -#: project/forms/event.py:364 +#: project/forms/event.py:388 msgid "EventStatus.scheduled" msgstr "" -#: project/forms/event.py:365 project/templates/layout.html:82 +#: project/forms/event.py:389 project/templates/layout.html:82 #: project/templates/layout.html:97 msgid "EventStatus.cancelled" msgstr "" -#: project/forms/event.py:366 project/templates/layout.html:85 +#: project/forms/event.py:390 project/templates/layout.html:85 #: project/templates/layout.html:100 msgid "EventStatus.movedOnline" msgstr "" -#: project/forms/event.py:367 project/templates/layout.html:88 +#: project/forms/event.py:391 project/templates/layout.html:88 #: project/templates/layout.html:103 msgid "EventStatus.postponed" msgstr "" -#: project/forms/event.py:368 project/templates/layout.html:91 +#: project/forms/event.py:392 project/templates/layout.html:91 #: project/templates/layout.html:106 msgid "EventStatus.rescheduled" msgstr "" -#: project/forms/event.py:370 +#: project/forms/event.py:394 msgid "Select the status of the event." msgstr "" -#: project/forms/event.py:374 +#: project/forms/event.py:398 msgid "Public status" msgstr "" -#: project/forms/event.py:377 +#: project/forms/event.py:401 msgid "PublicStatus.published" msgstr "" -#: project/forms/event.py:378 project/templates/_macros.html:282 +#: project/forms/event.py:402 project/templates/_macros.html:246 msgid "PublicStatus.draft" msgstr "" -#: project/forms/event.py:380 +#: project/forms/event.py:404 msgid "Select the public status of the event." msgstr "" -#: project/forms/event.py:383 project/templates/event/update.html:5 -#: project/templates/event/update.html:141 +#: project/forms/event.py:407 project/templates/event/update.html:5 +#: project/templates/event/update.html:132 msgid "Update event" msgstr "" -#: project/forms/event.py:397 project/templates/_macros.html:1241 +#: project/forms/event.py:423 project/templates/_macros.html:1212 #: project/templates/event/actions.html:47 #: project/templates/event/delete.html:6 msgid "Delete event" msgstr "" -#: project/forms/event.py:405 project/forms/event_date.py:15 +#: project/forms/event.py:430 project/forms/event_date.py:15 #: project/forms/planing.py:14 msgid "From" msgstr "" -#: project/forms/event.py:407 project/forms/event_date.py:17 +#: project/forms/event.py:432 project/forms/event_date.py:17 #: project/forms/planing.py:16 msgid "to" msgstr "" -#: project/forms/event.py:409 project/forms/event_date.py:19 +#: project/forms/event.py:434 project/forms/event_date.py:19 msgid "Keyword" msgstr "" -#: project/forms/event.py:411 project/forms/event_date.py:21 -#: project/forms/planing.py:19 project/templates/_macros.html:396 +#: project/forms/event.py:436 project/forms/event_date.py:21 +#: project/forms/planing.py:19 project/templates/_macros.html:360 msgid "Category" msgstr "" -#: project/forms/event.py:417 +#: project/forms/event.py:442 msgid "Find events" msgstr "" #: project/forms/event_date.py:24 project/forms/planing.py:22 -#: project/templates/_macros.html:137 project/templates/_macros.html:330 +#: project/templates/_macros.html:294 #: project/templates/admin_unit/create.html:38 #: project/templates/admin_unit/update.html:39 #: project/templates/event_place/create.html:40 @@ -925,8 +925,7 @@ msgstr "" msgid "Create place" msgstr "" -#: project/forms/event_place.py:45 project/templates/event_place/read.html:12 -#: project/templates/event_place/update.html:5 +#: project/forms/event_place.py:45 project/templates/event_place/update.html:5 #: project/templates/event_place/update.html:21 msgid "Update place" msgstr "" @@ -955,13 +954,13 @@ msgstr "" msgid "I would like to be notified by email after the review" msgstr "" -#: project/forms/event_suggestion.py:52 project/templates/event/create.html:320 +#: project/forms/event_suggestion.py:52 project/templates/event/create.html:309 msgid "" "Choose where the event takes place. If the venue is not yet in the list, " "just enter it." msgstr "" -#: project/forms/event_suggestion.py:62 project/templates/event/create.html:288 +#: project/forms/event_suggestion.py:62 project/templates/event/create.html:277 msgid "" "Select the organizer. If the organizer is not yet on the list, just enter" " it." @@ -973,27 +972,27 @@ msgstr "" msgid "Create event suggestion" msgstr "" -#: project/forms/event_suggestion.py:116 project/forms/reference_request.py:48 +#: project/forms/event_suggestion.py:124 project/forms/reference_request.py:48 msgid "Rejection reason" msgstr "" -#: project/forms/event_suggestion.py:121 +#: project/forms/event_suggestion.py:129 msgid "EventRejectionReason.noreason" msgstr "" -#: project/forms/event_suggestion.py:125 +#: project/forms/event_suggestion.py:133 msgid "EventRejectionReason.duplicate" msgstr "" -#: project/forms/event_suggestion.py:129 +#: project/forms/event_suggestion.py:137 msgid "EventRejectionReason.untrustworthy" msgstr "" -#: project/forms/event_suggestion.py:133 +#: project/forms/event_suggestion.py:141 msgid "EventRejectionReason.illegal" msgstr "" -#: project/forms/event_suggestion.py:138 +#: project/forms/event_suggestion.py:146 #: project/templates/event_suggestion/reject.html:9 #: project/templates/event_suggestion/review.html:33 #: project/templates/event_suggestion/review.html:40 @@ -1043,7 +1042,7 @@ msgid "Weekdays" msgstr "" #: project/forms/reference.py:11 project/forms/reference_request.py:16 -#: project/templates/_macros.html:516 project/templates/_macros.html:676 +#: project/templates/_macros.html:480 project/templates/_macros.html:640 #: project/templates/admin_unit/create.html:28 #: project/templates/admin_unit/update.html:29 #: project/templates/layout.html:258 @@ -1071,7 +1070,7 @@ msgstr "" msgid "Delete request" msgstr "" -#: project/forms/reference_request.py:28 project/templates/_macros.html:1424 +#: project/forms/reference_request.py:28 project/templates/_macros.html:1395 #: project/templates/event_suggestion/review_status.html:18 #: project/templates/reference_request/review_status.html:12 msgid "Review status" @@ -1133,108 +1132,98 @@ msgstr "" msgid "This field is required." msgstr "" -#: project/templates/_macros.html:134 project/templates/_macros.html:418 -#: project/templates/_macros.html:937 -msgid "Date" -msgstr "" - -#: project/templates/_macros.html:136 -msgid "Host" -msgstr "" - -#: project/templates/_macros.html:158 -msgid "Show all events" -msgstr "" - -#: project/templates/_macros.html:174 +#: project/templates/_macros.html:138 msgid "Show on Google Maps" msgstr "" -#: project/templates/_macros.html:253 +#: project/templates/_macros.html:217 msgid "Link" msgstr "" -#: project/templates/_macros.html:309 +#: project/templates/_macros.html:273 msgid "Verified" msgstr "" -#: project/templates/_macros.html:373 +#: project/templates/_macros.html:337 #, python-format msgid "Created at %(created_at)s by %(created_by)s." msgstr "" -#: project/templates/_macros.html:375 +#: project/templates/_macros.html:339 #, python-format msgid "Created at %(created_at)s." msgstr "" -#: project/templates/_macros.html:380 +#: project/templates/_macros.html:344 #, python-format msgid "Last updated at %(updated_at)s by %(updated_by)s." msgstr "" -#: project/templates/_macros.html:382 +#: project/templates/_macros.html:346 #, python-format msgid "Last updated at %(updated_at)s." msgstr "" -#: project/templates/_macros.html:412 project/templates/_macros.html:582 +#: project/templates/_macros.html:376 project/templates/_macros.html:546 #: project/templates/event/actions.html:12 -#: project/templates/event/create.html:257 -#: project/templates/event/delete.html:13 -#: project/templates/event/update.html:148 +#: project/templates/event/create.html:250 +#: project/templates/event/update.html:141 #: project/templates/widget/event_suggestion/create.html:229 msgid "Event" msgstr "" -#: project/templates/_macros.html:445 project/templates/_macros.html:604 -#: project/templates/_macros.html:1493 project/templates/event/actions.html:32 +#: project/templates/_macros.html:382 project/templates/_macros.html:908 +msgid "Date" +msgstr "" + +#: project/templates/_macros.html:409 project/templates/_macros.html:568 +#: project/templates/_macros.html:1464 project/templates/event/actions.html:32 msgid "Share" msgstr "" -#: project/templates/_macros.html:449 project/templates/_macros.html:608 -#: project/templates/_macros.html:1523 +#: project/templates/_macros.html:413 project/templates/_macros.html:572 +#: project/templates/_macros.html:1494 msgid "Add to calendar" msgstr "" -#: project/templates/_macros.html:457 project/templates/_macros.html:616 +#: project/templates/_macros.html:421 project/templates/_macros.html:580 #: project/templates/event/report.html:4 msgid "Report event" msgstr "" -#: project/templates/_macros.html:484 project/templates/_macros.html:642 +#: project/templates/_macros.html:448 project/templates/_macros.html:606 msgid "Show directions" msgstr "" -#: project/templates/_macros.html:489 project/templates/_macros.html:647 +#: project/templates/_macros.html:453 project/templates/_macros.html:611 msgid "The event takes place online." msgstr "" -#: project/templates/_macros.html:491 project/templates/_macros.html:649 +#: project/templates/_macros.html:455 project/templates/_macros.html:613 msgid "The event takes place both offline and online." msgstr "" -#: project/templates/_macros.html:703 project/templates/event_date/list.html:5 +#: project/templates/_macros.html:667 project/templates/event_date/list.html:5 #: project/templates/event_date/list.html:300 #: project/templates/reference_request/review.html:32 msgid "Event Dates" msgstr "" -#: project/templates/_macros.html:795 +#: project/templates/_macros.html:759 msgid "Search location on Google" msgstr "" -#: project/templates/_macros.html:861 +#: project/templates/_macros.html:825 #, python-format msgid "%(count)d event dates" msgstr "" -#: project/templates/_macros.html:877 project/templates/_macros.html:879 +#: project/templates/_macros.html:848 project/templates/_macros.html:850 #: project/templates/event_date/list.html:321 msgid "First" msgstr "" -#: project/templates/_macros.html:882 project/templates/_macros.html:884 +#: project/templates/_macros.html:853 project/templates/_macros.html:855 #: project/templates/event_date/list.html:322 #: project/templates/widget/event_suggestion/create.html:193 #: project/templates/widget/event_suggestion/create.html:218 @@ -1245,12 +1234,12 @@ msgstr "" msgid "Previous" msgstr "" -#: project/templates/_macros.html:886 +#: project/templates/_macros.html:857 #, python-format msgid "Page %(page)d of %(pages)d (%(total)d total)" msgstr "" -#: project/templates/_macros.html:888 project/templates/_macros.html:890 +#: project/templates/_macros.html:859 project/templates/_macros.html:861 #: project/templates/event_date/list.html:324 #: project/templates/widget/event_suggestion/create.html:194 #: project/templates/widget/event_suggestion/create.html:219 @@ -1260,76 +1249,80 @@ msgstr "" msgid "Next" msgstr "" -#: project/templates/_macros.html:893 project/templates/_macros.html:895 +#: project/templates/_macros.html:864 project/templates/_macros.html:866 #: project/templates/event_date/list.html:325 msgid "Last" msgstr "" -#: project/templates/_macros.html:960 +#: project/templates/_macros.html:931 msgid "Radius" msgstr "" -#: project/templates/_macros.html:1170 +#: project/templates/_macros.html:1141 msgid "Edit image" msgstr "" -#: project/templates/_macros.html:1191 +#: project/templates/_macros.html:1162 msgid "Close" msgstr "" -#: project/templates/_macros.html:1192 +#: project/templates/_macros.html:1163 msgid "Okay" msgstr "" -#: project/templates/_macros.html:1204 +#: project/templates/_macros.html:1175 msgid "Choose image file" msgstr "" -#: project/templates/_macros.html:1240 project/templates/event/actions.html:46 +#: project/templates/_macros.html:1211 project/templates/event/actions.html:46 msgid "Edit event" msgstr "" -#: project/templates/_macros.html:1243 project/templates/manage/events.html:45 +#: project/templates/_macros.html:1214 project/templates/manage/events.html:45 msgid "More" msgstr "" -#: project/templates/_macros.html:1290 +#: project/templates/_macros.html:1261 msgid "Please enter a valid time, between 00:00 and 23:59." msgstr "" -#: project/templates/_macros.html:1318 +#: project/templates/_macros.html:1289 #, python-format msgid "Just use %(term)s" msgstr "" -#: project/templates/_macros.html:1384 +#: project/templates/_macros.html:1355 msgid "Event suggestion" msgstr "" -#: project/templates/_macros.html:1502 +#: project/templates/_macros.html:1473 msgid "Link copied" msgstr "" -#: project/templates/_macros.html:1502 +#: project/templates/_macros.html:1473 msgid "Copy link" msgstr "" -#: project/templates/_macros.html:1531 +#: project/templates/_macros.html:1502 msgid "Google calendar" msgstr "" -#: project/templates/_macros.html:1532 +#: project/templates/_macros.html:1503 msgid "Apple calendar" msgstr "" -#: project/templates/_macros.html:1533 +#: project/templates/_macros.html:1504 msgid "Yahoo calendar" msgstr "" -#: project/templates/_macros.html:1534 +#: project/templates/_macros.html:1505 msgid "Other calendar" msgstr "" +#: project/templates/_macros.html:1700 +msgid "Remove event date" +msgstr "" + #: project/templates/home.html:28 msgid "Manage" msgstr "" @@ -1339,8 +1332,8 @@ msgstr "" msgid "Register for free" msgstr "" -#: project/templates/event_place/read.html:22 project/templates/layout.html:175 -#: project/templates/layout.html:219 project/templates/manage/events.html:6 +#: project/templates/layout.html:175 project/templates/layout.html:219 +#: project/templates/manage/events.html:6 #: project/templates/manage/events.html:24 msgid "Events" msgstr "" @@ -1382,7 +1375,7 @@ msgid "Show events" msgstr "" #: project/templates/event/create.html:5 -#: project/templates/event/create.html:250 project/templates/layout.html:226 +#: project/templates/event/create.html:241 project/templates/layout.html:226 #: project/templates/manage/events.html:27 #: project/templates/manage/organizers.html:21 msgid "Create event" @@ -1501,8 +1494,8 @@ msgstr "" #: project/templates/admin_unit/create.html:58 #: project/templates/admin_unit/update.html:59 -#: project/templates/event/create.html:378 -#: project/templates/event/update.html:234 +#: project/templates/event/create.html:367 +#: project/templates/event/update.html:223 #: project/templates/event_place/create.html:57 #: project/templates/event_place/update.html:57 #: project/templates/organizer/create.html:56 @@ -1642,40 +1635,45 @@ msgstr "" msgid "List all events of %(admin_unit_name)s" msgstr "" -#: project/templates/event/create.html:97 -#: project/templates/event/update.html:83 +#: project/templates/event/create.html:90 +#: project/templates/event/update.html:76 #: project/templates/widget/event_suggestion/create.html:104 msgid "Enter place or address" msgstr "" -#: project/templates/event/create.html:183 -#: project/templates/event/create.html:240 -#: project/templates/event/update.html:106 -#: project/templates/event/update.html:132 +#: project/templates/event/create.html:176 +#: project/templates/event/create.html:233 +#: project/templates/event/update.html:99 +#: project/templates/event/update.html:125 #: project/templates/widget/event_suggestion/create.html:129 msgid "Enter organizer" msgstr "" -#: project/templates/event/create.html:267 -#: project/templates/event/update.html:158 -msgid "Event date" +#: project/templates/event/create.html:260 +#: project/templates/event/update.html:151 +msgid "Event dates" msgstr "" -#: project/templates/event/create.html:305 +#: project/templates/event/create.html:267 +#: project/templates/event/update.html:158 +msgid "Add event date" +msgstr "" + +#: project/templates/event/create.html:294 msgid "Switch to organizer search" msgstr "" -#: project/templates/event/create.html:340 +#: project/templates/event/create.html:329 msgid "Switch to place search" msgstr "" -#: project/templates/event/create.html:351 -#: project/templates/event/update.html:207 +#: project/templates/event/create.html:340 +#: project/templates/event/update.html:196 msgid "Access" msgstr "" -#: project/templates/event/create.html:365 -#: project/templates/event/update.html:221 +#: project/templates/event/create.html:354 +#: project/templates/event/update.html:210 msgid "Target group" msgstr "" @@ -1689,10 +1687,6 @@ msgstr "" msgid "Request reference for event \"%(name)s\"" msgstr "" -#: project/templates/event_place/read.html:19 -msgid "Info" -msgstr "" - #: project/templates/event_suggestion/review.html:20 #: project/templates/manage/reviews.html:19 msgid "Review event suggestion" @@ -1902,7 +1896,7 @@ msgstr "" msgid "Widget" msgstr "" -#: project/templates/widget/event_date/list.html:124 +#: project/templates/widget/event_date/list.html:128 msgid "Print" msgstr "" @@ -1980,31 +1974,27 @@ msgstr "" msgid "Invitation successfully deleted" msgstr "" -#: project/views/event.py:178 +#: project/views/event.py:177 msgid "Event successfully published" msgstr "" -#: project/views/event.py:180 +#: project/views/event.py:179 msgid "Draft successfully saved" msgstr "" -#: project/views/event.py:223 +#: project/views/event.py:222 msgid "Event successfully updated" msgstr "" -#: project/views/event.py:246 -msgid "Entered name does not match event name" -msgstr "" - -#: project/views/event.py:252 +#: project/views/event.py:248 msgid "Event successfully deleted" msgstr "" -#: project/views/event.py:404 +#: project/views/event.py:403 msgid "Referenced event changed" msgstr "" -#: project/views/event.py:427 +#: project/views/event.py:426 msgid "New event report" msgstr "" @@ -2154,7 +2144,7 @@ msgstr "" msgid "You do not have permission for this action" msgstr "" -#: project/views/utils.py:264 +#: project/views/utils.py:258 msgid "" "The invitation was issued to another user. Sign in with the email address" " the invitation was sent to." diff --git a/project/forms/event.py b/project/forms/event.py index e16f5ea..c51a734 100644 --- a/project/forms/event.py +++ b/project/forms/event.py @@ -37,13 +37,13 @@ class EventDateDefinitionFormMixin: start = CustomDateTimeField( lazy_gettext("Start"), validators=[DataRequired()], - description=lazy_gettext("Indicate when the event will take place."), + description=lazy_gettext("Indicate when the event date will start."), ) end = CustomDateTimeField( lazy_gettext("End"), validators=[Optional()], description=lazy_gettext( - "Indicate when the event will end. An event can last a maximum of 14 days." + "Indicate when the event date will end. An event can last a maximum of 14 days." ), ) allday = BooleanField( @@ -235,6 +235,9 @@ class BaseEventForm(SharedEventForm): FormField(EventDateDefinitionForm, default=lambda: EventDateDefinition()), min_entries=1, ) + date_definition_template = FormField( + EventDateDefinitionForm, default=lambda: EventDateDefinition() + ) previous_start_date = CustomDateTimeField( lazy_gettext("Previous start date"), validators=[Optional()], @@ -330,6 +333,8 @@ class CreateEventForm(BaseEventForm): field.populate_obj(obj, "organizer") elif name == "photo" and not obj.photo: obj.photo = Image() + elif name == "date_definition_template": + continue field.populate_obj(obj, name) obj.public_status = ( @@ -405,6 +410,8 @@ class UpdateEventForm(BaseEventForm): for name, field in self._fields.items(): if name == "photo" and not obj.photo: obj.photo = Image() + elif name == "date_definition_template": + continue field.populate_obj(obj, name) if obj.photo and obj.photo.is_empty(): diff --git a/project/models.py b/project/models.py index f2517ac..00833c1 100644 --- a/project/models.py +++ b/project/models.py @@ -909,9 +909,10 @@ class Event(db.Model, TrackableMixin, EventMixin): @min_start.expression def min_start(cls): return ( - select([EventDateDefinition.end]) + select([EventDateDefinition.start]) .where(EventDateDefinition.event_id == cls.id) .order_by(EventDateDefinition.start) + .limit(1) .as_scalar() ) @@ -938,6 +939,7 @@ class Event(db.Model, TrackableMixin, EventMixin): date_definitions = relationship( "EventDateDefinition", + order_by="EventDateDefinition.start", backref=backref("event", lazy=False), cascade="all, delete-orphan", ) diff --git a/project/services/event.py b/project/services/event.py index 076e658..0d882a5 100644 --- a/project/services/event.py +++ b/project/services/event.py @@ -349,7 +349,8 @@ def update_event_dates_with_recurrence_rule(event): None, ) if existing_date: - dates_to_remove.remove(existing_date) + if existing_date in dates_to_remove: + dates_to_remove.remove(existing_date) else: new_date = EventDate( event_id=event.id, diff --git a/project/static/jquery.recurrenceinput.css b/project/static/jquery.recurrenceinput.css index 425edba..663c181 100644 --- a/project/static/jquery.recurrenceinput.css +++ b/project/static/jquery.recurrenceinput.css @@ -108,3 +108,7 @@ div.errorarea { font-weight: bold; padding: 2px 10px; } + +.recc-event-container .form-group { + margin-bottom: 0; +} diff --git a/project/static/jquery.recurrenceinput.js b/project/static/jquery.recurrenceinput.js index 76905a7..be0f64e 100644 --- a/project/static/jquery.recurrenceinput.js +++ b/project/static/jquery.recurrenceinput.js @@ -207,6 +207,7 @@ reccStartTime: 'Begin', reccFoEndTime: 'End', reccAllDay: 'All day', + removeEventDate: 'Remove event date', }); @@ -257,15 +258,16 @@ $.templates('occurrenceTmpl', OCCURRENCETMPL); var DISPLAYTMPL = ['
', - '
', + '
', '
', '
', '
', '
{{:i18n.displayUnactivate}}
', '
', '{{if !readOnly}}', - '', - '', + '', + '', + '', '{{/if}}', '
', ''].join('\n'); @@ -284,37 +286,37 @@ '