mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Addition of the stock parameter to the counter admin list
This commit is contained in:
parent
33c7e7db9f
commit
29fb0af893
@ -33,7 +33,12 @@
|
|||||||
<a href="{{ url('counter:stats', counter_id=c.id) }}">{% trans %}Stats{% endtrans %}</a> -
|
<a href="{{ url('counter:stats', counter_id=c.id) }}">{% trans %}Stats{% endtrans %}</a> -
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user.is_owner(c) %}
|
{% if user.is_owner(c) %}
|
||||||
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a>
|
<a href="{{ url('counter:prop_admin', counter_id=c.id) }}">{% trans %}Props{% endtrans %}</a> -
|
||||||
|
{%if c.stock %}
|
||||||
|
<a href="{{ url('stock:main', stock_id=c.stock.id) }}">{{c.stock}}</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ url('stock:new', counter_id=c.id) }}">{% trans %}Create new stock{% endtrans%}</a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -34,6 +34,7 @@ urlpatterns = [
|
|||||||
url(r'^com/', include('com.urls', namespace="com", app_name="com")),
|
url(r'^com/', include('com.urls', namespace="com", app_name="com")),
|
||||||
url(r'^club/', include('club.urls', namespace="club", app_name="club")),
|
url(r'^club/', include('club.urls', namespace="club", app_name="club")),
|
||||||
url(r'^counter/', include('counter.urls', namespace="counter", app_name="counter")),
|
url(r'^counter/', include('counter.urls', namespace="counter", app_name="counter")),
|
||||||
|
url(r'^stock/', include('stock.urls', namespace="stock", app_name="stock")),
|
||||||
url(r'^accounting/', include('accounting.urls', namespace="accounting", app_name="accounting")),
|
url(r'^accounting/', include('accounting.urls', namespace="accounting", app_name="accounting")),
|
||||||
url(r'^eboutic/', include('eboutic.urls', namespace="eboutic", app_name="eboutic")),
|
url(r'^eboutic/', include('eboutic.urls', namespace="eboutic", app_name="eboutic")),
|
||||||
url(r'^launderette/', include('launderette.urls', namespace="launderette", app_name="launderette")),
|
url(r'^launderette/', include('launderette.urls', namespace="launderette", app_name="launderette")),
|
||||||
|
@ -1 +1,11 @@
|
|||||||
TOTO
|
{% extends "core/base.jinja" %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{{stock}}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h3>{{stock}}</h3>
|
||||||
|
<a href="{{ url('stock:new_item', stock_id=stock.id) }}">{{stock.name}}</a>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ from django.conf.urls import include, url
|
|||||||
from stock.views import *
|
from stock.views import *
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^(?P<counter_id>[0-9]+)$', StockListView.as_view(), name='stock_list'),
|
url(r'^(?P<stock_id>[0-9]+)$', StockMain.as_view(), name='main'),
|
||||||
url(r'^(?P<counter_id>[0-9]+)/new$', StockCreateView.as_view(), name='stock_new'),
|
url(r'^new/counter/(?P<counter_id>[0-9]+)$', StockCreateView.as_view(), name='new'),
|
||||||
|
url(r'^(?P<stock_id>[0-9]+)/newItem$', StockItemCreateView.as_view(), name='new_item'),
|
||||||
]
|
]
|
||||||
|
@ -1,3 +1,24 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from django.views.generic import ListView, DetailView, RedirectView, TemplateView
|
||||||
|
from django.views.generic.edit import UpdateView, CreateView, DeleteView, ProcessFormView, FormMixin
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
|
from stock.models import Stock
|
||||||
|
|
||||||
|
class StockMain(DetailView):
|
||||||
|
"""
|
||||||
|
The stock view for the counter owner
|
||||||
|
"""
|
||||||
|
model = Stock
|
||||||
|
template_name = 'stock/stock_main.jinja'
|
||||||
|
pk_url_kwarg = "stock_id"
|
||||||
|
|
||||||
|
class StockCreateView(CreateView):
|
||||||
|
"""
|
||||||
|
docstring for StockCreateView
|
||||||
|
"""
|
||||||
|
|
||||||
|
class StockItemCreateView(CreateView):
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
Loading…
Reference in New Issue
Block a user