Skip to content

Commit

Permalink
Add custom template for blockquote
Browse files Browse the repository at this point in the history
  • Loading branch information
JackMorganNZ committed Sep 17, 2018
1 parent f769b03 commit d4f65c3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Expand Up @@ -40,7 +40,7 @@ If you are searching millions of items of data, or displaying millions of pixels

Here's some advice from Fred Wilson, who has invested in many high profile tech companies:

{blockquote source="http://triple-networks.com/2011/12/06/10-golden-principles-of-successful-web-apps/)" footer="true"}
{blockquote source="http://triple-networks.com/2011/12/06/10-golden-principles-of-successful-web-apps/" footer="true"}

First and foremost, we believe that speed is more than a feature. Speed is the most important feature. If your application is slow, people won't use it. I see this more with mainstream users than I do with power users. I think that power users sometimes have a bit of sympathetic eye to the challenges of building really fast web apps, and maybe they're willing to live with it, but when I look at my wife and kids, they're my mainstream view of the world. If something is slow, they're just gone. ... speed is more than a feature. It's a requirement.

Expand Down
6 changes: 6 additions & 0 deletions csfieldguide/static/scss/website.scss
Expand Up @@ -153,3 +153,9 @@ h1, h2, h3, h4, h5, h6, details {
.figure {
display: block !important;
}

blockquote {
padding: 1rem 1rem 1rem 1.5rem;
font-size: 1.1rem !important;
border-left: 5px solid $csfg;
}
11 changes: 11 additions & 0 deletions csfieldguide/utils/custom_converter_templates/blockquote.html
@@ -0,0 +1,11 @@
<blockquote class="blockquote text-muted{% if alignment == 'left' %} text-left{% elif alignment =='center' %} text-center{% elif alignment =='right' %} text-right{% endif %}"
{%- if source %} cite="{{ source }}"{% endif %}>
{% autoescape false -%}
{{ content }}
{%- endautoescape -%}
{% if footer or source %}
<footer class="blockquote-footer">
{{ footer }} {% if source %}(<a href="{{ source }}">{{ '{% trans "Source" %}'}}</a>){% endif %}
</footer>
{% endif %}
</blockquote>
2 changes: 1 addition & 1 deletion csfieldguide/utils/render_html_with_load_tags.py
Expand Up @@ -2,7 +2,7 @@

from django import template

LOAD_TAGS = "{% load static %}{% load render_interactive_in_page %}"
LOAD_TAGS = "{% load static %}{% load i18n %}{% load render_interactive_in_page %}"


def render_html_with_load_tags(html, context=None):
Expand Down

0 comments on commit d4f65c3

Please sign in to comment.