Snipt history.
parent
c4bf1562db
commit
b6ab20f200
File diff suppressed because one or more lines are too long
|
@ -816,80 +816,7 @@ section.main-edit {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
article.snipt {
|
section.code {
|
||||||
margin: 30px 0;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
div.number {
|
|
||||||
color: #CCC;
|
|
||||||
font: normal 12px $Helvetica;
|
|
||||||
left: -115px;
|
|
||||||
position: absolute;
|
|
||||||
text-align: right;
|
|
||||||
top: 4px;
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
div.container {
|
|
||||||
background: #FFF;
|
|
||||||
border: 1px solid #DDD;
|
|
||||||
border-left: 0;
|
|
||||||
float: left;
|
|
||||||
position: relative;
|
|
||||||
width: 85%;
|
|
||||||
|
|
||||||
div.ruler {
|
|
||||||
background: #DDD;
|
|
||||||
height: 1px;
|
|
||||||
left: -3000px;
|
|
||||||
position: absolute;
|
|
||||||
top: auto;
|
|
||||||
width: 3000px;
|
|
||||||
}
|
|
||||||
div.top-x {
|
|
||||||
top: -1px;
|
|
||||||
}
|
|
||||||
div.bottom-x {
|
|
||||||
bottom: -1px;
|
|
||||||
}
|
|
||||||
header {
|
|
||||||
border-bottom: 1px solid #F1F1EE;
|
|
||||||
min-height: 58px;
|
|
||||||
@include inset-box-shadow(0, -1px, 0, #FFF);
|
|
||||||
@include vertical-gradient(#FFF, #FFFAF2);
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
clear: left;
|
|
||||||
font: bold 16px/20px $Helvetica;
|
|
||||||
margin: 8px 15px 10px 15px;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #666;
|
|
||||||
display: block;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
text-decoration: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
-webkit-transition: color .03s linear;
|
|
||||||
-moz-transition: color .03s linear;
|
|
||||||
-o-transition: color .03s linear;
|
|
||||||
transition: color .03s linear;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #3BAAF3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
border: 1px solid #E9E9E9;
|
|
||||||
border-top: 0;
|
|
||||||
color: #73BBC5;
|
|
||||||
display: inline-block;
|
|
||||||
font: normal 12px $Helvetica;
|
|
||||||
margin: 0 0 0 15px;
|
|
||||||
padding: 3px 8px 2px 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
section.code {
|
|
||||||
height: 230px;
|
height: 230px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -1022,6 +949,172 @@ article.snipt {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
footer.snipt-attrs {
|
||||||
|
clear: both;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
|
||||||
|
ul.attrs {
|
||||||
|
margin: 14px 0 0 15px;
|
||||||
|
|
||||||
|
li {
|
||||||
|
background: transparent url('../img/calendar-icon.png') top left no-repeat;
|
||||||
|
color: #999;
|
||||||
|
display: inline;
|
||||||
|
font: normal 12px $Helvetica;
|
||||||
|
margin-right: 15px;
|
||||||
|
padding: 1px 0 0 24px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #999;
|
||||||
|
font: normal 12px $Helvetica;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.author {
|
||||||
|
background-image: none;
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
span.avatar {
|
||||||
|
background-color: transparent;
|
||||||
|
background-position: top left;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
display: inline-block;
|
||||||
|
height: 15px;
|
||||||
|
margin-right: 7px;
|
||||||
|
vertical-align: -3px;
|
||||||
|
width: 15px;
|
||||||
|
@include border-radius(3px);
|
||||||
|
}
|
||||||
|
span.pro {
|
||||||
|
a {
|
||||||
|
color: #3299B7;
|
||||||
|
font: italic bold 10px $Helvetica;
|
||||||
|
margin-left: 5px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
span.gittip {
|
||||||
|
a {
|
||||||
|
background: #DFF0D8;
|
||||||
|
border: 1px solid #CBDDBB;
|
||||||
|
color: #468847;
|
||||||
|
font: bold 10px $Helvetica;
|
||||||
|
margin-left: 5px;
|
||||||
|
padding: 0 3px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
@include border-radius(3px);
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-family: $Consolas;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
background: #E6F7DF;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.comments {
|
||||||
|
background: transparent url('../img/comments-icon.png') 0 2px no-repeat;
|
||||||
|
}
|
||||||
|
&.raw {
|
||||||
|
background-image: none;
|
||||||
|
float: right;
|
||||||
|
margin-right: 15%;
|
||||||
|
}
|
||||||
|
&.tweet {
|
||||||
|
background: none;
|
||||||
|
margin: -1px 0 0 0;
|
||||||
|
padding: 0;
|
||||||
|
vertical-align: -6px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
article.snipt {
|
||||||
|
margin: 30px 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
div.number {
|
||||||
|
color: #CCC;
|
||||||
|
font: normal 12px $Helvetica;
|
||||||
|
left: -115px;
|
||||||
|
position: absolute;
|
||||||
|
text-align: right;
|
||||||
|
top: 4px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
div.container {
|
||||||
|
background: #FFF;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
border-left: 0;
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
width: 85%;
|
||||||
|
|
||||||
|
div.ruler {
|
||||||
|
background: #DDD;
|
||||||
|
height: 1px;
|
||||||
|
left: -3000px;
|
||||||
|
position: absolute;
|
||||||
|
top: auto;
|
||||||
|
width: 3000px;
|
||||||
|
}
|
||||||
|
div.top-x {
|
||||||
|
top: -1px;
|
||||||
|
}
|
||||||
|
div.bottom-x {
|
||||||
|
bottom: -1px;
|
||||||
|
}
|
||||||
|
header {
|
||||||
|
border-bottom: 1px solid #F1F1EE;
|
||||||
|
min-height: 58px;
|
||||||
|
@include inset-box-shadow(0, -1px, 0, #FFF);
|
||||||
|
@include vertical-gradient(#FFF, #FFFAF2);
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
clear: left;
|
||||||
|
font: bold 16px/20px $Helvetica;
|
||||||
|
margin: 8px 15px 10px 15px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #666;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
-webkit-transition: color .03s linear;
|
||||||
|
-moz-transition: color .03s linear;
|
||||||
|
-o-transition: color .03s linear;
|
||||||
|
transition: color .03s linear;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #3BAAF3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
border: 1px solid #E9E9E9;
|
||||||
|
border-top: 0;
|
||||||
|
color: #73BBC5;
|
||||||
|
display: inline-block;
|
||||||
|
font: normal 12px $Helvetica;
|
||||||
|
margin: 0 0 0 15px;
|
||||||
|
padding: 3px 8px 2px 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
section.emacs, section.default {
|
section.emacs, section.default {
|
||||||
a.expand {
|
a.expand {
|
||||||
|
@ -1160,6 +1253,9 @@ article.snipt {
|
||||||
&.download {
|
&.download {
|
||||||
background-image: url('../img/download-icon.png');
|
background-image: url('../img/download-icon.png');
|
||||||
}
|
}
|
||||||
|
&.history {
|
||||||
|
background-image: url('../img/copy-icon.png');
|
||||||
|
}
|
||||||
&.embed {
|
&.embed {
|
||||||
background-image: url('../img/embed-icon.png');
|
background-image: url('../img/embed-icon.png');
|
||||||
}
|
}
|
||||||
|
@ -1212,99 +1308,6 @@ article.snipt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
footer {
|
|
||||||
clear: both;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
|
|
||||||
ul.attrs {
|
|
||||||
margin: 14px 0 0 15px;
|
|
||||||
|
|
||||||
li {
|
|
||||||
background: transparent url('../img/calendar-icon.png') top left no-repeat;
|
|
||||||
color: #999;
|
|
||||||
display: inline;
|
|
||||||
font: normal 12px $Helvetica;
|
|
||||||
margin-right: 15px;
|
|
||||||
padding: 1px 0 0 24px;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #999;
|
|
||||||
font: normal 12px $Helvetica;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.author {
|
|
||||||
background-image: none;
|
|
||||||
padding-left: 0;
|
|
||||||
|
|
||||||
span.avatar {
|
|
||||||
background-color: transparent;
|
|
||||||
background-position: top left;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
display: inline-block;
|
|
||||||
height: 15px;
|
|
||||||
margin-right: 7px;
|
|
||||||
vertical-align: -3px;
|
|
||||||
width: 15px;
|
|
||||||
@include border-radius(3px);
|
|
||||||
}
|
|
||||||
span.pro {
|
|
||||||
a {
|
|
||||||
color: #3299B7;
|
|
||||||
font: italic bold 10px $Helvetica;
|
|
||||||
margin-left: 5px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
span.gittip {
|
|
||||||
a {
|
|
||||||
background: #DFF0D8;
|
|
||||||
border: 1px solid #CBDDBB;
|
|
||||||
color: #468847;
|
|
||||||
font: bold 10px $Helvetica;
|
|
||||||
margin-left: 5px;
|
|
||||||
padding: 0 3px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
@include border-radius(3px);
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-family: $Consolas;
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
background: #E6F7DF;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.comments {
|
|
||||||
background: transparent url('../img/comments-icon.png') 0 2px no-repeat;
|
|
||||||
}
|
|
||||||
&.raw {
|
|
||||||
background-image: none;
|
|
||||||
float: right;
|
|
||||||
margin-right: 15%;
|
|
||||||
}
|
|
||||||
&.tweet {
|
|
||||||
background: none;
|
|
||||||
margin: -1px 0 0 0;
|
|
||||||
padding: 0;
|
|
||||||
vertical-align: -6px;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
section.description {
|
section.description {
|
||||||
padding: 10px 20px 20px 20px;
|
padding: 10px 20px 20px 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -3197,3 +3200,15 @@ video {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
width: 1056px;
|
width: 1056px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.snipt-log {
|
||||||
|
background: #E9E9E9;
|
||||||
|
display: none;
|
||||||
|
padding: 40px;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
|
||||||
|
section.code {
|
||||||
|
border: 1px solid #DDDDDD;
|
||||||
|
margin-top: 10px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'click a.copy': 'copyFromClick',
|
'click a.copy': 'copyFromClick',
|
||||||
|
'click a.history': 'toggleHistory',
|
||||||
'click a.edit': 'edit',
|
'click a.edit': 'edit',
|
||||||
'click a.favorite': 'favoriteToggle',
|
'click a.favorite': 'favoriteToggle',
|
||||||
'click a.embed': 'embedFromClick',
|
'click a.embed': 'embedFromClick',
|
||||||
|
@ -594,6 +595,9 @@
|
||||||
if (isFullScreen(cm)) setFullScreen(cm, false);
|
if (isFullScreen(cm)) setFullScreen(cm, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
toggleHistory: function() {
|
||||||
|
$('div.snipt-log').toggle();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Snipt.SniptListView = Backbone.View.extend({
|
Snipt.SniptListView = Backbone.View.extend({
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% load humanize pygmentize snipt_tags %}
|
||||||
|
|
||||||
{% block add-snipt %}
|
{% block add-snipt %}
|
||||||
{% include 'add-snipt.html' %}
|
{% include 'add-snipt.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -51,6 +53,22 @@
|
||||||
{% with 'true' as detail %}
|
{% with 'true' as detail %}
|
||||||
{% include "snipts/snipt-list.html" %}
|
{% include "snipts/snipt-list.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
<div class="snipt-log" id="history">
|
||||||
|
{% for log_entry in snipt.sniptlogentry_set.all|dictsortreversed:"created" %}
|
||||||
|
<section class="code autumn">
|
||||||
|
{{ log_entry.diff|pygmentize|safe }}
|
||||||
|
</section>
|
||||||
|
<footer class="snipt-attrs">
|
||||||
|
<ul class="attrs">
|
||||||
|
<li class="author">
|
||||||
|
<span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/{{ log_entry.user.email|md5 }}?s=15&d=https://snipt.s3.amazonaws.com/img/author-icon.png');"></span>
|
||||||
|
<a href="{{ log_entry.user.get_absolute_url }}">{{ log_entry.user.username }}</a>
|
||||||
|
</li>
|
||||||
|
<li class="created" title="{{ log_entry.created|date:"Y-m-d\TH:i:s" }}">{{ log_entry.created|naturaltime }}</li>
|
||||||
|
</ul>
|
||||||
|
</footer>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
<div id="disqus_thread">
|
<div id="disqus_thread">
|
||||||
{% if snipt.public %}
|
{% if snipt.public %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</section>
|
</section>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer class="snipt-attrs">
|
||||||
<ul class="attrs">
|
<ul class="attrs">
|
||||||
<li class="author">
|
<li class="author">
|
||||||
<span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/<%= snipt.user.email_md5 %>?s=15&d=https://snipt.s3.amazonaws.com/img/author-icon.png');"></span>
|
<span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/<%= snipt.user.email_md5 %>?s=15&d=https://snipt.s3.amazonaws.com/img/author-icon.png');"></span>
|
||||||
|
|
|
@ -145,6 +145,9 @@
|
||||||
<li>
|
<li>
|
||||||
<a class="download" href="{{ snipt.get_download_url }}">Download</a>
|
<a class="download" href="{{ snipt.get_download_url }}">Download</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="history" href="#history">History</a>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
{% if snipt.tags.all %}
|
{% if snipt.tags.all %}
|
||||||
|
@ -172,7 +175,7 @@
|
||||||
</aside>
|
</aside>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<footer ng-show="!account || account.list_view == 'N'">
|
<footer class="snipt-attrs" ng-show="!account || account.list_view == 'N'">
|
||||||
<ul class="attrs">
|
<ul class="attrs">
|
||||||
{% block author %}
|
{% block author %}
|
||||||
<li class="author">
|
<li class="author">
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/highlightjs-themes/tomorrow.css" />
|
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/highlightjs-themes/tomorrow.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/blog-themes/default/style.css" />
|
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/blog-themes/default/style.css" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/snipt.css?121" />
|
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/snipt.css?122" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if has_snipts and not detail %}
|
{% if has_snipts and not detail %}
|
||||||
|
@ -426,7 +426,7 @@
|
||||||
<script type="text/javascript" src="{{ STATIC_URL }}js/src/account.js"></script>
|
<script type="text/javascript" src="{{ STATIC_URL }}js/src/account.js"></script>
|
||||||
<script type="text/javascript" src="{{ STATIC_URL }}js/src/snipts.js"></script>
|
<script type="text/javascript" src="{{ STATIC_URL }}js/src/snipts.js"></script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<script type="text/javascript" src="{{ STATIC_URL }}js/snipt-all.min.js?76"></script>
|
<script type="text/javascript" src="{{ STATIC_URL }}js/snipt-all.min.js?77"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if has_snipts and detail %}
|
{% if has_snipts and detail %}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
from django import template
|
||||||
|
from pygments import highlight
|
||||||
|
from pygments.formatters import HtmlFormatter
|
||||||
|
from pygments.lexers import get_lexer_by_name
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def pygmentize(text):
|
||||||
|
return highlight(text,
|
||||||
|
get_lexer_by_name('diff',
|
||||||
|
encoding='UTF-8'),
|
||||||
|
HtmlFormatter(linenos='table',
|
||||||
|
anchorlinenos=True,
|
||||||
|
lineanchors='L',
|
||||||
|
linespans='L',
|
||||||
|
))
|
Loading…
Reference in New Issue