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,35 +10,34 @@
{% 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>
<p class="card-text">
<p>
{% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %}
</p>
<div class="well well-sm">
<p>{% trans 'Rating' %}: {{ item.score }}</p>
<p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p>
</div> </div>
<div class="panel-body"> </p>
<p>{{ item.question }}</p>
</div>
<div class="panel-footer">
<p>
{% blocktrans with item.get_absolute_url as url %}View <a href='{{ url }}'>Answer <i class="fa fa-arrow-right"></i></a>{% endblocktrans %}
</p>
<div class="well well-sm">
<p>{% trans 'Rating' %}: {{ item.score }}</p>
<p>{% trans 'Last Update' %}: {{ item.last_updated|naturaltime }}</p>
</div>
</div>
</div>
</div> </div>
</div>
{% ifequal itemnumperrow 'three' %}</div>{% endifequal %} {% ifequal itemnumperrow 'three' %}</div>{% endifequal %}
{% endfor %} {% endfor %}

View File

@ -16,20 +16,14 @@
{% 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 %}
{% endfor %} {% endfor %}

View File

@ -13,35 +13,34 @@
{% 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>
<div class="row"> <div class="row">
<div class="col-lg-6"> <div class="col-lg-6">
<a href='vote/?vote=up'><button type="button" class="btn btn-success btn-circle btn-xl"><i class="fa fa-thumbs-up fa-lg"></i></button></a> <a href='vote/?vote=up'><button type="button" class="btn btn-success btn-circle btn-xl"><i class="fa fa-thumbs-up fa-lg"></i></button></a>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
<a href='vote/?vote=down'><button type="button" class="btn btn-danger btn-circle btn-xl"><i class="fa fa-thumbs-down fa-lg"></i></button></a> <a href='vote/?vote=down'><button type="button" class="btn btn-danger btn-circle btn-xl"><i class="fa fa-thumbs-down fa-lg"></i></button></a>
</div>
</div> </div>
</div> </div>
<div class="col-lg-10"> </div>
<p>{% trans "The results of voting by other readers of this article are below:" %}</p> <div class="col-lg-10">
<ul> <p>{% trans "The results of voting by other readers of this article are below:" %}</p>
<ul>
<li>{% blocktrans with item.recommendations as recommendations %}Recommendations: {{ recommendations }}{% endblocktrans %}</li> <li>{% blocktrans with item.recommendations as recommendations %}Recommendations: {{ recommendations }}{% endblocktrans %}</li>
<li>{% blocktrans with item.votes as votes %}Votes: {{ votes }}{% endblocktrans %}</li> <li>{% blocktrans with item.votes as votes %}Votes: {{ votes }}{% endblocktrans %}</li>
<li>{% blocktrans with item.score as score %}Overall Rating: {{ score }}{% endblocktrans %}</li> <li>{% blocktrans with item.score as score %}Overall Rating: {{ score }}{% endblocktrans %}</li>
</ul> </ul>
</div>
</div> </div>
</div> </div>
</div> </div>