Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added basic method to prevent duplicates

  • Loading branch information...
commit b5b485167517df852c8fb34a166c9e8b50b31c6b 1 parent eec826d
@jessor authored
Showing with 11 additions and 0 deletions.
  1. +5 −0 views/stylesheet.scss
  2. +6 −0 zeitgeist.rb
View
5 views/stylesheet.scss
@@ -153,6 +153,11 @@ img {
width: 100%;
z-index: 100;
padding: 5px;
+
+ a {
+ color: white;
+ text-decoration: underline;
+ }
}
.error {
View
6 zeitgeist.rb
@@ -175,6 +175,12 @@ def is_ajax_request?
# let's put it together
begin
+ if type == 'image' and dupe = Item.first(:checksum => checksum)
+ raise "We got this already, sir. See <a href='/#{settings.assetpath}/#{dupe.name}'>#{dupe.name}</a>."
+ elsif type != 'image' and dupe = Item.first(:source => params['remote_url'])
+ raise "We got this already, sir. See <a href='#{dupe.source}'>#{dupe.source}</a>."
+ end
+
@item = Item.new(:image => params['image_upload'],
:source => params['remote_url'],
:mimetype => mimetype,
Please sign in to comment.
Something went wrong with that request. Please try again.