2011-10-08 23:36:38 +02:00
|
|
|
%h3
|
|
|
|
.left
|
|
|
|
= form_tag tree_project_path(@project), :method => :get do
|
|
|
|
= select_tag "branch", options_for_select(@repo.heads.map(&:name), @branch), :onchange => "this.form.submit();", :class => "", :prompt => "Branches"
|
|
|
|
|
|
|
|
.left.prepend-1
|
|
|
|
= form_tag tree_project_path(@project), :method => :get do
|
2011-10-14 18:30:31 +02:00
|
|
|
= select_tag "tag", options_for_select(@project.tags, @tag), :onchange => "this.form.submit();", :class => "", :prompt => "Tags"
|
2011-10-08 23:36:38 +02:00
|
|
|
= text_field_tag "ssh", @project.url_to_repo, :class => ["ssh_project_url","one_click_select"]
|
|
|
|
.clear
|
|
|
|
|
|
|
|
%h3#tree-breadcrumbs
|
|
|
|
= link_to @project.name, tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true
|
|
|
|
- if params[:path]
|
|
|
|
- part_path = ""
|
|
|
|
- params[:path].split("\/").each do |part|
|
|
|
|
- part_path = File.join(part_path, part) unless part_path.empty?
|
|
|
|
- if part_path.empty?
|
|
|
|
- part_path = part
|
|
|
|
\/
|
2011-10-14 18:30:31 +02:00
|
|
|
= link_to truncate(part, :length => 40), tree_file_project_path(@project, :path => part_path, :commit_id => @commit.try(:id), :branch => @branch, :tag => @tag), :remote => :true
|
2011-10-08 23:36:38 +02:00
|
|
|
#tree-content-holder
|
|
|
|
- if tree.is_a?(Grit::Blob)
|
|
|
|
= render :partial => "projects/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
|
|
|
|
- else
|
|
|
|
- contents = tree.contents
|
|
|
|
%table#tree-slider.round-borders
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Last Update
|
|
|
|
%th
|
|
|
|
Last commit
|
2011-10-23 09:17:57 +02:00
|
|
|
= link_to "history", project_commits_path(@project, :path => params[:path], :branch => params[:branch],:tag => params[:tag]), :class => "right"
|
2011-10-08 23:36:38 +02:00
|
|
|
- if params[:path]
|
|
|
|
- file = File.join(params[:path], "..")
|
|
|
|
%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) }
|
|
|
|
%td.tree-item-file-name
|
|
|
|
= image_tag "dir.png"
|
2011-10-14 18:30:31 +02:00
|
|
|
= link_to "..", tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true
|
2011-10-23 09:17:57 +02:00
|
|
|
%td
|
|
|
|
%td
|
2011-10-08 23:36:38 +02:00
|
|
|
|
|
|
|
- contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
|
|
|
|
= render :partial => "projects/tree_item", :locals => { :content => content }
|
|
|
|
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
|
|
|
|
= render :partial => "projects/tree_item", :locals => { :content => content }
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
|
|
|
$('select#branch').selectmenu({style:'popup', width:200});
|
|
|
|
$('select#tag').selectmenu({style:'popup', width:200});
|
|
|
|
});
|
|
|
|
|
|
|
|
- if params[:path] && request.xhr?
|
2011-10-23 09:17:57 +02:00
|
|
|
:javascript
|
2011-10-08 23:36:38 +02: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;}});
|