Browse Source

Added icons to new /templates/ page

Nathan Schneider 4 years ago
parent
commit
38ccf68f39
1 changed files with 7 additions and 1 deletions
  1. 7 1
      _layouts/library.html

+ 7 - 1
_layouts/library.html

@@ -16,10 +16,16 @@ layout: default
           // iterating over all the rules
           for (var i = 0; i < rules.length; i++) {
               libHTML += "<div class='library-item'>\n";
+              // icon if there is one
+              var icon = rules[i]["icon"];
+              var iconHTML = "";
+              if (icon != null) {
+                  iconHTML = "<img src='/assets/tabler_icons/" + icon + "' /> ";
+              }
               // first the titles
               var title = rules[i]["communityname"];
               if (title == null) { title = "Untitled"; }
-              libHTML += "<div class='library-rule-name'>" +
+              libHTML += "<div class='library-rule-name'>" + iconHTML +
                   "<a href='/create/?r=" + rules[i]["ruleID"] + "'>" +
                   title + "</a></div>\n";
               // then the authors