2012-01-27 00:13:19 +02:00
|
|
|
%ul.breadcrumb
|
2012-01-29 21:30:03 +02:00
|
|
|
%li
|
2012-02-28 00:00:19 +02:00
|
|
|
%span.arrow
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do
|
2012-02-28 00:00:19 +02:00
|
|
|
= @project.name
|
2012-01-27 00:13:19 +02:00
|
|
|
- tree.breadcrumbs(6) do |link|
|
|
|
|
\/
|
|
|
|
%li= link
|
2011-11-01 22:11:24 +02:00
|
|
|
.clear
|
2012-01-29 21:30:03 +02:00
|
|
|
%div.tree_progress
|
2011-10-09 00:36:38 +03:00
|
|
|
#tree-content-holder
|
2011-11-20 22:32:12 +02:00
|
|
|
- if tree.is_blob?
|
2012-08-10 18:07:50 -04:00
|
|
|
= render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
|
2011-10-09 00:36:38 +03:00
|
|
|
- else
|
|
|
|
- contents = tree.contents
|
2012-09-03 21:53:16 +03:00
|
|
|
%table#tree-slider{class: "table_#{@hex_path}" }
|
2011-11-01 22:11:24 +02:00
|
|
|
%thead
|
2011-10-09 00:36:38 +03:00
|
|
|
%th Name
|
|
|
|
%th Last Update
|
|
|
|
%th
|
|
|
|
Last commit
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to "History", tree.history_path, class: "right"
|
2011-12-13 00:42:07 +08:00
|
|
|
|
2011-11-20 22:32:12 +02:00
|
|
|
- if tree.up_dir?
|
2012-08-10 18:07:50 -04:00
|
|
|
%tr{ class: "tree-item", url: tree.up_dir_path }
|
2011-10-09 00:36:38 +03:00
|
|
|
%td.tree-item-file-name
|
2012-03-12 23:52:10 +02:00
|
|
|
= image_tag "file_empty.png"
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to "..", tree.up_dir_path, remote: :true
|
2011-10-23 12:47:57 +05:30
|
|
|
%td
|
|
|
|
%td
|
2011-10-09 00:36:38 +03:00
|
|
|
|
2012-07-10 23:12:38 +03:00
|
|
|
- index = 0
|
2011-10-09 00:36:38 +03:00
|
|
|
- contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
|
2012-08-10 18:07:50 -04:00
|
|
|
= render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
|
2011-10-09 00:36:38 +03:00
|
|
|
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
|
2012-08-10 18:07:50 -04:00
|
|
|
= render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
|
2012-02-14 23:48:42 +02:00
|
|
|
- contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content|
|
2012-08-10 18:07:50 -04:00
|
|
|
= render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) }
|
2011-10-09 00:36:38 +03:00
|
|
|
|
2011-12-13 19:25:58 +08:00
|
|
|
- if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
|
2012-07-10 20:15:33 +03:00
|
|
|
.file_holder#README
|
|
|
|
.file_title
|
|
|
|
%i.icon-file
|
|
|
|
= content.name
|
|
|
|
.file_content.wiki
|
2012-09-05 16:52:49 -04:00
|
|
|
= raw GitHub::Markup.render(content.name, content.data)
|
2011-12-13 00:42:07 +08:00
|
|
|
|
2011-10-09 00:36:38 +03:00
|
|
|
:javascript
|
|
|
|
$(function(){
|
2012-07-10 22:52:38 +03:00
|
|
|
history.pushState({ path: this.path }, '', "#{@history_path}");
|
|
|
|
});
|
|
|
|
|
2012-09-11 05:35:16 -07:00
|
|
|
- unless tree.is_blob?
|
|
|
|
:javascript
|
|
|
|
// Load last commit log for each file in tree
|
|
|
|
$(window).load(function(){
|
|
|
|
ajaxGet('#{@logs_path}');
|
|
|
|
});
|
2012-01-29 21:30:03 +02:00
|
|
|
|
2011-12-20 08:49:14 +02: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;}});
|