Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5eecbfdb
Commit
5eecbfdb
authored
Nov 05, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit paging fixes
parent
586c53ea
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
14 deletions
+68
-14
app/assets/javascripts/commits.js
app/assets/javascripts/commits.js
+48
-0
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+3
-2
app/views/commits/_commits.html.haml
app/views/commits/_commits.html.haml
+0
-1
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+11
-1
app/views/commits/index.js.erb
app/views/commits/index.js.erb
+0
-2
app/views/commits/index.js.haml
app/views/commits/index.js.haml
+3
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+3
-8
No files found.
app/assets/javascripts/commits.js
View file @
5eecbfdb
...
@@ -7,3 +7,51 @@ $(document).ready(function(){
...
@@ -7,3 +7,51 @@ $(document).ready(function(){
}
}
});
});
});
});
var
CommitsList
=
{
ref
:
null
,
limit
:
0
,
offset
:
0
,
init
:
function
(
ref
,
limit
)
{
this
.
ref
=
ref
;
this
.
limit
=
limit
;
this
.
offset
=
limit
;
this
.
initLoadMore
();
$
(
'
.loading
'
).
show
();
},
getOld
:
function
()
{
$
(
'
.loading
'
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
"
limit=
"
+
this
.
limit
+
"
&offset=
"
+
this
.
offset
+
"
&ref=
"
+
this
.
ref
,
complete
:
function
(){
$
(
'
.loading
'
).
hide
()},
dataType
:
"
script
"
});
},
append
:
function
(
count
,
html
)
{
$
(
"
#commits_list
"
).
append
(
html
);
if
(
count
>
0
)
{
this
.
offset
+=
count
;
this
.
initLoadMore
();
}
},
initLoadMore
:
function
()
{
$
(
window
).
bind
(
'
scroll
'
,
function
(){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
$
(
window
).
unbind
(
'
scroll
'
);
CommitsList
.
getOld
();
}
});
}
}
app/controllers/commits_controller.rb
View file @
5eecbfdb
...
@@ -13,11 +13,12 @@ class CommitsController < ApplicationController
...
@@ -13,11 +13,12 @@ class CommitsController < ApplicationController
load_refs
# load @branch, @tag & @ref
load_refs
# load @branch, @tag & @ref
@repo
=
project
.
repo
@repo
=
project
.
repo
limit
,
offset
=
(
params
[
:limit
]
||
20
),
(
params
[
:offset
]
||
0
)
if
params
[
:path
]
if
params
[
:path
]
@commits
=
@repo
.
log
(
@ref
,
params
[
:path
],
:max_count
=>
params
[
:limit
]
||
100
,
:skip
=>
params
[
:offset
]
||
0
)
@commits
=
@repo
.
log
(
@ref
,
params
[
:path
],
:max_count
=>
limit
,
:skip
=>
offset
)
else
else
@commits
=
@repo
.
commits
(
@ref
,
params
[
:limit
]
||
100
,
params
[
:offset
]
||
0
)
@commits
=
@repo
.
commits
(
@ref
,
limit
,
offset
)
end
end
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/views/commits/_commits.html.haml
View file @
5eecbfdb
...
@@ -22,4 +22,3 @@
...
@@ -22,4 +22,3 @@
%strong
=
commit
.
author_name
%strong
=
commit
.
author_name
=
time_ago_in_words
(
commit
.
committed_date
)
=
time_ago_in_words
(
commit
.
committed_date
)
ago
ago
=
more_commits_link
if
@commits
.
size
>
99
app/views/commits/index.html.haml
View file @
5eecbfdb
...
@@ -15,4 +15,14 @@
...
@@ -15,4 +15,14 @@
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
project_commits_path
(
@project
)
}
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
project_commits_path
(
@project
)
}
%div
{
:id
=>
dom_id
(
@project
)}
%div
{
:id
=>
dom_id
(
@project
)}
=
render
"commits"
#commits_list
=
render
"commits"
.clear
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
:javascript
$
(
function
(){
CommitsList
.
init
(
"
#{
@ref
}
"
,
20
);
});
app/views/commits/index.js.erb
deleted
100644 → 0
View file @
586c53ea
$("#more-commits-link").remove();
$('#
<%=
dom_id
(
@project
)
%>
').append('
<%=
escape_javascript
(
render
(
"commits"
))
%>
');
app/views/commits/index.js.haml
0 → 100644
View file @
5eecbfdb
:plain
CommitsList.append(
#{
@commits
.
count
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'commits/commits'
))
}
");
app/views/layouts/application.html.haml
View file @
5eecbfdb
...
@@ -2,11 +2,7 @@
...
@@ -2,11 +2,7 @@
%html
%html
%head
%head
%title
%title
GitLab
#{
" - #{@project.name}"
if
@project
&&
!
@project
.
new_record?
}
GitLab
-#= stylesheet_link_tag 'blueprint/screen', :media => "screen, projection"
-#= stylesheet_link_tag 'blueprint/print', :media => "print"
-#= stylesheet_link_tag 'blueprint/plugins/buttons/screen', :media => "screen, projection"
-#= stylesheet_link_tag 'blueprint/plugins/link-icons/screen', :media => "screen, projection"
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
...
@@ -17,6 +13,5 @@
...
@@ -17,6 +13,5 @@
#container
#container
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/head_panel"
=
render
:partial
=>
"layouts/head_panel"
%div
{
:id
=>
"main"
,
:role
=>
"main"
,
:class
=>
"container_4"
}
=
render
:partial
=>
"layouts/page_title"
=
render
:partial
=>
"layouts/page_title"
=
yield
=
yield
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