2012-01-26 23:13:19 +01:00
|
|
|
%ul.breadcrumb
|
|
|
|
%li
|
2012-01-11 08:35:21 +01:00
|
|
|
= link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do
|
|
|
|
= @project.code
|
2012-01-26 23:13:19 +01:00
|
|
|
- tree.breadcrumbs(6) do |link|
|
|
|
|
\/
|
|
|
|
%li= link
|
2012-01-11 08:35:21 +01:00
|
|
|
%span.tree_progress
|
2011-11-01 21:11:24 +01:00
|
|
|
.clear
|
2011-10-08 23:36:38 +02:00
|
|
|
#tree-content-holder
|
2011-11-20 21:32:12 +01:00
|
|
|
- if tree.is_blob?
|
2011-11-16 06:38:53 +01:00
|
|
|
= render :partial => "refs/tree_file", :locals => { :name => tree.name, :content => tree.data, :file => tree }
|
2011-10-08 23:36:38 +02:00
|
|
|
- else
|
|
|
|
- contents = tree.contents
|
2012-01-27 00:46:32 +01:00
|
|
|
%table#tree-slider
|
2011-11-01 21:11:24 +01:00
|
|
|
%thead
|
2011-10-08 23:36:38 +02:00
|
|
|
%th Name
|
|
|
|
%th Last Update
|
|
|
|
%th
|
|
|
|
Last commit
|
2012-01-17 23:04:27 +01:00
|
|
|
= link_to "History", tree.history_path, :class => "right"
|
2011-12-12 17:42:07 +01:00
|
|
|
|
2011-11-20 21:32:12 +01:00
|
|
|
- if tree.up_dir?
|
|
|
|
%tr{ :class => "tree-item", :url => tree.up_dir_path }
|
2011-10-08 23:36:38 +02:00
|
|
|
%td.tree-item-file-name
|
|
|
|
= image_tag "dir.png"
|
2011-11-20 21:32:12 +01:00
|
|
|
= link_to "..", tree.up_dir_path, :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|
|
2011-11-16 06:38:53 +01:00
|
|
|
= render :partial => "refs/tree_item", :locals => { :content => content }
|
2011-10-08 23:36:38 +02:00
|
|
|
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
|
2011-11-16 06:38:53 +01:00
|
|
|
= render :partial => "refs/tree_item", :locals => { :content => content }
|
2011-10-08 23:36:38 +02:00
|
|
|
|
2011-12-13 12:25:58 +01:00
|
|
|
- if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
|
2011-12-12 17:42:07 +01:00
|
|
|
#tree-readme-holder
|
|
|
|
%h3= content.name
|
|
|
|
.readme
|
2011-12-13 12:25:58 +01:00
|
|
|
- if content.name =~ /\.(md|markdown)$/i
|
2011-12-30 14:41:39 +01:00
|
|
|
= markdown(content.data)
|
2011-12-13 12:25:58 +01:00
|
|
|
- else
|
2011-12-30 14:41:39 +01:00
|
|
|
= simple_format(content.data)
|
2011-12-12 17:42:07 +01:00
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
:javascript
|
|
|
|
$(function(){
|
|
|
|
$('select#branch').selectmenu({style:'popup', width:200});
|
|
|
|
$('select#tag').selectmenu({style:'popup', width:200});
|
|
|
|
});
|
2011-12-20 07:49:14 +01:00
|
|
|
|
|
|
|
- if params[:path] && request.xhr?
|
|
|
|
:javascript
|
|
|
|
$(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;}});
|