Pulling out snipt/list.html and working on edit.

master
Nick Sergeant 2012-02-16 12:01:31 -05:00
parent 2242d0fc52
commit 923d1676d5
7 changed files with 46 additions and 73 deletions

View File

@ -769,7 +769,7 @@ article.snipt {
article.private-snipt {
div.container {
header {
@include vertical-gradient-with-image(#FFF, #FFFAF2, url('/media/images/private-icon.png') top right no-repeat);
@include vertical-gradient-with-image(url('/media/images/private-icon.png') top right no-repeat, #FFF, #FFFAF2);
h1 {
a {

View File

@ -86,10 +86,10 @@
},
edit: function() {
if (!$('section.main-edit:visible').length) {
this.select();
var editPane = this.editTemplate(this.model.toJSON());
$main = $('section.main');
$main.hide();
$main.after(editPane);
$('section#main').hide();
$('section#main-edit').html(editPane).show();
}
return false;
},
@ -208,9 +208,9 @@
}
});
$document.bind('keydown', 'esc', function() {
if ($('section.main-edit:visible').length) {
$('section.main-edit').remove();
$('section.main').show();
if ($('section#main-edit:visible').length) {
$('section#main-edit').hide();
$('section#main').show();
$('html, body').animate({
scrollTop: $selected.offset().top - 50
}, 0);

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block page-title %}/ {{ user.username }} / {{ snipt.title }} - {{ block.super }}{% endblock %}
{% block page-title %}/ {{ snipt.title }} / {{ user.username }} - {{ block.super }}{% endblock %}
{% block body-class %}detail{% endblock %}
{% block breadcrumb %}

View File

@ -1,8 +1,4 @@
{% extends "base.html" %}
{% load pagination_tags %}
{% block page-title %}/ public{% if tag %} / {{ tag }}{% endif %} - {{ block.super }}{% endblock %}
{% extends "snipts/list.html" %}
{% block breadcrumb %}
<li><a href="/public/">public</a></li>
@ -14,28 +10,3 @@
{% block tags %}
{% include "snipts/tags-public.html" %}
{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% with public='true' %}
{% autopaginate snipts 20 %}
{% for snipt in snipts %}
{% include "snipts/snipt-list.html" %}
{% endfor %}
{% paginate %}
{% endwith %}
</section>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endblock %}

View File

@ -1,8 +1,4 @@
{% extends "base.html" %}
{% load pagination_tags %}
{% block page-title %}/ {{ user.username }}{% if tag %} / {{ tag }}{% endif %} - {{ block.super }}{% endblock %}
{% extends "snipts/list.html" %}
{% block breadcrumb %}
<li><a href="/{{ user.username }}/">{{ user.username }}</a></li>
@ -14,26 +10,3 @@
{% block tags %}
{% include "snipts/tags-user.html" %}
{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% autopaginate snipts 20 %}
{% for snipt in snipts %}
{% include "snipts/snipt-list.html" %}
{% endfor %}
{% paginate %}
</section>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endblock %}

View File

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% load pagination_tags %}
{% block page-title %}/ {% if public %}public{% else %}{{ user.username }}{% endif %}{% if tag %} / {{ tag }}{% endif %} - {{ block.super }}{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% autopaginate snipts 20 %}
{% for snipt in snipts %}
{% include "snipts/snipt-list.html" %}
{% endfor %}
{% paginate %}
</section>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endblock %}

View File

@ -96,7 +96,7 @@
</div>
</header>
{% endblock %}
<section class="main group">
<section class="main group" id="main">
<div class="inner">
{% block content %}{% endblock %}
</div>
@ -132,6 +132,9 @@
<div class="left-y ruler"></div>
<div class="right-y ruler"></div>
</section>
{% if snipts or snipt %}
<section class="main group hidden" id="main-edit"></section>
{% endif %}
<div class="modal hide" id="keyboard-shortcuts">
<div class="modal-header">
<a href="#" class="close">×</a>
@ -245,12 +248,10 @@
</div>
</div>
<div id="edit">
<section class="main main-edit">
<div class="inner">
{{url}}<br />
{{title}}
</div>
</section>
<div class="inner">
{{url}}<br />
{{title}}
</div>
</div>
</div>
{% endverbatim %}