Merge branch 'master' into simplify_controllers2

Conflicts:
	app/controllers/commits_controller.rb
	app/controllers/refs_controller.rb
This commit is contained in:
Cyril 2012-09-27 12:25:52 +02:00
commit e563e948bb
108 changed files with 1762 additions and 652 deletions

View file

@ -68,10 +68,22 @@
* Blame file
*/
&.blame {
table {
border:none;
box-shadow:none;
margin:0;
}
tr {
border-bottom: 1px solid #eee;
}
td {
&:first-child {
border-left:none;
}
&:last-child {
border-right:none;
}
background:#fff;
padding:5px;
}
.author,

View file

@ -53,7 +53,7 @@ ul.main_menu {
border-left: 0;
}
&.current {
&.active {
background-color:#D5D5D5;
border-right: 1px solid #BBB;
border-left: 1px solid #BBB;

View file

@ -2,7 +2,6 @@ class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :reject_blocked!
before_filter :set_current_user_for_mailer
before_filter :check_token_auth
before_filter :set_current_user_for_observers
before_filter :dev_tools if Rails.env == 'development'
@ -24,13 +23,6 @@ class ApplicationController < ActionController::Base
protected
def check_token_auth
# Redirect to login page if not atom feed
if params[:private_token].present? && params[:format] != 'atom'
redirect_to new_user_session_path
end
end
def reject_blocked!
if current_user && current_user.blocked
sign_out current_user
@ -103,7 +95,7 @@ class ApplicationController < ActionController::Base
end
def render_404
render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
render file: Rails.root.join("public", "404"), layout: false, status: "404"
end
def require_non_empty_project
@ -116,10 +108,6 @@ class ApplicationController < ActionController::Base
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
def render_full_content
@full_content = true
end
def dev_tools
Rack::MiniProfiler.authorize_request
end

View file

@ -0,0 +1,21 @@
# Controller for viewing a file's blame
class BlameController < ApplicationController
include ExtractsPath
layout "project"
before_filter :project
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :assign_ref_vars
def show
@repo = @project.repo
@blame = Grit::Blob.blame(@repo, @commit.id, @path)
end
end

View file

@ -0,0 +1,37 @@
# Controller for viewing a file's blame
class BlobController < ApplicationController
include ExtractsPath
include Gitlab::Encode
layout "project"
before_filter :project
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :assign_ref_vars
def show
if @tree.is_blob?
if @tree.text?
encoding = detect_encoding(@tree.data)
mime_type = encoding ? "text/plain; charset=#{encoding}" : "text/plain"
else
mime_type = @tree.mime_type
end
send_data(
@tree.data,
type: mime_type,
disposition: 'inline',
filename: @tree.name
)
else
not_found!
end
end
end

View file

@ -0,0 +1,36 @@
# Controller for a specific Commit
#
# Not to be confused with CommitsController, plural.
class CommitController < ApplicationController
before_filter :project
layout "project"
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
def show
result = CommitLoad.new(project, current_user, params).execute
@commit = result[:commit]
git_not_found! unless @commit
@suppress_diff = result[:suppress_diff]
@note = result[:note]
@line_notes = result[:line_notes]
@notes_count = result[:notes_count]
@comments_allowed = true
respond_to do |format|
format.html do
if result[:status] == :huge_commit
render "huge_commit" and return
end
end
format.patch
end
end
end

View file

@ -1,18 +1,18 @@
require "base64"
class CommitsController < ProjectController
include ExtractsPath
# Authorize
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :load_refs, only: :index # load @branch, @tag & @ref
before_filter :render_full_content
def index
@repo = project.repo
def show
@repo = @project.repo
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @project.commits(@ref, params[:path], @limit, @offset)
@commits = @project.commits(@ref, @path, @limit, @offset)
@commits = CommitDecorator.decorate(@commits)
respond_to do |format|
@ -21,54 +21,4 @@ class CommitsController < ProjectController
format.atom { render layout: false }
end
end
def show
result = CommitLoad.new(project, current_user, params).execute
@commit = result[:commit]
if @commit
@suppress_diff = result[:suppress_diff]
@note = result[:note]
@line_notes = result[:line_notes]
@notes_count = result[:notes_count]
@comments_allowed = true
else
return git_not_found!
end
if result[:status] == :huge_commit
render "huge_commit" and return
end
end
def compare
result = Commit.compare(project, params[:from], params[:to])
@commits = result[:commits]
@commit = result[:commit]
@diffs = result[:diffs]
@refs_are_same = result[:same]
@line_notes = []
@commits = CommitDecorator.decorate(@commits)
end
def patch
@commit = project.commit(params[:id])
send_data(
@commit.to_patch,
type: "text/plain",
disposition: 'attachment',
filename: "#{@commit.id}.patch"
)
end
protected
def load_refs
@ref ||= params[:ref].presence || params[:branch].presence || params[:tag].presence
@ref ||= @ref || @project.try(:default_branch) || 'master'
end
end

View file

@ -0,0 +1,29 @@
class CompareController < ApplicationController
before_filter :project
layout "project"
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
def index
end
def show
result = Commit.compare(project, params[:from], params[:to])
@commits = result[:commits]
@commit = result[:commit]
@diffs = result[:diffs]
@refs_are_same = result[:same]
@line_notes = []
@commits = CommitDecorator.decorate(@commits)
end
def create
redirect_to project_compare_path(@project, params[:from], params[:to])
end
end

View file

@ -4,7 +4,6 @@ class ProtectedBranchesController < ProjectController
before_filter :require_non_empty_project
before_filter :authorize_admin_project!, only: [:destroy, :create]
before_filter :render_full_content
def index
@branches = @project.protected_branches.all

View file

@ -1,5 +1,3 @@
require 'github/markup'
class RefsController < ProjectController
include Gitlab::Encode
@ -9,21 +7,20 @@ class RefsController < ProjectController
before_filter :require_non_empty_project
before_filter :ref
before_filter :define_tree_vars, only: [:tree, :blob, :blame, :logs_tree]
before_filter :render_full_content
before_filter :define_tree_vars, only: [:blob, :logs_tree]
def switch
respond_to do |format|
format.html do
new_path = if params[:destination] == "tree"
tree_project_ref_path(@project, params[:ref])
project_tree_path(@project, @ref)
else
project_commits_path(@project, ref: params[:ref])
project_commits_path(@project, @ref)
end
redirect_to new_path
redirect_to new_path
end
format.js do
format.js do
@ref = params[:ref]
define_tree_vars
render "tree"
@ -31,19 +28,6 @@ class RefsController < ProjectController
end
end
#
# Repository preview
#
def tree
respond_to do |format|
format.html
format.js do
# disable cache to allow back button works
no_cache_headers
end
end
end
def logs_tree
contents = @tree.contents
@logs = contents.map do |content|
@ -51,36 +35,12 @@ class RefsController < ProjectController
last_commit = @project.commits(@commit.id, file, 1).last
last_commit = CommitDecorator.decorate(last_commit)
{
file_name: content.name,
file_name: content.name,
commit: last_commit
}
end
end
def blob
if @tree.is_blob?
if @tree.text?
encoding = detect_encoding(@tree.data)
mime_type = encoding ? "text/plain; charset=#{encoding}" : "text/plain"
else
mime_type = @tree.mime_type
end
send_data(
@tree.data,
type: mime_type,
disposition: 'inline',
filename: @tree.name
)
else
head(404)
end
end
def blame
@blame = Grit::Blob.blame(@repo, @commit.id, params[:path])
end
protected
def define_tree_vars
@ -91,20 +51,20 @@ class RefsController < ProjectController
@commit = CommitDecorator.decorate(@commit)
@tree = Tree.new(@commit.tree, project, @ref, params[:path])
@tree = TreeDecorator.new(@tree)
@hex_path = Digest::SHA1.hexdigest(params[:path] || "/")
@hex_path = Digest::SHA1.hexdigest(params[:path] || "")
if params[:path]
@history_path = tree_file_project_ref_path(@project, @ref, params[:path])
@logs_path = logs_file_project_ref_path(@project, @ref, params[:path])
@history_path = project_tree_path(@project, File.join(@ref, params[:path]))
@logs_path = logs_file_project_ref_path(@project, @ref, params[:path])
else
@history_path = tree_project_ref_path(@project, @ref)
@logs_path = logs_tree_project_ref_path(@project, @ref)
@history_path = project_tree_path(@project, @ref)
@logs_path = logs_tree_project_ref_path(@project, @ref)
end
rescue
return render_404
end
def ref
@ref = params[:id]
@ref = params[:id] || params[:ref]
end
end

View file

@ -3,18 +3,17 @@ class RepositoriesController < ProjectController
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :render_full_content
def show
@activities = @project.commits_with_refs(20)
end
def branches
@branches = @project.repo.heads.sort_by(&:name)
@branches = @project.branches
end
def tags
@tags = @project.repo.tags.sort_by(&:name).reverse
@tags = @project.tags
end
def archive

View file

@ -50,7 +50,6 @@ class SnippetsController < ProjectController
def show
@note = @project.notes.new(noteable: @snippet)
render_full_content
end
def destroy

View file

@ -0,0 +1,29 @@
# Controller for viewing a repository's file structure
class TreeController < ApplicationController
include ExtractsPath
layout "project"
before_filter :project
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :assign_ref_vars
def show
@hex_path = Digest::SHA1.hexdigest(@path)
@history_path = project_tree_path(@project, @id)
@logs_path = logs_file_project_ref_path(@project, @ref, @path)
respond_to do |format|
format.html
# Disable cache so browser history works
format.js { no_cache_headers }
end
end
end

View file

@ -21,7 +21,7 @@ class EventDecorator < ApplicationDecorator
elsif self.merge_request?
h.project_merge_request_url(self.project, self.merge_request)
elsif self.push?
h.project_commits_url(self.project, ref: self.ref_name)
h.project_commits_url(self.project, self.ref_name)
end
end
end

View file

@ -6,7 +6,7 @@ class TreeDecorator < ApplicationDecorator
part_path = ""
parts = path.split("\/")
#parts = parts[0...-1] if is_blob?
#parts = parts[0...-1] if is_blob?
yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links
@ -15,29 +15,29 @@ class TreeDecorator < ApplicationDecorator
part_path = part if part_path.empty?
next unless parts.last(2).include?(part) if parts.count > max_links
yield(h.link_to(h.truncate(part, length: 40), h.tree_file_project_ref_path(project, ref, path: part_path), remote: :true))
yield(h.link_to(h.truncate(part, length: 40), h.project_tree_path(project, h.tree_join(ref, part_path)), remote: :true))
end
end
end
def up_dir?
!!path
path.present?
end
def up_dir_path
file = File.join(path, "..")
h.tree_file_project_ref_path(project, ref, file)
h.project_tree_path(project, h.tree_join(ref, file))
end
def history_path
h.project_commits_path(project, path: path, ref: ref)
h.project_commits_path(project, h.tree_join(ref, path))
end
def mb_size
size = (tree.size / 1024)
if size < 1024
"#{size} KB"
else
"#{size} KB"
else
"#{size/1024} MB"
end
end

View file

@ -1,6 +1,35 @@
require 'digest/md5'
module ApplicationHelper
# Check if a particular controller is the current one
#
# args - One or more controller names to check
#
# Examples
#
# # On TreeController
# current_controller?(:tree) # => true
# current_controller?(:commits) # => false
# current_controller?(:commits, :tree) # => true
def current_controller?(*args)
args.any? { |v| v.to_s.downcase == controller.controller_name }
end
# Check if a partcular action is the current one
#
# args - One or more action names to check
#
# Examples
#
# # On Projects#new
# current_action?(:new) # => true
# current_action?(:create) # => false
# current_action?(:new, :create) # => true
def current_action?(*args)
args.any? { |v| v.to_s.downcase == action_name }
end
def gravatar_icon(user_email = '', size = 40)
if Gitlab.config.disable_gravatar? || user_email.blank?
'no_avatar.png'
@ -31,8 +60,8 @@ module ApplicationHelper
def grouped_options_refs(destination = :tree)
options = [
["Branch", @project.repo.heads.map(&:name) ],
[ "Tag", @project.tags ]
["Branch", @project.branch_names ],
[ "Tag", @project.tag_names ]
]
# If reference is commit id -
@ -58,11 +87,11 @@ module ApplicationHelper
if @project && !@project.new_record?
project_nav = [
{ label: "#{@project.name} / Issues", url: project_issues_path(@project) },
{ label: "#{@project.name} / Wall", url: wall_project_path(@project) },
{ label: "#{@project.name} / Tree", url: tree_project_ref_path(@project, @project.root_ref) },
{ label: "#{@project.name} / Commits", url: project_commits_path(@project) },
{ label: "#{@project.name} / Team", url: project_team_index_path(@project) }
{ label: "#{@project.name} / Issues", url: project_issues_path(@project) },
{ label: "#{@project.name} / Wall", url: wall_project_path(@project) },
{ label: "#{@project.name} / Tree", url: project_tree_path(@project, @ref || @project.root_ref) },
{ label: "#{@project.name} / Commits", url: project_commits_path(@project, @ref || @project.root_ref) },
{ label: "#{@project.name} / Team", url: project_team_index_path(@project) }
]
end
@ -85,45 +114,6 @@ module ApplicationHelper
event.project.merge_requests_enabled
end
def tab_class(tab_key)
active = case tab_key
# Project Area
when :wall; wall_tab?
when :wiki; controller.controller_name == "wikis"
when :issues; issues_tab?
when :network; current_page?(controller: "projects", action: "graph", id: @project)
when :merge_requests; controller.controller_name == "merge_requests"
# Dashboard Area
when :help; controller.controller_name == "help"
when :search; current_page?(search_path)
when :dash_issues; current_page?(dashboard_issues_path)
when :dash_mr; current_page?(dashboard_merge_requests_path)
when :root; current_page?(dashboard_path) || current_page?(root_path)
# Profile Area
when :profile; current_page?(controller: "profile", action: :show)
when :history; current_page?(controller: "profile", action: :history)
when :account; current_page?(controller: "profile", action: :account)
when :token; current_page?(controller: "profile", action: :token)
when :design; current_page?(controller: "profile", action: :design)
when :ssh_keys; controller.controller_name == "keys"
# Admin Area
when :admin_root; controller.controller_name == "dashboard"
when :admin_users; controller.controller_name == 'users'
when :admin_projects; controller.controller_name == "projects"
when :admin_hooks; controller.controller_name == 'hooks'
when :admin_resque; controller.controller_name == 'resque'
when :admin_logs; controller.controller_name == 'logs'
else
false
end
active ? "current" : nil
end
def hexdigest(string)
Digest::SHA1.hexdigest string
end

View file

@ -1,35 +1,85 @@
module TabHelper
def issues_tab?
controller.controller_name == "issues" || controller.controller_name == "milestones"
end
# Navigation link helper
#
# Returns an `li` element with an 'active' class if the supplied
# controller(s) and/or action(s) currently active. The contents of the
# element is the value passed to the block.
#
# options - The options hash used to determine if the element is "active" (default: {})
# :controller - One or more controller names to check (optional).
# :action - One or more action names to check (optional).
# :path - A shorthand path, such as 'dashboard#index', to check (optional).
# :html_options - Extra options to be passed to the list element (optional).
# block - An optional block that will become the contents of the returned
# `li` element.
#
# When both :controller and :action are specified, BOTH must match in order
# to be marked as active. When only one is given, either can match.
#
# Examples
#
# # Assuming we're on TreeController#show
#
# # Controller matches, but action doesn't
# nav_link(controller: [:tree, :refs], action: :edit) { "Hello" }
# # => '<li>Hello</li>'
#
# # Controller matches
# nav_link(controller: [:tree, :refs]) { "Hello" }
# # => '<li class="active">Hello</li>'
#
# # Shorthand path
# nav_link(path: 'tree#show') { "Hello" }
# # => '<li class="active">Hello</li>'
#
# # Supplying custom options for the list element
# nav_link(controller: :tree, html_options: {class: 'home'}) { "Hello" }
# # => '<li class="home active">Hello</li>'
#
# Returns a list item element String
def nav_link(options = {}, &block)
if path = options.delete(:path)
c, a, _ = path.split('#')
else
c = options.delete(:controller)
a = options.delete(:action)
end
def wall_tab?
current_page?(controller: "projects", action: "wall", id: @project)
if c && a
# When given both options, make sure BOTH are active
klass = current_controller?(*c) && current_action?(*a) ? 'active' : ''
else
# Otherwise check EITHER option
klass = current_controller?(*c) || current_action?(*a) ? 'active' : ''
end
# Add our custom class into the html_options, which may or may not exist
# and which may or may not already have a :class key
o = options.delete(:html_options) || {}
o[:class] ||= ''
o[:class] += ' ' + klass
o[:class].strip!
if block_given?
content_tag(:li, capture(&block), o)
else
content_tag(:li, nil, o)
end
end
def project_tab_class
[:show, :files, :edit, :update].each do |action|
return "current" if current_page?(controller: "projects", action: action, id: @project)
return "active" if current_page?(controller: "projects", action: action, id: @project)
end
if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
"current"
end
end
def tree_tab_class
controller.controller_name == "refs" ? "current" : nil
end
def commit_tab_class
if ['commits', 'repositories', 'protected_branches'].include? controller.controller_name
"current"
"active"
end
end
def branches_tab_class
if current_page?(branches_project_repository_path(@project)) ||
controller.controller_name == "protected_branches" ||
current_controller?(:protected_branches) ||
current_page?(project_repository_path(@project))
'active'
end

View file

@ -39,4 +39,9 @@ module TreeHelper
def gitlab_markdown?(filename)
filename.end_with?(*%w(.mdown .md .markdown))
end
# Simple shortcut to File.join
def tree_join(*args)
File.join(*args)
end
end

View file

@ -1,4 +1,4 @@
require File.join(Rails.root, "app/models/commit")
require Rails.root.join("app/models/commit")
class MergeRequest < ActiveRecord::Base
include IssueCommonality

View file

@ -1,5 +1,5 @@
class Tree
include Linguist::BlobHelper
include Linguist::BlobHelper
attr_accessor :path, :tree, :project, :ref
delegate :contents,
@ -14,8 +14,8 @@ class Tree
to: :tree
def initialize(raw_tree, project, ref = nil, path = nil)
@project, @ref, @path = project, ref, path,
@tree = if path
@project, @ref, @path = project, ref, path
@tree = if path.present?
raw_tree / path.dup.force_encoding('ascii-8bit')
else
raw_tree
@ -26,6 +26,10 @@ class Tree
tree.is_a?(Grit::Blob)
end
def invalid?
tree.nil?
end
def empty?
data.blank?
end

View file

@ -45,8 +45,29 @@ module Repository
File.exists?(hook_file)
end
# Returns an Array of branch names
def branch_names
repo.branches.collect(&:name).sort
end
# Returns an Array of Branches
def branches
repo.branches.sort_by(&:name)
end
# Returns an Array of tag names
def tag_names
repo.tags.collect(&:name).sort.reverse
end
# Returns an Array of Tags
def tags
repo.tags.map(&:name).sort.reverse
repo.tags.sort_by(&:name).reverse
end
# Returns an Array of branch and tag names
def ref_names
[branch_names + tag_names].flatten
end
def repo
@ -79,14 +100,6 @@ module Repository
@heads ||= repo.heads
end
def branches_names
heads.map(&:name)
end
def ref_names
[branches_names + tags].flatten
end
def tree(fcommit, path = nil)
fcommit = commit if fcommit == :head
tree = fcommit.tree
@ -109,14 +122,12 @@ module Repository
# - If two or more branches are present, returns the one that has a name
# matching root_ref (default_branch or 'master' if default_branch is nil)
def discover_default_branch
branches = heads.collect(&:name)
if branches.length == 0
if branch_names.length == 0
nil
elsif branches.length == 1
branches.first
elsif branch_names.length == 1
branch_names.first
else
branches.select { |v| v == root_ref }.first
branch_names.select { |v| v == root_ref }.first
end
end
@ -144,7 +155,7 @@ module Repository
# Build file path
file_name = self.code + "-" + commit.id.to_s + ".tar.gz"
storage_path = File.join(Rails.root, "tmp", "repositories", self.code)
storage_path = Rails.root.join("tmp", "repositories", self.code)
file_path = File.join(storage_path, file_name)
# Put files into a directory before archiving

View file

@ -25,6 +25,10 @@ module StaticModel
id
end
def new_record?
false
end
def persisted?
false
end

View file

@ -1,9 +1,8 @@
%ul.nav.nav-tabs
%li
= render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: params[:path]}
%li{class: "#{'active' if (controller.controller_name == "refs") }"}
= link_to tree_project_ref_path(@project, @ref) do
Source
= nav_link(controller: :refs) do
= link_to 'Source', project_tree_path(@project, @ref)
%li.right
.input-prepend.project_clone_holder
%button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH

View file

@ -4,7 +4,7 @@
%ul.breadcrumb
%li
%span.arrow
= link_to tree_project_ref_path(@project, @ref, path: nil) do
= link_to project_tree_path(@project, @ref) do
= @project.name
- @tree.breadcrumbs(6) do |link|
\/
@ -18,9 +18,9 @@
= @tree.name
%small blame
%span.options
= link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
= link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small"
= link_to "source", tree_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
= link_to "raw", project_blob_path(@project, @id), class: "btn very_small", target: "_blank"
= link_to "history", project_commits_path(@project, @id), class: "btn very_small"
= link_to "source", project_tree_path(@project, @id), class: "btn very_small"
.file_content.blame
%table
- @blame.each do |commit, lines|
@ -32,8 +32,8 @@
= commit.author_name
%td.blame_commit
&nbsp;
%code= link_to commit.short_id, project_commit_path(@project, id: commit.id)
= link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding"
%code= link_to commit.short_id, project_commit_path(@project, commit)
= link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, commit), class: "row_title" rescue "--broken encoding"
%td.lines
= preserve do
%pre

View file

@ -0,0 +1,10 @@
= render "commits/commit_box"
= render "commits/diffs", diffs: @commit.diffs
= render "notes/notes_with_form", tid: @commit.id, tt: "commit"
= render "notes/per_line_form"
:javascript
$(function(){
PerLineNotes.init();
});

View file

@ -0,0 +1 @@
<%= @commit.to_patch %>

View file

@ -1,16 +1,15 @@
%li.commit
.browse_code_link_holder
%p
%strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right"
%strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right"
%p
= link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id"
= link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
%strong.commit-author-name= commit.author_name
%span.dash &ndash;
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
= link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
= link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, commit.id), class: "row_title"
%span.committed_ago
= time_ago_in_words(commit.committed_date)
ago
&nbsp;

View file

@ -5,10 +5,10 @@
%span.btn.disabled.grouped
%i.icon-comment
= @notes_count
= link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do
= link_to project_commit_path(@project, @commit, format: :patch), class: "btn small grouped" do
%i.icon-download-alt
Get Patch
= link_to tree_project_ref_path(@project, @commit.id), class: "browse-button primary grouped" do
= link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do
%strong Browse Code »
%h3.commit-title.page_title
= gfm escape_once(@commit.title)

View file

@ -5,7 +5,7 @@
%p To prevent performance issue we rejected diff information.
%p
But if you still want to see diff
= link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark"
= link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "dark"
%p.cgray
Showing #{pluralize(diffs.count, "changed file")}
@ -24,7 +24,7 @@
%i.icon-file
%span{id: "#{diff.old_path}"}= diff.old_path
- else
= link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
= link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)) do
%i.icon-file
%span{id: "#{diff.new_path}"}= diff.new_path
%br/

View file

@ -1,23 +1,23 @@
%ul.nav.nav-tabs
%li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}
%li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
= link_to project_commits_path(@project) do
Commits
%li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
= link_to compare_project_commits_path(@project) do
Compare
%li{class: "#{branches_tab_class}"}
= nav_link(controller: [:commit, :commits]) do
= link_to 'Commits', project_commits_path(@project, @project.root_ref)
= nav_link(controller: :compare) do
= link_to 'Compare', project_compare_index_path(@project)
= nav_link(html_options: {class: branches_tab_class}) do
= link_to project_repository_path(@project) do
Branches
%span.badge= @project.repo.branch_count
%li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
= nav_link(controller: :repositories, action: :tags) do
= link_to tags_project_repository_path(@project) do
Tags
%span.badge= @project.repo.tag_count
- if current_page?(project_commits_path(@project)) && current_user.private_token
- if current_controller?(:commits) && current_user.private_token
%li.right
%span.rss-icon
= link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do
= link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
= image_tag "rss_ui.png", title: "feed"

