diff options
author | gitlabhq <m@gitlabhq.com> | 2011-11-16 08:38:53 +0300 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-11-16 08:38:53 +0300 |
commit | af08ed6b66530b8efc68bf45e1f11599e333b826 (patch) | |
tree | 1db2fb4d69f60a7da99ec69e6bdcd1a9eb1fd183 /app/views/projects | |
parent | f294b8d4c3209689dde00326ca6270afa0b4843e (diff) | |
download | gitlab-ce-af08ed6b66530b8efc68bf45e1f11599e333b826.tar.gz |
refactoring
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/_tree.html.haml | 60 | ||||
-rw-r--r-- | app/views/projects/_tree_file.html.haml | 19 | ||||
-rw-r--r-- | app/views/projects/_tree_item.html.haml | 18 | ||||
-rw-r--r-- | app/views/projects/tree.html.erb | 5 |
4 files changed, 0 insertions, 102 deletions
diff --git a/app/views/projects/_tree.html.haml b/app/views/projects/_tree.html.haml deleted file mode 100644 index b7d4b327f5c..00000000000 --- a/app/views/projects/_tree.html.haml +++ /dev/null @@ -1,60 +0,0 @@ --#%a.right.button{:href => "#"} Download --#-if can? current_user, :admin_project, @project - %a.right.button.blue{:href => "#"} EDIT -#tree-breadcrumbs - %h2.icon - %span - %d - = link_to tree_project_path(@project, :path => nil, :commit_id => @commit.try(:id)), :remote => true do - = @project.name - - 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 - \/ - = 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 - - .right= render :partial => "projects/refs", :locals => { :destination => tree_project_path(@project) } -.clear - -#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 - %thead - %th Name - %th Last Update - %th - Last commit - = link_to "history", project_commits_path(@project, :path => params[:path], :branch => params[:branch],:tag => params[:tag]), :class => "right" - - 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" - = link_to "..", tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true - %td - %td - - - 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? - :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;}}); diff --git a/app/views/projects/_tree_file.html.haml b/app/views/projects/_tree_file.html.haml deleted file mode 100644 index b5b18213887..00000000000 --- a/app/views/projects/_tree_file.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -:css -.view_file - .view_file_header - %strong - = name - = link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank" - = link_to "history", project_commits_path(@project, :path => params[:path], :branch => params[:branch], :tag => params[:tag] ), :class => "right", :style => "margin-right:10px;" - %br/ - - if file.text? - .view_file_content - :erb - <%= raw file.colorize %> - - elsif file.image? - .view_file_content_image - %img{ :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} - - else - %p - %center No preview for this file type - diff --git a/app/views/projects/_tree_item.html.haml b/app/views/projects/_tree_item.html.haml deleted file mode 100644 index 1637202cbd3..00000000000 --- a/app/views/projects/_tree_item.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- file = params[:path] ? File.join(params[:path], content.name) : content.name -- content_commit = @project.repo.log(@commit.id, file, :max_count => 1).last -- return unless content_commit -%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) } - %td.tree-item-file-name - - if content.is_a?(Grit::Blob) - = image_tag "txt.png" - - else - = image_tag "dir.png" - = link_to truncate(content.name, :length => 40), tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true - %td - = time_ago_in_words(content_commit.committed_date) - ago - %td.commit - = link_to truncate(content_commit.safe_message, :length => 40), project_commit_path(@project, content_commit), :class => "tree-commit-link" - - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) - - if tm - = link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) diff --git a/app/views/projects/tree.html.erb b/app/views/projects/tree.html.erb deleted file mode 100644 index c29ed2f90d4..00000000000 --- a/app/views/projects/tree.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<div> - <div id="tree-holder"> - <%= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} %> - </div> -</div> |