Adding the core applications code to the repository

This commit is contained in:
artus
2016-08-05 10:41:43 +02:00
parent 243ff9153e
commit 5f4faf46ec
155 changed files with 13176 additions and 0 deletions

0
suivi/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
suivi/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
suivi/apps.py Normal file
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class SuiviConfig(AppConfig):
name = 'suivi'

3
suivi/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View 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>

View 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 %}

View 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
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

9
suivi/urls.py Normal file
View 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
View 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