Tons of stuff

master
Nick Sergeant 2012-01-16 21:17:58 -05:00
parent 9f20924d3d
commit 5773f84e9f
5 changed files with 100 additions and 10 deletions

View File

@ -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: ".";

View File

@ -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({

View File

@ -1,6 +1,7 @@
{% extends "base.html" %}
{% block page-title %}/ {{ user.username }} / {{ snipt.title }} - {{ block.super }}{% endblock %}
{% block body-class %}detail{% endblock %}
{% block breadcrumb %}
<li><a href="/{{ user.username }}/">{{ user.username }}</a></li>
@ -11,7 +12,21 @@
{% block content %}
<section class="snipts" id="snipts">
{% include "snipts/snipt-detail.html" %}
{% with 'true' as detail %}
{% include "snipts/snipt-list.html" %}
{% endwith %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
var disqus_developer = 1;
var disqus_url = ('https:' == document.location.protocol ? 'https' : 'http') + '://snipt.net{{ request.path }}';
var disqus_identifier = {{ snipt.id }};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</section>
{% endblock %}

View File

@ -1,16 +1,16 @@
{% load humanize %}
<article class="snipt {% if not snipt.public %}private-snipt{% endif %}{% if snipt.get_line_count > 8 %}expandable{% endif %}">
<article class="snipt {% if not snipt.public %}private-snipt{% endif %} {% if snipt.get_line_count > 8 and not detail %}expandable{% endif %}">
<div class="number">#{{ snipt.id }}</div>
<div class="group">
<div class="container">
<header>
<h2>{{ snipt.lexer_name }}</h2>
<h1><a href="{{ snipt.get_absolute_url }}">{{ snipt.title }}</a></h1>
<h1><a href="{{ snipt.get_absolute_url }}">{{ snipt.title }} fdsauif odpsaufiodpsa ufiopdsa ufiopds uaiopfu dsaiopf udiospa ufiopdsau fiopdsa</a></h1>
</header>
<section class="code {% if request.GET.style %}{{ request.GET.style }}{% else %}autumn{% endif %}">
{{ snipt.get_stylized|safe }}
{% if snipt.get_line_count > 8 %}
{% if snipt.get_line_count > 8 and not detail %}
<a href="#" class="expand">
<span class="expand">Expand</span>
<span class="collapse">Collapse</span>
@ -40,7 +40,7 @@
<h2>{{ snipt.tags.all|length }} tag{{ snipt.tags.all|pluralize }}</h2>
<ul>
{% for tag in snipt.sorted_tags %}
<li {% if forloop.counter > 4 %}class="hidden"{% endif %}>
<li {% if forloop.counter > 4 and not detail %}class="hidden"{% endif %}>
{% if public %}
<a href="/public/tag/{{ tag.slug }}/">{{ tag }}</a>
{% else %}
@ -59,3 +59,5 @@
</ul>
</footer>
</article>
{% block comments %}{% endblock %}