This repository has been archived by the owner on Jul 3, 2020. It is now read-only.
/
index.haml
34 lines (31 loc) · 1.46 KB
/
index.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#content
%form#create{ :action => '/new', :method => 'post', :enctype => 'multipart/form-data' }
%fieldset
%ol
%li
%label{ :for => 'image_upload' } Image Upload:
%input{ :type => 'file', :name => 'image_upload' }
%li
%label{ :for => 'image_url' } Remote URL (images will be fetched, else it'll get embedded):
%input{ :type => 'text', :name => 'remote_url', :size => 38 }
%li.last
%input{ :type => 'submit', :value => 'upload!' }
- if @items
%ul.items
- @items.each do |item|
%li
- if item.type == "image"
%a{ :href => "#{item.image}", :class => 'pirobox', :title => "#{item.name} at #{item.dimensions}" }
%img{ :src => "#{item.image.thumbnail}", :width => '200px', :height => '200px' }
- else
%a{ :href => "#{item.source}" }
%img{ :src => "/images/#{item.type}.png", :width => '200px', :height => '200px' }
.item-meta
Tags:
%span{ :id => "tagsforitem-#{item.id}", :class => 'taglist' }
- item.tags.each do |tag|
%a{ :href => "/filter/by/tag/#{tag.tagname}", :class => 'taglink' } #{tag.tagname}
%form.tag{ :action => "/edit/#{item.id}", :method => 'post', :id => "formforitem-#{item.id}" }
%input{ :type => 'text', :name => 'tag', :size => 10 }
%input.tagpush{ :type => 'submit', :value => 'add' }
%div.clear