summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-09 04:09:47 +0100
committerDan McGee <dan@archlinux.org>2013-02-09 04:09:47 +0100
commite65c7805547484cad1be55dfa20355ef18b857be (patch)
tree6945e7e76e061ecb426f320ed176186d0bc3df1b
parent8d79a1ea84756b016fb76d940e95a8885d014dae (diff)
downloadarchweb-e65c7805547484cad1be55dfa20355ef18b857be.tar.gz
archweb-e65c7805547484cad1be55dfa20355ef18b857be.tar.xz
Remove package seach by 'Last Updated After'
It is a lot easier to just sort the list rather than mess with this particular field, which didn't even allow you to specify a range or direction to search in. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--packages/views/search.py9
-rw-r--r--templates/packages/search.html14
2 files changed, 0 insertions, 23 deletions
diff --git a/packages/views/search.py b/packages/views/search.py
index 0f313cc..9cb5f38 100644
--- a/packages/views/search.py
+++ b/packages/views/search.py
@@ -3,7 +3,6 @@ import json
from pytz import utc
from django import forms
-from django.contrib.admin.widgets import AdminDateWidget
from django.contrib.auth.models import User
from django.db.models import Q
from django.http import HttpResponse
@@ -44,8 +43,6 @@ class PackageSearchForm(forms.Form):
sort = forms.CharField(required=False, widget=forms.HiddenInput())
maintainer = forms.ChoiceField(required=False)
packager = forms.ChoiceField(required=False)
- last_update = forms.DateField(required=False, widget=AdminDateWidget(),
- label='Last Updated After')
flagged = forms.ChoiceField(
choices=[('', 'All')] + make_choice(['Flagged', 'Not Flagged']),
required=False)
@@ -104,12 +101,6 @@ def parse_form(form, packages):
elif form.cleaned_data['flagged'] == 'Not Flagged':
packages = packages.filter(flag_date__isnull=True)
- if form.cleaned_data['last_update']:
- lu = form.cleaned_data['last_update']
- cutoff = datetime(lu.year, lu.month, lu.day, 0, 0)
- cutoff = cutoff.replace(tzinfo=utc)
- packages = packages.filter(last_update__gte=cutoff)
-
if form.cleaned_data['name']:
name = form.cleaned_data['name']
packages = packages.filter(pkgname=name)
diff --git a/templates/packages/search.html b/templates/packages/search.html
index ab9b6d3..a5d52d6 100644
--- a/templates/packages/search.html
+++ b/templates/packages/search.html
@@ -1,13 +1,11 @@
{% extends "base.html" %}
{% load package_extras %}
-{% load admin_static %}
{% block title %}Arch Linux - Package Database{% endblock %}
{% block navbarclass %}anb-packages{% endblock %}
{% block head %}
{% if is_paginated and page_obj.number > 1 %}<meta name="robots" content="noindex, nofollow"/>{% endif %}
-<link rel="stylesheet" type="text/css" href="{% static "admin/css/widgets.css" %}" />
<link rel="alternate" type="application/rss+xml" title="Arch Linux Package Updates" href="/feeds/packages/" />
{% endblock %}
@@ -35,9 +33,6 @@
<div>{{ search_form.maintainer.errors }}
<label for="id_maintainer" title="Limit results to a specific maintainer">
Maintainer</label>{{ search_form.maintainer}}</div>
- <div>{{ search_form.last_update.errors }}
- <label for="id_last_update" title="Limit results to a date after the date entered">
- Last Updated After</label>{{ search_form.last_update }}</div>
<div>{{ search_form.flagged.errors }}
<label for="id_flagged" title="Limit results based on out-of-date status">
Flagged</label>{{ search_form.flagged }}</div>
@@ -126,13 +121,4 @@
For unsupported packages, browse the <a href="https://aur.archlinux.org/"
title="AUR package database">Arch User Repository (AUR).</a></p>
</div>
-
-{% load cdn %}{% jquery %}
-<script type="text/javascript" src="/jsi18n/"></script>
-<script type="text/javascript">
- window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";
- var django = {"jQuery": jQuery};
-</script>
-<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
-{{search_form.media}}
{% endblock %}