diff --git a/pinry/core/static/core/css/pinry.css b/pinry/core/static/core/css/pinry.css index 0b2a0e3..ab2e015 100644 --- a/pinry/core/static/core/css/pinry.css +++ b/pinry/core/static/core/css/pinry.css @@ -90,6 +90,24 @@ body { font-weight: normal; } +.pin-options { + display: none; + position: absolute; + padding: 5px 7px 4px; + background-color: #eee; + border: 1px solid #ccc; + -webkit-box-shadow: 0 1px 3px #ccc; + -moz-box-shadow: 0 1px 3px #ccc; + box-shadow: 0 1px 3px #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + + .pin:hover .pin-options { + display: block; + } + #form { border: 1px solid #ccc; background-color: white; diff --git a/pinry/core/static/core/js/pinry.js b/pinry/core/static/core/js/pinry.js index fd03428..22e9c29 100644 --- a/pinry/core/static/core/js/pinry.js +++ b/pinry/core/static/core/js/pinry.js @@ -60,6 +60,11 @@ $(window).ready(function () { for(; i'; + html += ''; + html += ''; + html += ''; html += ''; html += ''; html += ''; diff --git a/pinry/core/templates/core/base.html b/pinry/core/templates/core/base.html index ebb9397..e3a6f76 100644 --- a/pinry/core/templates/core/base.html +++ b/pinry/core/templates/core/base.html @@ -44,7 +44,7 @@ {% block yield %}{% endblock %} - {% new_pin %} + {% new_pin request %} {% if debug %} diff --git a/pinry/pins/forms.py b/pinry/pins/forms.py index 1ee3eb4..5a2f95d 100644 --- a/pinry/pins/forms.py +++ b/pinry/pins/forms.py @@ -61,3 +61,4 @@ class PinForm(forms.ModelForm): class Meta: model = Pin + exclude = ['submitter'] diff --git a/pinry/pins/models.py b/pinry/pins/models.py index 5f6850d..0d1b37a 100644 --- a/pinry/pins/models.py +++ b/pinry/pins/models.py @@ -1,6 +1,7 @@ from django.db import models from django.core.files import File from django.core.files.temp import NamedTemporaryFile +from django.contrib.auth.models import User from thumbs import ImageWithThumbsField @@ -8,6 +9,7 @@ import urllib2 class Pin(models.Model): + submitter = models.ForeignKey(User) url = models.TextField(blank=True, null=True) description = models.TextField(blank=True, null=True) image = ImageWithThumbsField(upload_to='pins/pin', sizes=((200, 1000),)) @@ -23,7 +25,7 @@ class Pin(models.Model): temp_img.flush() # pylint: disable-msg=E1101 self.image.save(self.url.split('/')[-1], File(temp_img)) - super(Pin, self).save() + super(Pin, self).save(*args, **kwargs) class Meta: ordering = ['-id'] diff --git a/pinry/pins/templates/pins/templatetags/new_pin.html b/pinry/pins/templates/pins/templatetags/new_pin.html index 1922713..d7b3cc7 100644 --- a/pinry/pins/templates/pins/templatetags/new_pin.html +++ b/pinry/pins/templates/pins/templatetags/new_pin.html @@ -5,6 +5,7 @@

New Pin

+ {% csrf_token %}