Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify action_url, view_url, edit_url, delete_url to accept :id, similar to how it did in 1.8 #272

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions flask_bootstrap/templates/base/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
{% for (action_name, action_icon, action_url) in custom_actions %}
<a class="action-icon text-decoration-none"
{% if action_url is string %}
href="{{ action_url }}"
href="{{ action_url | replace(action_pk_placeholder, row[primary_key]) }}"
{% else %}
href="{{ build_url(row, action_url[0], action_url[1], model, primary_key) | trim }}"
{% endif %}
Expand All @@ -123,7 +123,7 @@
{% if view_url %}
<a class="action-icon text-decoration-none"
{% if view_url is string %}
href="{{ view_url }}"
href="{{ view_url | replace(action_pk_placeholder, row[primary_key]) }}"
{% else %}
href="{{ build_url(row, view_url[0], view_url[1], model, primary_key) | trim }}"
{% endif %}
Expand All @@ -134,7 +134,7 @@
{% if edit_url -%}
<a class="action-icon text-decoration-none"
{% if edit_url is string %}
href="{{ edit_url }}"
href="{{ edit_url | replace(action_pk_placeholder, row[primary_key]) }}"
{% else %}
href="{{ build_url(row, edit_url[0], edit_url[1], model, primary_key) | trim }}"
{% endif %}
Expand All @@ -145,7 +145,7 @@
{% if delete_url %}
<form class="d-inline"
{% if delete_url is string %}
action="{{ delete_url }}"
action="{{ delete_url | replace(action_pk_placeholder, row[primary_key]) }}"
{% else %}
action="{{ build_url(row, delete_url[0], delete_url[1], model, primary_key) | trim }}"
{% endif %}
Expand Down