View file

@ -1,24 +0,0 @@
= render "head"
- if params[:path]
%ul.breadcrumb
%li
%span.arrow
= link_to project_commits_path(@project) do
= @project.name
%span.divider
\/
%li
%a{href: "#"}= params[:path].split("/").join(" / ")
%div{id: dom_id(@project)}
#commits_list= render "commits"
.clear
.loading{ style: "display:none;"}
- if @commits.count == @limit
:javascript
$(function(){
CommitsList.init("#{@ref}", #{@limit});
});

View file

@ -1,8 +1,8 @@
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "Recent commits to #{@project.name}:#{@ref}"
xml.link :href => project_commits_url(@project, :atom, :ref => @ref), :rel => "self", :type => "application/atom+xml"
xml.link :href => project_commits_url(@project), :rel => "alternate", :type => "text/html"
xml.link :href => project_commits_url(@project, @ref, format: :atom), :rel => "self", :type => "application/atom+xml"
xml.link :href => project_commits_url(@project, @ref), :rel => "alternate", :type => "text/html"
xml.id project_commits_url(@project)
xml.updated @commits.first.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ") if @commits.any?

View file

@ -1,10 +1,24 @@
= render "commits/commit_box"
= render "commits/diffs", diffs: @commit.diffs
= render "notes/notes_with_form", tid: @commit.id, tt: "commit"
= render "notes/per_line_form"
= render "head"
- if @path.present?
%ul.breadcrumb
%li
%span.arrow
= link_to project_commits_path(@project) do
= @project.name
%span.divider
\/
%li
%a{href: "#"}= @path.split("/").join(" / ")
%div{id: dom_id(@project)}
#commits_list= render "commits"
.clear
.loading{ style: "display:none;"}
- if @commits.count == @limit
:javascript
$(function(){
CommitsList.init("#{@ref}", #{@limit});
});
:javascript
$(function(){
PerLineNotes.init();
});

View file

@ -1,9 +1,3 @@
= render "head"
%h3.page_title
Compare View
%hr
%div
%p.slead
Fill input field with commit id like
@ -14,7 +8,7 @@
%br
= form_tag compare_project_commits_path(@project), method: :get do
= form_tag project_compare_index_path(@project), method: :post do
.clearfix
= text_field_tag :from, params[:from], placeholder: "master", class: "xlarge"
= "..."
@ -25,29 +19,14 @@
.actions
= submit_tag "Compare", class: "btn primary wide commits-compare-btn"
- if @commits.present?
%div.ui-box
%h5.small Commits (#{@commits.count})
%ul.unstyled= render @commits
- unless @diffs.empty?
%h4 Diff
= render "commits/diffs", diffs: @diffs
:javascript
$(function() {
var availableTags = #{@project.ref_names.to_json};
$("#from").autocomplete({
source: availableTags,
minLength: 1
});
$("#to").autocomplete({
$("#from, #to").autocomplete({
source: availableTags,
minLength: 1
});
disableButtonIfEmptyField('#to', '.commits-compare-btn');
});

View file

@ -0,0 +1,7 @@
= render "commits/head"
%h3.page_title
Compare View
%hr
= render "form"

View file

@ -0,0 +1,16 @@
= render "commits/head"
%h3.page_title
Compare View
%hr
= render "form"
- if @commits.present?
%div.ui-box
%h5.small Commits (#{@commits.count})
%ul.unstyled= render @commits
- unless @diffs.empty?
%h4 Diff
= render "commits/diffs", diffs: @diffs

View file

@ -1,7 +1,7 @@
- commit = CommitDecorator.decorate(commit)
%li.commit
%p
= link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
= link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"
%span= commit.author_name
&ndash;
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16

View file

@ -4,7 +4,7 @@
= image_tag gravatar_icon(event.author_email), class: "avatar"
%span You pushed to
= event.ref_type
= link_to project_commits_path(event.project, ref: event.ref_name) do
= link_to project_commits_path(event.project, event.ref_name) do
%strong= truncate(event.ref_name, length: 28)
at
%strong= link_to event.project.name, event.project

View file

@ -5,7 +5,7 @@
.event-title
%strong.author_name #{event.author_name}
%span.event_label.pushed #{event.push_action_name} #{event.ref_type}
= link_to project_commits_path(event.project, ref: event.ref_name) do
= link_to project_commits_path(event.project, event.ref_name) do
%strong= event.ref_name
at
%strong= link_to event.project.name, event.project
@ -21,6 +21,6 @@
%li.commits-stat
- if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits.
= link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
= link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
%strong Compare &rarr; #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
.clearfix

View file

@ -1,13 +1,10 @@
%ul.nav.nav-tabs
%li{class: "#{'active' if current_page?(project_issues_path(@project))}"}
= link_to project_issues_path(@project), class: "tab" do
Browse Issues
%li{class: "#{'active' if current_page?(project_milestones_path(@project))}"}
= link_to project_milestones_path(@project), class: "tab" do
Milestones
%li{class: "#{'active' if current_page?(project_labels_path(@project))}"}
= link_to project_labels_path(@project), class: "tab" do
Labels
= nav_link(controller: :issues) do
= link_to 'Browse Issues', project_issues_path(@project), class: "tab"
= nav_link(controller: :milestones) do
= link_to 'Milestones', project_milestones_path(@project), class: "tab"
= nav_link(controller: :labels) do
= link_to 'Labels', project_labels_path(@project), class: "tab"
%li.right
%span.rss-icon
= link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do

View file

@ -1,19 +0,0 @@
%ul.main_menu
%li.home{class: tab_class(:root)}
= link_to "Home", root_path, title: "Home"
%li{class: tab_class(:dash_issues)}
= link_to dashboard_issues_path do
Issues
%span.count= current_user.assigned_issues.opened.count
%li{class: tab_class(:dash_mr)}
= link_to dashboard_merge_requests_path do
Merge Requests
%span.count= current_user.cared_merge_requests.count
%li{class: tab_class(:search)}
= link_to "Search", search_path
%li{class: tab_class(:help)}
= link_to "Help", help_path

View file

@ -10,8 +10,8 @@
- if controller_name == 'projects' && action_name == 'index'
= auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- if @project && !@project.new_record?
- if current_page?(tree_project_ref_path(@project, @project.root_ref)) || current_page?(project_commits_path(@project))
= auto_discovery_link_tag(:atom, project_commits_url(@project, :atom, ref: @ref, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- if request.path == project_issues_path(@project)
- if current_controller?(:tree, :commits)
= auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- if current_controller?(:issues)
= auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
= csrf_meta_tags

View file

@ -1,37 +0,0 @@
%ul.main_menu
%li.home{class: project_tab_class}
= link_to @project.code, project_path(@project), title: "Project"
- if @project.repo_exists?
- if can? current_user, :download_code, @project
%li{class: tree_tab_class}
= link_to tree_project_ref_path(@project, @project.root_ref) do
Files
%li{class: commit_tab_class}
= link_to "Commits", project_commits_path(@project)
%li{class: tab_class(:network)}
= link_to "Network", graph_project_path(@project)
- if @project.issues_enabled
%li{class: tab_class(:issues)}
= link_to project_issues_filter_path(@project) do
Issues
%span.count.issue_counter= @project.issues.opened.count
- if @project.repo_exists?
- if @project.merge_requests_enabled
%li{class: tab_class(:merge_requests)}
= link_to project_merge_requests_path(@project) do
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wall_enabled
%li{class: tab_class(:wall)}
= link_to wall_project_path(@project) do
Wall
- if @project.wiki_enabled
%li{class: tab_class(:wiki)}
= link_to project_wiki_path(@project, :index) do
Wiki

View file

@ -6,17 +6,17 @@
= render "layouts/head_panel", title: "Admin area"
.container
%ul.main_menu
%li.home{class: tab_class(:admin_root)}
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to "Stats", admin_root_path
%li{class: tab_class(:admin_projects)}
= nav_link(controller: :projects) do
= link_to "Projects", admin_projects_path
%li{class: tab_class(:admin_users)}
= nav_link(controller: :users) do
= link_to "Users", admin_users_path
%li{class: tab_class(:admin_logs)}
= nav_link(controller: :logs) do
= link_to "Logs", admin_logs_path
%li{class: tab_class(:admin_hooks)}
= nav_link(controller: :hooks) do
= link_to "Hooks", admin_hooks_path
%li{class: tab_class(:admin_resque)}
= nav_link(controller: :resque) do
= link_to "Resque", admin_resque_path
.content= yield

View file

@ -5,6 +5,20 @@
= render "layouts/flash"
= render "layouts/head_panel", title: "Dashboard"
.container
= render partial: "layouts/app_menu"
.content
= yield
%ul.main_menu
= nav_link(path: 'dashboard#index', html_options: {class: 'home'}) do
= link_to "Home", root_path, title: "Home"
= nav_link(path: 'dashboard#issues') do
= link_to dashboard_issues_path do
Issues
%span.count= current_user.assigned_issues.opened.count
= nav_link(path: 'dashboard#merge_requests') do
= link_to dashboard_merge_requests_path do
Merge Requests
%span.count= current_user.cared_merge_requests.count
= nav_link(path: 'search#show') do
= link_to "Search", search_path
= nav_link(path: 'help#index') do
= link_to "Help", help_path
.content= yield

View file

@ -6,23 +6,17 @@
= render "layouts/head_panel", title: "Profile"
.container
%ul.main_menu
%li.home{class: tab_class(:profile)}
= nav_link(path: 'profile#show', html_options: {class: 'home'}) do
= link_to "Profile", profile_path
%li{class: tab_class(:account)}
= nav_link(path: 'profile#account') do
= link_to "Account", profile_account_path
%li{class: tab_class(:ssh_keys)}
= nav_link(controller: :keys) do
= link_to keys_path do
SSH Keys
%span.count= current_user.keys.count
%li{class: tab_class(:design)}
= nav_link(path: 'profile#design') do
= link_to "Design", profile_design_path
%li{class: tab_class(:history)}
= nav_link(path: 'profile#history') do
= link_to "History", profile_history_path
.content
= yield
.content= yield

View file

@ -5,7 +5,37 @@
= render "layouts/flash"
= render "layouts/head_panel", title: @project.name
.container
= render partial: "layouts/project_menu"
.content
= yield
%ul.main_menu
= nav_link(html_options: {class: "home #{project_tab_class}"}) do
= link_to @project.code, project_path(@project), title: "Project"
- if @project.repo_exists?
- if can? current_user, :download_code, @project
= nav_link(controller: %w(tree blob blame)) do
= link_to 'Files', project_tree_path(@project, @ref || @project.root_ref)
= nav_link(controller: %w(commit commits compare repositories protected_branches)) do
= link_to "Commits", project_commits_path(@project, @ref || @project.root_ref)
= nav_link(path: 'projects#graph') do
= link_to "Network", graph_project_path(@project)
- if @project.issues_enabled
= nav_link(controller: %w(issues milestones labels)) do
= link_to project_issues_filter_path(@project) do
Issues
%span.count.issue_counter= @project.issues.opened.count
- if @project.repo_exists? && @project.merge_requests_enabled
= nav_link(controller: :merge_requests) do
= link_to project_merge_requests_path(@project) do
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wall_enabled
= nav_link(path: 'projects#wall') do
= link_to 'Wall', wall_project_path(@project)
- if @project.wiki_enabled
= nav_link(controller: :wikis) do
= link_to 'Wiki', project_wiki_path(@project, :index)
.content= yield

View file

@ -1,29 +1,27 @@
%ul.nav.nav-tabs
%li{ class: "#{'active' if current_page?(project_path(@project)) }" }
= nav_link(path: 'projects#show') do
= link_to project_path(@project), class: "activities-tab tab" do
%i.icon-home
Show
%li{ class: " #{'active' if (controller.controller_name == "team_members") || current_page?(project_team_index_path(@project)) }" }
= nav_link(controller: :team_members) do
= link_to project_team_index_path(@project), class: "team-tab tab" do
%i.icon-user
Team
%li{ class: "#{'active' if current_page?(files_project_path(@project)) }" }
= link_to files_project_path(@project), class: "files-tab tab " do
Attachments
%li{ class: " #{'active' if (controller.controller_name == "snippets") }" }
= link_to project_snippets_path(@project), class: "snippets-tab tab" do
Snippets
= nav_link(path: 'projects#files') do
= link_to 'Attachments', files_project_path(@project), class: "files-tab tab"
= nav_link(controller: :snippets) do
= link_to 'Snippets', project_snippets_path(@project), class: "snippets-tab tab"
- if can? current_user, :admin_project, @project
%li.right{class: "#{'active' if controller.controller_name == "deploy_keys"}"}
= nav_link(controller: :deploy_keys, html_options: {class: 'right'}) do
= link_to project_deploy_keys_path(@project) do
%span
Deploy Keys
%li.right{class: "#{'active' if controller.controller_name == "hooks" }"}
= nav_link(controller: :hooks, html_options: {class: 'right'}) do
= link_to project_hooks_path(@project) do
%span
Hooks
%li.right{ class: "#{'active' if current_page?(edit_project_path(@project)) }" }
= nav_link(path: 'projects#edit', html_options: {class: 'right'}) do
= link_to edit_project_path(@project), class: "stat-tab tab " do
%i.icon-edit
Edit

View file

@ -34,7 +34,7 @@
- @branches.each do |branch|
%tr
%td
= link_to project_commits_path(@project, ref: branch.name) do
= link_to project_commits_path(@project, branch.name) do
%strong= branch.name
- if branch.name == @project.root_ref
%span.label default

View file

@ -6,4 +6,4 @@
:plain
var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago');
row.find("td.tree_commit").html('#{escape_javascript(render("tree_commit", tm: tm, content_commit: content_commit))}');
row.find("td.tree_commit").html('#{escape_javascript(render("tree/tree_commit", tm: tm, content_commit: content_commit))}');

View file

@ -1,7 +0,0 @@
= render "head"
#tree-holder= render partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}
:javascript
$(function() {
Tree.init();
});

View file

@ -2,12 +2,12 @@
- commit = CommitDecorator.decorate(commit)
%tr
%td
= link_to project_commits_path(@project, ref: branch.name) do
= link_to project_commits_path(@project, branch.name) do
%strong= truncate(branch.name, length: 60)
- if branch.name == @project.root_ref
%span.label default
%td
= link_to project_commit_path(@project, id: commit.id) do
= link_to project_commit_path(@project, commit) do
%code= commit.short_id
= image_tag gravatar_icon(commit.author_email), class: "", width: 16

View file

@ -1,11 +1,8 @@
= render "commits/head"
%ul.nav.nav-pills
%li{class: ("active" if current_page?(project_repository_path(@project)))}
= link_to project_repository_path(@project) do
Recent
%li{class: ("active" if current_page?(project_protected_branches_path(@project)))}
= link_to project_protected_branches_path(@project) do
Protected
%li{class: ("active" if current_page?(branches_project_repository_path(@project)))}
= link_to branches_project_repository_path(@project) do
All
= nav_link(path: 'repositories#show') do
= link_to 'Recent', project_repository_path(@project)
= nav_link(path: 'protected_branches#index') do
= link_to 'Protected', project_protected_branches_path(@project)
= nav_link(path: 'repositories#branches') do
= link_to 'All', branches_project_repository_path(@project)

View file

@ -2,7 +2,7 @@
- commit = CommitDecorator.new(commit)
%tr
%td
= link_to project_commits_path(@project, ref: commit.head.name) do
= link_to project_commits_path(@project, commit.head.name) do
%strong
= commit.head.name
- if commit.head.name == @project.root_ref

View file

@ -12,7 +12,7 @@
- commit = CommitDecorator.decorate(commit)
%tr
%td
%strong= link_to tag.name, project_commits_path(@project, ref: tag.name), class: ""
%strong= link_to tag.name, project_commits_path(@project, tag.name), class: ""
%td
= link_to project_commit_path(@project, commit.id) do
%code= commit.short_id

View file

@ -1,5 +1,5 @@
= form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do
= select_tag "ref", grouped_options_refs, class: "project-refs-select chosen"
= hidden_field_tag :destination, destination
- if respond_to?(:path)
- if defined?(path)
= hidden_field_tag :path, path

View file

@ -0,0 +1,10 @@
%ul.nav.nav-tabs
%li
= render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: @path}
= nav_link(controller: :tree) do
= link_to 'Source', project_tree_path(@project, @ref)
%li.right
.input-prepend.project_clone_holder
%button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH
%button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP
= text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"

View file

@ -1,7 +1,7 @@
%ul.breadcrumb
%li
%span.arrow
= link_to tree_project_ref_path(@project, @ref, path: nil), remote: true do
= link_to project_tree_path(@project, @ref), remote: true do
= @project.name
- tree.breadcrumbs(6) do |link|
\/
@ -10,7 +10,7 @@
%div.tree_progress
#tree-content-holder
- if tree.is_blob?
= render partial: "refs/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
= render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
- else
- contents = tree.contents
%table#tree-slider{class: "table_#{@hex_path}" }
@ -31,11 +31,11 @@
- index = 0
- contents.select{ |i| i.is_a?(Grit::Tree)}.each do |content|
= render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
= render partial: "tree/tree_item", locals: { content: content, index: (index += 1) }
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
= render partial: "refs/tree_item", locals: { content: content, index: (index += 1) }
= render partial: "tree/tree_item", locals: { content: content, index: (index += 1) }
- contents.select{ |i| i.is_a?(Grit::Submodule)}.each do |content|
= render partial: "refs/submodule_item", locals: { content: content, index: (index += 1) }
= render partial: "tree/submodule_item", locals: { content: content, index: (index += 1) }
- if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
.file_holder#README

View file

@ -5,9 +5,9 @@
= name.force_encoding('utf-8')
%small #{file.mode}
%span.options
= link_to "raw", blob_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small", target: "_blank"
= link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small"
= link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
= link_to "raw", project_blob_path(@project, @id), class: "btn very_small", target: "_blank"
= link_to "history", project_commits_path(@project, @id), class: "btn very_small"
= link_to "blame", project_blame_path(@project, @id), class: "btn very_small"
- if file.text?
- if gitlab_markdown?(name)
.file_content.wiki
@ -32,7 +32,7 @@
- else
.file_content.blob_file
%center
= link_to blob_project_ref_path(@project, @ref, path: params[:path]) do
= link_to project_blob_path(@project, @id) do
%div.padded
%br
= image_tag "download.png", width: 64

View file

@ -1,8 +1,8 @@
- file = tree_full_path(content)
%tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(@project, @ref, file) }
%tr{ class: "tree-item #{tree_hex_class(content)}", url: project_tree_path(@project, tree_join(@id, file)) }
%td.tree-item-file-name
= tree_icon(content)
%strong= link_to truncate(content.name, length: 40), tree_file_project_ref_path(@project, @ref || @commit.id, file), remote: :true
%strong= link_to truncate(content.name, length: 40), project_tree_path(@project, tree_join(@id || @commit.id, file)), remote: :true
%td.tree_time_ago.cgray
- if index == 1
%span.log_loading

View file

@ -0,0 +1,7 @@
= render "head"
#tree-holder= render partial: "tree", locals: {commit: @commit, tree: @tree}
:javascript
$(function() {
Tree.init();
});

View file

@ -1,8 +1,8 @@
:plain
// Load Files list
$("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}");
$("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {commit: @commit, tree: @tree}))}");
$("#tree-content-holder").show("slide", { direction: "right" }, 150);
$('.project-refs-form #path').val("#{params[:path]}");
$('.project-refs-form #path').val("#{@path}");
// Load last commit log for each file in tree
$('#tree-slider').waitForImages(function() {