lib/gitdocs/views/dir.haml in gitdocs-0.2.0 vs lib/gitdocs/views/dir.haml in gitdocs-0.3.0
- old
+ new
@@ -1,20 +1,29 @@
-%h1
- =root
+%h1= root
- if parent
%a{ :href => parent.empty? ? "/#{idx}" : "/#{idx}#{parent}", :class => "parent" }
- ↪
- = parent.empty? ? '/' : parent
+ ↪ Back to parent
- else
%a{ :href => "/", :class => "parent" }
↪ Back to selection
%h2
- =request.path_info.empty? ? '/' : request.path_info
+ %span.path= request.path_info.empty? ? '/' : request.path_info
%table
-contents.each_with_index do |f, i|
%tr
%td
%a{ :href => "/#{idx}#{request.path_info}/#{File.basename(f)}" }
="#{request.path_info}/#{File.basename(f)}"
+
+
+%form.add
+ %p Add a file in this directory
+ %input{:type => 'text', :name => "path", :class => "edit" }
+ %input{:type => 'submit', :value => "New file" }
+
+%form.upload{ :method => "post", :enctype => "multipart/form-data", :action => "/#{idx}#{request.path_info}/upload" }
+ %p Upload a file to this directory
+ %input{:type => 'file', :value => "Select a file", :name => "file", :class => "uploader" }
+ %input{:type => 'submit', :value => "Upload file"}