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

Bootstrap v3+ Danger Alerts #7901

Merged
merged 2 commits into from Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/7901.bugfix
@@ -0,0 +1 @@
Updated Bootstrap alert-error class to alert-danger.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -717,7 +717,7 @@ def flash_error(message: Any, allow_html: bool = False) -> None:
message = Markup(message)
else:
message = escape(message)
flash(message, category='alert-error')
flash(message, category='alert-danger')


@core_helper
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/snippets/info.html
Expand Up @@ -51,7 +51,7 @@ <h1 class="heading">
{% block follow %}
{% if current_user.is_authenticated %}
{% if error_message %}
<div class="alert alert-error">{{ error_message }}</div>
<div class="alert alert-danger">{{ error_message }}</div>
{% endif %}
{% if am_following %}
<a class="btn btn-danger" hx-post="{{ h.url_for('group.unfollow', id=group.id) }}" hx-target="#group-info"><i class="fa-solid fa-circle-minus"></i> Unfollow</a>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/organization/snippets/info.html
Expand Up @@ -62,7 +62,7 @@ <h1 class="heading">{{ organization.title or organization.name }}
{% block follow %}
{% if current_user.is_authenticated %}
{% if error_message %}
<div class="alert alert-error">{{ error_message }}</div>
<div class="alert alert-danger">{{ error_message }}</div>
{% elif am_following %}
<a class="btn btn-danger" hx-post="{{ h.url_for('organization.unfollow', id=organization.id) }}" hx-target="#organization-info"><i class="fa-solid fa-circle-minus"></i> Unfollow</a>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/info.html
Expand Up @@ -30,7 +30,7 @@ <h1 class="heading">{{ h.dataset_display_name(pkg) }}</h1>
{% block follow_button %}
{% if current_user.is_authenticated %}
{% if error_message %}
<div class="alert alert-error">{{ error_message }}</div>
<div class="alert alert-danger">{{ error_message }}</div>
{% endif %}
{% if am_following %}
<a class="btn btn-danger" hx-post="{{ h.url_for('dataset.unfollow', id=pkg.id) }}" hx-target="#package-info"><i class="fa-solid fa-circle-minus"></i> Unfollow</a>
Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/user/snippets/info.html
Expand Up @@ -58,7 +58,7 @@ <h1 class="heading">{{ user.display_name }}</h1>
{% block user_follow %}
{% if current_user.is_authenticated %}
{% if error_message %}
<div class="alert alert-error">{{ error_message }}</div>
<div class="alert alert-danger">{{ error_message }}</div>
{% endif %}
{% if am_following %}
<a class="btn btn-danger" hx-post="{{ h.url_for('user.unfollow', id=user.id) }}" hx-target="#user-info"><i class="fa-solid fa-circle-minus"></i> Unfollow</a>
Expand Down Expand Up @@ -109,4 +109,4 @@ <h1 class="heading">{{ user.display_name }}</h1>
{% endblock %}
{% endblock %}
</section>
</div>
</div>
8 changes: 4 additions & 4 deletions ckanext/datapusher/templates/datapusher/resource_data.html
Expand Up @@ -8,19 +8,19 @@
{% set show_table = true %}

<form method="post" action="{{ action }}" class="datapusher-form">
{{ h.csrf_input() }}
{{ h.csrf_input() }}
<button class="btn btn-primary" name="save" type="submit">
<i class="fa fa-cloud-upload"></i> {{ _('Upload to DataStore') }}
</button>
</form>

{% if status.error and status.error.message %}
{% set show_table = false %}
<div class="alert alert-error">
<div class="alert alert-danger">
<strong>{{ _('Upload error:') }}</strong> {{ status.error.message }}
</div>
{% elif status.task_info and status.task_info.error %}
<div class="alert alert-error">
<div class="alert alert-danger">
{% if status.task_info.error is string %}
{# DataPusher < 0.0.3 #}
<strong>{{ _('Error:') }}</strong> {{ status.task_info.error }}
Expand Down Expand Up @@ -76,7 +76,7 @@ <h3>{{ _('Upload Log') }}</h3>
{% endfor %}
<span class="date" title="{{ h.render_datetime(item.timestamp, with_hours=True) }}">
{{ h.time_ago_from_timestamp(item.timestamp) }}
<a href="#" data-module="datapusher_popover" data-module-title="Details <a href='#' class='popover-close'>X</a>" data-module-content="<ul class='list-unstyled'>{% for key, value in item.items() %}<li><b>{{ key }}</b>: {{ h.clean_html(value|string) }}</li>{% endfor %}</ul>">
<a href="#" data-module="datapusher_popover" data-module-title="Details <a href='#' class='popover-close'>X</a>" data-module-content="<ul class='list-unstyled'>{% for key, value in item.items() %}<li><b>{{ key }}</b>: {{ h.clean_html(value|string) }}</li>{% endfor %}</ul>">
{{ _('Details') }}
</a>
</span>
Expand Down