From c3a75305cbbb099afc5127c000aa7a242c229338 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Thu, 13 Dec 2012 14:32:03 +0100 Subject: [PATCH 1/3] Avoid empty tags to be created --- models.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/models.py b/models.py index 4e6cdd0..cbbf394 100644 --- a/models.py +++ b/models.py @@ -262,6 +262,7 @@ class Post(models.Model): my_tags = [] # Create new tags for tag in tags.split(','): + if tag == '': continue tag_slug = slugify(tag) found = False for t in tags_list: @@ -277,6 +278,7 @@ class Post(models.Model): # Add new tags post_tags_list = Tag.objects.filter(post=self.id) for tag in tags.split(','): + if tag == '': continue tag_slug = slugify(tag) found = False for t in post_tags_list: @@ -291,16 +293,20 @@ class Post(models.Model): break # Remove old tags - for t in post_tags_list: - found = False - for tag in tags.split(','): - tag_slug = slugify(tag) - if t.name_slug == tag_slug: - found = True - break - if not found: - # print 'Remove ' + t.name_slug + if tags == '': + for t in post_tags_list: self.tags.remove(t) + else: + for t in post_tags_list: + found = False + for tag in tags.split(','): + tag_slug = slugify(tag) + if t.name_slug == tag_slug: + found = True + break + if not found: + # print 'Remove ' + t.name_slug + self.tags.remove(t) self.save() From 2f70a4bec5a7b490dd461d8d0ebc8f5b8fc2de74 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Thu, 13 Dec 2012 14:32:27 +0100 Subject: [PATCH 2/3] Limit search text width --- sites/blog.soutade.fr/_base.html | 2 +- sites/blog.soutade.fr/css/blog.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sites/blog.soutade.fr/_base.html b/sites/blog.soutade.fr/_base.html index 2a35b3c..0b7330a 100755 --- a/sites/blog.soutade.fr/_base.html +++ b/sites/blog.soutade.fr/_base.html @@ -28,7 +28,7 @@ diff --git a/sites/blog.soutade.fr/css/blog.css b/sites/blog.soutade.fr/css/blog.css index c301cd1..9347c04 100755 --- a/sites/blog.soutade.fr/css/blog.css +++ b/sites/blog.soutade.fr/css/blog.css @@ -449,3 +449,8 @@ ul li padding:0; margin:0; } + +#search_text +{ + width:100%; +} \ No newline at end of file From 5077ab0a3037e2f6022177ddc86f7608de22f2d6 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Thu, 13 Dec 2012 14:32:54 +0100 Subject: [PATCH 3/3] Add _search.html --- sites/blog.soutade.fr/_search.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 sites/blog.soutade.fr/_search.html diff --git a/sites/blog.soutade.fr/_search.html b/sites/blog.soutade.fr/_search.html new file mode 100755 index 0000000..e770671 --- /dev/null +++ b/sites/blog.soutade.fr/_search.html @@ -0,0 +1,12 @@ + + +
+ +
+ |
Écrit par
+
+ +
+ +
+