diff --git a/www/conservancy/static/css/conservancy.css b/www/conservancy/static/css/conservancy.css index 917882e2631e0b7f29e78e7a6eb12b6ce9a13352..10162b392583dc86e564a54c2c353770f064eba9 100644 --- a/www/conservancy/static/css/conservancy.css +++ b/www/conservancy/static/css/conservancy.css @@ -268,7 +268,7 @@ h3 { margin-top: .6em; margin-bottom: .4em; } clear: both; } -span.continued { +.continued { display: block; font-size: .9em; font-weight: bold; @@ -276,7 +276,7 @@ span.continued { margin-bottom: 1em; } -p.date { +.date, .blog-tags, .blog-comments { font-style: italic; font-size: .9em; margin-bottom: .3em; diff --git a/www/conservancy/templates/blog/entry_archive_day.html b/www/conservancy/templates/blog/entry_archive_day.html index 3a2b0ef386358dbc25f6d8ddeaa8ac2d5a944542..77588b7f56777c56215a071b5390080fe3e12cea 100644 --- a/www/conservancy/templates/blog/entry_archive_day.html +++ b/www/conservancy/templates/blog/entry_archive_day.html @@ -6,13 +6,8 @@
Posted by {{ object.author.formal_name }} on {{ object.pub_date|date:"F j, Y" }} - {% if object.tags.all %}
+{% for entry in object_list %} + {% include "blog/entry_partial.html" with entry=entry show="summary+tags" only %} {% endfor %} {% endblock %} diff --git a/www/conservancy/templates/blog/entry_archive_month.html b/www/conservancy/templates/blog/entry_archive_month.html index db40d377f13ace9bf43407c8b3f5684d4aab5de7..97ea8373a4d4c9e72d0349fb7e8d2a3f8ecb95f9 100644 --- a/www/conservancy/templates/blog/entry_archive_month.html +++ b/www/conservancy/templates/blog/entry_archive_month.html @@ -6,13 +6,8 @@ {% endif %} -Posted by {{ object.author.formal_name }} on {{ object.pub_date|date:"F j, Y" }} - {% if object.tags.all %}
+{% for entry in object_list %} + {% include "blog/entry_partial.html" with entry=entry show="summary+tags" only %} {% endfor %} {% endblock %} diff --git a/www/conservancy/templates/blog/entry_archive_year.html b/www/conservancy/templates/blog/entry_archive_year.html index 3c70195e1d9f034e141429d38d9bc52973d710a6..8413f9cb7abea0318f373c624c298f5516f1d732 100644 --- a/www/conservancy/templates/blog/entry_archive_year.html +++ b/www/conservancy/templates/blog/entry_archive_year.html @@ -6,11 +6,8 @@ {% endif %} -{{ object.pub_date|date:"F j, Y" }} by {{ object.author.formal_name }}
-Posted by {{ object.author.formal_name }} on {{object.pub_date|date:"F j, Y" }}. Please email any comments on this entry to info@sfconservancy.org.
+{% include "blog/entry_partial.html" with entry=object htag="h2" only %} -{% if object.tags.all %} {% endif %} +Please email any comments on this entry to + info@sfconservancy.org.
Other Conservancy Blog entries…
diff --git a/www/conservancy/templates/blog/entry_list.html b/www/conservancy/templates/blog/entry_list.html index 2d6c566b05d60694c29f5259dd7dbea606338dc4..041f66c3058458b4c37df4eceb60d57a1fac04f4 100644 --- a/www/conservancy/templates/blog/entry_list.html +++ b/www/conservancy/templates/blog/entry_list.html @@ -13,11 +13,7 @@ {% endif %} {% for entry in blog_entries %} -Posted by {{ entry.author.formal_name }} on {{ entry.pub_date|date:"F j, Y" }} - {% if entry.tags.all %}
+ {% include "blog/entry_partial.html" with entry=entry only %} {% endfor %} {% endif %} -diff --git a/www/conservancy/templates/blog/entry_partial.html b/www/conservancy/templates/blog/entry_partial.html new file mode 100644 index 0000000000000000000000000000000000000000..9511f757c86c35f92ebbd68f42bd11528968b4fa --- /dev/null +++ b/www/conservancy/templates/blog/entry_partial.html @@ -0,0 +1,49 @@ +{% comment %} + +This partial requires these parameters: + +* `entry`: The BlogEntry object to render. + +This partial accepts these optional parameters: + +* `show`: How much of the BlogEntry to render. Accepted values are + "headline", "dateline", "summary", "summary+tags", and "body". + Every value will render the parts listed before it, except "body" + doesn't include "summary". Default "body". +* `htag`: Name of the HTML tag to render the entry headline. Default "h3". + +{% endcomment %} + +
by
+ +{% if show != "dateline" %} + +{% if show|default:"body" == "body" %} +{{ entry.body|safe }} +{% else %} +{{ entry.summary|safe }} +{% endif %} + +{% if show|default:"body" != "body" %} + + on {{ entry.pub_date|date:"F j, Y" }} + +{% endif %} + +{% if show != "summary" and entry.tags.exists %} + +{% endif %} + +{% endif %}{# show != "dateline" #} +{% endif %}{# show != "headline" #} + +Posted by {{ entry.author.formal_name }} on {{ entry.pub_date|date:"F j, Y" }} - {% if entry.tags.all %}
+ {% include "blog/entry_partial.html" with entry=entry only %} {% endfor %} {% endif %} -Read all ContractPatch blog posts…
diff --git a/www/conservancy/templates/frontpage.html b/www/conservancy/templates/frontpage.html index 71c0a07818853cd6b3af316e71e9dd26fd376b26..c00a70f9ff57418c7ed2bb0798db3aa698c346a1 100644 --- a/www/conservancy/templates/frontpage.html +++ b/www/conservancy/templates/frontpage.html @@ -49,42 +49,12 @@Posted by {{ blog.0.author.formal_name }} on {{ blog.0.pub_date|date:"F j, Y" }}
-{{ blog.0.summary|safe }} -Read More from {{ blog.0.author.casual_name }} on this…
- -{% if blog.1 and blog.1.pub_date|date_within_past_days:30 %} -Posted by {{ blog.1.author.formal_name }} on {{ blog.1.pub_date|date:"F j, Y" }}
-{{ blog.1.summary|safe }} -Read More from {{ blog.1.author.casual_name }} on this…
-{% endif %} - -{% if blog.2 and blog.2.pub_date|date_within_past_days:30 %} -Posted by {{ blog.2.author.formal_name }} on {{ blog.2.pub_date|date:"F j, Y" }}
-{{ blog.2.summary|safe }} -Read More from {{ blog.2.author.casual_name }} on this…
-{% endif %} - -{% if blog.3 and blog.3.pub_date|date_within_past_days:30 %} -Posted by {{ blog.3.author.formal_name }} on {{ blog.3.pub_date|date:"F j, Y" }}
-{{ blog.3.summary|safe }} -Read More from {{ blog.3.author.casual_name }} on this…
-{% endif %} - -{% if blog.4 and blog.4.pub_date|date_within_past_days:30 %} -Posted by {{ blog.4.author.formal_name }} on {{ blog.4.pub_date|date:"F j, Y" }}
-{{ blog.4.summary|safe }} -Read More from {{ blog.4.author.casual_name }} on this…
-{% endif %} +{% for entry in blog|slice:":5" %} + {% if forloop.first or entry.pub_date|date_within_past_days:30 %} + {% if not forloop.first %}