From 5773f84e9fce3f1cf78e6ee93f0bb018948487ad Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Mon, 16 Jan 2012 21:17:58 -0500 Subject: [PATCH] Tons of stuff --- snipt/media/css/style.less | 72 +++++++++++++++++++ snipt/media/js/src/modules/snipt.js | 9 +-- snipt/snipts/templates/snipts/detail.html | 19 ++++- .../snipts/templates/snipts/snipt-detail.html | 0 snipt/snipts/templates/snipts/snipt-list.html | 10 +-- 5 files changed, 100 insertions(+), 10 deletions(-) delete mode 100644 snipt/snipts/templates/snipts/snipt-detail.html diff --git a/snipt/media/css/style.less b/snipt/media/css/style.less index 72e6d0a..890b2ea 100644 --- a/snipt/media/css/style.less +++ b/snipt/media/css/style.less @@ -681,6 +681,12 @@ article.private-snipt { div.container { header { .vertical-gradient-with-image(#FFF, #FFFAF2, url('/media/images/private-icon.png') top right no-repeat); + + h1 { + a { + padding-right: 25px; + } + } } } } @@ -714,6 +720,72 @@ div.pagination { } } +// Pages +body.detail { + div.right-y { + display: none; + } + section.main { + div.inner { + width: 100%; + + section.snipts { + div#disqus_thread { + margin-bottom: 0; + margin-left: 15px; + width: 825px; + + #dsq-content { + margin-top: -38px; + + #dsq-global-toolbar { + margin-bottom: 18px; + margin-top: 0; + } + #dsq-sort-by { + display: none; + } + .dsq-comment-text { + color: #666; + } + h3 { + display: none; + } + } + #dsq-footer { + display: none; + } + } + article.snipt { + margin-bottom: 0; + + div.container { + width: 839px; + + header { + h1 { + a { + white-space: normal; + } + } + } + section.code { + height: auto; + } + &:after { + bottom: 11px; + height: 23px; + } + } + aside { + margin-right: 0; + } + } + } + } + } +} + // Utils .group:after { content: "."; diff --git a/snipt/media/js/src/modules/snipt.js b/snipt/media/js/src/modules/snipt.js index d8d2b14..03702aa 100644 --- a/snipt/media/js/src/modules/snipt.js +++ b/snipt/media/js/src/modules/snipt.js @@ -24,7 +24,7 @@ events: { 'click a.copy': 'copy', 'click a.expand': 'expand', - 'click .container': 'clickSelect', + 'click .container': 'selectFromClick', 'copy': 'copy', 'detail': 'detail', 'deselect': 'deselect', @@ -34,9 +34,6 @@ 'select': 'select' }, - clickSelect: function() { - this.select(true); - }, copy: function() { var cmd; if (navigator.platform == 'MacPPC' || @@ -59,6 +56,7 @@ expand: function() { this.$container.toggleClass('expanded', 100); this.$tags.toggleClass('expanded'); + this.select(); return false; }, next: function() { @@ -89,6 +87,9 @@ } window.$selected = this.$el; + }, + selectFromClick: function() { + this.select(true); } }); SniptListView = Backbone.View.extend({ diff --git a/snipt/snipts/templates/snipts/detail.html b/snipt/snipts/templates/snipts/detail.html index bd04b6c..7f8781d 100644 --- a/snipt/snipts/templates/snipts/detail.html +++ b/snipt/snipts/templates/snipts/detail.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block page-title %}/ {{ user.username }} / {{ snipt.title }} - {{ block.super }}{% endblock %} +{% block body-class %}detail{% endblock %} {% block breadcrumb %}
  • {{ user.username }}
  • @@ -11,7 +12,21 @@ {% block content %}
    - {% include "snipts/snipt-detail.html" %} + {% with 'true' as detail %} + {% include "snipts/snipt-list.html" %} + {% endwith %} +
    +
    {% endblock %} - diff --git a/snipt/snipts/templates/snipts/snipt-detail.html b/snipt/snipts/templates/snipts/snipt-detail.html deleted file mode 100644 index e69de29..0000000 diff --git a/snipt/snipts/templates/snipts/snipt-list.html b/snipt/snipts/templates/snipts/snipt-list.html index 9d74086..724f14b 100644 --- a/snipt/snipts/templates/snipts/snipt-list.html +++ b/snipt/snipts/templates/snipts/snipt-list.html @@ -1,16 +1,16 @@ {% load humanize %} -
    +
    #{{ snipt.id }}
    + +{% block comments %}{% endblock %}