Skip to content

Commit

Permalink
fix: remove links underline (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jul 24, 2024
1 parent b49eafc commit 7ced92a
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/unfold/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_admin_url(self, remote_field, remote_obj):
current_app=self.model_admin.admin_site.name,
)
return format_html(
'<a href="{}" class="text-primary-600 underline dark:text-primary-500">{}</a>',
'<a href="{}" class="text-primary-600 dark:text-primary-500">{}</a>',
url,
remote_obj,
)
Expand Down Expand Up @@ -148,7 +148,7 @@ def _get_contents(self) -> str:
return conditional_escape(result_repr)
elif isinstance(f, models.URLField):
return format_html(
'<a href="{}" class="text-primary-600 underline whitespace-nowrap dark:text-primary-500">{}</a>',
'<a href="{}" class="text-primary-600 dark:text-primary-500">{}</a>',
value,
value,
)
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
self.fields["password"].help_text = _(
"Raw passwords are not stored, so there is no way to see this "
"user’s password, but you can change the password using "
'<a href="{}" class="text-primary-600 underline whitespace-nowrap dark:text-primary-500">this form</a>.'
'<a href="{}" class="text-primary-600 dark:text-primary-500">this form</a>.'
)

password = self.fields.get("password")
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/unfold/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ table tr.selected th {

.selector-chooseall,
.selector-clearall {
@apply block border-t py-2 text-center text-sm text-primary-500 underline dark:border-gray-700;
@apply block border-t py-2 text-center text-sm text-primary-500 dark:border-gray-700;
}

.selector-clearall {
Expand Down Expand Up @@ -276,7 +276,7 @@ h3 .delete label {
}

.inline-deletelink {
@apply block leading-none text-red-600 text-sm underline dark:text-red-500;
@apply block leading-none text-red-600 text-sm dark:text-red-500;
}

td .inline-deletelink {
Expand Down Expand Up @@ -507,7 +507,7 @@ fieldset.collapsed .collapse-toggle {
}

.calendar-cancel {
@apply block border-t py-2 text-center text-xs text-red-600 underline dark:border-gray-700 dark:text-red-500;
@apply block border-t py-2 text-center text-xs text-red-600 dark:border-gray-700 dark:text-red-500;
}

.calendarnav-previous {
Expand Down
4 changes: 2 additions & 2 deletions src/unfold/templates/admin/actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
{{ selection_note_all }}
</span>

<span class="question hidden text-primary-600 text-sm underline dark:text-primary-500">
<span class="question hidden text-primary-600 text-sm dark:text-primary-500">
<a href="#" title="{% translate "Click here to select the objects across all pages" %}">
{% blocktranslate with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktranslate %}
</a>
</span>

<span class="clear hidden text-sm text-red-600 underline">
<span class="clear hidden text-sm text-red-600">
<a href="#">
{% translate "Clear selection" %}
</a>
Expand Down
6 changes: 3 additions & 3 deletions src/unfold/templates/admin/edit_inline/stacked.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3 class="bg-gray-50 border-b {% if not forloop.first %}border-t{% endif %} bor

<span class="inline_label font-semibold text-gray-900 dark:text-gray-200">
{% if inline_admin_form.original and inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} font-medium text-primary-600 underline">
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{% if inline_admin_formset.has_change_permission %}inlinechangelink{% else %}inlineviewlink{% endif %} font-medium text-primary-600 dark:text-primary-500">
{{ inline_admin_form.original }}
</a>
{% else %}
Expand All @@ -38,7 +38,7 @@ <h3 class="bg-gray-50 border-b {% if not forloop.first %}border-t{% endif %} bor
{% endwith %}

{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{{ inline_admin_formset.has_change_permission|yesno:'inlinechangelink,inlineviewlink' }} font-medium ml-2 text-primary-600 underline dark:text-primary-500">
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{{ inline_admin_formset.has_change_permission|yesno:'inlinechangelink,inlineviewlink' }} font-medium ml-2 text-primary-600 dark:text-primary-500">
{% if inline_admin_formset.has_change_permission %}
{% translate "Change" %}
{% else %}
Expand All @@ -53,7 +53,7 @@ <h3 class="bg-gray-50 border-b {% if not forloop.first %}border-t{% endif %} bor
</span>

{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 underline dark:text-primary-500">
<a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 dark:text-primary-500">
{% trans "View on site" %}
</a>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions src/unfold/templates/admin/edit_inline/tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
</span>

{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{{ inline_admin_formset.has_change_permission|yesno:'inlinechangelink,inlineviewlink' }} font-medium ml-2 text-primary-600 underline dark:text-primary-500">
<a href="{% url inline_admin_form.model_admin.opts|admin_urlname:'change' inline_admin_form.original.pk|admin_urlquote %}" class="{{ inline_admin_formset.has_change_permission|yesno:'inlinechangelink,inlineviewlink' }} font-medium ml-2 text-primary-600 dark:text-primary-500">
{% if inline_admin_formset.has_change_permission %}
{% translate "Change" %}
{% else %}
Expand All @@ -86,7 +86,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% endif %}

{% if inline_admin_form.show_url %}
<a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 underline dark:text-primary-500">
<a href="{{ inline_admin_form.absolute_url }}" class="font-medium ml-2 text-primary-600 dark:text-primary-500">
{% translate "View on site" %}
</a>
{% endif %}
Expand Down Expand Up @@ -146,7 +146,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% endfor %}

{% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission %}
<td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left text-red-600 border-b border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:pr-4 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:underline lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
<td class="delete {% if inline_admin_form.original %}p-3 lg:py-3{% else %}py-3{% endif %} text-left text-red-600 border-b border-gray-200 flex items-center before:capitalize before:content-[attr(data-label)] before:mr-auto before:text-gray-500 before:pr-4 lg:before:hidden font-normal px-3 text-sm lg:align-top lg:table-cell lg:w-px dark:border-gray-800" data-label="{% trans "Remove" %}">
{% if inline_admin_form.original %}
<div class="flex flex-row lg:mt-3">
<div class="ml-auto">
Expand Down
4 changes: 2 additions & 2 deletions src/unfold/templates/admin/filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">
{% if spec|class_name == "BooleanFieldListFilter" %}
<ul class="border-l-4 border-gray-200 flex pl-4 py-2 text-gray-500 text-sm dark:border-gray-700">
{% for choice in choices %}
<li class="{% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 underline dark{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200{% endif %} pr-4">
<li class="{% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 dark{% else %}text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200{% endif %} pr-4">
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">
{{ choice.display }}
</a>
Expand All @@ -24,7 +24,7 @@ <h3 class="font-medium mb-2 text-gray-700 text-sm dark:text-gray-200">
{% else %}
<ul class="border-l-4 border-gray-200 flex flex-col pl-4 py-4 text-gray-500 text-sm dark:border-gray-700">
{% for choice in choices %}
<li class="mb-4 last:mb-0 {% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 underline {% else %}text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200{% endif %}">
<li class="mb-4 last:mb-0 {% if choice.selected %}font-medium text-primary-600 dark:text-primary-500 {% else %}text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-gray-200{% endif %}">
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">
{{ choice.display }}
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/admin/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</div>

{% if show_all_url %}
<a href="{{ show_all_url }}" class="showall ml-4 text-primary-600 underline">
<a href="{{ show_all_url }}" class="showall ml-4 text-primary-600 dark:text-primary-500">
{% translate 'Show all' %}
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/change_list_filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h3 class="border-b flex font-medium mb-6 px-6 py-4 text-gray-700 text-sm dark:t
{% trans "Filter results" %}

{% if cl.has_active_filters %}
<a href="{{ cl.clear_all_filters_qs }}" class="font-normal ml-3 text-sm text-red-600 underline dark:text-red-500">
<a href="{{ cl.clear_all_filters_qs }}" class="font-normal ml-3 text-sm text-red-600 dark:text-red-500">
{% translate "Clear all filters" %}
</a>
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion src/unfold/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
"prose-pre:rounded",
"prose-headings:font-medium",
"prose-a:text-primary-600",
"prose-a:underline",
"prose-headings:font-medium",
"prose-headings:text-gray-700",
"prose-ol:list-decimal",
Expand Down

0 comments on commit 7ced92a

Please sign in to comment.