From 8909efb0aac87223f78b61f494b1674a7e4ba28c Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sun, 29 Nov 2009 10:16:10 +0100 Subject: [PATCH] Implement Unflag feature on the Package Details page It was needed, because until this time only the Flag out-of-date option was available there, and it could be solved without any plus line adding in the Package Details page. The implementation touched the following items: * Implement unflag_out_of_date function in the aur/views.py * Add the desired link for this operation in the aur/urls.py * Modify the string for the relevant link in the package_detail.html template Signed-off-by: Laszlo Papp Signed-off-by: Sebastian Nowicki --- archlinux/aur/urls.py | 2 ++ archlinux/aur/views.py | 6 ++++++ archlinux/templates/aur/package_detail.html | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/archlinux/aur/urls.py b/archlinux/aur/urls.py index 4b3a4b4..2e03c37 100644 --- a/archlinux/aur/urls.py +++ b/archlinux/aur/urls.py @@ -14,6 +14,8 @@ urlpatterns = patterns('aur.views', name='aur-comment_on_package'), url(r'^package/(?P[\w_-]+)/flag_out_of_date/$', 'flag_out_of_date', name='aur-flag_out_of_date'), + url(r'^package/(?P[\w_-]+)/unflag_out_of_date/$', + 'unflag_out_of_date', name='aur-unflag_out_of_date'), url(r'^package/(?P[\w_-]+)/notify_of_updates/$', 'notify_of_updates', name='aur-notify_of_updates'), url(r'^package/(?P[\w_-]+)/denotify_of_updates/$', diff --git a/archlinux/aur/views.py b/archlinux/aur/views.py index e6ec7b7..ea7b577 100644 --- a/archlinux/aur/views.py +++ b/archlinux/aur/views.py @@ -141,6 +141,12 @@ def flag_out_of_date(request, object_id): package.save() return HttpResponseRedirect(package.get_absolute_url()) +def unflag_out_of_date(request, object_id): + package = get_object_or_404(Package, name=object_id) + package.outdated = False + package.save() + return HttpResponseRedirect(package.get_absolute_url()) + @login_required def notify_of_updates(request, object_id): """Subscribe a user to package updates""" diff --git a/archlinux/templates/aur/package_detail.html b/archlinux/templates/aur/package_detail.html index b58f49b..65c6bc4 100644 --- a/archlinux/templates/aur/package_detail.html +++ b/archlinux/templates/aur/package_detail.html @@ -16,7 +16,7 @@ {% endif %}
  • {% if pkg.outdated %} - {% trans "This package has been flagged out-of-date" %} + {% trans "Unflag Package Out-of-Date" %} {% else %} {% trans "Flag Package Out-of-Date" %} (?) {% endif %} -- 2.11.4.GIT