mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Construct the correct current path, when serving from a subdirectory
This fixes issue #274
This commit is contained in:
parent
0c47aa226c
commit
7145bce605
10 changed files with 12 additions and 12 deletions
|
@ -36,7 +36,7 @@
|
|||
{% if entity.buildPart %}
|
||||
<span class="form-control-static"><a href="{{ entity_url(entity.buildPart) }}">{{ entity.buildPart.name }}</a></span>
|
||||
{% else %}
|
||||
<a href="{{ path('part_new_build_part', {"project_id": entity.id , "_redirect": app.request.baseUrl ~ app.request.requestUri}) }}"
|
||||
<a href="{{ path('part_new_build_part', {"project_id": entity.id , "_redirect": app.request.baseUrl ~ app.request.pathInfo}) }}"
|
||||
class="btn btn-outline-success">{% trans %}project.edit.associated_build_part.add{% endtrans %}</a>
|
||||
{% endif %}
|
||||
<p class="text-muted">{% trans %}project.edit.associated_build.hint{% endtrans %}</p>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% macro datatable(datatable, controller = 'elements/datatables/datatables', state_save_tag = null) %}
|
||||
<div {{ stimulus_controller(controller, {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<div {{ stimulus_controller(controller, {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
<div {{ stimulus_target(controller, 'dt') }}>
|
||||
<div class="card-body">
|
||||
<div class="card">
|
||||
|
@ -20,12 +20,12 @@
|
|||
{% macro partsDatatableWithForm(datatable, state_save_tag = 'parts') %}
|
||||
<form method="post" action="{{ path("table_action") }}"
|
||||
{# The app.request.baseUrl here is important or it wont work behind a reverse proxy with subfolder #}
|
||||
{{ stimulus_controller('elements/datatables/parts', {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.baseUrl ~ app.request.requestUri }}"
|
||||
{{ stimulus_controller('elements/datatables/parts', {"stateSaveTag": state_save_tag}) }} data-dt-settings='{{ datatable_settings(datatable)|escape('html_attr') }}' data-dt-url="{{ app.request.baseUrl ~ app.request.pathInfo }}"
|
||||
{{ stimulus_action('elements/datatables/parts', 'confirmDeletionAtSubmit') }} data-delete-title="{% trans %}part_list.action.delete-title{% endtrans %}"
|
||||
data-delete-message="{% trans %}part_list.action.delete-message{% endtrans %}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('table_action') }}">
|
||||
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
|
||||
<input type="hidden" name="ids" {{ stimulus_target('elements/datatables/parts', 'selectIDs') }} value="">
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{ stimulus_controller('elements/delete_btn') }} {{ stimulus_action('elements/delete_btn', "submit", "submit") }}
|
||||
data-delete-title="{% trans %}log.undo.confirm_title{% endtrans %}"
|
||||
data-delete-message="{% trans %}log.undo.confirm_message{% endtrans %}">
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
|
||||
{{ datatables.logDataTable(datatable, tag) }}
|
||||
</form>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
data-delete-title="{% trans %}log.undo.confirm_title{% endtrans %}"
|
||||
data-delete-message="{% trans %}log.undo.confirm_message{% endtrans %}">
|
||||
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="redirect_back" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
|
||||
<div class="btn-group btn-group-sm" role="group">
|
||||
<button type="submit" class="btn btn-outline-secondary" name="undo" value="{{ entry.id }}" {% if disabled %}disabled{% endif %}>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="modal-body">
|
||||
{# non visible form elements #}
|
||||
<input type="hidden" name="lot_id" value="">
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
|
||||
<div class="row mb-2">
|
||||
<label class="form-label">
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</table>
|
||||
|
||||
<a class="btn btn-success" {% if not is_granted('@projects.edit') %}disabled{% endif %}
|
||||
href="{{ path('project_add_parts_no_id', {"parts": part.id, "_redirect": app.request.baseUrl ~ app.request.requestUri}) }}">
|
||||
href="{{ path('project_add_parts_no_id', {"parts": part.id, "_redirect": app.request.baseUrl ~ app.request.pathInfo}) }}">
|
||||
<i class="fa-solid fa-magnifying-glass-plus fa-fw"></i>
|
||||
{% trans %}part.info.add_part_to_project{% endtrans %}
|
||||
</a>
|
|
@ -69,7 +69,7 @@
|
|||
{{ dropdown.profile_dropdown('part', part.id) }}
|
||||
|
||||
<a class="btn btn-success mt-2" {% if not is_granted('@projects.edit') %}disabled{% endif %}
|
||||
href="{{ path('project_add_parts_no_id', {"parts": part.id, "_redirect": app.request.baseUrl ~ app.request.requestUri}) }}">
|
||||
href="{{ path('project_add_parts_no_id', {"parts": part.id, "_redirect": app.request.baseUrl ~ app.request.pathInfo}) }}">
|
||||
<i class="fa-solid fa-magnifying-glass-plus fa-fw"></i>
|
||||
{% trans %}part.info.add_part_to_project{% endtrans %}
|
||||
</a>
|
|
@ -15,7 +15,7 @@
|
|||
<input type="hidden" name="lot_id" value="">
|
||||
<input type="hidden" name="action" value="">
|
||||
<input type="hidden" name="_csfr" value="{{ csrf_token('part_withraw' ~ part.iD) }}">
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
|
||||
<div class="row mb-2">
|
||||
<label class="col-form-label col-sm-3">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="btn-group mb-2 mt-2">
|
||||
<a class="btn btn-success" {% if not is_granted('@projects.edit') %}disabled{% endif %}
|
||||
href="{{ path('project_add_parts', {"id": project.id, "_redirect": app.request.baseUrl ~ app.request.requestUri}) }}">
|
||||
href="{{ path('project_add_parts', {"id": project.id, "_redirect": app.request.baseUrl ~ app.request.pathInfo}) }}">
|
||||
<i class="fa-solid fa-square-plus fa-fw"></i>
|
||||
{% trans %}project.info.bom_add_parts{% endtrans %}
|
||||
</a>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<div class="col-4">
|
||||
<div class="input-group mb-3">
|
||||
<input type="number" min="1" class="form-control" placeholder="{% trans %}project.builds.number_of_builds{% endtrans %}" name="n" required>
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.requestUri }}">
|
||||
<input type="hidden" name="_redirect" value="{{ app.request.baseUrl ~ app.request.pathInfo }}">
|
||||
<button class="btn btn-outline-secondary" type="submit" id="button-addon2">{% trans %}project.build.btn_build{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue