FEATURE: Small improvements to the topic list embed (#12881)

* FEATURE: Small improvements to the topic list embed

- Ability to wrap the list in a custom class so you can styles different
lists using specific CSS

- Adds a topic link to the thumbnail when using the complete template

* FIX: Be more strict about allowed chars in class name
This commit is contained in:
Rafael dos Santos Silva
2021-04-29 12:12:00 -03:00
committed by GitHub
parent 15eabb1d97
commit e2154b3d59
3 changed files with 19 additions and 3 deletions
+4 -2
View File
@@ -7,7 +7,7 @@
</button>
<%- end %>
<%- end %>
<div class='topics-list' data-embed-state='loaded' <%- if @embed_id %>data-embed-id="<%= @embed_id %>"<%- end %>>
<div class='topics-list <%= @embed_class %>' data-embed-state='loaded' <%- if @embed_id %>data-embed-id="<%= @embed_id %>"<%- end %>>
<%- @list.topics.each do |t| %>
<div class='topic-list-item'>
<%- if @template == "complete" %>
@@ -49,7 +49,9 @@
<div class='topic-column featured-image-column'>
<%- if t.image_url.present? %>
<div class='topic-featured-image'>
<img src="<%= t.image_url %>">
<a target="_parent" href="<%= t.url %>" class="title raw-link raw-topic-link" data-topic-id="<%= t.id %>">
<img src="<%= t.image_url %>">
</a>
</div>
<%- end %>
</div>