Commit 3f351d2b authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

tables templates

parent cd546a7e
......@@ -125,3 +125,5 @@ STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
SITE_ID = 1
DJANGO_TABLES2_TEMPLATE = 'rainboard/tables.html'
......@@ -5,6 +5,5 @@ from .models import Project
class ProjectTable(tables.Table):
class Meta:
model = Project
template = 'django_tables2/bootstrap.html'
fields = ('main_namespace', 'name', 'license', 'homepage')
attrs = {'class': 'table table-striped'}
{% extends 'django_tables2/bootstrap.html' %}
{% load bootstrap3 %}
{% block pagination %}
{% bootstrap_pagination table.page %}
{% endblock %}
from django.shortcuts import render
from django_tables2 import RequestConfig
from .models import Forge, Namespace, Project
from .tables import ProjectTable
def home(request):
projects = ProjectTable(Project.objects.all())
RequestConfig(request).configure(projects)
return render(request, 'rainboard/home.html', {
'forges': Forge.objects.all(),
'namespaces': Namespace.objects.all(),
'projects': ProjectTable(Project.objects.all()),
'projects': projects,
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment