Fix some bugs.
parent
a0ae95da64
commit
6071307c6a
|
@ -76,7 +76,7 @@
|
|||
return false;
|
||||
});
|
||||
|
||||
$('div.modal a.close').click(function() {
|
||||
$('section.main').on('click', 'a.close', function() {
|
||||
$(this).parent().parent().modal('hide');
|
||||
window.ui_halted = false;
|
||||
return false;
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
window.$selected = false;
|
||||
},
|
||||
detail: function() {
|
||||
window.location = this.model.get('get_absolute_url');
|
||||
window.location = this.model.get('absolute_url');
|
||||
},
|
||||
edit: function() {
|
||||
|
||||
|
@ -336,7 +336,7 @@
|
|||
created: $created.attr('title'),
|
||||
created_formatted: $created.text(),
|
||||
embed_url: $('div.embed-url', $el).text(),
|
||||
get_absolute_url: $h1.attr('href'),
|
||||
absolute_url: $h1.attr('href'),
|
||||
id: parseInt($el.attr('id').replace('snipt-', ''), 0),
|
||||
key: $('div.key', $el).text(),
|
||||
lexer: $('div.lexer', $el).text(),
|
||||
|
@ -350,7 +350,7 @@
|
|||
tags_list: $('div.tags-list', $el).text(),
|
||||
title: $h1.text(),
|
||||
user: {
|
||||
get_absolute_url: $user.attr('href'),
|
||||
absolute_url: $user.attr('href'),
|
||||
username: $user.text()
|
||||
}
|
||||
};
|
||||
|
@ -376,6 +376,7 @@
|
|||
title: '',
|
||||
lexer: 'text',
|
||||
lexer_name: 'Text only',
|
||||
new_from_js: true,
|
||||
user: {
|
||||
username: ''
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class PublicSniptResource(ModelResource):
|
|||
class Meta:
|
||||
queryset = Snipt.objects.filter(public=True).order_by('-created')
|
||||
resource_name = 'snipt'
|
||||
fields = ['title', 'slug', 'lexer', 'code', 'line_count',
|
||||
fields = ['id', 'title', 'slug', 'lexer', 'code', 'line_count',
|
||||
'stylized', 'created', 'modified',]
|
||||
include_absolute_url = True
|
||||
allowed_methods = ['get']
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="container">
|
||||
<header>
|
||||
<h2><%= snipt.lexer_name %></h2>
|
||||
<h1><a href="<%= snipt.get_absolute_url %>"><%= snipt.title %></a></h1>
|
||||
<h1><a href="<%= snipt.absolute_url %>"><%= snipt.title %></a></h1>
|
||||
</header>
|
||||
<section class="code autumn">
|
||||
<%= snipt.stylized %>
|
||||
|
@ -51,9 +51,11 @@
|
|||
</div>
|
||||
<footer>
|
||||
<ul class="attrs">
|
||||
<li class="author"><a href="<%= snipt.user.get_absolute_url %>"><%= snipt.user.username %></a></li>
|
||||
<li class="created" title="<%= snipt.created %>"><%= snipt.created_formatted %></li>
|
||||
<li class="comments"><a href="<%= snipt.get_absolute_url %>#disqus_thread" data-disqus-identifier="<%= snipt.id %>"></a></li>
|
||||
<li class="author"><a href="<%= snipt.user.absolute_url %>"><%= snipt.user.username %></a></li>
|
||||
<% if (!snipt.new_from_js) { %>
|
||||
<li class="created" title="<%= snipt.created %>"><%= snipt.created_formatted %></li>
|
||||
<% } %>
|
||||
<li class="comments"><a href="<%= snipt.absolute_url %>#disqus_thread" data-disqus-identifier="<%= snipt.id %>"></a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
<div class="modal hide copy-modal">
|
||||
|
|
Loading…
Reference in New Issue