From 5216f954f4e33a41996b708fd2771877772357cf Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Thu, 13 Oct 2011 13:30:44 -0400 Subject: [PATCH] Working on list view --- media/css/style.less | 85 ++++++++++++++++++++++-- media/images/calendar-icon.png | Bin 0 -> 369 bytes media/images/comments-icon.png | Bin 0 -> 295 bytes media/images/infinity.png | Bin 0 -> 420 bytes media/images/permalink.png | Bin 0 -> 467 bytes snipts/models.py | 5 ++ snipts/templates/snipts/snipt-list.html | 32 +++++---- templates/base.html | 4 +- 8 files changed, 107 insertions(+), 19 deletions(-) create mode 100644 media/images/calendar-icon.png create mode 100644 media/images/comments-icon.png create mode 100644 media/images/infinity.png create mode 100644 media/images/permalink.png diff --git a/media/css/style.less b/media/css/style.less index 0e4ebd9..f2bf916 100644 --- a/media/css/style.less +++ b/media/css/style.less @@ -197,12 +197,16 @@ section.main { width: 1px; z-index: 48; } + div.left-y { + margin-left: 0; + } div.right-y { margin-left: 750px; } div.inner { float: left; - width: 750px; + margin-left: 1px; + width: 749px; } aside.main { float: right; @@ -297,40 +301,113 @@ section.main { } 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: 618px; + 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; .inset-box-shadow(0, -1px, 0, #FFF); .vertical-gradient(#FFF, #FFFAF2); h1 { - color: #666; clear: left; - float: left; font: bold 16px/20px @Helvetica; margin: 8px 15px 10px 15px; + + a { + color: #666; + display: block; + text-decoration: none; + -webkit-transition: color .08s linear; + -moz-transition: color .08s linear; + -o-transition: color .08s linear; + transition: color .08s linear; + + &:hover { + color: #3BAAF3; + } + } } h2 { border: 1px solid #E9E9E9; border-top: 0; color: #73BBC5; - float: left; + display: inline-block; font: normal 12px @Helvetica; margin-left: 15px; padding: 3px 8px 2px 8px; } } + section.code { + max-height: 200px; + margin: 20px; + overflow: hidden; + } } aside { float: right; width: 130px; } + footer { + clear: both; + padding-bottom: 20px; + + ul.attrs { + margin: 15px 0 0 15px; + + li { + background: transparent url('/media/images/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; + } + } + &.comments { + background: transparent url('/media/images/comments-icon.png') 0 2px no-repeat; + } + } + } + } } // Utils diff --git a/media/images/calendar-icon.png b/media/images/calendar-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5df11522f911f075f44e4b4388b4a09210a8fe28 GIT binary patch literal 369 zcmV-%0gnEOP)Q51#WOl%akP)LYG zqxT2=2?`Msi9$@Jl+f#FR)NeYlo|yEtKjF@O(<5ZDI{WiM~-AX&2W=%&dfXS-FxTV zq^hc*D2k$mfq4r++fV1=TS9z-N+lN)dyZmkoI8`KBBYw#~w_<42)}G4ED)*7#aqZ zOSP(NZAHeBwPQW7?s-cUXmtSF8cS2y|C%~O>5LcFGwZ4KxZc56xZ>7-E51A9we>RU z;Of^6arzlH|5&lqI1*SV>$K;WS`**+x3;bGTGPRMn1z*wV|;_VPXPu1LBQfLSwtv_ P00000NkvXXu0mjfbsnRB literal 0 HcmV?d00001 diff --git a/media/images/comments-icon.png b/media/images/comments-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b71c98b1185fd65c72c413d40e189b68551325c6 GIT binary patch literal 295 zcmV+?0oeYDP)(RCwBA{Qv(y0}RZXHA@#rMF6oK z5UT_6Um(5;#QTAGMOs?gU6@)%kVc>e4j{V|h_iv1nE^Za4#XWm+yXS<9}84)ArOZ# z;0K&Q+z7;yK%B`qbLPxgAY%~&X&{gZNW?IZ4q`wWHObJZ3(|O)42>5-8t0LraUl~h zX!imcOGwbv57e`j3CcM|gobxOoDbAg1meKrQ3gsM0OIvPtOmr&KnybYDG(n8;>|!! tuVALI08110tm>t28W0|4SQGABMtmX81c002ovPDHLkV1jBKX^a2> literal 0 HcmV?d00001 diff --git a/media/images/infinity.png b/media/images/infinity.png new file mode 100644 index 0000000000000000000000000000000000000000..712b3f38aa526cd178162502a4446d3553be7bbf GIT binary patch literal 420 zcmV;V0bBlwP)j}0B&T6xFAyIVnTQWrtk<-T&h8snOTiAs|`0{?E8%Cf>`WAB4^$jN`d>Kx|B2;;QV;jcd1D0V5f<#RO zA*NX~>_nWJIb6ezI!Z&oHmt!TtVmzLo{R>dP5F!&npqcIK`*>&(Yl?7*+e&6FbO5; zS~!AsI1ik=$T?;f-;jk(CwB=Gj+w_XOWJFZ3UpM9vR66EiSMXFP3#ewVNqfbY7#{Y zdigk7Vco5Jf4Q%7YKnG;eS91%QGk7QV)=~nX7U6}(r0=U`{@w0DBly0O$amp9NAud z%$k8!jZHG_zUR2l(02ygx*3K>=?4w=0em`}(;DoQI=q1m%<{JQBftPbnp8~!irCmF3o9wHvJi#M$Zt_5V~3Qbg~BYb8Z_qlPMxVcw|Vc? z*SYWB_uYHWz4tku=M@D#->HXo!Ys7FFPy?csHXYF36c@}3ENO%4Lw1(uZ-A9h(ic| zU>#~o z!TXec`j}TUgQHRllvs1lz!e-r6=d_$w!}|Zf;vd47&pXmGC3<&F=mL8Y7hKDMtAxM zs#Tmo+!D`8zu(J|oPcEU1yXY>tXio{eUpeAxei%*UPVcDkii5o346M;GT|)@m|{+j zXnT#pb7>H72rHUy6x!%Jv`@y>n&b%^o7YF!fl7FlV=8nJT;2XLh#^Ve8%#sFPMq+& zMY3V_#0zM&#zY)p)m>j%E(t3(&|ZWtD1|#YXT-~(-}PUB0RU0$g?x~vOjQ5?002ov JPDHLkV1l_P$1DH< literal 0 HcmV?d00001 diff --git a/snipts/models.py b/snipts/models.py index aea47b4..04d9a4d 100644 --- a/snipts/models.py +++ b/snipts/models.py @@ -46,6 +46,7 @@ class Snipt(models.Model): def get_absolute_url(self): return "/%s/%s/" % (self.user.username, self.slug) + #TODO This needs to be deprecated - render stylized version on save def get_stylized(self): if self.stylized == '': self.stylized = highlight(self.code, @@ -62,6 +63,10 @@ class Snipt(models.Model): site.domain, self.key) + @property + def lexer_name(self): + return get_lexer_by_name(self.lexer).name + class Comment(models.Model): """A comment on a Snipt""" diff --git a/snipts/templates/snipts/snipt-list.html b/snipts/templates/snipts/snipt-list.html index dd45d9a..23a2235 100644 --- a/snipts/templates/snipts/snipt-list.html +++ b/snipts/templates/snipts/snipt-list.html @@ -1,17 +1,23 @@ -
-
-
-

{{ snipt.lexer }}

-

{{ snipt.title }}

-
-
-







-
+{% load humanize %} + + diff --git a/templates/base.html b/templates/base.html index eec7bbf..6ed6744 100644 --- a/templates/base.html +++ b/templates/base.html @@ -83,8 +83,6 @@
{% block content %}{% endblock %}
-
-
+
+
{% if not debug %}