Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Imagens Featured ok!
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocintra committed Feb 23, 2016
1 parent d46de4e commit d497595
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-20 16:55
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('cleonice', '0020_indexmediacarrousel_slide_active'),
]

operations = [
migrations.AddField(
model_name='indexmediaphotofeatured',
name='photo_featured_title_silver',
field=models.CharField(default='', max_length=200, verbose_name='Titulo cinza'),
),
]
4 changes: 1 addition & 3 deletions cleonice/models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from django import template
from django.db import models
from django.utils import timezone
from cloudinary.models import CloudinaryField

register = template.Library()


class Product(models.Model):
PRODUCT_TYPE = (
Expand Down Expand Up @@ -57,6 +54,7 @@ def __str__(self):

class IndexMediaPhotoFeatured(models.Model):
photo_featured_title = models.CharField('Titulo imagem destaque', max_length=200)
photo_featured_title_silver = models.CharField('Titulo cinza', max_length=200, default='')
photo_featured_substitle = models.CharField('Substitulo imagem destaque', max_length=200)
photo_featured_image = CloudinaryField('Foto destaque')
published_date = models.DateTimeField(auto_now_add=True)
Expand Down
35 changes: 19 additions & 16 deletions cleonice/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,29 @@ <h2>{{ circle.circle_title }}</h2>
<!-- START THE FEATURETTES -->

{% for photo in photosFeature %}

{% if forloop.counter|mod:2 %}
{% with "col-md-7" as divClassDescript %}{% endwith%}
{% with "col-md-5" as divClassImage %}{% endwith%}
{% else %}
{% with "col-md-7 col-md-push-5" as divClassDescript %}{% endwith%}
{% with "col-md-5 col-md-pull-7" as divClassImage %}{% endwith%}
{% endif%}

<hr class="featurette-divider">

<div class="row featurette">
<div class="{{ divClassDescript }}">
<h2 class="featurette-heading">Cada criança com seu estilo. <span class="text-muted">Bolos decorativos.</span></h2>
<p class="lead">Peça bolos com fotos personalizadas. Fotos de heróis, personagens famosos, etc,. Coloque o bolo no tema da festa!</p>
{% if forloop.counter0|mod:2 %}
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">{{ photo.photo_featured_title }} <span class="text-muted">{{ photo.photo_featured_title_silver }}</span></h2>
<p class="lead">{{ photo.photo_featured_substitle }}</p>
</div>
<div class="col-md-5">
{% cloudinary photo.photo_featured_image class="featurette-image img-responsive center-block" alt=photo.photo_featured_title %}
</div>
</div>
<div class="{{ divClassImage }}">
<img class="featurette-image img-responsive center-block" src="/static/images/bolos/barbie.jpg" alt="Generic placeholder image">
{% else %}
<div class="row featurette">
<div class="col-md-7 col-md-push-5">
<h2 class="featurette-heading">{{ photo.photo_featured_title }} <span class="text-muted">{{ photo.photo_featured_title_silver }}</span></h2>
<p class="lead">{{ photo.photo_featured_substitle }}</p>
</div>
<div class="col-md-5 col-md-pull-7">
{% cloudinary photo.photo_featured_image class="featurette-image img-responsive center-block" alt=photo.photo_featured_title %}
</div>
</div>
</div>
{% endif%}

<hr class="featurette-divider">
{% endfor %}
Expand Down

0 comments on commit d497595

Please sign in to comment.