From 14283b2496748a8dd0ec2eae424d8e66168ef981 Mon Sep 17 00:00:00 2001 From: Will Larson Date: Mon, 7 Jul 2008 13:29:14 +0900 Subject: [PATCH] Added support for deleting languages in the article_authors.html template. This is where translations are assigned, and thus the most logical (in my mind) place for this functionality. --- editor/views.py | 2 +- templates/lifeflow/editor/article_authors.html | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/editor/views.py b/editor/views.py index 17d0627..c3890ad 100644 --- a/editor/views.py +++ b/editor/views.py @@ -204,7 +204,7 @@ def update(request): return HttpResponse("success") -API_CLASSES = {"comment":Comment, "project":Project, "flow":Flow, "tag":Tag, "series":Series, "draft":Draft, "entry":Entry, "author":Author, "resource":Resource, "recommendedsite":RecommendedSite,'site_to_notify':SiteToNotify,'site':Site} +API_CLASSES = {"comment":Comment, "project":Project, "flow":Flow, "tag":Tag, "series":Series, "draft":Draft, "entry":Entry, "author":Author, "resource":Resource, "recommendedsite":RecommendedSite,'site_to_notify':SiteToNotify,'site':Site,"language":Language} def get_class(str): return API_CLASSES[str] diff --git a/templates/lifeflow/editor/article_authors.html b/templates/lifeflow/editor/article_authors.html index f1e5564..b8899da 100644 --- a/templates/lifeflow/editor/article_authors.html +++ b/templates/lifeflow/editor/article_authors.html @@ -55,6 +55,14 @@ update_model("{{ model }}",{{ object.pk }}, data); }); }); + +var delete_language = function(pk) { + delete_model("language",pk); + var id = "#language_" + pk; + var opt = "#language_option_" + pk; + $(id).fadeOut('slow'); + $(opt).fadeOut('slow'); +}
@@ -84,7 +92,7 @@ @@ -112,6 +120,14 @@ +
  • +

    Delete unwanted languages.

    + {% for language in langs %} + Delete "{{ language }}" + {% endfor %} + +
  • +