%h3= t("layout.projects.files_in_project") .files .l = render :partial => 'git/shared/whereami' .both - render_way = choose_render_way(@blob) .file .top .l = @blob.mode + ' | ' - if (render_way == :text) - text = @blob.data.split("\n") = "#{text.length} lines (#{text.select{|s| s.strip.length > 0}.length} sloc) | " = "#{(@blob.size / 1024.0).round(3)} Kb" .r - if render_way == :text and can? :write, @project and @treeish.in? @project.branches.map(&:name) = raw "#{link_to "Edit", edit_blob_path(@project, @treeish, @path) } | " = raw "#{link_to "Raw", raw_path(@project, @treeish, @path)} | " = raw "#{link_to "Blame", blame_path(@project, @treeish, @path)} | " = link_to "History", commits_path(@project, @treeish, @path) .both .data - case render_way - when :image %table.table.blob %tr %td.lines %td.blob :plain

- when :text .gutter :plain
#{render_line_numbers(text.length)}
%pre{:class => "brush: #{@blob.mime_type.split('/').last}"} =#{render_blob(@blob)} = @blob.data.encode_to_default.html_safe - when :binary %table.table.blob %tr %td.lines %td.blob :plain
#{ link_to @blob.basename.encode_to_default, raw_path(@project, @treeish, @path) }