Adding the core applications code to the repository
This commit is contained in:
0
suivi/__init__.py
Normal file
0
suivi/__init__.py
Normal file
BIN
suivi/__pycache__/__init__.cpython-35.pyc
Normal file
BIN
suivi/__pycache__/__init__.cpython-35.pyc
Normal file
Binary file not shown.
BIN
suivi/__pycache__/admin.cpython-35.pyc
Normal file
BIN
suivi/__pycache__/admin.cpython-35.pyc
Normal file
Binary file not shown.
BIN
suivi/__pycache__/models.cpython-35.pyc
Normal file
BIN
suivi/__pycache__/models.cpython-35.pyc
Normal file
Binary file not shown.
BIN
suivi/__pycache__/urls.cpython-35.pyc
Normal file
BIN
suivi/__pycache__/urls.cpython-35.pyc
Normal file
Binary file not shown.
BIN
suivi/__pycache__/views.cpython-35.pyc
Normal file
BIN
suivi/__pycache__/views.cpython-35.pyc
Normal file
Binary file not shown.
3
suivi/admin.py
Normal file
3
suivi/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
suivi/apps.py
Normal file
5
suivi/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SuiviConfig(AppConfig):
|
||||
name = 'suivi'
|
||||
3
suivi/models.py
Normal file
3
suivi/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
9
suivi/templates/suivis/details.html
Normal file
9
suivi/templates/suivis/details.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<ul class="nav nav-pills nav-justified" role="tablist" style="padding-bottom:20px;float:bottom;">
|
||||
<li role="presentation" class="active"><a href="#suivi" aria-controls="suivi" role="tab" data-toggle="tab">Suivi</a></li>
|
||||
<li role="presentation"><a href="#fiche" aria-controls="fiche" role="tab" data-toggle="tab">Fiche</a></li>
|
||||
</ul>
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="suivi">{% include "suivis/sujet_suivi.html" %}</div>
|
||||
<div role="tabpanel" class="tab-pane" id="fiche">{% include "sujets/sujet_details_inner.html" %}</div>
|
||||
</div>
|
||||
19
suivi/templates/suivis/index.html
Normal file
19
suivi/templates/suivis/index.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Sujets</div>
|
||||
<div class="list-group">
|
||||
<a href="{% url 'sujets:liste' %}" class="list-group-item">Liste complète</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if user.is_superuser %}
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">Administration</div>
|
||||
<div class="list-group">
|
||||
<a href="{% url 'sujets:create' %}" class="list-group-item">Nouveau sujet</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
14
suivi/templates/suivis/sujet_suivi.html
Normal file
14
suivi/templates/suivis/sujet_suivi.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="col-md-6">
|
||||
<table class="table table-striped table-bordered">
|
||||
{% for note in notes %}
|
||||
<tr><th>{{note.date}}
|
||||
<div class="pull-right">
|
||||
<span class="label label-primary">{{ note.header_label }}</span>
|
||||
{% for info in note.header_infos %}<span class="label label-info">{{ info }}</span>
|
||||
{%endfor%}
|
||||
</div>
|
||||
</th></tr>
|
||||
<tr><td>{{note.note}}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
3
suivi/tests.py
Normal file
3
suivi/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
9
suivi/urls.py
Normal file
9
suivi/urls.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
from sujets import views as sujets_views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.IndexView.as_view(), name="index"),
|
||||
url(r'(?P<pk>[0-9]+)/$', views.SuiviSujetView.as_view(), name="details"),
|
||||
]
|
||||
32
suivi/views.py
Normal file
32
suivi/views.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
from django.views import generic
|
||||
from website import views
|
||||
|
||||
from sujets.models import Sujet
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
||||
|
||||
class SuivisView(views.WebsiteProtectedMixin):
|
||||
title = "Suivi des bénéficiaires"
|
||||
header = "Suivi"
|
||||
|
||||
permissions = ['sujets.view_sujets']
|
||||
|
||||
|
||||
class IndexView(SuivisView, generic.TemplateView):
|
||||
template_name = "suivis/index.html"
|
||||
header_small = "Tableau de bord"
|
||||
|
||||
|
||||
class SuiviSujetView(SuivisView, generic.DetailView):
|
||||
model = Sujet
|
||||
template_name = "suivis/details.html"
|
||||
context_object_name = "sujet"
|
||||
|
||||
def get_context_date(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['notes'] = self.object.notes.all()
|
||||
return context
|
||||
Reference in New Issue
Block a user