Procházet zdrojové kódy

makes paragraph numbers optional

Caleb Fangmeier před 5 roky
rodič
revize
6fe53ece8b
3 změnil soubory, kde provedl 23 přidání a 16 odebrání
  1. 0 14
      static/css/custom.css
  2. 21 2
      templates/article.html
  3. 2 0
      templates/base.html

+ 0 - 14
static/css/custom.css

@@ -4,21 +4,7 @@ figure img {
   margin-right: auto;
 }
 
-/* Next 2 rules add ability to have paragraph numbers */
-.article-content p {
-  padding-left: 50px;
-  position: relative;
-}
-
-.article-content p:before {
-  display: block;
-  position: absolute;
-  left: 5px;
-}
-
 /* Styling of tables */
-
-
 table {
   border-collapse: collapse;
 }

+ 21 - 2
templates/article.html

@@ -20,6 +20,23 @@
 {{ smo_metadata(article) }}
 {% endblock meta_tags_in_head %}
 
+{% block style %}
+{% if DRAFT %}
+<style>
+.article-content p {
+  padding-left: 50px;
+  position: relative;
+}
+
+.article-content p:before {
+  display: block;
+  position: absolute;
+  left: 5px;
+}
+</style>
+{% endif %}
+{% endblock %}
+
 {% block content %}
 <article>
 <div class="row-fluid">
@@ -37,9 +54,9 @@
         </nav>
     </div>
     <div class="span8 article-content">
-       {% else %}
+    {% else %}
         <div class="span8 offset2 article-content">
-            {% endif %}
+    {% endif %}
 
             {% import '_includes/translations.html' as translations with context %}
             {{ translations.translations_for(article) }}
@@ -93,6 +110,7 @@
     {% from '_includes/comments.html' import comments_script with context %}
     {{ comments_script(article) }}
 
+{% if DRAFT %}
 <script>
 $(document).ready(function() {
   var maxNum = 0;  //how many lines should be prepared (Takin in considersation, there would be more wrappers) 
@@ -112,5 +130,6 @@ $(document).ready(function() {
   console.log("resulting generated <style id='numbers'>"+prepStyle+"</style>")
 });
 </script>
+{% endif %}
 
 {% endblock script %}

+ 2 - 0
templates/base.html

@@ -59,6 +59,8 @@
         {% include '_includes/feeds.html' %}
         {% endblock feed_links %}
         {% include '_includes/analytics.html' %}
+        {% block style %}
+        {% endblock %}
     </head>
     <body>
         <div id="content-sans-footer">