Layout tweaks: line numbers for text, WIP upload dialog.

This commit is contained in:
Paul van Tilburg 2010-09-11 00:13:51 +02:00
parent 3b43695538
commit 4c850354e8
2 changed files with 30 additions and 9 deletions

View File

@ -127,12 +127,19 @@ module Plemp::Views
end
def main
h1 "Plemp!"
form :action => R(Upload), :method => "post",
:enctype => "multipart/form-data" do
div.header! do
h1 { span.left "Plemp!"; span.right "+" }
end
div.add_dialog! do
form :action => R(Upload), :method => "post",
:enctype => "multipart/form-data" do
p "Scribble something below:"
input :name => "text", :id => "text", :type => "textarea"
p "… or upload a file:"
input :name => "file", :id => "file", :type => "file"
input :type => "submit", :value => "Upload!"
end
end
end
div.draggables! do
@draggables.each do |d|
file = UPLOAD_DIR + d.file
@ -163,7 +170,8 @@ module Plemp::Views
"controls=\"true\">" + "</audio>\n"
when "text"
div.draggable :id => d.file, :style => default_style do
CodeRay.scan_file(file).div
CodeRay.scan_file(file).div(:tab_width => 2,
:line_numbers => :inline)
end
else
span.draggable :id => d.file, :style => default_style do

View File

@ -1,13 +1,26 @@
/* CSS style file for Plemp! */
#header {
position: relative;
border-bottom: thin solid gray;
height: 100%;
}
#header h1 { margin: 5pt 0pt; }
#add_dialog {
display: none;
}
.left { text-align: left; }
.right { text-align: right; }
.draggable {
position: absolute;
padding: 15px;
padding: 10px;
width: 400px;
max-height: 300px;
overflow: auto;
top: 0px;
left: 0px;
border: thin solid black;
border: thin solid #888;
background: white;
}