Merge branch 'master' of soutade.fr:dynastie

This commit is contained in:
Grégory Soutadé 2012-12-22 09:39:42 +01:00
commit 652b279850
4 changed files with 33 additions and 10 deletions

View File

@ -262,6 +262,7 @@ class Post(models.Model):
my_tags = [] my_tags = []
# Create new tags # Create new tags
for tag in tags.split(','): for tag in tags.split(','):
if tag == '': continue
tag_slug = slugify(tag) tag_slug = slugify(tag)
found = False found = False
for t in tags_list: for t in tags_list:
@ -277,6 +278,7 @@ class Post(models.Model):
# Add new tags # Add new tags
post_tags_list = Tag.objects.filter(post=self.id) post_tags_list = Tag.objects.filter(post=self.id)
for tag in tags.split(','): for tag in tags.split(','):
if tag == '': continue
tag_slug = slugify(tag) tag_slug = slugify(tag)
found = False found = False
for t in post_tags_list: for t in post_tags_list:
@ -291,6 +293,10 @@ class Post(models.Model):
break break
# Remove old tags # Remove old tags
if tags == '':
for t in post_tags_list:
self.tags.remove(t)
else:
for t in post_tags_list: for t in post_tags_list:
found = False found = False
for tag in tags.split(','): for tag in tags.split(','):

View File

@ -28,7 +28,7 @@
<div class="menu_content_header">Recherche</div> <div class="menu_content_header">Recherche</div>
<div id="menu_main"> <div id="menu_main">
<dyn:replace div_name="form" id="search_form" method="POST" action="/search/dyn:blog_id"> <dyn:replace div_name="form" id="search_form" method="POST" action="/search/dyn:blog_id">
<input type="text" name="text" onkeypress="handleKeyPress(event,this.form)"/> <input type="text" name="text" id="search_text" onkeypress="handleKeyPress(event,this.form)"/>
</dyn:replace> </dyn:replace>
</div> </div>
</div> </div>

View File

@ -0,0 +1,12 @@
<dyn:base file="_base.html" block="content" xmlns:dyn="http://indefero.soutade.fr/p/dynastie">
<dyn:posts limit="25">
<div class="post_header">
<dyn:title/>
<div class="post_sub_header">
<dyn:date/> | <div class="author_icon"> Écrit par <dyn:author/> </div>
</div>
<dyn:tags link="1"/>
</div>
<dyn:post_content/>
</dyn:posts>
</dyn:base>

View File

@ -449,3 +449,8 @@ ul li
padding:0; padding:0;
margin:0; margin:0;
} }
#search_text
{
width:100%;
}