Modification de l'ordering par defaut dans le fichier cards/miodels.py, ajout de la balise 'title' sur les images dans les pages index & list, modif du menu (a gauche) pour y ajouter un champ de recherche (pas encore rempli), modif de l'import pour forcer une sous-categorie au nom de sa categorie mere si ce champ est vide dans l'import gcstar

This commit is contained in:
Fred Pauchet 2012-06-13 17:31:31 +02:00
parent 85ac7f412a
commit 371e4660df
8 changed files with 21 additions and 6 deletions

View File

@ -58,7 +58,7 @@ class Command(BaseCommand):
i.country = attrs.get('gcsfield1')
i.with_chip = attrs.get('gcsfield2')
i.image_path = self._get_absfilepath(os.path.dirname(filepath), attrs.get('gcsfield3'))
i.subcategory = attrs.get('gcsfield4')
i.subcategory = attrs.get('gcsfield4')
i.units = attrs.get('gcsfield5')
i.label = attrs.get('gcsfield6')
i.emissionDate = attrs.get('gcsfield7')
@ -67,7 +67,9 @@ class Command(BaseCommand):
i.category = attrs.get('gcsfield11')
i.gcsid = attrs.get('gcsautoid')
if i.subcategory is None or i.subcategory == '':
i.subcategory = i.category
my_list.append(i)
return my_list

View File

@ -22,6 +22,7 @@ class Category(models.Model):
class Meta:
verbose_name_plural ='Catégories'
verbose_name = 'Catégorie'
ordering = ['label']
def __unicode__(self):
return self.label
@ -35,6 +36,7 @@ class SubCategory(models.Model):
class Meta:
verbose_name_plural ='Thèmes'
verbose_name = 'Thème'
ordering = ['label']
def __unicode__(self):
return self.category.label + ' - ' + self.label

View File

@ -3,3 +3,9 @@
vertical-align: middle;
padding: 5px;
}
#page-content
{
width: 95%;
margin: auto;
}

View File

@ -10,7 +10,7 @@
<title>{% block page_title %}Collec' de cart'{% endblock %}</title>
</head>
<body>
<header>
<header class="jumbotron subhead" id="overview">
<p><a href="{% url index %}">No header</a></p>
</header>
<div class="container-fluid">

View File

@ -44,7 +44,7 @@
<td>{{card.expirationdate}}</td>
</tr>
</table>
<p>Dernière mise-à-jour : {{card.updated_at}}</p>
<p class="pull-right">Dernière mise-à-jour : {{card.updated_at}}</p>
</div>
{% endblock %}

View File

@ -11,7 +11,7 @@
<li class="span2">
<a href="{% url card-details card.id %}" class="thumbnail">
{% if card.image %}
<img src="{{card.image|crop}}" />
<img src="{{card.image|crop}}" title="{{card.label}}" />
{% endif %}
</a>
</li>

View File

@ -11,7 +11,7 @@
<li class="span2">
<a href="{% url card-details card.id %}" class="thumbnail">
{% if card.image %}
<img src="{{card.image|crop}}" />
<img src="{{card.image|crop}}" title="{{card.label}}" />
{% endif %}
</a>
</li>

View File

@ -4,6 +4,11 @@
<div class="well" style="padding: 8px 0;">
<ul class="nav nav-list">
<li>
<form>
<input type="text" class="search-query" placeholder="Recherche">
</form>
</li>
<li class="nav-header">
Pays
</li>