style: simplify wiki data badge display
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled

- Removed unnecessary div wrappers from the wiki data badge
- Cleaned up the code for better readability

This change enhances the markup simplicity without affecting the functionality,
ensuring the badge displays correctly while maintaining the same styling.
This commit is contained in:
songtianlun 2025-04-02 15:37:51 +08:00
parent 75e7004da6
commit 435244777c

View File

@ -1,14 +1,12 @@
<% if city.wiki_data_id.present? %> <% if city.wiki_data_id.present? %>
<div class="badge badge-soft badge-lg badge-info"> <%= link_to "https://www.wikidata.org/wiki/#{city.wiki_data_id}",
<%= link_to "https://www.wikidata.org/wiki/#{city.wiki_data_id}", target: "_blank",
target: "_blank", rel: "noopener noreferrer",
rel: "noopener noreferrer", class: "badge badge-lg badge-outline badge-info gap-2",
class: "badge badge-lg badge-outline badge-info gap-2", data: { controller: "tooltip", tooltip_target: "tooltip", tooltip_content: "View on WikiData" } do %>
data: { controller: "tooltip", tooltip_target: "tooltip", tooltip_content: "View on WikiData" } do %> <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </svg>
</svg> <%= t("text.wiki_data") %>
<%= t("text.wiki_data") %> <% end %>
<% end %>
</div>
<% end %> <% end %>