Skip to content

Commit d2ae143

Browse files
committed
Slightly less hideous file upload form.
1 parent 11eadcd commit d2ae143

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

public/style.css

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ th{font-weight:bold;}
3232
.toc li:before { content: counters(toc, ".") ". "; counter-increment: toc }
3333
.toc a { color: blue }
3434

35+
#upload-form {
36+
width: 500px;
37+
border: 1px solid #ccc;
38+
}
39+
40+
#upload-form dt {
41+
float: left;
42+
padding-right: 1em;
43+
padding-top: 3px;
44+
width: 150px;
45+
text-align: right;
46+
font-weight: bold;
47+
}
48+
49+
#upload-form dd {
50+
padding-top: 3px;
51+
}
52+
3553
.thumbimage {
3654
max-width: 500px;
3755
max-height: 220px;

views/upload.haml

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
- if defined? err
22
%h2.error= err
3+
%p
4+
Pick a file to upload from your local system.
35
%form.upload{ :method => 'post', :enctype => 'multipart/form-data' }
4-
%table.upload
5-
%tr
6-
%th{ :align => 'right' } From Local File:
7-
%td
8-
%input{ :id => "upload-file", :type=> "file", :name=> "file" }
9-
%tr
10-
%th{ :align => 'right' } Save File As:
11-
%td
12-
%input{ :id => "upload-filename", :type => "text", :name=> "filename" }
13-
%tr
14-
%th{ :align => 'right' }
15-
%input{ :type => "submit", :value => "Upload" }
6+
%dl.upload{ :id => 'upload-form' }
7+
%dt
8+
From Local File:
9+
%dd
10+
%input{ :id => "upload-file", :type=> "file", :name=> "file" }
11+
%dt
12+
Save File As:
13+
%dd
14+
%input{ :id => "upload-filename", :type => "text", :name=> "filename" }
15+
%dt
16+
%input{ :type => "submit", :value => "Upload" }
17+
%dd

0 commit comments

Comments
 (0)