Category Icons

I’m looking at the code and trying to fix the following two issues, but I’m stuck on the second one.

Category icon list is not applied in category view (with Show subcategory list above topics in this category)

subcategory-view-missing-category-icon

I managed to fix this one by replacing line 112 in header.html

      if(iconItem && !attrs.category.parent_category_id) {

with

      if (iconItem) {

and adding the following code to common.scss

.subcategory .category-icon-widget {
  display: none;
}

subcategory-view-missing-category-icon-fixed

Category lock icon next to category doesn’t change to new svg

Categories view:
category-view-lock-icon

Category view (with Show subcategory list above topics in this category):
subcategory-view-lock-icon

I think this is the relevant code:

    let classNames = "badge-category clear-badge";
    if (restricted) {
      classNames += " restricted";
    }
    
...

    html +=
      `<span ${style} ` +
      'data-drop-close="true" class="' +
      classNames +
      '"' +
      (description ? 'title="' + escapeExpression(description) + '" ' : "") +
      ">";

which adds restricted class to a <span> with classes badge-category clear-badge which controls the subcategory lock icon display, but I cannot figure out how to also apply this to <div> with class category-text-title which controls category lock icon display.

Please help @pmusaraj @tshenry

2 Likes