upload xls
This commit is contained in:
parent
7cd46f0fd5
commit
5221b2b068
9 changed files with 22 additions and 34 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,5 +7,6 @@ db.*
|
|||
*.csv
|
||||
*.xls
|
||||
*.xlsx
|
||||
*.xls
|
||||
.*
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,12 @@ class UploadDoc(models.Model):
|
|||
|
||||
def __str__(self):
|
||||
return self.titre
|
||||
|
||||
"""
|
||||
class OffreEmploi(models.Model):
|
||||
source = models.CharField(max_lenght=200, blank=False)
|
||||
descr = model.HTMLField(blank=False)
|
||||
published = models.BooleanField(default=False)
|
||||
"""
|
||||
|
||||
|
||||
class PDFResponse(HttpResponse):
|
||||
|
|
|
|||
10
cms/views.py
10
cms/views.py
|
|
@ -172,6 +172,11 @@ class DocumentListView(ListView):
|
|||
template_name = 'cms/document_list.html'
|
||||
model = Document
|
||||
|
||||
def get_queryset(self, **kwargs):
|
||||
query = Document.objects.filter(published=True)
|
||||
return query
|
||||
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(DocumentListView, self).get_context_data(**kwargs)
|
||||
context['upload'] = UploadDoc.objects.filter(published=True)
|
||||
|
|
@ -184,6 +189,10 @@ class DocumentDetailView(DetailView):
|
|||
|
||||
|
||||
class UploadDetailView(DetailView):
|
||||
"""
|
||||
Affiche les documents uploadés à la suite des doc.
|
||||
DocumentsInline
|
||||
"""
|
||||
template_name = 'cms/upload_detail.html'
|
||||
model = UploadDoc
|
||||
|
||||
|
|
@ -249,7 +258,6 @@ class ModulePDF(DetailView):
|
|||
|
||||
doc = MyDocTemplate(response)
|
||||
doc.build(response.story)
|
||||
|
||||
return response
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,5 +39,8 @@ urlpatterns = [
|
|||
url(r'^documents/$', views.DocumentListView.as_view(), name='document-list'),
|
||||
url(r'^document/(?P<pk>\d+)$', views.DocumentDetailView.as_view(), name='document-detail'),
|
||||
url(r'^upload/(?P<pk>\d+)$', views.UploadDetailView.as_view(), name='upload-detail'),
|
||||
|
||||
#url(r'^emplois/$', views.EmploiListView.as_view(), name='emploi-list'),
|
||||
url(r'^tinymce/', include('tinymce.urls'), name='tinymce-js'),
|
||||
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT )
|
||||
|
|
|
|||
BIN
media/doc/EDS_Calendrier_2017.pdf
Normal file
BIN
media/doc/EDS_Calendrier_2017.pdf
Normal file
Binary file not shown.
BIN
media/doc/EDS_Calendrier_2018.pdf
Normal file
BIN
media/doc/EDS_Calendrier_2018.pdf
Normal file
Binary file not shown.
|
|
@ -18,7 +18,7 @@
|
|||
{% endfor %}
|
||||
|
||||
{% for fic in upload %}
|
||||
<li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }} (pdf)</a></li>
|
||||
<li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
{% extends "./base_site.html" %}
|
||||
{% load i18n static %}
|
||||
|
||||
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />{% endblock %}
|
||||
|
||||
{% block coltype %}colMS{% endblock %}
|
||||
|
||||
{% block bodyclass %}{{ block.super }} dashboard{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'home' %}">Accueil</a>
|
||||
<a href="{% url 'document' %}">Document</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="content-main">
|
||||
<h1>Documents utiles</h1>
|
||||
<ul>
|
||||
<li><a href=""
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue