Enable HTML in note tags and support highlighting
This commit is contained in:
@@ -144,6 +144,8 @@ def preprocess_collection(user, course, collection):
|
||||
u"quote": sanitize_html(model["quote"]),
|
||||
u"updated": dateutil_parse(model["updated"]),
|
||||
})
|
||||
if "tags" in model:
|
||||
model.update({u"tags": [sanitize_html(tag) for tag in model["tags"]]})
|
||||
usage_id = model["usage_id"]
|
||||
if usage_id in cache:
|
||||
model.update(cache[usage_id])
|
||||
|
||||
@@ -233,6 +233,13 @@ $divider-visual-tertiary: ($baseline/20) solid $gray-l4;
|
||||
color: $m-gray-d2;
|
||||
}
|
||||
|
||||
// CASE: tag matches a search query
|
||||
.reference-meta.reference-tags .note-highlight {
|
||||
// needed because .note-highlight is a span, which overrides the color
|
||||
@extend %shame-link-text;
|
||||
background-color: $result-highlight-color-base;
|
||||
}
|
||||
|
||||
// Put commas between tags.
|
||||
a.reference-meta.reference-tags:after {
|
||||
content: ",";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<% if (tags.length > 0) { %>
|
||||
<p class="reference-title"><%- gettext("Tags:") %></p>
|
||||
<% for (var i = 0; i < tags.length; i++) { %>
|
||||
<a class="reference-meta reference-tags" href="#"><%- tags[i] %></a>
|
||||
<a class="reference-meta reference-tags" href="#"><%= tags[i] %></a>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user