Fix templates for knowledgebase

This commit is contained in:
Garret Wassermann 2018-12-21 23:37:46 -05:00
parent 7c64a01e6f
commit 0c61f65060
3 changed files with 50 additions and 58 deletions

View File

@ -10,25 +10,24 @@
{% block helpdesk_body %} {% block helpdesk_body %}
<h2>{% trans 'Knowledgebase Category' %}:{% blocktrans with category.title as kbcat %}{{ kbcat }}{% endblocktrans %}</h2> <h2>{% trans 'Knowledgebase Category' %}:{% blocktrans with category.title as kbcat %}{{ kbcat }}{% endblocktrans %}</h2>
<div class="col-lg-12"> <div class="card mb-3">
<div class="well well-sm"> <div class="card-header">
<h4>{% blocktrans with category.title as kbcat %}You are viewing all items in the {{ kbcat }} category.{% endblocktrans %}</h4> <i class="fas fa-info-circle"></i>
{% blocktrans with category.title as kbcat %}You are viewing all items in the {{ kbcat }} category.{% endblocktrans %}
</div>
<div class="card-body">
<p>{{ category.description }}</p> <p>{{ category.description }}</p>
</div> </div>
</div> </div>
{% for item in items %} {% for item in items %}
{% cycle 'one' 'two' 'three' as itemnumperrow silent %} {% cycle 'one' 'two' 'three' as itemnumperrow silent %}
{% ifequal itemnumperrow 'one' %}<div class="row">{% endifequal %} {% ifequal itemnumperrow 'one' %}<div class="card-deck">{% endifequal %}
<div class="col-lg-3"> <div class="card">
<div class="panel panel-primary"> <div class="card-body">
<div class="panel-heading"> <h5 class="card-title">{{ item.title }}</h5>
<h4>{{ item.title }}</h4> <p class="card-text">{{ item.question }}</p>
</div> <p class="card-text">
<div class="panel-body">
<p>{{ item.question }}</p>
</div>
<div class="panel-footer">
<p> <p>
{% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %} {% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %}
</p> </p>
@ -36,7 +35,7 @@
<p>{% trans 'Rating' %}: {{ item.score }}</p> <p>{% trans 'Rating' %}: {{ item.score }}</p>
<p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p> <p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p>
</div> </div>
</div> </p>
</div> </div>
</div> </div>
{% ifequal itemnumperrow 'three' %}</div>{% endifequal %} {% ifequal itemnumperrow 'three' %}</div>{% endifequal %}

View File

@ -16,18 +16,12 @@
{% for category in kb_categories %} {% for category in kb_categories %}
{% cycle 'one' 'two' 'three' as catnumperrow silent %} {% cycle 'one' 'two' 'three' as catnumperrow silent %}
{% if catnumperrow == 'one' %}<div class="row">{% endif %} {% if catnumperrow == 'one' %}<div class="card-deck">{% endif %}
<div class="col-lg-4"> <div class="card">
<div class="panel panel-primary"> <div class="card-body">
<div class="panel-heading"> <h5 class="card-title">{{ category.title }}</h5>
<h3>{{ category.title }}</h3> <p class="card-text">{{ category.description }}</p>
</div> <p class="card-text"><small class="text-muted"><a href='{{ category.get_absolute_url }}'>{% trans 'View articles' %}<i class="fa fa-arrow-right"></i></a></small></p>
<div class="panel-body">
<p>{{ category.description }}</p>
</div>
<div class="panel-footer">
<a href='{{ category.get_absolute_url }}'>{% trans 'View articles' %}<i class="fa fa-arrow-right"></i></a>
</div>
</div> </div>
</div> </div>
{% if catnumperrow == 'three' %}</div>{% endif %} {% if catnumperrow == 'three' %}</div>{% endif %}

View File

@ -13,15 +13,15 @@
{% block helpdesk_body %} {% block helpdesk_body %}
<h2>{% trans 'Knowledgebase' %}:{% blocktrans with item.title as item %}{{ item }}{% endblocktrans %}</h2> <h2>{% trans 'Knowledgebase' %}:{% blocktrans with item.title as item %}{{ item }}{% endblocktrans %}</h2>
<div class="col-lg-12"> <div class="card mb-3">
<div class="panel panel-primary"> <div class="card-header">
<div class="panel-heading"> <i class="fas fa-question-circle"></i>
<h4>{{ item.question }}</h4> {{ item.question }}
</div> </div>
<div class="panel-body"> <div class="card-body">
<p>{{ item.answer|markdown }}</p> <p>{{ item.answer|markdown }}</p>
</div> </div>
<div class="panel-footer"> <div class="card-footer">
<div class="row"> <div class="row">
<div class="col-lg-2"> <div class="col-lg-2">
<p>{% trans "Did you find this article useful?" %}</p> <p>{% trans "Did you find this article useful?" %}</p>
@ -45,7 +45,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<p>{% blocktrans with item.category.title as category_title and item.category.get_absolute_url as category_url %}View <a href='{{ category_url }}'>other <em>{{ category_title }}</em> articles</a>, or continue <a href='../'>viewing other knowledgebase articles</a>.{% endblocktrans %}</p> <p>{% blocktrans with item.category.title as category_title and item.category.get_absolute_url as category_url %}View <a href='{{ category_url }}'>other <em>{{ category_title }}</em> articles</a>, or continue <a href='../'>viewing other knowledgebase articles</a>.{% endblocktrans %}</p>