lib/gitdocs/views/dir.haml in gitdocs-0.5.0.pre6 vs lib/gitdocs/views/dir.haml in gitdocs-0.5.0.pre7
- old
+ new
@@ -1,8 +1,8 @@
- @title = root
-= partial("header", :locals => { :parent => parent, :file => false, :idx => idx })
+= partial('header', locals: { file: false, idx: idx })
- if contents && contents.any?
%table#fileListing.condensed-table.zebra-striped
%thead
%tr
@@ -10,34 +10,34 @@
%th Author
%th Last Modified
%th Size
%tbody
- - contents.each_with_index do |f, i|
+ - contents.each do |f|
%tr
%td
- %img{ :src => "/img/#{f.dir? ? 'folder' : 'file'}.png", :width => 16, :height => 16 }
- %a{ :href => "/#{idx}#{request.path_info}/#{f.name}" }
+ %img{ src: "/img/#{f.is_directory ? 'folder' : 'file'}.png", width: 16, height: 16 }
+ %a{ href: "/#{idx}#{request.path_info}/#{f.name}" }
= f.name
%td.author
%td.modified
%td.size
- if contents.empty?
%p No files were found in this directory.
.row
.span6
- %form.upload{ :method => "post", :enctype => "multipart/form-data", :action => "/#{idx}#{request.path_info}?mode=upload" }
+ %form.upload{ method: 'POST', enctype: 'multipart/form-data', action: "/#{idx}#{request.path_info}?mode=upload" }
%p Upload file to this directory
- %input{:type => 'file', :value => "Select a file", :name => "file", :class => "uploader", :size => 12}
- %input{:type => 'submit', :value => "Upload file", :class => "btn secondary" }
+ %input.uploader{ type: 'file', value: 'Select a file', name: 'file', size: 12 }
+ %input.btn.secondary{ type: 'submit', value: 'Upload file' }
.span8
%form.add
%p Add new file or directory
- %input{:type => 'text', :name => "path", :class => "edit", :placeholder => "somefile.md or somedir" }
- %input{:type => 'submit', :value => "New file", :class => "btn secondary file" }
- %input{:type => 'submit', :value => "New directory", :class => "btn secondary directory" }
+ %input.edit{ type: 'text', name: 'path', placeholder: 'somefile.md or somedir' }
+ %input.btn.secodary.file{ type: 'submit', value: 'New file' }
+ %input.btn.secondary.directory{ type: 'submit', value: 'New directory' }
- if rendered_readme
.contents
= preserve rendered_readme