Layout tweaks: line numbers for text, WIP upload dialog.
This commit is contained in:
parent
3b43695538
commit
4c850354e8
18
plemp.rb
18
plemp.rb
|
@ -127,12 +127,19 @@ module Plemp::Views
|
||||||
end
|
end
|
||||||
|
|
||||||
def main
|
def main
|
||||||
h1 "Plemp!"
|
div.header! do
|
||||||
form :action => R(Upload), :method => "post",
|
h1 { span.left "Plemp!"; span.right "+" }
|
||||||
:enctype => "multipart/form-data" do
|
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 :name => "file", :id => "file", :type => "file"
|
||||||
input :type => "submit", :value => "Upload!"
|
input :type => "submit", :value => "Upload!"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
div.draggables! do
|
div.draggables! do
|
||||||
@draggables.each do |d|
|
@draggables.each do |d|
|
||||||
file = UPLOAD_DIR + d.file
|
file = UPLOAD_DIR + d.file
|
||||||
|
@ -163,7 +170,8 @@ module Plemp::Views
|
||||||
"controls=\"true\">" + "</audio>\n"
|
"controls=\"true\">" + "</audio>\n"
|
||||||
when "text"
|
when "text"
|
||||||
div.draggable :id => d.file, :style => default_style do
|
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
|
end
|
||||||
else
|
else
|
||||||
span.draggable :id => d.file, :style => default_style do
|
span.draggable :id => d.file, :style => default_style do
|
||||||
|
|
|
@ -1,13 +1,26 @@
|
||||||
/* CSS style file for Plemp! */
|
/* 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 {
|
.draggable {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding: 15px;
|
padding: 10px;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
top: 0px;
|
border: thin solid #888;
|
||||||
left: 0px;
|
|
||||||
border: thin solid black;
|
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue