diff --git a/pinry/pins/urls.py b/pinry/pins/urls.py index 9bef562..1848b91 100644 --- a/pinry/pins/urls.py +++ b/pinry/pins/urls.py @@ -6,6 +6,8 @@ from .views import UploadImage urlpatterns = patterns('pinry.pins.views', url(r'^upload-pin/$', UploadImage.as_view(), name='new-pin'), - url(r'^$', TemplateView.as_view(template_name='core/recent_pins.html'), + url(r'^$', TemplateView.as_view(template_name='core/pins.html'), name='recent-pins'), + url(r'^tag/(?P(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'), + name='tag-pins'), ) diff --git a/pinry/static/css/lightbox.css b/pinry/static/css/lightbox.css index 81162bb..74ddfa2 100644 --- a/pinry/static/css/lightbox.css +++ b/pinry/static/css/lightbox.css @@ -11,6 +11,7 @@ border: 1px solid #bbb; position: absolute; left: 50%; + border-radius: 3px; } .lightbox-data { diff --git a/pinry/static/css/pinry.css b/pinry/static/css/pinry.css index 279f41c..e359adf 100644 --- a/pinry/static/css/pinry.css +++ b/pinry/static/css/pinry.css @@ -81,7 +81,7 @@ body { } .pin .editable .borderable { - padding: 7px 8px 5px; + padding: 5px 8px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; diff --git a/pinry/static/js/pinry.js b/pinry/static/js/pinry.js index 402d081..f737c61 100644 --- a/pinry/static/js/pinry.js +++ b/pinry/static/js/pinry.js @@ -67,7 +67,9 @@ $(window).load(function() { $('.spinner').css('display', 'block'); // Fetch our pins from the api using our current offset - $.get('/api/v1/pin/?format=json&ordering=-id&offset='+String(offset), function(pins) { + var apiUrl = '/api/v1/pin/?format=json&ordering=-id&offset='+String(offset); + if (tagFilter) apiUrl = apiUrl + '&tag=' + tagFilter; + $.get(apiUrl, function(pins) { // Set which items are editable by the current user for (var i=0; i < pins.objects.length; i++) pins.objects[i].editable = (pins.objects[i].submitter.username == currentUser.username); diff --git a/pinry/templates/base.html b/pinry/templates/base.html index ec58c58..c89d202 100644 --- a/pinry/templates/base.html +++ b/pinry/templates/base.html @@ -68,7 +68,8 @@ id: "{{ user.id }}", username: "{{ user.username }}", gravatar: "{{ user.gravatar }}" - }; + }, + tagFilter = "{{ request.resolver_match.kwargs.tag }}"; diff --git a/pinry/templates/core/recent_pins.html b/pinry/templates/core/pins.html similarity index 100% rename from pinry/templates/core/recent_pins.html rename to pinry/templates/core/pins.html diff --git a/pinry/templates/includes/lightbox.html b/pinry/templates/includes/lightbox.html index a37525b..1094232 100644 --- a/pinry/templates/includes/lightbox.html +++ b/pinry/templates/includes/lightbox.html @@ -2,6 +2,7 @@ diff --git a/pinry/templates/includes/pins.html b/pinry/templates/includes/pins.html index 62a343e..5596de7 100644 --- a/pinry/templates/includes/pins.html +++ b/pinry/templates/includes/pins.html @@ -24,7 +24,7 @@ {{#if tags}} in {{#each tags}} - {{this}} + {{this}} {{/each}} {{/if}}