Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an html snippet for initiative cards #35

Open
fluix-dev opened this issue Sep 16, 2020 · 0 comments
Open

Create an html snippet for initiative cards #35

fluix-dev opened this issue Sep 16, 2020 · 0 comments
Labels

Comments

@fluix-dev
Copy link
Collaborator

We have a lot of code like this for cards:

        <div class="col-4 pointer-cursor" onclick="location.href=`{% url name pk=object.pk %}`">
          <div class="card u-flex-column h-100 slide-up">
            <div class="card-container">
              {% if object.image %}
                <div class="card-image" style="background-image: url({{ object.image.url }})"></div>
              {% else %}
                <div class="card-image" style="background-image: url({% static 'img/logo.png' %})"></div>
              {% endif %}
            </div>
            <div class="mobile-title">
              <div class="content">
                <div class="tile">
                  <div class="tile__container">
                    <p class="tile__title">{{ object.name }}</p>
                    <p class="tile__subtitle">By {{ object.short_creators }}</p>
                  </div>
                </div>
              </div>
            </div>
            <div class="card-body content">
              <p>{{ object.description|truncatechars:48 }}</p>
            </div>
            <div class="card-footer content">
              {% for tag in object.tags.all|slice:':3' %}
                <div class="tag white" style="background-color: {{ tag.color }}">{{ tag.name }}</div>
              {% endfor %}
            </div>
          </div>
        </div>

This should be moved into a separate template and just {% include %} where necessary.

@fluix-dev fluix-dev added backend enhancement New feature or request labels Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants