Browse Source

Made Discuss only appear on published Rules

Nathan Schneider 4 years ago
parent
commit
7eca77e1c9
3 changed files with 7 additions and 1 deletions
  1. 2 0
      _includes/rule-scripts.html
  2. 2 1
      _layouts/rule.html
  3. 3 0
      _sass/communityrule.scss

+ 2 - 0
_includes/rule-scripts.html

@@ -350,6 +350,7 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
           classDisplayAll("site-footer","none");
           document.getElementById("attribution").style.display = "block";
           document.getElementById("fork").style.display = "inline-block";
+          document.getElementById("discuss-button").style.display = "inline-block";
           document.getElementById("publishRule").style.display = "none";
           document.getElementById("trash").style.display = "inline-block";
           // Turn on RuleWriter if there's content
@@ -365,6 +366,7 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
           classDisplayAll("site-footer","block");
           document.getElementById("attribution").style.display = "none";
           document.getElementById("fork").style.display = "none";
+          document.getElementById("discuss-button").style.display = "none";
           document.getElementById("publishRule").style.display = "inline-block";
           document.getElementById("trash").style.display = "none";
           displayMode = false;

+ 2 - 1
_layouts/rule.html

@@ -112,7 +112,7 @@ layout: default
         title="Add to the public Library">Publish</button>
   <button class="pushButton" id="fork" onclick="fork()"
         title="Edit this Rule into a new one">Fork</button>
-  <button class="pushButton" onclick="toggleVisible('discuss')"
+  <button class="pushButton" id="discuss-button" onclick="toggleVisible('discuss')"
         title="Discuss this Rule with others">Discuss</button>
   <button class="pushButton" onclick="textOutput()"
         title="Download this Rule as a Markdown text file">Export</button>
@@ -125,6 +125,7 @@ layout: default
     <script defer
             src="https://comment.medlab.host/js/commento.js"
             data-no-fonts="true"
+            data-css-override="{% link assets/commento.css %}"
             >
     </script>
     <div id="commento"></div>

+ 3 - 0
_sass/communityrule.scss

@@ -289,3 +289,6 @@ Enabling users to add links*/
 #discuss {
     margin: 20px 0 20px 0;
 }
+#discuss-button {
+    display: none;
+}