From b4999b495e828ff68a5c93f65a39efad5b37dcea Mon Sep 17 00:00:00 2001 From: Ismael Carnales Date: Fri, 30 Oct 2009 18:32:25 -0200 Subject: changed landing view - moved devel.views.siteindex to public.views.index - using template from public view with added devel menu - added extra styles and images --- devel/views.py | 9 ------- media/arch.css | 13 ++++++++- media/rss.png | Bin 0 -> 725 bytes media/sevenl_button.png | Bin 0 -> 9028 bytes media/vnet_button.png | Bin 0 -> 5923 bytes public/views.py | 18 +++++++------ templates/devel/siteindex.html | 60 ----------------------------------------- templates/public/index.html | 12 +++++++++ urls.py | 1 - 9 files changed, 34 insertions(+), 79 deletions(-) create mode 100644 media/rss.png create mode 100644 media/sevenl_button.png create mode 100644 media/vnet_button.png delete mode 100644 templates/devel/siteindex.html diff --git a/devel/views.py b/devel/views.py index 0a4074e0..9ba4f2cb 100644 --- a/devel/views.py +++ b/devel/views.py @@ -65,15 +65,6 @@ def change_profile(request): return render_to_response('devel/profile.html', RequestContext(request, {'form': form})) -def siteindex(request): - news = News.objects.order_by('-postdate', '-id')[:10] - pkgs = Package.objects.exclude(repo__name__iexact='testing').order_by( - '-last_update')[:15] - repos = Repo.objects.all() - return render_to_response('devel/siteindex.html', - RequestContext(request, - {'news_updates': news, 'pkg_updates': pkgs, 'repos': repos})) - def mirrorlist(request): mirrors = Mirror.objects.all() return render_to_response('devel/mirrorlist.html', diff --git a/media/arch.css b/media/arch.css index 04810ce1..92c2b938 100644 --- a/media/arch.css +++ b/media/arch.css @@ -66,6 +66,17 @@ body { border: 1px solid #eee4cb; padding: 10px; } +#updates { + font-size: small; + /*position: relative;*/ + top: 0px; + background: #f6efe0; + border: 1px solid #eee4cb; + padding: 10px; +} +#updates a.testing, #updates a.community-testing { + font-style: italic; +} #ads { z-index: 0; position: absolute; @@ -143,7 +154,7 @@ div.listing { #search { float: right; position: relative; - top: -1em; + top: -2em; font-size: 0.8em; } #search input { diff --git a/media/rss.png b/media/rss.png new file mode 100644 index 00000000..c9164592 Binary files /dev/null and b/media/rss.png differ diff --git a/media/sevenl_button.png b/media/sevenl_button.png new file mode 100644 index 00000000..131b4dc8 Binary files /dev/null and b/media/sevenl_button.png differ diff --git a/media/vnet_button.png b/media/vnet_button.png new file mode 100644 index 00000000..1104315f Binary files /dev/null and b/media/vnet_button.png differ diff --git a/public/views.py b/public/views.py index 1f8e6880..4a4e01e7 100644 --- a/public/views.py +++ b/public/views.py @@ -3,17 +3,19 @@ from archweb.main.models import Package, Repo, ExternalProject from django.db.models import Q from django.shortcuts import render_to_response +from django.template import RequestContext from django.views.generic import list_detail + def index(request): - # get the most recent 10 news items - news = News.objects.order_by('-postdate', '-id')[:10] - pkgs = Package.objects.order_by('-last_update')[:15] - repos = Repo.objects.order_by('name') - arches = Arch.objects.exclude(name__iexact='any').order_by('name') - return render_to_response('public/index.html', - {'news_updates':news,'pkg_updates':pkgs, - 'repos':repos, 'arches': arches, 'path':request.path}) + context = { + 'news': News.objects.order_by('-postdate', '-id')[:10], + 'pkgs': Package.objects.exclude(repo__name__iexact='testing').order_by( + '-last_update')[:15], + 'repos': Repo.objects.all() + } + return render_to_response('public/index.html', RequestContext(request, + context)) def about(request): return render_to_response('public/about.html') diff --git a/templates/devel/siteindex.html b/templates/devel/siteindex.html deleted file mode 100644 index ac0df767..00000000 --- a/templates/devel/siteindex.html +++ /dev/null @@ -1,60 +0,0 @@ -{% extends "base.html" %} - -{% block content_left %} -
-

Latest News

- {% for news in news_updates %} - {{ news.postdate }} - {{ news.title }} -
- {% endfor %} -
- More News... -
-
-
-
- - - - - {% for pkg in pkg_updates %} - - - - - {% endfor %} - - - -

Recent Updates

{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}{{ pkg.arch.name }}

More Updates...
-
-
-{% endblock %} - -{% block content_right %} - -
-

Dev Links:

- -

Main Site Links:

- -{% endblock %} diff --git a/templates/public/index.html b/templates/public/index.html index e092e289..4e5612d9 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -69,6 +69,18 @@

{{ news.title }}


+ {% if user.is_authenticated %} +

Dev Links:

+ + {% endif %}

Documentation: