diff --git a/messages.pot b/messages.pot index 8542934..869d8c6 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: 2023-05-11 11:19+0200\n" +"POT-Creation-Date: 2023-05-30 14:22+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -170,14 +170,18 @@ msgid "Scope_eventlist:write" msgstr "" #: project/i10n.py:53 -msgid "Scope_organization:read" +msgid "Scope_eventreference:write" msgstr "" #: project/i10n.py:54 -msgid "Scope_organization:write" +msgid "Scope_organization:read" msgstr "" #: project/i10n.py:55 +msgid "Scope_organization:write" +msgstr "" + +#: project/i10n.py:56 msgid "There must be no self-reference." msgstr "" @@ -193,29 +197,29 @@ msgstr "" msgid "message" msgstr "" -#: project/api/organization/resources.py:401 +#: project/api/organization/resources.py:423 #: project/views/admin_unit_member_invitation.py:89 msgid "You have received an invitation" msgstr "" -#: project/forms/admin.py:11 project/templates/layout.html:305 +#: project/forms/admin.py:11 project/templates/layout.html:315 #: project/views/root.py:55 msgid "Terms of service" msgstr "" -#: project/forms/admin.py:12 project/templates/layout.html:310 +#: project/forms/admin.py:12 project/templates/layout.html:320 #: project/views/root.py:67 msgid "Legal notice" msgstr "" -#: project/forms/admin.py:13 project/templates/_macros.html:1473 -#: project/templates/layout.html:314 +#: project/forms/admin.py:13 project/templates/_macros.html:1441 +#: project/templates/layout.html:324 #: project/templates/widget/event_suggestion/create.html:204 #: project/views/admin_unit.py:83 project/views/root.py:75 msgid "Contact" msgstr "" -#: project/forms/admin.py:14 project/templates/layout.html:318 +#: project/forms/admin.py:14 project/templates/layout.html:328 #: project/views/root.py:83 msgid "Privacy" msgstr "" @@ -256,7 +260,7 @@ msgstr "" #: project/forms/admin_unit_member.py:30 project/forms/event.py:107 #: project/forms/event_suggestion.py:38 project/forms/organizer.py:33 #: project/forms/user.py:18 project/forms/user.py:23 -#: project/templates/_macros.html:237 project/templates/_macros.html:1569 +#: project/templates/_macros.html:237 project/templates/_macros.html:1537 #: project/templates/admin/admin.html:27 project/templates/admin/email.html:4 #: project/templates/admin/email.html:66 project/templates/admin/users.html:19 #: project/templates/manage/organizers.html:21 @@ -327,7 +331,7 @@ msgstr "" #: project/templates/event_place/list.html:19 #: project/templates/manage/organizers.html:18 #: project/templates/manage/places.html:18 -#: project/templates/oauth2_client/list.html:25 +#: project/templates/oauth2_client/list.html:23 msgid "Name" msgstr "" @@ -361,7 +365,8 @@ msgid "Street" msgstr "" #: project/forms/admin_unit.py:18 project/forms/event.py:453 -#: project/forms/event_place.py:16 project/forms/organizer.py:16 +#: project/forms/event_date.py:56 project/forms/event_place.py:16 +#: project/forms/organizer.py:16 msgid "Postal code" msgstr "" @@ -393,7 +398,7 @@ msgstr "" msgid "The short name is used to create a unique identifier for your events" msgstr "" -#: project/forms/admin_unit.py:46 project/templates/_macros.html:1611 +#: project/forms/admin_unit.py:46 project/templates/_macros.html:1579 msgid "Short name must contain only letters numbers or underscore" msgstr "" @@ -495,7 +500,7 @@ msgstr "" msgid "Cancel deletion" msgstr "" -#: project/forms/admin_unit.py:151 project/templates/layout.html:276 +#: project/forms/admin_unit.py:151 project/templates/layout.html:286 #: project/templates/manage/delete_membership.html:6 msgid "Leave organization" msgstr "" @@ -611,7 +616,7 @@ msgstr "" msgid "100 km" msgstr "" -#: project/forms/event.py:38 project/templates/manage/events.html:100 +#: project/forms/event.py:38 project/templates/manage/events.html:102 msgid "Start" msgstr "" @@ -633,16 +638,16 @@ msgstr "" msgid "All-day" msgstr "" -#: project/forms/event.py:54 project/templates/_macros.html:1801 +#: project/forms/event.py:54 project/templates/_macros.html:1749 #: project/templates/widget/event_suggestion/create.html:240 msgid "Recurring event" msgstr "" -#: project/forms/event.py:61 project/templates/_macros.html:1330 +#: project/forms/event.py:61 project/templates/_macros.html:1298 msgid "The start must be before the end." msgstr "" -#: project/forms/event.py:67 project/templates/_macros.html:1347 +#: project/forms/event.py:67 project/templates/_macros.html:1315 msgid "An event can last a maximum of 14 days." msgstr "" @@ -796,8 +801,8 @@ msgid "Choose how people can attend the event." msgstr "" #: project/forms/event.py:225 project/forms/event_place.py:33 -#: project/templates/manage/events.html:104 -#: project/templates/manage/events.html:139 +#: project/templates/manage/events.html:106 +#: project/templates/manage/events.html:141 #: project/templates/manage/places.html:21 #: project/templates/manage/places.html:39 #: project/templates/widget/event_suggestion/create.html:258 @@ -829,8 +834,8 @@ msgstr "" #: 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:359 -#: project/templates/event/update.html:216 +#: project/templates/event/create.html:363 +#: project/templates/event/update.html:220 msgid "Rating" msgstr "" @@ -858,12 +863,12 @@ msgstr "" #: project/forms/event.py:286 project/forms/event.py:295 #: project/forms/event.py:368 project/forms/event.py:442 #: project/forms/event_suggestion.py:50 project/templates/_macros.html:438 -#: project/templates/_macros.html:604 project/templates/event/create.html:284 -#: project/templates/event/update.html:166 +#: project/templates/_macros.html:604 project/templates/event/create.html:288 +#: project/templates/event/update.html:170 #: project/templates/event_place/create.html:31 #: project/templates/event_place/delete.html:13 #: project/templates/event_place/update.html:31 -#: project/templates/manage/events.html:103 +#: project/templates/manage/events.html:105 msgid "Place" msgstr "" @@ -877,10 +882,11 @@ msgstr "" #: 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:475 -#: project/templates/_macros.html:647 project/templates/event/create.html:253 -#: project/templates/event/update.html:156 -#: project/templates/manage/events.html:102 +#: project/forms/event_date.py:44 project/forms/event_suggestion.py:60 +#: project/templates/_macros.html:475 project/templates/_macros.html:647 +#: project/templates/event/create.html:257 +#: project/templates/event/update.html:160 +#: project/templates/manage/events.html:104 #: project/templates/organizer/create.html:27 #: project/templates/organizer/delete.html:13 #: project/templates/organizer/update.html:27 @@ -923,7 +929,7 @@ msgid "" " Organizers." msgstr "" -#: project/forms/event.py:385 project/templates/event/update.html:145 +#: project/forms/event.py:385 project/templates/event/update.html:149 #: project/templates/oauth2_token/list.html:21 msgid "Status" msgstr "" @@ -973,11 +979,11 @@ msgid "Select the public status of the event." msgstr "" #: project/forms/event.py:407 project/templates/event/update.html:5 -#: project/templates/event/update.html:113 +#: project/templates/event/update.html:117 msgid "Update event" msgstr "" -#: project/forms/event.py:423 project/templates/_macros.html:1287 +#: project/forms/event.py:423 project/templates/_macros.html:1255 #: project/templates/event/actions.html:66 #: project/templates/event/delete.html:6 msgid "Delete event" @@ -1002,7 +1008,7 @@ msgstr "" msgid "Category" msgstr "" -#: project/forms/event.py:446 project/forms/event_date.py:24 +#: project/forms/event.py:446 project/forms/event_date.py:30 #: project/forms/planing.py:22 project/templates/_macros.html:305 #: project/templates/admin_unit/create.html:38 #: project/templates/admin_unit/update.html:46 @@ -1015,16 +1021,37 @@ msgstr "" msgid "Location" msgstr "" -#: project/forms/event.py:448 project/forms/event_date.py:26 +#: project/forms/event.py:448 project/forms/event_date.py:32 #: project/forms/planing.py:24 msgid "Distance" msgstr "" -#: project/forms/event.py:455 +#: project/forms/event.py:455 project/forms/event_date.py:53 +msgid "Exclude recurring events" +msgstr "" + +#: project/forms/event.py:459 project/forms/event_date.py:58 msgid "Find events" msgstr "" -#: project/forms/event_date.py:39 project/forms/planing.py:36 +#: project/forms/event_date.py:39 project/forms/reference.py:11 +#: project/forms/reference_request.py:16 project/templates/_macros.html:491 +#: project/templates/_macros.html:664 +#: project/templates/admin/delete_admin_unit.html:13 +#: project/templates/admin_unit/cancel_deletion.html:13 +#: project/templates/admin_unit/create.html:28 +#: project/templates/admin_unit/request_deletion.html:15 +#: project/templates/admin_unit/update.html:36 +#: project/templates/layout.html:257 +#: project/templates/manage/delete_membership.html:13 +msgid "Organization" +msgstr "" + +#: project/forms/event_date.py:49 +msgid "Show unreferenced events only" +msgstr "" + +#: project/forms/event_date.py:67 project/forms/planing.py:36 #: project/templates/widget/event_date/list.html:82 msgid "Find" msgstr "" @@ -1065,13 +1092,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:289 +#: project/forms/event_suggestion.py:52 project/templates/event/create.html:293 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:257 +#: project/forms/event_suggestion.py:62 project/templates/event/create.html:261 msgid "" "Select the organizer. If the organizer is not yet on the list, just enter" " it." @@ -1152,18 +1179,6 @@ msgstr "" msgid "Weekdays" msgstr "" -#: project/forms/reference.py:11 project/forms/reference_request.py:16 -#: project/templates/_macros.html:491 project/templates/_macros.html:664 -#: project/templates/admin/delete_admin_unit.html:13 -#: project/templates/admin_unit/cancel_deletion.html:13 -#: project/templates/admin_unit/create.html:28 -#: project/templates/admin_unit/request_deletion.html:15 -#: project/templates/admin_unit/update.html:36 -#: project/templates/layout.html:247 -#: project/templates/manage/delete_membership.html:13 -msgid "Organization" -msgstr "" - #: project/forms/reference.py:22 msgid "Save reference" msgstr "" @@ -1172,7 +1187,8 @@ msgstr "" msgid "Update reference" msgstr "" -#: project/forms/reference.py:39 project/templates/reference/delete.html:6 +#: project/forms/reference.py:39 project/templates/event_date/list.html:253 +#: project/templates/reference/delete.html:6 #: project/templates/reference/read.html:20 msgid "Delete reference" msgstr "" @@ -1185,7 +1201,7 @@ msgstr "" msgid "Delete request" msgstr "" -#: project/forms/reference_request.py:28 project/templates/_macros.html:1485 +#: project/forms/reference_request.py:28 project/templates/_macros.html:1453 #: project/templates/event_suggestion/review_status.html:18 #: project/templates/reference_request/review_status.html:12 msgid "Review status" @@ -1303,9 +1319,9 @@ msgstr "" #: project/templates/_macros.html:387 project/templates/_macros.html:557 #: project/templates/event/actions.html:25 -#: project/templates/event/create.html:230 -#: project/templates/event/update.html:122 -#: project/templates/manage/events.html:101 +#: project/templates/event/create.html:234 +#: project/templates/event/update.html:126 +#: project/templates/manage/events.html:103 #: project/templates/widget/event_suggestion/create.html:229 msgid "Event" msgstr "" @@ -1315,12 +1331,12 @@ msgid "Date" msgstr "" #: project/templates/_macros.html:420 project/templates/_macros.html:579 -#: project/templates/_macros.html:1554 project/templates/event/actions.html:51 +#: project/templates/_macros.html:1522 project/templates/event/actions.html:51 msgid "Share" msgstr "" #: project/templates/_macros.html:424 project/templates/_macros.html:583 -#: project/templates/_macros.html:1584 +#: project/templates/_macros.html:1552 msgid "Add to calendar" msgstr "" @@ -1341,7 +1357,7 @@ msgstr "" msgid "The event takes place both offline and online." msgstr "" -#: project/templates/_macros.html:587 project/templates/layout.html:173 +#: project/templates/_macros.html:587 project/templates/layout.html:183 #: project/templates/user/favorite_events.html:4 msgid "Favorite events" msgstr "" @@ -1350,12 +1366,12 @@ msgstr "" #: project/templates/_macros.html:765 #: project/templates/admin/admin_units.html:36 #: project/templates/admin/users.html:36 -#: project/templates/manage/events.html:116 +#: project/templates/manage/events.html:118 #: project/templates/manage/members.html:35 #: project/templates/manage/organizers.html:33 #: project/templates/manage/places.html:31 #: project/templates/manage/references_incoming.html:20 -#: project/templates/oauth2_client/list.html:34 +#: project/templates/oauth2_client/list.html:32 #: project/templates/oauth2_client/read.html:17 msgid "Edit" msgstr "" @@ -1364,9 +1380,10 @@ msgstr "" msgid "Referenced by" msgstr "" -#: project/templates/_macros.html:703 project/templates/_macros.html:1297 +#: project/templates/_macros.html:703 project/templates/_macros.html:1265 #: project/templates/event/actions.html:38 -#: project/templates/manage/events.html:123 +#: project/templates/event_date/list.html:251 +#: project/templates/manage/events.html:125 #: project/templates/manage/references_incoming.html:10 msgid "Reference event" msgstr "" @@ -1377,14 +1394,14 @@ msgstr "" msgid "Reference requests" msgstr "" -#: project/templates/_macros.html:723 project/templates/_macros.html:1294 +#: project/templates/_macros.html:723 project/templates/_macros.html:1262 #: project/templates/event/actions.html:32 -#: project/templates/manage/events.html:121 +#: project/templates/manage/events.html:123 msgid "Request reference" msgstr "" -#: project/templates/_macros.html:731 project/templates/event_date/list.html:5 -#: project/templates/event_date/list.html:299 +#: project/templates/_macros.html:731 project/templates/event_date/list.html:6 +#: project/templates/event_date/list.html:461 #: project/templates/reference_request/review.html:32 msgid "Event Dates" msgstr "" @@ -1399,12 +1416,12 @@ msgid "%(count)d event dates" msgstr "" #: project/templates/_macros.html:919 project/templates/_macros.html:921 -#: project/templates/event_date/list.html:321 +#: project/templates/event_date/list.html:510 msgid "First" msgstr "" #: project/templates/_macros.html:924 project/templates/_macros.html:926 -#: project/templates/event_date/list.html:322 +#: project/templates/event_date/list.html:511 #: project/templates/widget/event_suggestion/create.html:193 #: project/templates/widget/event_suggestion/create.html:218 #: project/templates/widget/event_suggestion/create.html:247 @@ -1420,7 +1437,7 @@ msgid "Page %(page)d of %(pages)d (%(total)d total)" msgstr "" #: project/templates/_macros.html:930 project/templates/_macros.html:932 -#: project/templates/event_date/list.html:324 +#: project/templates/event_date/list.html:513 #: project/templates/widget/event_suggestion/create.html:194 #: project/templates/widget/event_suggestion/create.html:219 #: project/templates/widget/event_suggestion/create.html:248 @@ -1430,7 +1447,7 @@ msgid "Next" msgstr "" #: project/templates/_macros.html:935 project/templates/_macros.html:937 -#: project/templates/event_date/list.html:325 +#: project/templates/event_date/list.html:514 msgid "Last" msgstr "" @@ -1438,88 +1455,89 @@ msgstr "" msgid "Radius" msgstr "" -#: project/templates/_macros.html:1216 +#: project/templates/_macros.html:1184 msgid "Edit image" msgstr "" -#: project/templates/_macros.html:1237 +#: project/templates/_macros.html:1205 msgid "Close" msgstr "" -#: project/templates/_macros.html:1238 +#: project/templates/_macros.html:1206 msgid "Okay" msgstr "" -#: project/templates/_macros.html:1250 +#: project/templates/_macros.html:1218 msgid "Choose image file" msgstr "" -#: project/templates/_macros.html:1286 project/templates/event/actions.html:65 +#: project/templates/_macros.html:1254 project/templates/event/actions.html:65 #: project/templates/event/delete.html:12 msgid "Edit event" msgstr "" -#: project/templates/_macros.html:1290 project/templates/event/actions.html:58 +#: project/templates/_macros.html:1258 project/templates/event/actions.html:58 msgid "Duplicate event" msgstr "" -#: project/templates/_macros.html:1301 project/templates/event/actions.html:44 -#: project/templates/manage/events.html:127 +#: project/templates/_macros.html:1269 project/templates/event/actions.html:44 +#: project/templates/manage/events.html:129 msgid "Add to list" msgstr "" -#: project/templates/_macros.html:1304 project/templates/manage/events.html:130 +#: project/templates/_macros.html:1272 project/templates/manage/events.html:132 msgid "More" msgstr "" -#: project/templates/_macros.html:1351 +#: project/templates/_macros.html:1319 msgid "Please enter a valid time, between 00:00 and 23:59." msgstr "" -#: project/templates/_macros.html:1379 +#: project/templates/_macros.html:1347 #, python-format msgid "Just use %(term)s" msgstr "" -#: project/templates/_macros.html:1445 +#: project/templates/_macros.html:1413 msgid "Event suggestion" msgstr "" -#: project/templates/_macros.html:1563 +#: project/templates/_macros.html:1531 msgid "Link copied" msgstr "" -#: project/templates/_macros.html:1563 +#: project/templates/_macros.html:1531 msgid "Copy link" msgstr "" -#: project/templates/_macros.html:1593 +#: project/templates/_macros.html:1561 msgid "Google calendar" msgstr "" -#: project/templates/_macros.html:1595 +#: project/templates/_macros.html:1563 msgid "Apple calendar" msgstr "" -#: project/templates/_macros.html:1596 +#: project/templates/_macros.html:1564 msgid "Yahoo calendar" msgstr "" -#: project/templates/_macros.html:1597 +#: project/templates/_macros.html:1565 msgid "Other calendar" msgstr "" -#: project/templates/_macros.html:1802 +#: project/templates/_macros.html:1750 msgid "Remove event date" msgstr "" -#: project/templates/_macros.html:1831 project/templates/event/create.html:176 -#: project/templates/event/update.html:99 +#: project/templates/_macros.html:1783 project/templates/event/create.html:180 +#: project/templates/event/update.html:103 +#: project/templates/event_date/list.html:446 #: project/templates/widget/event_suggestion/create.html:129 msgid "Enter organizer" msgstr "" -#: project/templates/_macros.html:1855 +#: project/templates/_macros.html:1811 msgid "Enter list name" msgstr "" @@ -1527,7 +1545,7 @@ msgstr "" msgid "Manage" msgstr "" -#: project/templates/home.html:37 project/templates/layout.html:163 +#: project/templates/home.html:37 project/templates/layout.html:173 #: project/templates/manage/admin_units.html:28 #: project/templates/manage/verification_requests_outgoing.html:13 #: project/templates/security/login_user.html:21 @@ -1539,7 +1557,7 @@ msgstr "" msgid "Features" msgstr "" -#: project/templates/layout.html:157 project/templates/layout.html:205 +#: project/templates/layout.html:167 project/templates/layout.html:215 #: project/templates/manage/events.html:6 #: project/templates/manage/events.html:54 #: project/templates/manage/events_vue.html:4 @@ -1549,18 +1567,18 @@ msgstr "" #: project/templates/admin/admin.html:19 #: project/templates/admin/admin_units.html:4 #: project/templates/admin/admin_units.html:11 -#: project/templates/layout.html:158 project/templates/layout.html:171 +#: project/templates/layout.html:168 project/templates/layout.html:181 #: project/templates/manage/admin_units.html:3 #: project/templates/manage/admin_units.html:26 #: project/templates/organization/main.html:4 msgid "Organizations" msgstr "" -#: project/templates/layout.html:159 +#: project/templates/layout.html:169 msgid "Planing" msgstr "" -#: project/templates/layout.html:172 project/templates/layout.html:265 +#: project/templates/layout.html:182 project/templates/layout.html:275 #: project/templates/oauth2_client/list.html:10 #: project/templates/oauth2_client/read.html:10 #: project/templates/oauth2_token/list.html:10 project/templates/profile.html:4 @@ -1573,87 +1591,87 @@ msgstr "" #: project/templates/admin/email.html:65 #: project/templates/admin/newsletter.html:92 #: project/templates/admin/settings.html:10 -#: project/templates/admin/users.html:10 project/templates/layout.html:176 +#: project/templates/admin/users.html:10 project/templates/layout.html:186 msgid "Admin" msgstr "" -#: project/templates/layout.html:180 +#: project/templates/layout.html:190 msgid "Logout" msgstr "" -#: project/templates/layout.html:211 +#: project/templates/layout.html:221 msgid "Show events" msgstr "" #: project/templates/event/create.html:5 -#: project/templates/event/create.html:221 project/templates/layout.html:212 +#: project/templates/event/create.html:225 project/templates/layout.html:222 #: project/templates/manage/events.html:55 #: project/templates/manage/organizers.html:38 msgid "Create event" msgstr "" -#: project/templates/layout.html:213 +#: project/templates/layout.html:223 msgid "Import event" msgstr "" -#: project/templates/layout.html:215 +#: project/templates/layout.html:225 #: project/templates/manage/event_lists.html:4 msgid "Event lists" msgstr "" -#: project/templates/layout.html:218 +#: project/templates/layout.html:228 msgid "Review suggestions" msgstr "" -#: project/templates/layout.html:228 +#: project/templates/layout.html:238 #: project/templates/manage/references_incoming.html:5 #: project/templates/manage/references_outgoing.html:5 msgid "References" msgstr "" -#: project/templates/layout.html:234 +#: project/templates/layout.html:244 #: project/templates/manage/references_incoming.html:9 msgid "Incoming references" msgstr "" -#: project/templates/layout.html:235 +#: project/templates/layout.html:245 #: project/templates/manage/references_outgoing.html:9 msgid "Outgoing references" msgstr "" -#: project/templates/layout.html:237 +#: project/templates/layout.html:247 #: project/templates/manage/reference_requests_incoming.html:9 msgid "Incoming reference requests" msgstr "" -#: project/templates/layout.html:242 +#: project/templates/layout.html:252 #: project/templates/manage/reference_requests_outgoing.html:9 msgid "Outgoing reference requests" msgstr "" -#: project/templates/layout.html:250 project/templates/manage/organizers.html:5 +#: project/templates/layout.html:260 project/templates/manage/organizers.html:5 #: project/templates/manage/organizers.html:10 #: project/templates/organizer/main.html:4 msgid "Organizers" msgstr "" #: project/templates/event_place/list.html:3 -#: project/templates/event_place/list.html:7 project/templates/layout.html:251 +#: project/templates/event_place/list.html:7 project/templates/layout.html:261 #: project/templates/manage/places.html:5 #: project/templates/manage/places.html:10 msgid "Places" msgstr "" -#: project/templates/layout.html:253 project/templates/manage/members.html:5 +#: project/templates/layout.html:263 project/templates/manage/members.html:5 #: project/templates/manage/members.html:28 msgid "Members" msgstr "" -#: project/templates/layout.html:254 project/templates/manage/relations.html:4 +#: project/templates/layout.html:264 project/templates/manage/relations.html:4 msgid "Relations" msgstr "" -#: project/templates/layout.html:256 +#: project/templates/layout.html:266 #: project/templates/manage/admin_units.html:17 #: project/templates/manage/organization_invitations.html:4 #: project/templates/user/organization_invitations.html:4 @@ -1665,34 +1683,34 @@ msgstr "" #: project/templates/admin/settings.html:11 #: project/templates/admin_unit/update.html:6 #: project/templates/admin_unit/update.html:30 -#: project/templates/layout.html:259 project/templates/manage/widgets.html:11 +#: project/templates/layout.html:269 project/templates/manage/widgets.html:11 #: project/templates/manage/widgets.html:15 project/templates/profile.html:32 msgid "Settings" msgstr "" -#: project/templates/layout.html:260 project/templates/manage/export.html:4 -#: project/templates/manage/export.html:65 +#: project/templates/layout.html:270 project/templates/manage/export.html:3 +#: project/templates/manage/export.html:63 msgid "Export" msgstr "" -#: project/templates/layout.html:262 +#: project/templates/layout.html:272 #: project/templates/manage/custom_widgets.html:13 msgid "Custom widgets" msgstr "" -#: project/templates/layout.html:263 project/templates/manage/reviews.html:10 +#: project/templates/layout.html:273 project/templates/manage/reviews.html:10 #: project/templates/manage/widgets.html:5 #: project/templates/manage/widgets.html:9 msgid "Widgets" msgstr "" -#: project/templates/layout.html:275 +#: project/templates/layout.html:285 msgid "Switch organization" msgstr "" #: project/templates/developer/read.html:4 -#: project/templates/developer/read.html:8 project/templates/layout.html:322 -#: project/templates/profile.html:46 +#: project/templates/developer/read.html:8 project/templates/layout.html:332 +#: project/templates/profile.html:45 msgid "Developer" msgstr "" @@ -1719,7 +1737,7 @@ msgstr "" #: project/templates/oauth2_client/list.html:4 #: project/templates/oauth2_client/list.html:11 #: project/templates/oauth2_client/read.html:11 -#: project/templates/profile.html:50 +#: project/templates/profile.html:49 msgid "OAuth2 clients" msgstr "" @@ -1729,7 +1747,7 @@ msgid "Users" msgstr "" #: project/templates/admin/admin_units.html:35 -#: project/templates/manage/events.html:115 +#: project/templates/manage/events.html:117 #: project/templates/manage/organizers.html:32 #: project/templates/manage/references_incoming.html:19 #: project/templates/manage/references_outgoing.html:19 @@ -1738,13 +1756,13 @@ msgstr "" #: project/templates/admin/admin_units.html:37 #: project/templates/admin/users.html:37 -#: project/templates/manage/events.html:117 +#: project/templates/manage/events.html:119 #: project/templates/manage/members.html:21 #: project/templates/manage/members.html:36 #: project/templates/manage/organizers.html:34 #: project/templates/manage/places.html:32 #: project/templates/manage/references_incoming.html:21 -#: project/templates/oauth2_client/list.html:35 +#: project/templates/oauth2_client/list.html:33 msgid "Delete" msgstr "" @@ -1779,8 +1797,8 @@ msgstr "" #: project/templates/admin_unit/create.html:58 #: project/templates/admin_unit/update.html:66 -#: project/templates/event/create.html:347 -#: project/templates/event/update.html:204 +#: project/templates/event/create.html:351 +#: project/templates/event/update.html:208 #: project/templates/event_place/create.html:57 #: project/templates/event_place/update.html:57 #: project/templates/organizer/create.html:56 @@ -1815,18 +1833,18 @@ msgstr "" msgid "Verification requests" msgstr "" -#: project/templates/developer/read.html:16 -#: project/templates/manage/export.html:67 +#: project/templates/developer/read.html:25 +#: project/templates/manage/export.html:65 msgid "Download" msgstr "" -#: project/templates/developer/read.html:20 -#: project/templates/manage/export.html:71 +#: project/templates/developer/read.html:29 +#: project/templates/manage/export.html:69 msgid "All data" msgstr "" -#: project/templates/developer/read.html:22 -#: project/templates/manage/export.html:73 +#: project/templates/developer/read.html:31 +#: project/templates/manage/export.html:71 msgid "No files available" msgstr "" @@ -2027,7 +2045,7 @@ msgstr "" #: project/templates/event/actions.html:74 project/templates/event/read.html:32 #: project/templates/event_date/read.html:34 -#: project/templates/manage/events.html:151 +#: project/templates/manage/events.html:153 msgid "Add event to list" msgstr "" @@ -2037,31 +2055,31 @@ msgstr "" msgid "Enter place or address" msgstr "" -#: project/templates/event/create.html:240 -#: project/templates/event/update.html:132 +#: project/templates/event/create.html:244 +#: project/templates/event/update.html:136 msgid "Event dates" msgstr "" -#: project/templates/event/create.html:247 -#: project/templates/event/update.html:139 +#: project/templates/event/create.html:251 +#: project/templates/event/update.html:143 msgid "Add event date" msgstr "" -#: project/templates/event/create.html:274 +#: project/templates/event/create.html:278 msgid "Switch to organizer search" msgstr "" -#: project/templates/event/create.html:309 +#: project/templates/event/create.html:313 msgid "Switch to place search" msgstr "" -#: project/templates/event/create.html:320 -#: project/templates/event/update.html:177 +#: project/templates/event/create.html:324 +#: project/templates/event/update.html:181 msgid "Access" msgstr "" -#: project/templates/event/create.html:334 -#: project/templates/event/update.html:191 +#: project/templates/event/create.html:338 +#: project/templates/event/update.html:195 msgid "Target group" msgstr "" @@ -2081,11 +2099,32 @@ msgstr "" msgid "Request reference for event \"%(name)s\"" msgstr "" -#: project/templates/event_date/list.html:301 -msgid "Search" +#: project/templates/event_date/list.html:249 +msgid "Own events cannot be referenced" msgstr "" -#: project/templates/event_date/list.html:302 +#: project/templates/event_date/list.html:249 +msgid "Own event" +msgstr "" + +#: project/templates/event_date/list.html:251 +msgid "Not referenced" +msgstr "" + +#: project/templates/event_date/list.html:253 +msgid "Referenced" +msgstr "" + +#: project/templates/event_date/list.html:416 +msgid "Enter organization" +msgstr "" + +#: project/templates/event_date/list.html:492 +#: project/templates/manage/events.html:93 +msgid "More filters" +msgstr "" + +#: project/templates/event_date/list.html:493 msgid "Map view" msgstr "" @@ -2148,25 +2187,21 @@ msgstr "" msgid "Verify organization" msgstr "" -#: project/templates/manage/events.html:91 -msgid "More filters" -msgstr "" - -#: project/templates/manage/events.html:105 -#: project/templates/manage/events.html:140 +#: project/templates/manage/events.html:107 +#: project/templates/manage/events.html:142 msgid "Number of references" msgstr "" -#: project/templates/manage/events.html:105 -#: project/templates/manage/events.html:140 +#: project/templates/manage/events.html:107 +#: project/templates/manage/events.html:142 msgid "Number of reference requests." msgstr "" -#: project/templates/manage/events.html:118 +#: project/templates/manage/events.html:120 msgid "Duplicate" msgstr "" -#: project/templates/manage/export.html:79 +#: project/templates/manage/export.html:77 msgid "Create export files" msgstr "" @@ -2215,7 +2250,7 @@ msgstr "" #: project/templates/oauth2_client/create.html:4 #: project/templates/oauth2_client/create.html:8 -#: project/templates/oauth2_client/list.html:17 +#: project/templates/oauth2_client/list.html:16 msgid "Create OAuth2 client" msgstr "" @@ -2485,23 +2520,23 @@ msgstr "" msgid "Event review status updated" msgstr "" -#: project/views/js.py:28 +#: project/views/js.py:30 msgid "Short name is already taken" msgstr "" -#: project/views/js.py:45 +#: project/views/js.py:47 msgid "Name is already taken" msgstr "" -#: project/views/js.py:59 +#: project/views/js.py:61 msgid "An account already exists with this email." msgstr "" -#: project/views/js.py:103 +#: project/views/js.py:105 msgid "Places of organization" msgstr "" -#: project/views/js.py:111 +#: project/views/js.py:113 msgid "Places of Google Maps" msgstr "" @@ -2517,19 +2552,19 @@ msgstr "" msgid "Organization successfully left" msgstr "" -#: project/views/oauth2_client.py:37 +#: project/views/oauth2_client.py:36 msgid "OAuth2 client successfully created" msgstr "" -#: project/views/oauth2_client.py:62 +#: project/views/oauth2_client.py:60 msgid "OAuth2 client successfully updated" msgstr "" -#: project/views/oauth2_client.py:85 +#: project/views/oauth2_client.py:82 msgid "Entered name does not match OAuth2 client name" msgstr "" -#: project/views/oauth2_client.py:90 +#: project/views/oauth2_client.py:87 msgid "OAuth2 client successfully deleted" msgstr "" @@ -2613,26 +2648,26 @@ msgstr "" msgid "User deletion requested" msgstr "" -#: project/views/utils.py:71 +#: project/views/utils.py:91 msgid "" "An entry with the entered values ​​already exists. Duplicate entries are " "not allowed." msgstr "" -#: project/views/utils.py:122 +#: project/views/utils.py:142 #, python-format msgid "Error in the %s field - %s" msgstr "" -#: project/views/utils.py:129 +#: project/views/utils.py:149 msgid "Show" msgstr "" -#: project/views/utils.py:137 +#: project/views/utils.py:157 msgid "You do not have permission for this action" msgstr "" -#: project/views/utils.py:258 +#: project/views/utils.py:278 msgid "" "The invitation was issued to another user. Sign in with the email address" " the invitation was sent to." diff --git a/project/api/__init__.py b/project/api/__init__.py index 947e094..251d7a7 100644 --- a/project/api/__init__.py +++ b/project/api/__init__.py @@ -132,6 +132,7 @@ scope_list = [ "organization:write", "eventlist:write", "customwidget:write", + "eventreference:write", ] scopes = {k: get_localized_scope(k) for v, k in enumerate(scope_list)} diff --git a/project/api/event/schemas.py b/project/api/event/schemas.py index 3163254..7f8fe87 100644 --- a/project/api/event/schemas.py +++ b/project/api/event/schemas.py @@ -163,7 +163,37 @@ class EventCurrentUserMixin(object): return has_favorite_event(current_user.id, event.id) -class EventSchema(EventIdSchema, EventBaseSchemaMixin, EventCurrentUserMixin): +class EventCurrentOrganizationMixin(object): + reference_id = fields.Method( + "get_reference_id", + metadata={ + "description": "Reference id, if event is referenced by current organization" + }, + ) + + def get_reference_id(self, event): + if not current_user or not current_user.is_authenticated: + return None + + from project.views.utils import get_current_admin_unit_for_api + + admin_unit = get_current_admin_unit_for_api() + + if not admin_unit: + return None + + from project.services.reference import get_event_reference + + reference = get_event_reference(event.id, admin_unit.id) + return reference.id if reference is not None else None + + +class EventSchema( + EventIdSchema, + EventBaseSchemaMixin, + EventCurrentUserMixin, + EventCurrentOrganizationMixin, +): organization = fields.Nested(OrganizationRefSchema, attribute="admin_unit") organizer = fields.Nested(OrganizerRefSchema) place = fields.Nested(PlaceRefSchema, attribute="event_place") @@ -191,7 +221,9 @@ class EventRefSchema(EventIdSchema): name = marshmallow.auto_field() -class EventSearchItemSchema(EventRefSchema, EventCurrentUserMixin): +class EventSearchItemSchema( + EventRefSchema, EventCurrentUserMixin, EventCurrentOrganizationMixin +): description = marshmallow.auto_field() date_definitions = fields.List(fields.Nested(EventDateDefinitionSchema)) photo = fields.Nested(ImageSchema) diff --git a/project/api/event_date/resources.py b/project/api/event_date/resources.py index 39f4db8..d769f80 100644 --- a/project/api/event_date/resources.py +++ b/project/api/event_date/resources.py @@ -1,3 +1,4 @@ +from flask import request from flask_apispec import doc, marshal_with, use_kwargs from sqlalchemy import and_ from sqlalchemy.orm import defaultload, lazyload @@ -16,6 +17,7 @@ from project.api.resources import BaseResource, require_api_access from project.models import AdminUnit, Event, EventDate, PublicStatus from project.services.event import get_event_dates_query from project.services.event_search import EventSearchParams +from project.views.utils import get_current_admin_unit_for_api class EventDateListResource(BaseResource): @@ -62,6 +64,13 @@ class EventDateSearchResource(BaseResource): login_api_user() params = EventSearchParams() params.load_from_request() + + if "not_referenced" in request.args: + admin_unit = get_current_admin_unit_for_api() + + if admin_unit: + params.not_referenced_by_organization_id = admin_unit.id + pagination = get_event_dates_query(params).paginate() return pagination diff --git a/project/api/event_reference/resources.py b/project/api/event_reference/resources.py index e8c3a6e..5eb87aa 100644 --- a/project/api/event_reference/resources.py +++ b/project/api/event_reference/resources.py @@ -1,5 +1,8 @@ +from flask import make_response from flask_apispec import doc, marshal_with +from project import db +from project.access import access_or_401, login_api_user_or_401 from project.api import add_api_resource from project.api.event_reference.schemas import EventReferenceSchema from project.api.resources import BaseResource, require_api_access @@ -13,6 +16,22 @@ class EventReferenceResource(BaseResource): def get(self, id): return EventReference.query.get_or_404(id) + @doc( + summary="Delete reference", + tags=["Event References"], + ) + @marshal_with(None, 204) + @require_api_access("eventreference:write") + def delete(self, id): + login_api_user_or_401() + reference = EventReference.query.get_or_404(id) + access_or_401(reference.admin_unit, "event:reference") + + db.session.delete(reference) + db.session.commit() + + return make_response("", 204) + add_api_resource( EventReferenceResource, "/event-references/", "api_v1_event_reference" diff --git a/project/api/event_reference/schemas.py b/project/api/event_reference/schemas.py index 0be4320..f9561f2 100644 --- a/project/api/event_reference/schemas.py +++ b/project/api/event_reference/schemas.py @@ -1,18 +1,25 @@ from marshmallow import fields from project.api import marshmallow -from project.api.event.schemas import EventRefSchema +from project.api.event.schemas import EventRefSchema, EventWriteIdSchema from project.api.organization.schemas import OrganizationRefSchema -from project.api.schemas import PaginationRequestSchema, PaginationResponseSchema +from project.api.schemas import ( + IdSchemaMixin, + PaginationRequestSchema, + PaginationResponseSchema, + SQLAlchemyBaseSchema, +) from project.models import EventReference -class EventReferenceIdSchema(marshmallow.SQLAlchemySchema): +class EventReferenceModelSchema(SQLAlchemyBaseSchema): class Meta: model = EventReference load_instance = True - id = marshmallow.auto_field() + +class EventReferenceIdSchema(EventReferenceModelSchema, IdSchemaMixin): + pass class EventReferenceRefSchema(EventReferenceIdSchema): @@ -38,3 +45,20 @@ class EventReferenceListResponseSchema(PaginationResponseSchema): fields.Nested(EventReferenceRefSchema), metadata={"description": "Event references"}, ) + + +class EventReferenceWriteSchemaMixin(object): + event = fields.Nested( + EventWriteIdSchema, + required=True, + metadata={"description": "Event to reference"}, + ) + + +class EventReferenceCreateRequestSchema( + EventReferenceModelSchema, + EventReferenceWriteSchemaMixin, +): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.make_post_schema() diff --git a/project/api/organization/resources.py b/project/api/organization/resources.py index c13b79c..ef94690 100644 --- a/project/api/organization/resources.py +++ b/project/api/organization/resources.py @@ -40,6 +40,8 @@ from project.api.event_list.schemas import ( EventListStatusListResponseSchema, ) from project.api.event_reference.schemas import ( + EventReferenceCreateRequestSchema, + EventReferenceIdSchema, EventReferenceListRequestSchema, EventReferenceListResponseSchema, ) @@ -309,6 +311,26 @@ class OrganizationIncomingEventReferenceListResource(BaseResource): pagination = get_reference_incoming_query(admin_unit).paginate() return pagination + @doc( + summary="Add reference", + tags=["Organizations", "Event References"], + ) + @use_kwargs(EventReferenceCreateRequestSchema, location="json", apply=False) + @marshal_with(EventReferenceIdSchema, 201) + @require_api_access("eventreference:write") + def post(self, id): + login_api_user_or_401() + admin_unit = get_admin_unit_for_manage_or_404(id) + access_or_401(admin_unit, "event:reference") + + reference = self.create_instance( + EventReferenceCreateRequestSchema, admin_unit_id=admin_unit.id + ) + db.session.add(reference) + db.session.commit() + + return reference, 201 + class OrganizationOutgoingEventReferenceListResource(BaseResource): @doc( diff --git a/project/forms/event.py b/project/forms/event.py index c8252eb..a76865b 100644 --- a/project/forms/event.py +++ b/project/forms/event.py @@ -451,6 +451,10 @@ class FindEventForm(FlaskForm): choices=distance_choices, ) postal_code = StringField(lazy_gettext("Postal code"), validators=[Optional()]) + exclude_recurring = BooleanField( + lazy_gettext("Exclude recurring events"), + validators=[Optional()], + ) submit = SubmitField(lazy_gettext("Find events")) diff --git a/project/forms/event_date.py b/project/forms/event_date.py index 90f12e4..d1e1b77 100644 --- a/project/forms/event_date.py +++ b/project/forms/event_date.py @@ -1,14 +1,13 @@ -from flask import request from flask_babel import lazy_gettext from flask_wtf import FlaskForm -from wtforms import HiddenField, SelectField, StringField, SubmitField +from wtforms import BooleanField, HiddenField, SelectField, StringField, SubmitField from wtforms.validators import Optional from project.forms.common import distance_choices from project.forms.widgets import CustomDateField -class FindEventDateForm(FlaskForm): +class FindEventDateBaseForm(FlaskForm): class Meta: csrf = False @@ -20,6 +19,9 @@ class FindEventDateForm(FlaskForm): category_id = SelectField( lazy_gettext("Category"), validators=[Optional()], coerce=int ) + + +class FindEventDateForm(FindEventDateBaseForm): coordinate = HiddenField(validators=[Optional()]) location = SelectField(lazy_gettext("Location"), validators=[Optional()]) distance = SelectField( @@ -29,14 +31,33 @@ class FindEventDateForm(FlaskForm): choices=distance_choices, ) event_list_id = HiddenField(validators=[Optional()]) - organization_id = HiddenField(validators=[Optional()]) - organizer_id = HiddenField(validators=[Optional()]) + admin_unit_id = SelectField( + lazy_gettext("Organization"), + validators=[Optional()], + coerce=int, + ) + organizer_id = SelectField( + lazy_gettext("Organizer"), + validators=[Optional()], + coerce=int, + ) + not_referenced = BooleanField( + lazy_gettext("Show unreferenced events only"), + validators=[Optional()], + ) + exclude_recurring = BooleanField( + lazy_gettext("Exclude recurring events"), + validators=[Optional()], + ) + postal_code = StringField(lazy_gettext("Postal code"), validators=[Optional()]) + + submit = SubmitField(lazy_gettext("Find events")) + + +class FindEventDateWidgetForm(FindEventDateBaseForm): s_ft = HiddenField(validators=[Optional()]) s_bg = HiddenField(validators=[Optional()]) s_pr = HiddenField(validators=[Optional()]) s_li = HiddenField(validators=[Optional()]) submit = SubmitField(lazy_gettext("Find")) - - def is_submitted(self): - return "submit" in request.args diff --git a/project/i10n.py b/project/i10n.py index 4e66122..0d553b8 100644 --- a/project/i10n.py +++ b/project/i10n.py @@ -50,6 +50,7 @@ def print_dynamic_texts(): gettext("Scope_place:write") gettext("Scope_event:write") gettext("Scope_eventlist:write") + gettext("Scope_eventreference:write") gettext("Scope_organization:read") gettext("Scope_organization:write") gettext("There must be no self-reference.") diff --git a/project/models/event_reference.py b/project/models/event_reference.py index 9194f24..74f5903 100644 --- a/project/models/event_reference.py +++ b/project/models/event_reference.py @@ -1,7 +1,9 @@ from sqlalchemy import Column, Integer, UniqueConstraint +from sqlalchemy.event import listens_for from project import db from project.models.trackable_mixin import TrackableMixin +from project.utils import make_check_violation class EventReference(db.Model, TrackableMixin): @@ -11,3 +13,13 @@ class EventReference(db.Model, TrackableMixin): event_id = db.Column(db.Integer, db.ForeignKey("event.id"), nullable=False) admin_unit_id = db.Column(db.Integer, db.ForeignKey("adminunit.id"), nullable=False) rating = Column(Integer(), default=50) + + def validate(self): + if self.event and self.event.admin_unit_id == self.admin_unit_id: + raise make_check_violation("Own events cannot be referenced") + + +@listens_for(EventReference, "before_insert") +@listens_for(EventReference, "before_update") +def before_saving_event_reference(mapper, connect, self): + self.validate() diff --git a/project/services/admin_unit.py b/project/services/admin_unit.py index 681308f..c2ef1c7 100644 --- a/project/services/admin_unit.py +++ b/project/services/admin_unit.py @@ -188,13 +188,20 @@ def get_admin_unit_query( if keyword: like_keyword = "%" + keyword + "%" + order_keyword = keyword + "%" keyword_filter = or_( AdminUnit.name.ilike(like_keyword), AdminUnit.short_name.ilike(like_keyword), ) - query = query.filter(keyword_filter) + query = query.filter(keyword_filter).order_by( + AdminUnit.name.ilike(order_keyword).desc(), + AdminUnit.short_name.ilike(order_keyword).desc(), + func.lower(AdminUnit.name), + ) + else: + query = query.order_by(func.lower(AdminUnit.name)) - return query.order_by(func.lower(AdminUnit.name)) + return query def get_organizer_query(admin_unit_id, name=None): @@ -202,9 +209,15 @@ def get_organizer_query(admin_unit_id, name=None): if name: like_name = "%" + name + "%" - query = query.filter(EventOrganizer.name.ilike(like_name)) + order_name = name + "%" + query = query.filter(EventOrganizer.name.ilike(like_name)).order_by( + EventOrganizer.name.ilike(order_name).desc(), + func.lower(EventOrganizer.name), + ) + else: + query = query.order_by(func.lower(EventOrganizer.name)) - return query.order_by(func.lower(EventOrganizer.name)) + return query def get_custom_widget_query(admin_unit_id, name=None): diff --git a/project/services/event.py b/project/services/event.py index 63ce85b..02b1056 100644 --- a/project/services/event.py +++ b/project/services/event.py @@ -64,7 +64,7 @@ def upsert_event_category(category_name): return result -def fill_event_filter(event_filter, params): +def fill_event_filter(event_filter, params: EventSearchParams): if params.keyword: tq = func.websearch_to_tsquery("german", params.keyword) event_filter = and_( @@ -137,10 +137,27 @@ def fill_event_filter(event_filter, params): user_favorite_exists, ) + if params.not_referenced_by_organization_id: + reference_does_not_exist = ~EventReference.query.filter( + EventReference.event_id == Event.id, + EventReference.admin_unit_id == params.not_referenced_by_organization_id, + ).exists() + event_filter = and_( + event_filter, + Event.admin_unit_id != params.not_referenced_by_organization_id, + reference_does_not_exist, + ) + + if params.exclude_recurring: + event_filter = and_( + event_filter, + ~Event.is_recurring, + ) + return event_filter -def get_event_dates_query(params): +def get_event_dates_query(params: EventSearchParams): event_filter = 1 == 1 date_filter = EventDate.start >= datetime.min @@ -314,7 +331,7 @@ def get_event_with_details_or_404(event_id): ) -def get_events_query(params): +def get_events_query(params: EventSearchParams): event_filter = 1 == 1 date_filter = EventDate.start >= datetime.min diff --git a/project/services/event_search.py b/project/services/event_search.py index b122d15..4d74155 100644 --- a/project/services/event_search.py +++ b/project/services/event_search.py @@ -31,6 +31,8 @@ class EventSearchParams(object): self.status = None self.favored_by_user_id = None self.postal_code = None + self.not_referenced_by_organization_id = None + self.exclude_recurring = False @property def date_from(self): @@ -94,6 +96,9 @@ class EventSearchParams(object): def load_list_param(self, param: str): item_ids = request.args.getlist(param) + if len(item_ids) == 1 and "," in item_ids[0]: + item_ids = [i.strip() for i in item_ids[0].split(",")] + if "0" in item_ids: item_ids.remove("0") @@ -102,6 +107,9 @@ class EventSearchParams(object): return None + def load_bool_param(self, param: str): + return request.args[param] == "y" + def load_status_list_param(self): stati = self.load_list_param("status") @@ -149,7 +157,7 @@ class EventSearchParams(object): if "event_list_id" in request.args: self.event_list_id = self.load_list_param("event_list_id") - if "postal_code" in request.args: # pragma: no cover + if "postal_code" in request.args: self.postal_code = self.load_list_param("postal_code") if "sort" in request.args: @@ -158,5 +166,11 @@ class EventSearchParams(object): if "organization_id" in request.args: self.admin_unit_id = request.args["organization_id"] + if "admin_unit_id" in request.args: + self.admin_unit_id = request.args["admin_unit_id"] + if "status" in request.args: self.status = self.load_status_list_param() + + if "exclude_recurring" in request.args: + self.exclude_recurring = self.load_bool_param("exclude_recurring") diff --git a/project/services/place.py b/project/services/place.py index cfc24de..5ac6f80 100644 --- a/project/services/place.py +++ b/project/services/place.py @@ -28,9 +28,13 @@ def get_event_places(admin_unit_id, keyword=None, limit=None): if keyword: like_keyword = "%" + keyword + "%" + order_keyword = keyword + "%" query = query.filter(EventPlace.name.ilike(like_keyword)) - - query = query.order_by(func.lower(EventPlace.name)) + query = query.order_by( + EventPlace.name.ilike(order_keyword).desc(), func.lower(EventPlace.name) + ) + else: + query = query.order_by(func.lower(EventPlace.name)) if limit: query = query.limit(5) diff --git a/project/static/ext/select2.4.0.13.min.css b/project/static/ext/select2.4.0.13.min.css new file mode 100644 index 0000000..7c18ad5 --- /dev/null +++ b/project/static/ext/select2.4.0.13.min.css @@ -0,0 +1 @@ +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/project/static/ext/select2.4.0.13.min.js b/project/static/ext/select2.4.0.13.min.js new file mode 100644 index 0000000..091d4b5 --- /dev/null +++ b/project/static/ext/select2.4.0.13.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('
    ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):ithis.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
      '),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('
    • ×
    • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
    • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--group{padding:0}.select2-container--default .select2-results__option--disabled{color:#999}.select2-container--default .select2-results__option--selected{background-color:#ddd}.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;padding-bottom:5px;padding-right:5px}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;display:inline-block;margin-left:5px;margin-top:5px;padding:0}.select2-container--classic .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{background-color:transparent;border:none;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#888;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;outline:none}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option--group{padding:0}.select2-container--classic .select2-results__option--disabled{color:grey}.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/project/static/ext/select2.4.1.0-beta.1.min.js b/project/static/ext/select2.4.1.0-beta.1.min.js deleted file mode 100644 index f82d88b..0000000 --- a/project/static/ext/select2.4.1.0-beta.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! Select2 4.1.0-beta.1 | https://github.com/select2/select2/blob/master/LICENSE.md */ -!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,i,h,s,o,f,g,m,v,y,_,r,a,b;function w(e,t){return r.call(e,t)}function l(e,t){var n,i,r,s,o,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(o=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[o])&&(e[o]=e[o].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null!=t||(t=e.id?"select2-data-"+e.id:"select2-data-"+(++n).toString()+"-"+r.generateChars(4),e.setAttribute("data-select2-id",t)),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:s(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r.copyNonInternalCssClasses=function(e,t){var n=e.getAttribute("class").trim().split(/\s+/);n=n.filter(function(e){return 0===e.indexOf("select2-")});var i=t.getAttribute("class").trim().split(/\s+/);i=i.filter(function(e){return 0!==e.indexOf("select2-")});var r=n.concat(i);e.setAttribute("class",r.join(" "))},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
        ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),o.append(a),o.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");e.hasClass("select2-results__option--selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find(".select2-results__option--selectable"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var s=l.$results.offset().top,o=r.offset().top,a=l.$results.scrollTop()+(o-s);0===i?l.$results.scrollTop(0):o-s<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find(".select2-results__option--selectable"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),s=i.offset().top+i.outerHeight(!1),o=l.$results.scrollTop()+s-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||s<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function s(e,t){this.$element=e,this.options=t,s.__super__.constructor.call(this)}return i.Extend(s,i.Observable),s.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},s.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},s.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},s.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},s.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},s.prototype.position=function(e,t){t.find(".selection").append(e)},s.prototype.destroy=function(){this._detachCloseHandler(this.container)},s.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},s.prototype.isEnabled=function(){return!this.isDisabled()},s.prototype.isDisabled=function(){return this.options.get("disabled")},s}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,d){function s(e,t){s.__super__.constructor.apply(this,arguments)}return d.Extend(s,e),s.prototype.render=function(){var e=s.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('
          '),e},s.prototype.bind=function(e,t){var i=this;s.__super__.bind.apply(this,arguments);var n=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=d.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}}),this.$selection.on("keydown",".select2-selection__choice__remove",function(e){i.isDisabled()||e.stopPropagation()})},s.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},s.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},s.prototype.selectionContainer=function(){return r('
        • ')},s.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",i=0;i');r.attr("title",i()),r.attr("aria-label",i()),r.attr("aria-describedby",n),a.StoreData(r[0],"data",t),this.$selection.prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,l,c){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete"));var n=e.call(this);return this._transferTabIndex(),n.append(this.$searchContainer),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results",s=t.id+"-container";e.call(this,t,n),i.$search.attr("aria-describedby",s),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.resizeSearch(),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===c.BACKSPACE&&""===i.$search.val()){var t=i.$selection.find(".select2-selection__choice").last();if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery"],function(s){function e(){}return e.prototype.render=function(e){var t=e.call(this),n=s('');return this.$searchContainer=n,this.$search=n.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),t.prepend(n),t},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){s(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer[0].classList.remove("select2-search--hide"):i.$searchContainer[0].classList.add("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},e.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},e.prototype.showSearch=function(e,t){return!0},e}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
        • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,s="orientationchange.select2."+t.id,o=this.$container.parents().filter(a.hasScroll);o.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),o.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+s,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown[0].classList.contains("select2-dropdown--above"),n=this.$dropdown[0].classList.contains("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=r.top,s.bottom=r.top+s.height;var o=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+o,d={left:r.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=s.top-h.top-o),null!=i&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+i),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,e,s,t,o){if(null==r.fn.select2){var a=["open","close","destroy"];r.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new s(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1 - + {{ $t("shared.models.event.listName") }} @@ -65,10 +65,6 @@ const OrganizationRead = { - -
          - -
          @@ -122,9 +118,6 @@ const OrganizationRead = { }) .then((response) => { this.organization = response.data; - Vue.nextTick(function () { - iFrameResize({ minHeight: 300, onMessage: function(m) {} }, '#eventcally-widget'); - }); }); }, handleLoading(isLoading) { diff --git a/project/templates/_macros.html b/project/templates/_macros.html index f226a6d..7d8150a 100644 --- a/project/templates/_macros.html +++ b/project/templates/_macros.html @@ -1025,38 +1025,6 @@ {% endif %} {% endmacro %} -{% macro render_event_dates_filter_form(form) %} -
          - {{ form.hidden_tag() }} - - {% if form.keyword %} - {{ render_field_with_errors(form.keyword, formrow="1") }} - {% endif %} - - {% if form.category_id %} - {{ render_field_with_errors(form.category_id, formrow="1") }} - {% endif %} - - {% if form.organizer_id and form.organizer_id.type != "HiddenField" %} - {{ render_field_with_errors(form.organizer_id, formrow="1") }} - {% endif %} - - {% if form.event_place_id and form.event_place_id.type != "HiddenField" %} - {{ render_field_with_errors(form.event_place_id, formrow="1") }} - {% endif %} - - {{ render_event_dates_date_field(form.date_from, form.date_to) }} - - {% if form.weekday and form.weekday.choices|length > 0 %} - {{ render_field_with_errors(form.weekday, ri="multicheckbox", formrow="1") }} - {% endif %} - - {{ render_event_dates_location_field(form.location, form.distance) }} - - {{ render_field(form.submit) }} -
          -{% endmacro %} - {% macro render_cropper_code(field_id = "photo", min_width=320, min_height=160) %} var field_id = "#{{ field_id }}-image_base64"; var inputImage = document.getElementById('photo-image_file'); @@ -1690,8 +1658,8 @@ $('#allday').on('change', function() { {% macro render_form_scripts() %} - - + + {% endblock %} {% block content %} -

          {{ _('Event Dates') }}

          -
          - - -
          +

          {{ _('Event Dates') }}

          -