Fixed challenges not having an description

This commit is contained in:
teras 2018-01-31 18:27:35 +02:00
parent 9dec2d6e3a
commit 58a90fe761
2 changed files with 16 additions and 3 deletions

View File

@ -8,7 +8,11 @@
<div class="col m8"> <div class="col m8">
<h3 class="">{{ challenge.name }}</h3> <h3 class="">{{ challenge.name }}</h3>
<p style="">{{ challenge.description | markdownify }}</p> {% if challenge.description %}
<p style="">{{ challenge.description | markdownify }}</p>
{% else %}
<p style="">{{ challenge.blurb | markdownify }}</p>
{% endif %}
<div class="section"> <div class="section">
{% if challenge.creator.profile.contact_info %} {% if challenge.creator.profile.contact_info %}

View File

@ -1,4 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load markdownify %}
{% block content %} {% block content %}
<div class="row container"> <div class="row container">
<div class="section slogan"> <div class="section slogan">
@ -13,9 +16,15 @@
<div class="card"> <div class="card">
<div class="card-content" style="overflow: hidden; height:150px;"> <div class="card-content" style="overflow: hidden; height:200px;">
<div class="card-title"><b>{{ challenge.name }}</b></div> <div class="card-title"><b>{{ challenge.name }}</b></div>
<p style="text-align: justify;">{% if challenge.blurb %}{{ challenge.blurb }}{% else %}{{ challenge.description|slice:":500" }}{% endif %}</p> <p style="text-align: justify;">
{% if challenge.blurb %}
{{ challenge.blurb | markdownify }}
{% else %}
{{ challenge.description|slice:":500" | markdownify }}
{% endif %}
</p>
<div style="padding-top: 15px;"> <div style="padding-top: 15px;">
{% for tag in challenge.tags.all %} {% for tag in challenge.tags.all %}
<div class="chip">{{ tag.name }}</div> <div class="chip">{{ tag.name }}</div>