Zine

open source content publishing system


Changeset 1307:160547939d6e


Ignore:
Timestamp:
01/12/10 19:34:12 (2 years ago)
Author:
mitsuhiko
Branch:
default
Message:

Fixed JS for new jQuery version and unbroke some time relevant code for
windows.

Location:
zine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • zine/services.py

    r1279 r1307  
    1313from zine.models import Comment, Tag 
    1414from zine.privileges import MODERATE_COMMENTS 
     15from zine.utils.dates import to_timestamp 
    1516 
    1617 
     
    3738        'author':       comment.author, 
    3839        'email':        email, 
    39         'pub_date':     int(comment.pub_date.strftime('%s')), 
     40        'pub_date':     to_timestamp(comment.pub_date), 
    4041    } 
    4142 
  • zine/shared/js/Zine.js

    r1303 r1307  
    2424   
    2525  replyToComment : function(parent_id) { 
    26     $('form.comments input[@name="parent"]').val(parent_id); 
     26    $('form.comments input[name="parent"]').val(parent_id); 
    2727    $('#comment-message').hide(); 
    2828    this.callJSONService('get_comment', {comment_id: parent_id}, function(c) { 
     
    4242 
    4343  replyToNothing : function() { 
    44     $('form.comments input[@name="parent"]').val(''); 
     44    $('form.comments input[name="parent"]').val(''); 
    4545    $('#comment-message').fadeOut(); 
    4646  }, 
  • zine/templates/admin/_post_helpers.html

    r1043 r1307  
    1111      <td class="title"><a href="{{ url_for('admin/edit_post', post_id=post.id) 
    1212        }}">{%- if post.title %}{{ post.title|e }}{%- else %}<em>#</em>{%- endif %}</a> 
     13        [<a href="{{ url_for(post) }}">{{ _('show') }}</a>] 
    1314      <td class="author"><a href="{{ url_for('admin/edit_user', 
    1415        user_id=post.author.id) }}">{{ post.author.display_name|e }}</a> 
  • zine/utils/dates.py

    r1279 r1307  
    99""" 
    1010import re 
     11from calendar import timegm 
    1112from datetime import datetime, timedelta 
    1213 
     
    2021    r'(?:T(\d{2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?(Z|[+-]\d{2}:\d{2})?)?$' 
    2122) 
     23 
     24 
     25def to_timestamp(value): 
     26    """Converts a datetime to an unix timestamp.""" 
     27    return timegm(value.timetuple()) 
    2228 
    2329 
Note: See TracChangeset for help on using the changeset viewer.