From 99dea00d410f8acca861fdf0d8e220e97d437819 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 02:47:14 +0530 Subject: [PATCH 1/7] noteworthy with thumbnail resize + title as link --- urbstudio/templates/noteworthy.html | 16 +++++++++++----- urbstudio/urb/models.py | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/urbstudio/templates/noteworthy.html b/urbstudio/templates/noteworthy.html index be2abaa..4de35af 100755 --- a/urbstudio/templates/noteworthy.html +++ b/urbstudio/templates/noteworthy.html @@ -1,4 +1,5 @@ {% extends 'inner.html' %} +{% load thumbnail %} {% block title %} | Noteworthy {% endblock %} @@ -32,12 +33,17 @@ height:150px; {% block inner_content %} -
-


-
- {% for n in noteworthy %} -
+
+ {% thumbnail n.image "200x150" crop='center' as im %} + + {% endthumbnail %} +

{{ n.title }}

+
+ +

{{ n.description }}

+


+
{% endfor %} diff --git a/urbstudio/urb/models.py b/urbstudio/urb/models.py index 7b0bb03..480cc15 100755 --- a/urbstudio/urb/models.py +++ b/urbstudio/urb/models.py @@ -17,6 +17,9 @@ class Project(models.Model): # end_date = models.DateField(blank=True) # location = models.CharField(max_length=255, blank=True) + class Meta: + ordering = ['-id'] + def get_info(self): return { 'id': self.id, From 4f96c9ed4f69f5e11fae1f5820bb0bedae801446 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 02:48:21 +0530 Subject: [PATCH 2/7] links - title as link --- urbstudio/templates/links.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/urbstudio/templates/links.html b/urbstudio/templates/links.html index 229bf81..a048646 100755 --- a/urbstudio/templates/links.html +++ b/urbstudio/templates/links.html @@ -10,11 +10,9 @@ {% block inner_content %} {% for l in links %} -

{{ l.title }}

+

{{ l.title }}


{{ l.description }}

-
- {{ l.url }}


