gitlab-org--gitlab-foss/app/views/refs/_tree.html.haml

52 lines
1.7 KiB
Text
Raw Normal View History

2011-11-01 16:11:24 -04:00
#tree-breadcrumbs
%h2.icon
%span
%d
2011-11-16 00:38:53 -05:00
= link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do
2011-11-25 18:42:42 -05:00
= @project.code
2011-11-20 15:32:12 -05:00
- tree.breadcrumbs(2) do |link|
\/
= link
 
2011-11-16 12:19:18 -05:00
.right= render :partial => "projects/refs", :locals => { :destination => :tree }
2011-11-01 16:11:24 -04:00
.clear
2011-10-08 17:36:38 -04:00
#tree-content-holder
2011-11-20 15:32:12 -05:00
- if tree.is_blob?
2011-11-16 00:38:53 -05:00
= render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
2011-10-08 17:36:38 -04:00
- else
- contents = tree.contents
%table#tree-slider.round-borders
2011-11-01 16:11:24 -04:00
%thead
2011-10-08 17:36:38 -04:00
%th Name
%th Last Update
%th
Last commit
2011-11-20 15:32:12 -05:00
= link_to "history", tree.history_path, :class => "right"
- if tree.up_dir?
%tr{ :class => "tree-item", :url => tree.up_dir_path }
2011-10-08 17:36:38 -04:00
%td.tree-item-file-name
= image_tag "dir.png"
2011-11-20 15:32:12 -05:00
= link_to "..", tree.up_dir_path, :remote => :true
%td
%td
2011-10-08 17:36:38 -04:00
- contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
2011-11-16 00:38:53 -05:00
= render :partial => "refs/tree_item", :locals => { :content => content }
2011-10-08 17:36:38 -04:00
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
2011-11-16 00:38:53 -05:00
= render :partial => "refs/tree_item", :locals => { :content => content }
2011-10-08 17:36:38 -04:00
:javascript
$(function(){
$('select#branch').selectmenu({style:'popup', width:200});
$('select#tag').selectmenu({style:'popup', width:200});
});
- if params[:path] && request.xhr?
:javascript
2011-10-08 17:36:38 -04:00
$(window).unbind('popstate');
$(window).bind('popstate', function() {
if(location.pathname.search("tree") != -1) {
$.ajax({type: "GET", url: location.pathname, dataType: "script"})}
else { location.href = location.pathname;}});