new-text #631
@ -158,9 +158,9 @@ function selectBoatChange() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.detail.customProperties.convert_handoperated_possible) {
|
if (event.detail.customProperties.convert_handoperated_possible) {
|
||||||
only_steering.removeAttribute('disabled');
|
only_steering.removeAttribute('readonly');
|
||||||
}else {
|
}else {
|
||||||
only_steering.setAttribute('disabled', 'disabled');
|
only_steering.setAttribute('readonly', 'readonly');
|
||||||
}
|
}
|
||||||
|
|
||||||
const destination = <HTMLSelectElement>(
|
const destination = <HTMLSelectElement>(
|
||||||
|
@ -190,3 +190,57 @@ test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
|
|||||||
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
||||||
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
|
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Cox can start and finish trip with cox steering only", async ({ page }, testInfo) => {
|
||||||
|
await page.goto("/auth");
|
||||||
|
await page.getByPlaceholder("Name").click();
|
||||||
|
await page.getByPlaceholder("Name").fill("cox2");
|
||||||
|
await page.getByPlaceholder("Name").press("Tab");
|
||||||
|
await page.getByPlaceholder("Passwort").fill("cox");
|
||||||
|
await page.getByPlaceholder("Passwort").press("Enter");
|
||||||
|
|
||||||
|
await page.goto("/");
|
||||||
|
await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
|
||||||
|
if (testInfo.project.name.includes("Mobile")) {
|
||||||
|
// No left boat selector on mobile views
|
||||||
|
await page.getByText('-- Wähle ein Boot aus ---').nth(1).click();
|
||||||
|
await page.getByRole("option", { name: "cox_only_steering_boat" }).click();
|
||||||
|
} else {
|
||||||
|
await page.getByText('2+', { exact: true }).click();
|
||||||
|
await page.getByText("cox_only_steering_boat", { exact: true }).click();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trip starts 2 hours ago
|
||||||
|
const datetimeSelector = '#departure';
|
||||||
|
const currentValue = await page.$eval(datetimeSelector, el => el.value);
|
||||||
|
const currentDate = new Date(currentValue);
|
||||||
|
currentDate.setMinutes(currentDate.getMinutes());
|
||||||
|
currentDate.setHours(currentDate.getHours() - new Date().getTimezoneOffset()/60 - 2);
|
||||||
|
const newDatetime = currentDate.toISOString().slice(0, 16);
|
||||||
|
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
|
||||||
|
|
||||||
|
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
|
||||||
|
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
|
||||||
|
"cox",
|
||||||
|
);
|
||||||
|
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
|
||||||
|
await expect(page.locator("body")).toContainText(
|
||||||
|
"Ausfahrt erfolgreich hinzugefügt",
|
||||||
|
);
|
||||||
|
await expect(page.locator("body")).toContainText("cox_only_steering_boat");
|
||||||
|
|
||||||
|
await page.goto("/log");
|
||||||
|
await page.locator("div:nth-child(2) > .border-0").click();
|
||||||
|
|
||||||
|
await page.getByRole("combobox", { name: "Destination" }).click();
|
||||||
|
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
|
||||||
|
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
|
||||||
|
await expect(page.locator("body")).toContainText(
|
||||||
|
"Ausfahrt korrekt eingetragen",
|
||||||
|
);
|
||||||
|
|
||||||
|
await page.goto('/log/show');
|
||||||
|
await expect(page.locator('body')).toContainText('cox_only_steering_boat');
|
||||||
|
await expect(page.locator('body')).toContainText('(cox2)');
|
||||||
|
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
|
||||||
|
});
|
||||||
|
@ -55,6 +55,7 @@ INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Kaputtes Boot :-('
|
|||||||
INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Sehr kaputtes Boot :-((', 7, 1);
|
INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Sehr kaputtes Boot :-((', 7, 1);
|
||||||
INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Ottensheim Boot', 7, 2);
|
INSERT INTO "boat" (name, amount_seats, location_id) VALUES ('Ottensheim Boot', 7, 2);
|
||||||
INSERT INTO "boat" (name, amount_seats, location_id, owner) VALUES ('second_private_boat_from_rower', 1, 1, 2);
|
INSERT INTO "boat" (name, amount_seats, location_id, owner) VALUES ('second_private_boat_from_rower', 1, 1, 2);
|
||||||
|
INSERT INTO "boat" (name, amount_seats, location_id, default_shipmaster_only_steering) VALUES ('cox_only_steering_boat', 3, 1, true);
|
||||||
INSERT INTO "logbook_type" (name) VALUES ('Wanderfahrt');
|
INSERT INTO "logbook_type" (name) VALUES ('Wanderfahrt');
|
||||||
INSERT INTO "logbook_type" (name) VALUES ('Regatta');
|
INSERT INTO "logbook_type" (name) VALUES ('Regatta');
|
||||||
INSERT INTO "logbook" (boat_id, shipmaster,steering_person, shipmaster_only_steering, departure) VALUES (2, 2, 2, false, strftime('%Y', 'now') || '-12-24 10:00');
|
INSERT INTO "logbook" (boat_id, shipmaster,steering_person, shipmaster_only_steering, departure) VALUES (2, 2, 2, false, strftime('%Y', 'now') || '-12-24 10:00');
|
||||||
|
@ -36,37 +36,52 @@
|
|||||||
placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" />
|
placeholder="Suchen nach (Name, [yes|no]-role:<name>, has-[no-]membership-pdf)" />
|
||||||
</div>
|
</div>
|
||||||
<!-- END filterBar -->
|
<!-- END filterBar -->
|
||||||
<div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4">
|
<div id="filter-result-js" class="search-result"></div>
|
||||||
<div id="filter-result-js"
|
|
||||||
class="text-primary-950 dark:text-white text-right"></div>
|
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<div data-filterable="true"
|
<div data-filterable="true"
|
||||||
data-filter="{{ user.name }} {% for role in roles %} {% if role.name in user.roles %} yes-role:{{ role.name }} {% else %} no-role:{{ role.name }} {% endif %} role-{{ role }} {% endfor %} {% if user.membership_pdf %}has-membership-pdf{% else %}has-no-membership-pdf{% endif %} ">
|
data-filter="{{ user.name }} {% for role in roles %} {% if role.name in user.roles %} yes-role:{{ role.name }} {% else %} no-role:{{ role.name }} {% endif %} role-{{ role }} {% endfor %} {% if user.membership_pdf %}has-membership-pdf{% else %}has-no-membership-pdf{% endif %}"
|
||||||
|
class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative">
|
||||||
|
<details class="block dark:text-white w-full">
|
||||||
|
<summary>
|
||||||
|
<span class="text-black dark:text-white cursor-pointer">
|
||||||
|
<span class="font-bold">
|
||||||
|
{{ user.name }}
|
||||||
|
{% if not user.last_access and "admin" in loggedin_user.roles and user.mail %}
|
||||||
<form action="/admin/user"
|
<form action="/admin/user"
|
||||||
method="post"
|
method="post"
|
||||||
enctype="multipart/form-data"
|
enctype="multipart/form-data"
|
||||||
class="bg-white dark:bg-primary-900 p-3 rounded-md w-full">
|
class="inline">
|
||||||
<div class="w-full grid gap-3">
|
• <a class="font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
|
||||||
<input type="hidden" name="id" value="{{ user.id }}" />
|
href="/admin/user/{{ user.id }}/send-welcome-mail"
|
||||||
<div class="font-bold mb-1 text-black dark:text-white">
|
onclick="return confirm('Willst du wirklich das Willkommensmail an {{ user.name }} ausschicken?');">Willkommensmail verschicken</a>
|
||||||
{{ user.name }}
|
</form>
|
||||||
{% if user.last_access %}
|
|
||||||
(last access:
|
|
||||||
{{ user.last_access | date }})
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if user.last_access %}• ⏳ {{ user.last_access | date }}{% endif %}
|
||||||
|
</span>
|
||||||
|
<small class="block text-gray-600 dark:text-gray-100">
|
||||||
|
{% for role in user.roles %}
|
||||||
|
{{ role }}
|
||||||
|
{% if not loop.last %},{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</small>
|
||||||
|
</span>
|
||||||
|
</summary>
|
||||||
|
<form action="/admin/user"
|
||||||
|
method="post"
|
||||||
|
enctype="multipart/form-data"
|
||||||
|
class="w-full mt-2">
|
||||||
{% if user.pw %}
|
{% if user.pw %}
|
||||||
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
|
<a class="block my-1 font-normal text-[#f43f5e] dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
|
||||||
href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
|
href="/admin/user/{{ user.id }}/reset-pw"
|
||||||
|
onclick="return confirm('Willst du wirklich das Passwort zurücksetzen?');">Passwort zurücksetzen</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not user.last_access and "admin" in loggedin_user.roles %}
|
<div class="w-full grid gap-3 mt-3">
|
||||||
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
|
<input type="hidden" name="id" value="{{ user.id }}" />
|
||||||
href="/admin/user/{{ user.id }}/send-welcome-mail">Willkommensmail verschicken</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
|
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
{{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }}
|
{{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<hr class="sm:col-span-2 lg:col-span-4 my-3" />
|
||||||
{% if user.membership_pdf %}
|
{% if user.membership_pdf %}
|
||||||
<a href="/admin/user/{{ user.id }}/membership"
|
<a href="/admin/user/{{ user.id }}/membership"
|
||||||
class="text-black dark:text-white">Beitrittserklärung herunterladen</a>
|
class="text-black dark:text-white">Beitrittserklärung herunterladen</a>
|
||||||
@ -100,8 +115,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
|
</details>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<div class="col-span-4 md:col-span-1">
|
<div class="col-span-4 md:col-span-1">
|
||||||
<div class="text-sm text-gray-600 dark:text-gray-100">Bootssteuerung</div>
|
<div class="text-sm text-gray-600 dark:text-gray-100">Bootssteuerung</div>
|
||||||
<div class="h-10 flex items-center">
|
<div class="h-10 flex items-center">
|
||||||
{{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering', disabled=true) }}
|
{{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering', readonly=true) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ log::rower_select(id="newrower", selected=[], class="col-span-4", init=true) }}
|
{{ log::rower_select(id="newrower", selected=[], class="col-span-4", init=true) }}
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
{% if readonly %}readonly{% endif %}>
|
{% if readonly %}readonly{% endif %}>
|
||||||
</div>
|
</div>
|
||||||
{% endmacro input %}
|
{% endmacro input %}
|
||||||
{% macro checkbox(label, name, id='', checked=false, class='', disabled=false) %}
|
{% macro checkbox(label, name, id='', checked=false, class='', disabled=false, readonly=false) %}
|
||||||
<label for="{{ name }}{{ id }}"
|
<label for="{{ name }}{{ id }}"
|
||||||
class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}">
|
class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
@ -145,6 +145,7 @@
|
|||||||
name="{{ name }}"
|
name="{{ name }}"
|
||||||
{% if checked %} checked{% endif %}
|
{% if checked %} checked{% endif %}
|
||||||
{% if disabled %} disabled{% endif %}
|
{% if disabled %} disabled{% endif %}
|
||||||
|
{% if readonly %} readonly="readonly"{% endif %}
|
||||||
class="h-4 w-4 accent-primary-600 dark:accent-primary-200 mr-2" />
|
class="h-4 w-4 accent-primary-600 dark:accent-primary-200 mr-2" />
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</label>
|
</label>
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer">hier</a>) melde dich bitte bei it@rudernlinz.at. @Studenten: Bitte die aktuelle Studienbestätigung an it@rudernlinz.at schicken.
|
rel="noopener noreferrer">hier</a>) melde dich bitte bei it@rudernlinz.at. @Studenten: Bitte die aktuelle Studienbestätigung an it@rudernlinz.at schicken.
|
||||||
<br />
|
<br />
|
||||||
<small>Wir aktualisieren den Ruderassistent unregelmäßig mit unserem Bankkonto. Falls du schon bezahlt hast, kannst du diese Nachricht getrost ignorieren :^)</small>
|
<small><a href="https://rudernlinz.at/unser-verein/vorstand/" target="_blank">Unsere Kassiere</a> aktualisieren den Ruderassistent unregelmäßig mit unserem Bankkonto. Falls du schon bezahlt hast, kannst du diese Nachricht getrost ignorieren. Wenn du schon vor "einigen Wochen" bezahlt hast bitte bei kassier@rudernlinz.at nachfragen :^)</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -391,15 +391,15 @@
|
|||||||
</div>
|
</div>
|
||||||
{# --- START Add Buttons --- #}
|
{# --- START Add Buttons --- #}
|
||||||
{% if "manage_events" in loggedin_user.roles or "cox" in loggedin_user.roles %}
|
{% if "manage_events" in loggedin_user.roles or "cox" in loggedin_user.roles %}
|
||||||
<div class="grid {% if "manage_events" in loggedin_user.roles %}grid-cols-2{% endif %} text-center">
|
<div class="grid {% if "manage_events" in loggedin_user.roles and "cox" in loggedin_user.roles %}grid-cols-2{% endif %} text-center">
|
||||||
{% if "manage_events" in loggedin_user.roles %}
|
{% if "manage_events" in loggedin_user.roles %}
|
||||||
<a href="#"
|
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#addEventForm" class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 text-sm font-semibold
|
||||||
data-sidebar="true"
|
{% if "cox" in loggedin_user.roles %}
|
||||||
data-trigger="sidebar"
|
rounded-bl-md
|
||||||
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
|
{% else %}
|
||||||
data-day="{{ day.day }}"
|
rounded-b-md
|
||||||
data-body="#addEventForm"
|
{% endif %}
|
||||||
class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 rounded-bl-md text-sm font-semibold">
|
">
|
||||||
<span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/plus-icon" %}</span>
|
<span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/plus-icon" %}</span>
|
||||||
Event
|
Event
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user