{% endfor %} {% endblock %} From bd59955f45701992a29612ad50c8375fb1161d63 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 02:54:52 +0530 Subject: [PATCH 3/7] favicon --- urbstudio/static/images/favicon.ico | Bin 0 -> 743 bytes urbstudio/templates/base.html | 2 +- urbstudio/urls.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100755 urbstudio/static/images/favicon.ico diff --git a/urbstudio/static/images/favicon.ico b/urbstudio/static/images/favicon.ico new file mode 100755 index 0000000000000000000000000000000000000000..668582883d685bcb01852bd79433b1ec31195351 GIT binary patch literal 743 zcmV?P)XsH66LQ%5D3Ch*OO7L01^>U z#KBaIDx*l?Oo6B}SEG`mbPv`?H^)w{zJ!>A%m*ncoGZ^4E3+;KvbRggww5cHgGn!+DQYitSs)-KJR|} zGFK_a#|)I7uPi=R6u<~13`A3;aOkwJ&UDJ&y;*8^onqdkh=J#C*J}19IL-#^zkTs~ zSqP)4h%S;KB;kk&G93&@p4%vWamOWQagi@Bx8BL(g^3FRf17y}9i%$9c8-ymr{E z?KY?LNtp@~fXb`6)6nPgra^CQh{@n9tWwH!I!?FS9#2w9m9`HX6%tPYX!ituBMk-B zeB!v?nk&S;iFkQts@`Zcf3>b}tucd^v!#5|Ou;|!g8=wWE-5vyWN+X)wzalaS7ba} zEgHJgxBG0+RS`UZFN$Gi7jniy0}L-2Io6M!H4(eH*|Af$IN$MoV zjZ_SaF!0=<4{bfP3kwCS$J(u4DnakUQogImfb6f%;6P9a6J8S}Dn z0e9EWo@8VZcYm|{>ZpSdxIq9wiK#<4a&pUujPyr< Z0RV4j|7SZ)pfdmf002ovPDHLkV1fgURJH&B literal 0 HcmV?d00001 diff --git a/urbstudio/templates/base.html b/urbstudio/templates/base.html index b9ce7f7..3e3a064 100755 --- a/urbstudio/templates/base.html +++ b/urbstudio/templates/base.html @@ -8,7 +8,7 @@ - + {% block extra_meta %} diff --git a/urbstudio/urls.py b/urbstudio/urls.py index 8316951..fe96126 100755 --- a/urbstudio/urls.py +++ b/urbstudio/urls.py @@ -20,7 +20,7 @@ urlpatterns = patterns('', (r'^noteworthy$', 'urb.views.noteworthy'), # Uncomment the admin/doc line below to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - + (r'^favicon.ico$', 'django.views.generic.simple.redirect_to', {'url': '/static/images/favicon.png'}), # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), ) From c747dcf0ea74ad59fd30e07302ca29a28b3b9309 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 16:49:52 +0530 Subject: [PATCH 4/7] test basic loading on projects page --- urbstudio/static/images/loading.gif | Bin 0 -> 847 bytes urbstudio/static/js/projects.js | 3 ++- urbstudio/templates/projects.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 urbstudio/static/images/loading.gif diff --git a/urbstudio/static/images/loading.gif b/urbstudio/static/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..79cc5e28fb2804811cc6288ba1324966bfb11f5a GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`(1JXU?2qVPTm+e|}6h*REZwprGLD>bh&!uH4+*s;Vjx z5s|>aKph>ONs}hEwY7mY5lblk=k{|A33hf2a5d61U}gmBQ~W38T$GwvlA5AWo>`Ki zkeHQNk&~a8qL-PMmd~L0lZBHDs7eQ91IUpKtN{uNeJPpqmKuoUC~CDNtXexmYwdvp2d^Dv;^>*ukeVSP#B=a~f`cHJ z&w+*y$${?8Oio*#ZVND-p0{bqWVZD*Xt=Aat;&6vAl3|g72d7x8jzOQ(6|TN)0k3Coc|z?? z%b8hfRI+(vH2HbDv054g3DyRMDNKeUM;%r)JIk@H5kHpQ-86?$(dkKoJwxMmrhOBX zU7IYboB|^nl6U7WD&rPXTBz{y(Bg!~gf`w#w`Gz=cO?0i7QEK{oc6x~t2H3M0b_54 z1COhrz@d{8xv>(*cS?BlTxh$Y!7k9nV#1{GTti1?UUB0cu(i`VAUAy((BOjfYz50rVKhG6xfe zLz|8{DtS)i*f48h0*75*E32o0N{2+RoVWQVUJo7igPpo1&00;(u2LcbOAhN^Ojyy8 naDeHjfMF+x#D?h({d~^m865hCENQGUn%zBWiVW7E +
  • {{ p.title }}
  • {% endthumbnail %} {% endfor %} From e8c7c5d1a797715f070522e04da61878f2df8645 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 16:55:16 +0530 Subject: [PATCH 5/7] ups --- urbstudio/static/js/projects.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urbstudio/static/js/projects.js b/urbstudio/static/js/projects.js index 96c93cb..b4e8fa0 100644 --- a/urbstudio/static/js/projects.js +++ b/urbstudio/static/js/projects.js @@ -10,7 +10,7 @@ $(function(){ $('.selected').removeClass("selected"); $this.addClass("selected"); var project_id = $this.attr("data-id"); - doProjectLoading(); +// doProjectLoading(); $.getJSON("project_json", {'id': project_id}, function(data) { $('#projectTitle').next().text(data.title); $('#projectSizeProgram').next().html(nl2br(data.size_program)); From f87af86cb4a0e2b64d3d1cb3175b3f1f27841d7b Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 17:02:58 +0530 Subject: [PATCH 6/7] URL Hashes --- urbstudio/static/js/projects.js | 15 ++++++++++++++- urbstudio/templates/projects.html | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/urbstudio/static/js/projects.js b/urbstudio/static/js/projects.js index b4e8fa0..1769e64 100644 --- a/urbstudio/static/js/projects.js +++ b/urbstudio/static/js/projects.js @@ -12,6 +12,7 @@ $(function(){ var project_id = $this.attr("data-id"); // doProjectLoading(); $.getJSON("project_json", {'id': project_id}, function(data) { + location.hash = data.slug; $('#projectTitle').next().text(data.title); $('#projectSizeProgram').next().html(nl2br(data.size_program)); $('#projectDesignStatement').next().html(nl2br(data.design_statement)); @@ -30,9 +31,21 @@ $(function(){ }); }); - $('.projectThumb').eq(0).click(); + + var hash = location.hash; + if (hash == '') { + $('.projectThumb').eq(0).click(); + } else { + var $thumb = $('#thumb_' + hash); + if ($thumb.length > 0) { + $thumb.click(); + } else { + $('.projectThumb').eq(0).click(); + } + } }); + function getA(image) { var $a = $('').attr("href", "#"); var $img = $('').attr("src", image.url).appendTo($a); diff --git a/urbstudio/templates/projects.html b/urbstudio/templates/projects.html index 6b79ffd..9a81313 100755 --- a/urbstudio/templates/projects.html +++ b/urbstudio/templates/projects.html @@ -78,7 +78,7 @@ {% load thumbnail %} {% for p in projects %} {% thumbnail p.thumb_image "100x100" crop="center" as im %} -
  • {{ p.title }}
  • +
  • {{ p.title }}
  • {% endthumbnail %} {% endfor %} From b631e2eb1271e0d69eb549380f8fd753fae12afb Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 17:07:09 +0530 Subject: [PATCH 7/7] add title attr to proj images --- urbstudio/templates/projects.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/urbstudio/templates/projects.html b/urbstudio/templates/projects.html index 9a81313..3b993a4 100755 --- a/urbstudio/templates/projects.html +++ b/urbstudio/templates/projects.html @@ -78,7 +78,7 @@ {% load thumbnail %} {% for p in projects %} {% thumbnail p.thumb_image "100x100" crop="center" as im %} -
  • {{ p.title }}
  • +
  • {{ p.title }}
  • {% endthumbnail %} {% endfor %}