BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fcb0b76c
Unverified
Commit
fcb0b76c
authored
Jun 12, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load last commit for files per 10 items.
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
9fd6c3d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
refs_controller.rb
app/controllers/projects/refs_controller.rb
+17
-3
logs_tree.js.haml
app/views/projects/refs/logs_tree.js.haml
+10
-0
No files found.
app/controllers/projects/refs_controller.rb
View file @
fcb0b76c
...
...
@@ -31,9 +31,23 @@ class Projects::RefsController < Projects::ApplicationController
end
def
logs_tree
contents
=
tree
.
entries
@logs
=
contents
.
map
do
|
content
|
file
=
params
[
:path
]
?
File
.
join
(
params
[:
path
],
content
.
name
)
:
content
.
name
@offset
=
if
params
[
:offset
].
present?
params
[
:offset
].
to_i
else
0
end
@limit
=
10
@path
=
params
[
:path
]
contents
=
[]
contents
+=
tree
.
trees
contents
+=
tree
.
blobs
contents
+=
tree
.
submodules
@logs
=
contents
[
@offset
,
@limit
].
to_a
.
map
do
|
content
|
file
=
@path
?
File
.
join
(
@path
,
content
.
name
)
:
content
.
name
last_commit
=
@repo
.
last_commit_for_path
(
@commit
.
id
,
file
)
{
file_name:
content
.
name
,
...
...
app/views/projects/refs/logs_tree.js.haml
View file @
fcb0b76c
...
...
@@ -7,3 +7,13 @@
var row = $("table.table_
#{
@hex_path
}
tr.file_
#{
hexdigest
(
file_name
)
}
");
row.find("td.tree_time_ago").html('
#{
escape_javascript
time_ago_with_tooltip
(
commit
.
committed_date
)
}
');
row.find("td.tree_commit").html('
#{
escape_javascript
render
(
"projects/tree/tree_commit_column"
,
commit:
commit
)
}
');
-
if
@logs
.
present?
:plain
var current_url = location.href.replace(/\/?$/, '/');
var log_url = '
#{
project_tree_url
(
@project
,
tree_join
(
@ref
,
@path
||
'/'
))
}
'.replace(/\/?$/, '/');
if(current_url == log_url) {
// Load 10 more commit log for each file in tree
// if we still on the same page
ajaxGet('
#{
logs_file_project_ref_path
(
@project
,
@ref
,
@path
||
'/'
,
offset:
(
@offset
+
@limit
))
}
');
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment