Added trade user list to amiibo detail

This commit is contained in:
Felipe Martín 2015-09-22 21:09:42 +02:00
parent a447af21ec
commit d2ae19a5fa
7 changed files with 65 additions and 26 deletions

View File

@ -6,7 +6,8 @@ from django.views.generic.base import View
from .models import ( from .models import (
Collection, Amiibo, Collection, Amiibo,
AmiiboFigure, AmiiboCard AmiiboFigure, AmiiboCard,
UserAmiibo
) )
from . import services from . import services
@ -34,7 +35,7 @@ class CollectionView(View):
'selected_collection': collection, 'selected_collection': collection,
'amiibo_list': amiibo_list, 'amiibo_list': amiibo_list,
'item': collection, 'item': collection,
'section': self.section 'section': self.section,
}) })
@ -62,6 +63,7 @@ class AmiiboView(View):
'amiibo': amiibo_obj, 'amiibo': amiibo_obj,
'item': amiibo_obj, 'item': amiibo_obj,
'section': self.section, 'section': self.section,
'users_trading': UserAmiibo.objects.filter(trade=True, _amiibo_id=amiibo_obj.pk)
}) })
class AmiiboFigureView(AmiiboView): class AmiiboFigureView(AmiiboView):

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-11 21:22+0200\n" "POT-Creation-Date: 2015-09-22 21:08+0200\n"
"PO-Revision-Date: 2015-09-11 21:25+0200\n" "PO-Revision-Date: 2015-09-22 21:09+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n" "Language: es\n"
@ -257,7 +257,7 @@ msgid "all"
msgstr "todas" msgstr "todas"
#: templates/_layout.html:36 templates/_layout.html.py:105 #: templates/_layout.html:36 templates/_layout.html.py:105
#: templates/profile/main.html:35 #: templates/profile/main.html:37
msgid "Figures" msgid "Figures"
msgstr "Figuras" msgstr "Figuras"
@ -267,7 +267,7 @@ msgid "All"
msgstr "Todas" msgstr "Todas"
#: templates/_layout.html:47 templates/_layout.html.py:114 #: templates/_layout.html:47 templates/_layout.html.py:114
#: templates/profile/main.html:36 #: templates/profile/main.html:38
msgid "Cards" msgid "Cards"
msgstr "Tarjetas" msgstr "Tarjetas"
@ -671,30 +671,38 @@ msgstr "%(amiibo)s amiibo de %(collection)s en "
msgid "Shops" msgid "Shops"
msgstr "Tiendas" msgstr "Tiendas"
#: templates/amiibo/amiibo-figure.html:73 #: templates/amiibo/amiibo-figure.html:60
msgid "Users trading"
msgstr "Usuarios para cambio"
#: templates/amiibo/amiibo-figure.html:74
msgid "Buy now for" msgid "Buy now for"
msgstr "Comprar ahora por" msgstr "Comprar ahora por"
#: templates/amiibo/amiibo-figure.html:80 #: templates/amiibo/amiibo-figure.html:81
msgid "No stock" msgid "No stock"
msgstr "Sin stock" msgstr "Sin stock"
#: templates/amiibo/amiibo-figure.html:88 #: templates/amiibo/amiibo-figure.html:89
msgid "Updated" msgid "Updated"
msgstr "Actualizado" msgstr "Actualizado"
#: templates/amiibo/amiibo-figure.html:91 #: templates/amiibo/amiibo-figure.html:92
msgid "This item had never been in stock" msgid "This item had never been in stock"
msgstr "Este articulo nunca ha estado en stock" msgstr "Este articulo nunca ha estado en stock"
#: templates/amiibo/amiibo-figure.html:97 #: templates/amiibo/amiibo-figure.html:98
msgid "This is a pack of various items" msgid "This is a pack of various items"
msgstr "Este es un pack que contiene varios artículos" msgstr "Este es un pack que contiene varios artículos"
#: templates/amiibo/amiibo-figure.html:107 #: templates/amiibo/amiibo-figure.html:108
msgid "No shops :(" msgid "No shops :("
msgstr "Sin tiendas :(" msgstr "Sin tiendas :("
#: templates/amiibo/amiibo-figure.html:128
msgid "No user have this amiibo available for trade :("
msgstr "Ningún usuario tiene disponible este amiibo para cambio :("
#: templates/amiibo/collection-cards.html:9 templates/amiibo/collection.html:29 #: templates/amiibo/collection-cards.html:9 templates/amiibo/collection.html:29
msgid "Search..." msgid "Search..."
msgstr "Buscar…" msgstr "Buscar…"
@ -886,32 +894,32 @@ msgstr ""
"favorita añadida? ¿Nos falta algo muy importante que te hará la vida mas " "favorita añadida? ¿Nos falta algo muy importante que te hará la vida mas "
"fácil? ¿Solo quieres hablar un rato? ¡Contacta con nosotros!" "fácil? ¿Solo quieres hablar un rato? ¡Contacta con nosotros!"
#: templates/profile/main.html:11 #: templates/profile/main.html:13
#, python-format #, python-format
msgid "Here you can browse over %(username)s's collection" msgid "Here you can browse over %(username)s's collection"
msgstr "Aquí puedes ver la colección de %(username)s" msgstr "Aquí puedes ver la colección de %(username)s"
#: templates/profile/main.html:19 #: templates/profile/main.html:21
msgid "Want everyone to see your collection? Spread the word!" msgid "Want everyone to see your collection? Spread the word!"
msgstr "¿Quieres presumir de colección? ¡Difunde la palabra!" msgstr "¿Quieres presumir de colección? ¡Difunde la palabra!"
#: templates/profile/main.html:21 #: templates/profile/main.html:23
msgid "Look at my amiibo collection!" msgid "Look at my amiibo collection!"
msgstr "¡Mira mi colección de #amiibo!" msgstr "¡Mira mi colección de #amiibo!"
#: templates/profile/main.html:28 #: templates/profile/main.html:30
msgid "Have it" msgid "Have it"
msgstr "Lo tiene" msgstr "Lo tiene"
#: templates/profile/main.html:29 #: templates/profile/main.html:31
msgid "Want it" msgid "Want it"
msgstr "Lo quiere" msgstr "Lo quiere"
#: templates/profile/main.html:30 #: templates/profile/main.html:32
msgid "Trade it" msgid "Trade it"
msgstr "Lo cambia" msgstr "Lo cambia"
#: templates/profile/main.html:48 #: templates/profile/main.html:50
msgid "Oooops, seems this user have nothing for that." msgid "Oooops, seems this user have nothing for that."
msgstr "Ups, ¡parece que no tiene nada por aquí!" msgstr "Ups, ¡parece que no tiene nada por aquí!"

View File

@ -16,6 +16,9 @@ $(function(){
position: 'left center' position: 'left center'
}); });
// Tabs
$('.tabular.menu .item').tab();
$(document).on('click', '[data-toggle]', function(event) { $(document).on('click', '[data-toggle]', function(event) {
var $el = event.target; var $el = event.target;
var $target = $($el.getAttribute('data-toggle')); var $target = $($el.getAttribute('data-toggle'));

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

View File

@ -46,4 +46,8 @@
z-index: 30; z-index: 30;
} }
.menu.fixzindex { z-index: 61 !important; } .menu.fixzindex { z-index: 61 !important; }
.ui.tabular.menu .item {
cursor: pointer;
}

View File

@ -34,9 +34,9 @@ AMIIBO FIGURE
<div class="ui stackable grid"> <div class="ui stackable grid">
<div class="eight wide column ui middle aligned"> <div class="eight wide column ui middle aligned">
{% block amiibo_header %} {% block amiibo_header %}
<h2 class="ui header"> <h2 class="ui header">
{{ amiibo.collection.name }}: {{ amiibo.name }} {{ amiibo.collection.name }}: {{ amiibo.name }}
</h2> </h2>
{% endblock %} {% endblock %}
</div> </div>
<div class="eight wide column right aligned"> <div class="eight wide column right aligned">
@ -56,10 +56,11 @@ AMIIBO FIGURE
</div> </div>
<div class="twelve wide column"> <div class="twelve wide column">
<div class="ui top attached tabular menu"> <div class="ui top attached tabular menu">
<div class="active item">{% trans "Shops" %}</div> <div class="active item" data-tab="shops">{% trans "Shops" %}</div>
<div class="item" data-tab="users-trading">{% trans "Users trading" %}</div>
</div> </div>
<div class="ui bottom attached active tab segment"> <!-- Shops --!>
<!-- Shops --!> <div class="ui bottom attached active tab segment" data-tab="shops">
{% if amiibo.shops_set.exists %} {% if amiibo.shops_set.exists %}
<div class="ui divided items"> <div class="ui divided items">
{% for shop_item in amiibo.shops_set.all %} {% for shop_item in amiibo.shops_set.all %}
@ -107,6 +108,27 @@ AMIIBO FIGURE
{% trans "No shops :(" %} {% trans "No shops :(" %}
{% endif %} {% endif %}
</div> </div>
<!-- Shops --!>
<div class="ui bottom attached tab segment" data-tab="users-trading">
<div class="ui five doubling cards">
{% for relation in users_trading %}
<div class="ui link card">
<a href="{{ amiibo.get_absolute_url }}">
<div class="image">
<div class="ui fluid image">
<img src="{% static 'images/avatar-male.png' %}">
</div>
</div>
</a>
<div class="content text-center">
<a class="bold" href="{% url 'profile:main' relation.user.username %}">{{ relation.user.username }}</a>
</div>
</div>
{% empty %}
{% trans "No user have this amiibo available for trade :(" %}
{% endfor %}
</div>
</div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}