Add index page
This commit is contained in:
parent
f035c91c26
commit
75daafb7bf
15
html/index.html
Normal file
15
html/index.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h2>{% trans "Projects" %}</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for prj in projects %}
|
||||||
|
<li><a href="{{ prj.get_absolute_url }}">{{ prj.name }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -190,3 +190,6 @@ LOGGING = {
|
||||||
|
|
||||||
# Path where git repositories are stored, it needs to be writable
|
# Path where git repositories are stored, it needs to be writable
|
||||||
GIT_ROOT = '%s/repos/' % WEB_ROOT
|
GIT_ROOT = '%s/repos/' % WEB_ROOT
|
||||||
|
|
||||||
|
# Title of site to use
|
||||||
|
SITE_TITLE = 'Weblate'
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
from django.shortcuts import render_to_response, get_object_or_404
|
from django.shortcuts import render_to_response, get_object_or_404
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from trans.models import Project, SubProject, Translation, Unit
|
from trans.models import Project, SubProject, Translation, Unit
|
||||||
|
|
||||||
|
def home(request):
|
||||||
|
projects = Project.objects.all()
|
||||||
|
|
||||||
|
return render_to_response('index.html', RequestContext(request, {
|
||||||
|
'projects': projects,
|
||||||
|
'title': settings.SITE_TITLE,
|
||||||
|
}))
|
||||||
|
|
||||||
def show_project(request, project):
|
def show_project(request, project):
|
||||||
obj = get_object_or_404(Project, slug = project)
|
obj = get_object_or_404(Project, slug = project)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user