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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
368deb59
Commit
368deb59
authored
Nov 15, 2011
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up whitespace from project
parent
415eddaf
Changes
50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
356 additions
and
413 deletions
+356
-413
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+5
-5
app/assets/javascripts/commits.js
app/assets/javascripts/commits.js
+10
-12
app/assets/javascripts/note.js
app/assets/javascripts/note.js
+12
-15
app/assets/javascripts/projects.js
app/assets/javascripts/projects.js
+0
-1
app/assets/stylesheets/application.css
app/assets/stylesheets/application.css
+3
-3
app/assets/stylesheets/issues.css.scss
app/assets/stylesheets/issues.css.scss
+3
-4
app/assets/stylesheets/notes.css.scss
app/assets/stylesheets/notes.css.scss
+0
-1
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+20
-22
app/assets/stylesheets/style.scss
app/assets/stylesheets/style.scss
+215
-244
app/assets/stylesheets/tags.css.css
app/assets/stylesheets/tags.css.css
+5
-7
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+2
-2
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+0
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-2
app/controllers/tags_controller.rb
app/controllers/tags_controller.rb
+8
-8
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-2
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+3
-3
app/models/issue.rb
app/models/issue.rb
+2
-2
app/models/note.rb
app/models/note.rb
+2
-2
app/models/project.rb
app/models/project.rb
+3
-3
app/models/repository.rb
app/models/repository.rb
+1
-1
app/views/admin/projects/_form.html.haml
app/views/admin/projects/_form.html.haml
+2
-3
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+1
-3
app/views/dashboard/index.html.haml
app/views/dashboard/index.html.haml
+2
-2
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+1
-1
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+0
-1
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+2
-3
app/views/layouts/_head_panel.html.erb
app/views/layouts/_head_panel.html.erb
+1
-1
app/views/layouts/profile.html.haml
app/views/layouts/profile.html.haml
+1
-1
app/views/notes/_form.html.haml
app/views/notes/_form.html.haml
+1
-1
app/views/notes/_load.js.haml
app/views/notes/_load.js.haml
+0
-1
app/views/notes/_show.html.haml
app/views/notes/_show.html.haml
+1
-1
app/views/projects/_feed.html.haml
app/views/projects/_feed.html.haml
+2
-2
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+2
-2
app/views/projects/_list.html.haml
app/views/projects/_list.html.haml
+0
-1
app/views/projects/_refs.html.haml
app/views/projects/_refs.html.haml
+0
-1
app/views/projects/_tile.html.haml
app/views/projects/_tile.html.haml
+1
-1
app/views/projects/_tree.html.haml
app/views/projects/_tree.html.haml
+1
-2
app/views/projects/index.html.haml
app/views/projects/index.html.haml
+1
-1
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+7
-7
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+1
-1
app/views/tags/index.html.haml
app/views/tags/index.html.haml
+2
-3
config/routes.rb
config/routes.rb
+0
-1
db/migrate/20111027152724_issue_conten_to_note.rb
db/migrate/20111027152724_issue_conten_to_note.rb
+4
-4
lib/assets/javascripts/branch-graph.js
lib/assets/javascripts/branch-graph.js
+4
-4
lib/graph_commit.rb
lib/graph_commit.rb
+10
-10
spec/models/project_spec.rb
spec/models/project_spec.rb
+5
-5
spec/requests/dashboard_spec.rb
spec/requests/dashboard_spec.rb
+3
-3
spec/requests/projects_spec.rb
spec/requests/projects_spec.rb
+1
-1
spec/requests/tags_spec.rb
spec/requests/tags_spec.rb
+0
-4
spec/requests/top_panel_spec.rb
spec/requests/top_panel_spec.rb
+2
-2
No files found.
app/assets/javascripts/application.js
View file @
368deb59
...
@@ -22,9 +22,9 @@ $(function(){
...
@@ -22,9 +22,9 @@ $(function(){
$
(
'
select#branch
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#branch
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#tag
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#tag
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
"
.account-box
"
).
mouseenter
(
showMenu
);
$
(
"
.account-box
"
).
mouseenter
(
showMenu
);
$
(
"
.account-box
"
).
mouseleave
(
resetMenu
);
$
(
"
.account-box
"
).
mouseleave
(
resetMenu
);
});
});
function
updatePage
(
data
){
function
updatePage
(
data
){
...
@@ -32,9 +32,9 @@ function updatePage(data){
...
@@ -32,9 +32,9 @@ function updatePage(data){
}
}
function
showMenu
()
{
function
showMenu
()
{
$
(
this
).
toggleClass
(
'
hover
'
);
$
(
this
).
toggleClass
(
'
hover
'
);
}
}
function
resetMenu
()
{
function
resetMenu
()
{
$
(
this
).
removeClass
(
"
hover
"
);
$
(
this
).
removeClass
(
"
hover
"
);
}
}
app/assets/javascripts/commits.js
View file @
368deb59
...
@@ -8,25 +8,23 @@ $(document).ready(function(){
...
@@ -8,25 +8,23 @@ $(document).ready(function(){
});
});
});
});
var
CommitsList
=
{
var
CommitsList
=
{
ref
:
null
,
ref
:
null
,
limit
:
0
,
limit
:
0
,
offset
:
0
,
offset
:
0
,
init
:
init
:
function
(
ref
,
limit
)
{
function
(
ref
,
limit
)
{
this
.
ref
=
ref
;
this
.
ref
=
ref
;
this
.
limit
=
limit
;
this
.
limit
=
limit
;
this
.
offset
=
limit
;
this
.
offset
=
limit
;
this
.
initLoadMore
();
this
.
initLoadMore
();
$
(
'
.loading
'
).
show
();
$
(
'
.loading
'
).
show
();
},
},
getOld
:
getOld
:
function
()
{
function
()
{
$
(
'
.loading
'
).
show
();
$
(
'
.loading
'
).
show
();
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
...
@@ -39,14 +37,14 @@ getOld:
...
@@ -39,14 +37,14 @@ getOld:
append
:
append
:
function
(
count
,
html
)
{
function
(
count
,
html
)
{
$
(
"
#commits_list
"
).
append
(
html
);
$
(
"
#commits_list
"
).
append
(
html
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
this
.
offset
+=
count
;
this
.
offset
+=
count
;
this
.
initLoadMore
();
this
.
initLoadMore
();
}
}
},
},
initLoadMore
:
initLoadMore
:
function
()
{
function
()
{
$
(
window
).
bind
(
'
scroll
'
,
function
(){
$
(
window
).
bind
(
'
scroll
'
,
function
(){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
$
(
window
).
unbind
(
'
scroll
'
);
$
(
window
).
unbind
(
'
scroll
'
);
...
...
app/assets/javascripts/note.js
View file @
368deb59
var
NoteList
=
{
var
NoteList
=
{
first_id
:
0
,
first_id
:
0
,
last_id
:
0
,
last_id
:
0
,
resource_name
:
null
,
resource_name
:
null
,
init
:
init
:
function
(
resource_name
,
first_id
,
last_id
)
{
function
(
resource_name
,
first_id
,
last_id
)
{
this
.
resource_name
=
resource_name
;
this
.
resource_name
=
resource_name
;
this
.
first_id
=
first_id
;
this
.
first_id
=
first_id
;
this
.
last_id
=
last_id
;
this
.
last_id
=
last_id
;
this
.
initRefresh
();
this
.
initRefresh
();
this
.
initLoadMore
();
this
.
initLoadMore
();
},
},
getOld
:
getOld
:
function
()
{
function
()
{
$
(
'
.loading
'
).
show
();
$
(
'
.loading
'
).
show
();
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
...
@@ -31,7 +31,7 @@ append:
...
@@ -31,7 +31,7 @@ append:
this
.
initLoadMore
();
this
.
initLoadMore
();
},
},
replace
:
replace
:
function
(
fid
,
lid
,
html
)
{
function
(
fid
,
lid
,
html
)
{
this
.
first_id
=
fid
;
this
.
first_id
=
fid
;
this
.
last_id
=
lid
;
this
.
last_id
=
lid
;
...
@@ -39,17 +39,16 @@ replace:
...
@@ -39,17 +39,16 @@ replace:
this
.
initLoadMore
();
this
.
initLoadMore
();
},
},
prepend
:
prepend
:
function
(
id
,
html
)
{
function
(
id
,
html
)
{
if
(
id
!=
this
.
last_id
)
{
if
(
id
!=
this
.
last_id
)
{
this
.
last_id
=
id
;
this
.
last_id
=
id
;
$
(
"
#notes-list
"
).
prepend
(
html
);
$
(
"
#notes-list
"
).
prepend
(
html
);
}
}
},
},
getNew
:
getNew
:
function
()
{
function
()
{
// refersh notes list
// refersh notes list
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
...
@@ -59,7 +58,7 @@ getNew:
...
@@ -59,7 +58,7 @@ getNew:
},
},
refresh
:
refresh
:
function
()
{
function
()
{
// refersh notes list
// refersh notes list
$
.
ajax
({
$
.
ajax
({
type
:
"
GET
"
,
type
:
"
GET
"
,
...
@@ -68,8 +67,6 @@ refresh:
...
@@ -68,8 +67,6 @@ refresh:
dataType
:
"
script
"
});
dataType
:
"
script
"
});
},
},
initRefresh
:
initRefresh
:
function
()
{
function
()
{
// init timer
// init timer
...
@@ -78,7 +75,7 @@ initRefresh:
...
@@ -78,7 +75,7 @@ initRefresh:
},
},
initLoadMore
:
initLoadMore
:
function
()
{
function
()
{
$
(
window
).
bind
(
'
scroll
'
,
function
(){
$
(
window
).
bind
(
'
scroll
'
,
function
(){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
$
(
window
).
unbind
(
'
scroll
'
);
$
(
window
).
unbind
(
'
scroll
'
);
...
...
app/assets/javascripts/projects.js
View file @
368deb59
...
@@ -48,7 +48,6 @@ function taggifyForm(){
...
@@ -48,7 +48,6 @@ function taggifyForm(){
source
:
'
/tags.json
'
source
:
'
/tags.json
'
});
});
$
(
'
form
'
).
submit
(
function
()
{
$
(
'
form
'
).
submit
(
function
()
{
var
tag_field
=
$
(
'
#tag_field
'
)
var
tag_field
=
$
(
'
#tag_field
'
)
tag_field
.
val
(
tag_field
.
tagify
(
'
serialize
'
)
);
tag_field
.
val
(
tag_field
.
tagify
(
'
serialize
'
)
);
...
...
app/assets/stylesheets/application.css
View file @
368deb59
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
.cgreen
{
color
:
#44aa22
;
}
.cgreen
{
color
:
#44aa22
;
}
/** COMMON STYLES **/
/** COMMON STYLES **/
.left
{
.left
{
float
:
left
;
float
:
left
;
}
}
.right
{
.right
{
float
:
right
;
float
:
right
;
}
}
.width-50p
{
.width-50p
{
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
.width-65p
{
.width-65p
{
width
:
65%
;
width
:
65%
;
}
}
.append-bottom-10
{
.append-bottom-10
{
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.prepend-top-10
{
.prepend-top-10
{
...
...
app/assets/stylesheets/issues.css.scss
View file @
368deb59
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
.issues_filter
{
.issues_filter
{
margin-top
:
10px
;
margin-top
:
10px
;
.left
{
.left
{
margin-right
:
15px
;
margin-right
:
15px
;
}
}
}
}
...
@@ -38,11 +38,10 @@
...
@@ -38,11 +38,10 @@
/** ISSUES LIST **/
/** ISSUES LIST **/
.issue
.action-links
{
.issue
.action-links
{
display
:none
;
display
:none
;
a
{
a
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
}
}
.issue
:hover
.action-links
{
display
:block
;
}
.issue
:hover
.action-links
{
display
:block
;
}
app/assets/stylesheets/notes.css.scss
View file @
368deb59
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
}
}
}
}
/* Note textare */
/* Note textare */
#note_note
{
#note_note
{
height
:
100px
;
height
:
100px
;
...
...
app/assets/stylesheets/projects.css.scss
View file @
368deb59
...
@@ -99,15 +99,15 @@ a {
...
@@ -99,15 +99,15 @@ a {
}
}
}
}
td
.code
{
td
.code
{
width
:
100%
;
width
:
100%
;
.highlight
{
.highlight
{
margin-left
:
55px
;
margin-left
:
55px
;
overflow
:auto
;
overflow
:auto
;
overflow-y
:hidden
;
overflow-y
:hidden
;
}
}
}
}
.highlight
pre
{
.highlight
pre
{
white-space
:
pre
;
white-space
:
pre
;
word-wrap
:normal
;
word-wrap
:normal
;
}
}
...
@@ -115,12 +115,11 @@ td.code {
...
@@ -115,12 +115,11 @@ td.code {
.highlighttable
tr
:hover
{
.highlighttable
tr
:hover
{
background
:white
;
background
:white
;
}
}
table
.highlighttable
pre
{
table
.highlighttable
pre
{
line-height
:
16px
!
important
;
line-height
:
16px
!
important
;
font-size
:
12px
!
important
;
font-size
:
12px
!
important
;
}
}
table
.highlighttable
.linenodiv
pre
{
table
.highlighttable
.linenodiv
pre
{
text-align
:
right
;
text-align
:
right
;
padding-right
:
4px
;
padding-right
:
4px
;
...
@@ -235,7 +234,6 @@ input.ssh_project_url {
...
@@ -235,7 +234,6 @@ input.ssh_project_url {
}
}
}
}
#user_projects_limit
{
#user_projects_limit
{
width
:
60px
;
width
:
60px
;
}
}
...
@@ -244,7 +242,7 @@ input.ssh_project_url {
...
@@ -244,7 +242,7 @@ input.ssh_project_url {
cursor
:
move
;
cursor
:
move
;
}
}
.project-refs-form
{
.project-refs-form
{
span
{
span
{
background
:
none
!
important
;
background
:
none
!
important
;
position
:static
!
important
;
position
:static
!
important
;
...
@@ -258,18 +256,18 @@ input.ssh_project_url {
...
@@ -258,18 +256,18 @@ input.ssh_project_url {
}
}
.filter
.left
{
margin-right
:
15px
;
}
.filter
.left
{
margin-right
:
15px
;
}
body
.project-page
table
.commit
{
body
.project-page
table
.commit
{
a
.tree-commit-link
{
a
.tree-commit-link
{
color
:gray
;
color
:gray
;
&
:hover
{
&
:hover
{
text-decoration
:underline
;
text-decoration
:underline
;
}
}
}
}
}
}
/** NEW PROJECT **/
/** NEW PROJECT **/
.new-project-hodler
{
.new-project-hodler
{
.icon
span
{
background-position
:
-31px
-70px
;
}
.icon
span
{
background-position
:
-31px
-70px
;
}
td
{
border-bottom
:
1px
solid
#DEE2E3
;
}
td
{
border-bottom
:
1px
solid
#DEE2E3
;
}
}
}
...
@@ -277,8 +275,8 @@ body.project-page table .commit {
...
@@ -277,8 +275,8 @@ body.project-page table .commit {
/** Feed entry **/
/** Feed entry **/
.commit
,
.commit
,
.snippet
,
.snippet
,
.message
{
.message
{
.title
{
.title
{
color
:
#666
;
color
:
#666
;
a
{
color
:
#666
!
important
;
}
a
{
color
:
#666
!
important
;
}
p
{
margin-top
:
0px
;
}
p
{
margin-top
:
0px
;
}
...
@@ -295,21 +293,21 @@ body.project-page table .commit {
...
@@ -295,21 +293,21 @@ body.project-page table .commit {
font-size
:
1
.5em
;
font-size
:
1
.5em
;
height
:auto
;
height
:auto
;
font-weight
:bold
;
font-weight
:bold
;
.ui-selectmenu-status
{
.ui-selectmenu-status
{
padding
:
3px
10px
;
padding
:
3px
10px
;
}
}
}
}
/** Snippets **/
/** Snippets **/
.new_snippet
textarea
,
.new_snippet
textarea
,
.edit_snippet
textarea
{
.edit_snippet
textarea
{
height
:
300px
;
height
:
300px
;
padding
:
8px
;
padding
:
8px
;
width
:
95%
;
width
:
95%
;
}
}
.snippet
.action-links
{
.snippet
.action-links
{
display
:none
;
display
:none
;
a
{
a
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
}
}
...
@@ -348,11 +346,11 @@ body.project-page table .commit {
...
@@ -348,11 +346,11 @@ body.project-page table .commit {
background
:
#2c5c66
;
background
:
#2c5c66
;
color
:white
;
color
:white
;
}
}
&
.issue
{
&
.issue
{
background
:
#D12F19
;
background
:
#D12F19
;
color
:white
;
color
:white
;
}
}
&
.commit
{
&
.commit
{
background
:
#44aacc
;
background
:
#44aacc
;
color
:white
;
color
:white
;
}
}
...
...
app/assets/stylesheets/style.scss
View file @
368deb59
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/tags.css.css
View file @
368deb59
.tags-list
{
.tags-list
{
padding
:
0px
10px
10px
10px
;
padding
:
0px
10px
10px
10px
;
}
}
.tags-list
a
{
.tags-list
a
{
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
font-size
:
14px
;
font-size
:
14px
;
}
}
.small-tags
a
{
.small-tags
a
{
font-size
:
9px
;
font-size
:
9px
;
...
@@ -26,10 +25,9 @@
...
@@ -26,10 +25,9 @@
background-color
:
#72bbdf
;
background-color
:
#72bbdf
;
color
:
#FFF
;
color
:
#FFF
;
text-shadow
:
none
;
text-shadow
:
none
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.medium-tags
a
{
.medium-tags
a
{
font-size
:
12px
;
font-size
:
12px
;
...
@@ -40,5 +38,5 @@
...
@@ -40,5 +38,5 @@
background-color
:
#72bbdf
;
background-color
:
#72bbdf
;
color
:
#FFF
;
color
:
#FFF
;
text-shadow
:
none
;
text-shadow
:
none
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
\ No newline at end of file
app/controllers/application_controller.rb
View file @
368deb59
...
@@ -79,8 +79,8 @@ class ApplicationController < ActionController::Base
...
@@ -79,8 +79,8 @@ class ApplicationController < ActionController::Base
elsif
params
[
:last_id
]
elsif
params
[
:last_id
]
@notes
=
@notes
.
where
(
"id > ?"
,
params
[
:last_id
])
@notes
=
@notes
.
where
(
"id > ?"
,
params
[
:last_id
])
elsif
params
[
:first_id
]
elsif
params
[
:first_id
]
@notes
=
@notes
.
where
(
"id < ?"
,
params
[
:first_id
])
@notes
=
@notes
.
where
(
"id < ?"
,
params
[
:first_id
])
else
else
nil
nil
end
end
end
end
...
...
app/controllers/commits_controller.rb
View file @
368deb59
...
@@ -10,7 +10,6 @@ class CommitsController < ApplicationController
...
@@ -10,7 +10,6 @@ class CommitsController < ApplicationController
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
before_filter
:load_refs
,
:only
=>
:index
# load @branch, @tag & @ref
before_filter
:load_refs
,
:only
=>
:index
# load @branch, @tag & @ref
def
index
def
index
@repo
=
project
.
repo
@repo
=
project
.
repo
limit
,
offset
=
(
params
[
:limit
]
||
20
),
(
params
[
:offset
]
||
0
)
limit
,
offset
=
(
params
[
:limit
]
||
20
),
(
params
[
:offset
]
||
0
)
...
...
app/controllers/projects_controller.rb
View file @
368deb59
...
@@ -79,7 +79,7 @@ class ProjectsController < ApplicationController
...
@@ -79,7 +79,7 @@ class ProjectsController < ApplicationController
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
js
{
respond_with_notes
}
format
.
js
{
respond_with_notes
}
end
end
...
@@ -168,7 +168,7 @@ class ProjectsController < ApplicationController
...
@@ -168,7 +168,7 @@ class ProjectsController < ApplicationController
def
add_refs
(
commit
,
ref_cache
)
def
add_refs
(
commit
,
ref_cache
)
if
ref_cache
.
empty?
if
ref_cache
.
empty?
@repo
.
refs
.
each
do
|
ref
|
@repo
.
refs
.
each
do
|
ref
|
ref_cache
[
ref
.
commit
.
id
]
||=
[]
ref_cache
[
ref
.
commit
.
id
]
||=
[]
ref_cache
[
ref
.
commit
.
id
]
<<
ref
ref_cache
[
ref
.
commit
.
id
]
<<
ref
end
end
...
...
app/controllers/tags_controller.rb
View file @
368deb59
class
TagsController
<
ApplicationController
class
TagsController
<
ApplicationController
def
index
def
index
@tags
=
Project
.
tag_counts
.
order
(
'count DESC'
)
@tags
=
Project
.
tag_counts
.
order
(
'count DESC'
)
@tags
=
@tags
.
where
(
'name like ?'
,
"%
#{
params
[
:term
]
}
%"
)
unless
params
[
:term
].
blank?
@tags
=
@tags
.
where
(
'name like ?'
,
"%
#{
params
[
:term
]
}
%"
)
unless
params
[
:term
].
blank?
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
json
{
render
json:
@tags
.
limit
(
8
).
map
{
|
t
|
t
.
name
}}
format
.
json
{
render
json:
@tags
.
limit
(
8
).
map
{
|
t
|
t
.
name
}}
end
end
end
end
end
end
app/helpers/application_helper.rb
View file @
368deb59
...
@@ -11,7 +11,7 @@ module ApplicationHelper
...
@@ -11,7 +11,7 @@ module ApplicationHelper
end
end
def
body_class
(
default_class
=
nil
)
def
body_class
(
default_class
=
nil
)
main
=
content_for
(
:body_class
).
blank?
?
main
=
content_for
(
:body_class
).
blank?
?
default_class
:
default_class
:
content_for
(
:body_class
)
content_for
(
:body_class
)
...
@@ -42,7 +42,7 @@ module ApplicationHelper
...
@@ -42,7 +42,7 @@ module ApplicationHelper
else
else
"Never"
"Never"
end
end
rescue
rescue
"Never"
"Never"
end
end
...
...
app/helpers/dashboard_helper.rb
View file @
368deb59
...
@@ -4,7 +4,7 @@ module DashboardHelper
...
@@ -4,7 +4,7 @@ module DashboardHelper
when
"Issue"
then
project_issue_path
(
project
,
project
.
issues
.
find
(
object
.
id
))
when
"Issue"
then
project_issue_path
(
project
,
project
.
issues
.
find
(
object
.
id
))
when
"Grit::Commit"
then
project_commit_path
(
project
,
project
.
repo
.
commits
(
object
.
id
).
first
)
when
"Grit::Commit"
then
project_commit_path
(
project
,
project
.
repo
.
commits
(
object
.
id
).
first
)
when
"Note"
when
"Note"
then
then
note
=
object
note
=
object
case
note
.
noteable_type
case
note
.
noteable_type
when
"Issue"
then
project_issue_path
(
project
,
note
.
noteable_id
)
when
"Issue"
then
project_issue_path
(
project
,
note
.
noteable_id
)
...
@@ -12,9 +12,9 @@ module DashboardHelper
...
@@ -12,9 +12,9 @@ module DashboardHelper
when
"Commit"
then
project_commit_path
(
project
,
:id
=>
note
.
noteable_id
)
when
"Commit"
then
project_commit_path
(
project
,
:id
=>
note
.
noteable_id
)
else
wall_project_path
(
project
)
else
wall_project_path
(
project
)
end
end
else
wall_project_path
(
project
)
else
wall_project_path
(
project
)
end
end
rescue
rescue
"#"
"#"
end
end
...
...
app/models/issue.rb
View file @
368deb59
...
@@ -11,8 +11,8 @@ class Issue < ActiveRecord::Base
...
@@ -11,8 +11,8 @@ class Issue < ActiveRecord::Base
validates_presence_of
:author_id
validates_presence_of
:author_id
delegate
:name
,
delegate
:name
,
:email
,
:email
,
:to
=>
:author
,
:to
=>
:author
,
:prefix
=>
true
:prefix
=>
true
validates
:title
,
validates
:title
,
...
...
app/models/note.rb
View file @
368deb59
...
@@ -8,8 +8,8 @@ class Note < ActiveRecord::Base
...
@@ -8,8 +8,8 @@ class Note < ActiveRecord::Base
:class_name
=>
"User"
:class_name
=>
"User"
delegate
:name
,
delegate
:name
,
:email
,
:email
,
:to
=>
:author
,
:to
=>
:author
,
:prefix
=>
true
:prefix
=>
true
attr_protected
:author
,
:author_id
attr_protected
:author
,
:author_id
...
...
app/models/project.rb
View file @
368deb59
...
@@ -121,9 +121,9 @@ class Project < ActiveRecord::Base
...
@@ -121,9 +121,9 @@ class Project < ActiveRecord::Base
private_flag
private_flag
end
end
def
last_activity
def
last_activity
updates
(
1
).
first
updates
(
1
).
first
rescue
rescue
nil
nil
end
end
...
@@ -132,7 +132,7 @@ class Project < ActiveRecord::Base
...
@@ -132,7 +132,7 @@ class Project < ActiveRecord::Base
end
end
def
updates
(
n
=
3
)
def
updates
(
n
=
3
)
[
[
fresh_commits
(
n
),
fresh_commits
(
n
),
issues
.
last
(
n
),
issues
.
last
(
n
),
notes
.
fresh
.
limit
(
n
)
notes
.
fresh
.
limit
(
n
)
...
...
app/models/repository.rb
View file @
368deb59
...
@@ -9,7 +9,7 @@ class Repository
...
@@ -9,7 +9,7 @@ class Repository
@project
=
project
@project
=
project
end
end
def
path
def
path
@path
||=
project
.
path
@path
||=
project
.
path
end
end
...
...
app/views/admin/projects/_form.html.haml
View file @
368deb59
=
form_for
[
:admin
,
@admin_project
]
do
|
f
|
=
form_for
[
:admin
,
@admin_project
]
do
|
f
|
-
if
@admin_project
.
errors
.
any?
-
if
@admin_project
.
errors
.
any?
#error_explanation
#error_explanation
%h2
=
"
#{
pluralize
(
@admin_project
.
errors
.
count
,
"error"
)
}
prohibited this admin_project from being saved:"
%h2
=
"
#{
pluralize
(
@admin_project
.
errors
.
count
,
"error"
)
}
prohibited this admin_project from being saved:"
%ul
%ul
-
@admin_project
.
errors
.
full_messages
.
each
do
|
msg
|
-
@admin_project
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%li
=
msg
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
%br
%br
=
f
.
text_field
:path
=
f
.
text_field
:path
.form-row
.form-row
=
f
.
label
:tag_list
=
f
.
label
:tag_list
%br
%br
...
@@ -36,4 +35,4 @@
...
@@ -36,4 +35,4 @@
:javascript
:javascript
$
(
function
(){
$
(
function
(){
taggifyForm
();
taggifyForm
();
})
})
app/views/commits/index.html.haml
View file @
368deb59
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
%h2
.icon
%h2
.icon
%span
%span
%d
%d
=
link_to
project_commits_path
(
@project
)
do
=
link_to
project_commits_path
(
@project
)
do
=
@project
.
name
=
@project
.
name
-
if
params
[
:path
]
-
if
params
[
:path
]
\/
\/
...
@@ -20,8 +20,6 @@
...
@@ -20,8 +20,6 @@
.loading
{
:style
=>
"display:none;"
}
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
%center
=
image_tag
"ajax-loader.gif"
:javascript
:javascript
$
(
function
(){
$
(
function
(){
CommitsList
.
init
(
"
#{
@ref
}
"
,
20
);
CommitsList
.
init
(
"
#{
@ref
}
"
,
20
);
...
...
app/views/dashboard/index.html.haml
View file @
368deb59
...
@@ -27,13 +27,13 @@
...
@@ -27,13 +27,13 @@
%a
.project-update
{
:href
=>
dashboard_feed_path
(
project
,
update
)}
%a
.project-update
{
:href
=>
dashboard_feed_path
(
project
,
update
)}
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
=
image_tag
gravatar_icon
(
update
.
author_email
),
:class
=>
"left"
,
:width
=>
40
%span
.update-title
%span
.update-title
-
if
update
.
kind_of?
(
Grit
::
Commit
)
-
if
update
.
kind_of?
(
Grit
::
Commit
)
%span
.right.tag.commit
=
update
.
head
.
name
%span
.right.tag.commit
=
update
.
head
.
name
=
dashboard_feed_title
(
update
)
=
dashboard_feed_title
(
update
)
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
authored
authored
=
time_ago_in_words
(
update
.
created_at
)
=
time_ago_in_words
(
update
.
created_at
)
ago
ago
/ #news-feed
/ #news-feed
/ #dashboard-content
/ #dashboard-content
app/views/issues/_show.html.haml
View file @
368deb59
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
-
if
can?
current_user
,
:write_issue
,
issue
-
if
can?
current_user
,
:write_issue
,
issue
-
if
issue
.
closed
-
if
issue
.
closed
=
link_to
'Reopen'
,
project_issue_path
(
@project
,
issue
,
:issue
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"cgray"
,
:remote
=>
true
=
link_to
'Reopen'
,
project_issue_path
(
@project
,
issue
,
:issue
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"cgray"
,
:remote
=>
true
-
else
-
else
=
link_to
'Resolve'
,
project_issue_path
(
@project
,
issue
,
:issue
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"cgray"
,
:remote
=>
true
=
link_to
'Resolve'
,
project_issue_path
(
@project
,
issue
,
:issue
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"cgray"
,
:remote
=>
true
-
if
can?
current_user
,
:write_issue
,
issue
-
if
can?
current_user
,
:write_issue
,
issue
=
link_to
'Edit'
,
edit_project_issue_path
(
@project
,
issue
),
:class
=>
"cgray edit-issue-link"
,
:remote
=>
true
=
link_to
'Edit'
,
edit_project_issue_path
(
@project
,
issue
),
:class
=>
"cgray edit-issue-link"
,
:remote
=>
true
...
...
app/views/issues/index.html.haml
View file @
368deb59
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
var
href
=
$
(
'
.issue_search
'
).
parent
().
attr
(
'
action
'
);
var
href
=
$
(
'
.issue_search
'
).
parent
().
attr
(
'
action
'
);
var
last_terms
=
''
;
var
last_terms
=
''
;
var
setIssueFilter
=
function
(
form
,
value
){
var
setIssueFilter
=
function
(
form
,
value
){
$
.
cookie
(
'
issue_filter
'
,
value
,
{
expires
:
140
});
$
.
cookie
(
'
issue_filter
'
,
value
,
{
expires
:
140
});
form
.
submit
();
form
.
submit
();
...
...
app/views/issues/show.html.haml
View file @
368deb59
...
@@ -22,12 +22,12 @@
...
@@ -22,12 +22,12 @@
%td
%td
=
image_tag
gravatar_icon
(
@issue
.
assignee
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding:0 5px;"
=
image_tag
gravatar_icon
(
@issue
.
assignee
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding:0 5px;"
=
@issue
.
assignee
.
name
=
@issue
.
assignee
.
name
%tr
%tr
%td
Tags
%td
Tags
%td
%td
-
if
@issue
.
critical
-
if
@issue
.
critical
%span
.tag.high
critical
%span
.tag.high
critical
-
else
-
else
%span
.tag.normal
normal
%span
.tag.normal
normal
-
if
@issue
.
today?
-
if
@issue
.
today?
...
@@ -42,7 +42,6 @@
...
@@ -42,7 +42,6 @@
-
else
-
else
=
check_box_tag
"closed"
,
1
,
@issue
.
closed
,
:disabled
=>
true
=
check_box_tag
"closed"
,
1
,
@issue
.
closed
,
:disabled
=>
true
-
if
can?
(
current_user
,
:write_issue
,
@issue
)
-
if
can?
(
current_user
,
:write_issue
,
@issue
)
.clear
.clear
%br
%br
...
...
app/views/layouts/_head_panel.html.erb
View file @
368deb59
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<div
class=
"account-links"
>
<div
class=
"account-links"
>
<%=
link_to
profile_path
,
:class
=>
"username"
do
%>
<%=
link_to
profile_path
,
:class
=>
"username"
do
%>
<%#= current_user.name %>
<%#= current_user.name %>
My profile
My profile
<%
end
%>
<%
end
%>
<%=
link_to
'Logout'
,
destroy_user_session_path
,
:class
=>
"logout"
,
:method
=>
:delete
%>
<%=
link_to
'Logout'
,
destroy_user_session_path
,
:class
=>
"logout"
,
:method
=>
:delete
%>
...
...
app/views/layouts/profile.html.haml
View file @
368deb59
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
%aside
%aside
=
link_to
"Profile"
,
profile_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:show
)
?
"current"
:
nil
=
link_to
"Profile"
,
profile_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:show
)
?
"current"
:
nil
=
link_to
"Password"
,
profile_password_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:password
)
?
"current"
:
nil
=
link_to
"Password"
,
profile_password_path
,
:class
=>
current_page?
(
:controller
=>
"profile"
,
:action
=>
:password
)
?
"current"
:
nil
=
link_to
keys_path
,
:class
=>
controller
.
controller_name
==
"keys"
?
"current"
:
nil
do
=
link_to
keys_path
,
:class
=>
controller
.
controller_name
==
"keys"
?
"current"
:
nil
do
Keys
Keys
-
unless
current_user
.
keys
.
empty?
-
unless
current_user
.
keys
.
empty?
%span
{
:class
=>
"number"
}=
current_user
.
keys
.
count
%span
{
:class
=>
"number"
}=
current_user
.
keys
.
count
...
...
app/views/notes/_form.html.haml
View file @
368deb59
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
%br
%br
%br
%br
=
f
.
text_area
:note
,
:size
=>
255
=
f
.
text_area
:note
,
:size
=>
255
%div
.attach_holder
%div
.attach_holder
%br
%br
=
f
.
label
:attachment
=
f
.
label
:attachment
...
...
app/views/notes/_load.js.haml
View file @
368deb59
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
:plain
:plain
NoteList.replace(
#{
@notes
.
last
.
id
}
,
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
NoteList.replace(
#{
@notes
.
last
.
id
}
,
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
-
elsif
params
[
:last_id
]
-
elsif
params
[
:last_id
]
:plain
:plain
NoteList.prepend(
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
NoteList.prepend(
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
...
...
app/views/notes/_show.html.haml
View file @
368deb59
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
ago
ago
-
if
(
note
.
author_id
==
current_user
.
id
)
||
can?
(
current_user
,
:admin_note
,
@project
)
-
if
(
note
.
author_id
==
current_user
.
id
)
||
can?
(
current_user
,
:admin_note
,
@project
)
=
link_to
"Remove"
,
[
@project
,
note
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:remote
=>
true
,
:class
=>
"cred delete-note right"
=
link_to
"Remove"
,
[
@project
,
note
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:remote
=>
true
,
:class
=>
"cred delete-note right"
%div
.note-title
%div
.note-title
=
markdown
(
note
.
note
)
=
markdown
(
note
.
note
)
-
if
note
.
attachment
.
url
-
if
note
.
attachment
.
url
...
...
app/views/projects/_feed.html.haml
View file @
368deb59
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
%span
.update-author
%span
.update-author
%strong
=
update
.
author_name
%strong
=
update
.
author_name
authored
authored
=
time_ago_in_words
(
update
.
created_at
)
=
time_ago_in_words
(
update
.
created_at
)
ago
ago
.right
.right
-
klass
=
update
.
class
.
to_s
.
split
(
"::"
).
last
.
downcase
-
klass
=
update
.
class
.
to_s
.
split
(
"::"
).
last
.
downcase
%span
.tag
{
:class
=>
klass
}=
klass
%span
.tag
{
:class
=>
klass
}=
klass
-
if
update
.
kind_of?
(
Grit
::
Commit
)
-
if
update
.
kind_of?
(
Grit
::
Commit
)
%span
.tag.commit
=
update
.
head
.
name
%span
.tag.commit
=
update
.
head
.
name
app/views/projects/_form.html.haml
View file @
368deb59
=
form_for
(
@project
,
:remote
=>
true
)
do
|
f
|
=
form_for
(
@project
,
:remote
=>
true
)
do
|
f
|
%div
.form_content
%div
.form_content
-
unless
@project
.
new_record?
-
unless
@project
.
new_record?
%h2
.icon
%h2
.icon
%span
%span
=
@project
.
name
=
@project
.
name
-
if
@project
.
errors
.
any?
-
if
@project
.
errors
.
any?
...
@@ -56,4 +56,4 @@
...
@@ -56,4 +56,4 @@
:javascript
:javascript
$
(
function
(){
$
(
function
(){
taggifyForm
();
taggifyForm
();
})
})
app/views/projects/_list.html.haml
View file @
368deb59
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
=
project
.
name
=
project
.
name
.small-tags
=
tag_list
project
.small-tags
=
tag_list
project
%td
=
truncate
project
.
url_to_repo
%td
=
truncate
project
.
url_to_repo
%td
=
project
.
code
%td
=
project
.
code
%td
=
check_box_tag
"read"
,
1
,
project
.
readers
.
include?
(
current_user
),
:disabled
=>
:disabled
%td
=
check_box_tag
"read"
,
1
,
project
.
readers
.
include?
(
current_user
),
:disabled
=>
:disabled
...
...
app/views/projects/_refs.html.haml
View file @
368deb59
=
form_tag
destination
,
:method
=>
:get
,
:class
=>
"project-refs-form"
do
=
form_tag
destination
,
:method
=>
:get
,
:class
=>
"project-refs-form"
do
=
select_tag
"ref"
,
grouped_options_refs
,
:onchange
=>
"this.form.submit();"
,
:class
=>
"project-refs-select"
=
select_tag
"ref"
,
grouped_options_refs
,
:onchange
=>
"this.form.submit();"
,
:class
=>
"project-refs-select"
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
'
.project-refs-select
'
).
chosen
();
$
(
'
.project-refs-select
'
).
chosen
();
...
...
app/views/projects/_tile.html.haml
View file @
368deb59
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
-
projects
.
each_with_index
do
|
project
,
i
|
-
projects
.
each_with_index
do
|
project
,
i
|
%div
.grid_1.projects_selector
%div
.grid_1.projects_selector
%div
{
:class
=>
"project-box ui-box ui-box-big"
}
%div
{
:class
=>
"project-box ui-box ui-box-big"
}
=
link_to
project_path
(
project
)
do
=
link_to
project_path
(
project
)
do
%h3
=
truncate
(
project
.
name
,
:length
=>
20
)
%h3
=
truncate
(
project
.
name
,
:length
=>
20
)
.data
.data
%p
.title.repository.git_url_wrapper
%p
.title.repository.git_url_wrapper
...
...
app/views/projects/_tree.html.haml
View file @
368deb59
-#%a.right.button{:href => "#"} Download
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
%a.right.button.blue{:href => "#"} EDIT
...
@@ -6,7 +5,7 @@
...
@@ -6,7 +5,7 @@
%h2
.icon
%h2
.icon
%span
%span
%d
%d
=
link_to
tree_project_path
(
@project
,
:path
=>
nil
,
:commit_id
=>
@commit
.
try
(
:id
)),
:remote
=>
true
do
=
link_to
tree_project_path
(
@project
,
:path
=>
nil
,
:commit_id
=>
@commit
.
try
(
:id
)),
:remote
=>
true
do
=
@project
.
name
=
@project
.
name
-
if
params
[
:path
]
-
if
params
[
:path
]
-
part_path
=
""
-
part_path
=
""
...
...
app/views/projects/index.html.haml
View file @
368deb59
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
.grid_4
.grid_4
-
if
current_user
.
can_create_project?
-
if
current_user
.
can_create_project?
%a
.grey-button.right
{
:href
=>
new_project_path
}
Create new project
%a
.grey-button.right
{
:href
=>
new_project_path
}
Create new project
%h2
.icon
%h2
.icon
%span
%span
Projects
Projects
...
...
app/views/projects/new.html.haml
View file @
368deb59
-
content_for
(
:body_class
,
"new-project-page"
)
-
content_for
(
:body_class
,
"new-project-page"
)
-
content_for
(
:page_title
)
do
-
content_for
(
:page_title
)
do
.new-project-hodler
.new-project-hodler
.container
.container
%h2
.icon
%h2
.icon
%span
%span
New Project
New Project
%div
.clear
%div
.clear
=
render
'form'
=
render
'form'
app/views/snippets/index.html.haml
View file @
368deb59
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
%table
.round-borders
#snippets-table
%table
.round-borders
#snippets-table
%thead
%thead
%th
%th
=
render
@snippets
.
fresh
=
render
@snippets
.
fresh
:javascript
:javascript
$
(
'
.delete-snippet
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
'
.delete-snippet
'
).
live
(
'
ajax:success
'
,
function
()
{
...
...
app/views/tags/index.html.haml
View file @
368deb59
-
content_for
(
:body_class
,
"projects-page"
)
-
content_for
(
:body_class
,
"projects-page"
)
-
content_for
(
:page_title
)
do
-
content_for
(
:page_title
)
do
.grid_4
.grid_4
%h2
%h2
Tags
Tags
.tags-list
.tags-list
-
@tags
.
all
.
each
do
|
tag
|
-
@tags
.
all
.
each
do
|
tag
|
=
link_to
"
#{
tag
.
name
}
(
#{
tag
.
count
}
)"
,
tag_path
(
name
)
=
link_to
"
#{
tag
.
name
}
(
#{
tag
.
count
}
)"
,
tag_path
(
name
)
config/routes.rb
View file @
368deb59
...
@@ -3,7 +3,6 @@ Gitlab::Application.routes.draw do
...
@@ -3,7 +3,6 @@ Gitlab::Application.routes.draw do
get
'tags'
=>
'tags#index'
get
'tags'
=>
'tags#index'
get
'tags/:tag'
=>
'projects#index'
get
'tags/:tag'
=>
'projects#index'
namespace
:admin
do
namespace
:admin
do
resources
:users
resources
:users
resources
:projects
resources
:projects
...
...
db/migrate/20111027152724_issue_conten_to_note.rb
View file @
368deb59
...
@@ -15,16 +15,16 @@ class IssueContenToNote < ActiveRecord::Migration
...
@@ -15,16 +15,16 @@ class IssueContenToNote < ActiveRecord::Migration
if
note
.
save
if
note
.
save
issue
.
update_attributes
(
:content
=>
nil
)
issue
.
update_attributes
(
:content
=>
nil
)
print
"."
print
"."
else
else
print
"F"
print
"F"
end
end
end
end
total
=
Issue
.
where
(
"content is not null"
).
count
total
=
Issue
.
where
(
"content is not null"
).
count
if
total
>
0
if
total
>
0
puts
"content of
#{
total
}
issues were not migrated"
puts
"content of
#{
total
}
issues were not migrated"
else
else
puts
"Done"
puts
"Done"
end
end
end
end
...
...
lib/assets/javascripts/branch-graph.js
View file @
368deb59
...
@@ -39,7 +39,7 @@ function branchGraph(holder) {
...
@@ -39,7 +39,7 @@ function branchGraph(holder) {
var
cuday
=
0
,
cumonth
=
""
;
var
cuday
=
0
,
cumonth
=
""
;
r
.
rect
(
0
,
0
,
days
.
length
*
20
+
20
,
20
).
attr
({
fill
:
"
#474D57
"
});
r
.
rect
(
0
,
0
,
days
.
length
*
20
+
20
,
20
).
attr
({
fill
:
"
#474D57
"
});
r
.
rect
(
0
,
20
,
days
.
length
*
20
+
20
,
20
).
attr
({
fill
:
"
#f7f7f7
"
});
r
.
rect
(
0
,
20
,
days
.
length
*
20
+
20
,
20
).
attr
({
fill
:
"
#f7f7f7
"
});
for
(
mm
=
0
;
mm
<
days
.
length
;
mm
++
)
{
for
(
mm
=
0
;
mm
<
days
.
length
;
mm
++
)
{
if
(
days
[
mm
]
!=
null
){
if
(
days
[
mm
]
!=
null
){
if
(
cuday
!=
days
[
mm
][
0
]){
if
(
cuday
!=
days
[
mm
][
0
]){
...
@@ -50,7 +50,7 @@ function branchGraph(holder) {
...
@@ -50,7 +50,7 @@ function branchGraph(holder) {
r
.
text
(
10
+
mm
*
20
,
10
,
days
[
mm
][
1
]).
attr
({
font
:
"
12px Fontin-Sans, Arial
"
,
fill
:
"
#444
"
});
r
.
text
(
10
+
mm
*
20
,
10
,
days
[
mm
][
1
]).
attr
({
font
:
"
12px Fontin-Sans, Arial
"
,
fill
:
"
#444
"
});
cumonth
=
days
[
mm
][
1
]
cumonth
=
days
[
mm
][
1
]
}
}
}
}
}
}
for
(
i
=
0
;
i
<
ii
;
i
++
)
{
for
(
i
=
0
;
i
<
ii
;
i
++
)
{
...
@@ -65,7 +65,7 @@ function branchGraph(holder) {
...
@@ -65,7 +65,7 @@ function branchGraph(holder) {
}
}
var
t
=
r
.
text
(
x
+
5
,
y
+
5
,
shortrefs
).
attr
({
font
:
"
12px Fontin-Sans, Arial
"
,
fill
:
"
#666
"
,
var
t
=
r
.
text
(
x
+
5
,
y
+
5
,
shortrefs
).
attr
({
font
:
"
12px Fontin-Sans, Arial
"
,
fill
:
"
#666
"
,
title
:
longrefs
,
cursor
:
"
pointer
"
,
rotation
:
"
90
"
});
title
:
longrefs
,
cursor
:
"
pointer
"
,
rotation
:
"
90
"
});
var
textbox
=
t
.
getBBox
();
var
textbox
=
t
.
getBBox
();
t
.
translate
(
textbox
.
height
/-
4
,
textbox
.
width
/
2
);
t
.
translate
(
textbox
.
height
/-
4
,
textbox
.
width
/
2
);
}
}
...
@@ -77,7 +77,7 @@ function branchGraph(holder) {
...
@@ -77,7 +77,7 @@ function branchGraph(holder) {
if
(
c
.
space
==
commits
[
i
].
space
)
{
if
(
c
.
space
==
commits
[
i
].
space
)
{
r
.
path
(
"
M
"
+
(
x
-
5
)
+
"
,
"
+
(
y
+
.
0001
)
+
"
L
"
+
(
15
+
20
*
c
.
time
)
+
"
,
"
+
(
y
+
.
0001
))
r
.
path
(
"
M
"
+
(
x
-
5
)
+
"
,
"
+
(
y
+
.
0001
)
+
"
L
"
+
(
15
+
20
*
c
.
time
)
+
"
,
"
+
(
y
+
.
0001
))
.
attr
({
stroke
:
colors
[
c
.
space
],
"
stroke-width
"
:
2
});
.
attr
({
stroke
:
colors
[
c
.
space
],
"
stroke-width
"
:
2
});
}
else
if
(
c
.
space
<
commits
[
i
].
space
)
{
}
else
if
(
c
.
space
<
commits
[
i
].
space
)
{
r
.
path
([
"
M
"
,
x
-
5
,
y
+
.
0001
,
"
l-5-2,0,4,5,-2C
"
,
x
-
5
,
y
,
x
-
17
,
y
+
2
,
x
-
20
,
y
-
10
,
"
L
"
,
cx
,
y
-
10
,
cx
,
cy
])
r
.
path
([
"
M
"
,
x
-
5
,
y
+
.
0001
,
"
l-5-2,0,4,5,-2C
"
,
x
-
5
,
y
,
x
-
17
,
y
+
2
,
x
-
20
,
y
-
10
,
"
L
"
,
cx
,
y
-
10
,
cx
,
cy
])
.
attr
({
stroke
:
colors
[
commits
[
i
].
space
],
"
stroke-width
"
:
2
});
.
attr
({
stroke
:
colors
[
commits
[
i
].
space
],
"
stroke-width
"
:
2
});
...
...
lib/graph_commit.rb
View file @
368deb59
...
@@ -12,20 +12,20 @@ class GraphCommit
...
@@ -12,20 +12,20 @@ class GraphCommit
@_commit
.
send
(
m
,
*
args
,
&
block
)
@_commit
.
send
(
m
,
*
args
,
&
block
)
end
end
# Method is adding time and space on the
# Method is adding time and space on the
# list of commits. As well as returns date list
# list of commits. As well as returns date list
# corelated with time set on commits.
# corelated with time set on commits.
#
#
# @param [Array<GraphCommit>] comits to index
# @param [Array<GraphCommit>] comits to index
#
#
# @return [Array<TimeDate>] list of commit dates corelated with time on commits
# @return [Array<TimeDate>] list of commit dates corelated with time on commits
def
self
.
index_commits
(
commits
)
def
self
.
index_commits
(
commits
)
days
,
heads
=
[],
[]
days
,
heads
=
[],
[]
map
=
{}
map
=
{}
commits
.
reverse
.
each_with_index
do
|
c
,
i
|
commits
.
reverse
.
each_with_index
do
|
c
,
i
|
c
.
time
=
i
c
.
time
=
i
days
[
i
]
=
c
.
committed_date
days
[
i
]
=
c
.
committed_date
map
[
c
.
id
]
=
c
map
[
c
.
id
]
=
c
heads
+=
c
.
refs
unless
c
.
refs
.
nil?
heads
+=
c
.
refs
unless
c
.
refs
.
nil?
end
end
...
@@ -35,7 +35,7 @@ class GraphCommit
...
@@ -35,7 +35,7 @@ class GraphCommit
heads
.
sort!
do
|
a
,
b
|
heads
.
sort!
do
|
a
,
b
|
if
a
.
name
==
"master"
if
a
.
name
==
"master"
-
1
-
1
elsif
b
.
name
==
"master"
elsif
b
.
name
==
"master"
1
1
else
else
b
.
commit
.
committed_date
<=>
a
.
commit
.
committed_date
b
.
commit
.
committed_date
<=>
a
.
commit
.
committed_date
...
@@ -45,7 +45,7 @@ class GraphCommit
...
@@ -45,7 +45,7 @@ class GraphCommit
j
=
0
j
=
0
heads
.
each
do
|
h
|
heads
.
each
do
|
h
|
if
map
.
include?
h
.
commit
.
id
then
if
map
.
include?
h
.
commit
.
id
then
j
=
mark_chain
(
j
+=
1
,
map
[
h
.
commit
.
id
],
map
)
j
=
mark_chain
(
j
+=
1
,
map
[
h
.
commit
.
id
],
map
)
end
end
end
end
days
days
...
@@ -55,15 +55,15 @@ class GraphCommit
...
@@ -55,15 +55,15 @@ class GraphCommit
#
#
# @param [Fixnum] space (row on the graph) to be set
# @param [Fixnum] space (row on the graph) to be set
# @param [GraphCommit] the commit object.
# @param [GraphCommit] the commit object.
# @param [Hash<String,GraphCommit>] map of commits
# @param [Hash<String,GraphCommit>] map of commits
#
#
# @return [Fixnum] max space used.
# @return [Fixnum] max space used.
def
self
.
mark_chain
(
mark
,
commit
,
map
)
def
self
.
mark_chain
(
mark
,
commit
,
map
)
commit
.
space
=
mark
if
commit
.
space
==
0
commit
.
space
=
mark
if
commit
.
space
==
0
m1
=
mark
-
1
m1
=
mark
-
1
marks
=
commit
.
parents
.
collect
do
|
p
|
marks
=
commit
.
parents
.
collect
do
|
p
|
if
map
.
include?
p
.
id
and
map
[
p
.
id
].
space
==
0
then
if
map
.
include?
p
.
id
and
map
[
p
.
id
].
space
==
0
then
mark_chain
(
m1
+=
1
,
map
[
p
.
id
],
map
)
mark_chain
(
m1
+=
1
,
map
[
p
.
id
],
map
)
else
else
m1
+
1
m1
+
1
end
end
...
@@ -71,5 +71,5 @@ class GraphCommit
...
@@ -71,5 +71,5 @@ class GraphCommit
marks
<<
mark
marks
<<
mark
marks
.
compact
.
max
marks
.
compact
.
max
end
end
end
end
spec/models/project_spec.rb
View file @
368deb59
...
@@ -62,10 +62,10 @@ describe Project do
...
@@ -62,10 +62,10 @@ describe Project do
end
end
end
end
describe
"updates"
do
describe
"updates"
do
let
(
:project
)
{
Factory
:project
}
let
(
:project
)
{
Factory
:project
}
before
do
before
do
@issue
=
Factory
:issue
,
@issue
=
Factory
:issue
,
:project
=>
project
,
:project
=>
project
,
:author
=>
Factory
(
:user
),
:author
=>
Factory
(
:user
),
...
@@ -86,10 +86,10 @@ describe Project do
...
@@ -86,10 +86,10 @@ describe Project do
end
end
end
end
describe
"last_activity"
do
describe
"last_activity"
do
let
(
:project
)
{
Factory
:project
}
let
(
:project
)
{
Factory
:project
}
before
do
before
do
@note
=
Factory
:note
,
@note
=
Factory
:note
,
:project
=>
project
,
:project
=>
project
,
:author
=>
Factory
(
:user
)
:author
=>
Factory
(
:user
)
...
@@ -99,7 +99,7 @@ describe Project do
...
@@ -99,7 +99,7 @@ describe Project do
it
{
project
.
last_activity_date
.
to_s
.
should
==
@note
.
created_at
.
to_s
}
it
{
project
.
last_activity_date
.
to_s
.
should
==
@note
.
created_at
.
to_s
}
end
end
describe
"fresh commits"
do
describe
"fresh commits"
do
let
(
:project
)
{
Factory
:project
}
let
(
:project
)
{
Factory
:project
}
it
{
project
.
fresh_commits
(
3
).
count
.
should
==
3
}
it
{
project
.
fresh_commits
(
3
).
count
.
should
==
3
}
...
...
spec/requests/dashboard_spec.rb
View file @
368deb59
...
@@ -15,13 +15,13 @@ describe "Dashboard" do
...
@@ -15,13 +15,13 @@ describe "Dashboard" do
end
end
it
"should have projects panel"
do
it
"should have projects panel"
do
within
".project-list"
do
within
".project-list"
do
page
.
should
have_content
(
@project
.
name
)
page
.
should
have_content
(
@project
.
name
)
end
end
end
end
it
"should have news feed"
do
it
"should have news feed"
do
within
"#news-feed"
do
within
"#news-feed"
do
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
...
...
spec/requests/projects_spec.rb
View file @
368deb59
...
@@ -73,7 +73,7 @@ describe "Projects" do
...
@@ -73,7 +73,7 @@ describe "Projects" do
end
end
it
"should beahave like activities page"
do
it
"should beahave like activities page"
do
within
".project-update"
do
within
".project-update"
do
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
"master"
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
author
.
name
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
page
.
should
have_content
(
@project
.
commit
.
safe_message
)
...
...
spec/requests/tags_spec.rb
View file @
368deb59
...
@@ -10,7 +10,6 @@ describe "Tags" do
...
@@ -10,7 +10,6 @@ describe "Tags" do
# end
# end
# end
# end
describe
"GET '/tags.json'"
do
describe
"GET '/tags.json'"
do
before
do
before
do
@project
=
Factory
:project
@project
=
Factory
:project
...
@@ -20,12 +19,9 @@ describe "Tags" do
...
@@ -20,12 +19,9 @@ describe "Tags" do
visit
'/tags.json'
visit
'/tags.json'
end
end
it
"should contains tags"
do
it
"should contains tags"
do
page
.
should
have_content
(
'demo1'
)
page
.
should
have_content
(
'demo1'
)
end
end
end
end
end
end
spec/requests/top_panel_spec.rb
View file @
368deb59
...
@@ -7,7 +7,7 @@ describe "Top Panel", :js => true do
...
@@ -7,7 +7,7 @@ describe "Top Panel", :js => true do
before
do
before
do
visit
projects_path
visit
projects_path
fill_in
"search"
,
:with
=>
"Ke"
fill_in
"search"
,
:with
=>
"Ke"
within
".ui-autocomplete"
do
within
".ui-autocomplete"
do
find
(
:xpath
,
"//a[.=
\"
Keys
\"
]"
).
click
find
(
:xpath
,
"//a[.=
\"
Keys
\"
]"
).
click
end
end
end
end
...
@@ -24,7 +24,7 @@ describe "Top Panel", :js => true do
...
@@ -24,7 +24,7 @@ describe "Top Panel", :js => true do
visit
project_path
(
@project
)
visit
project_path
(
@project
)
fill_in
"search"
,
:with
=>
"Commi"
fill_in
"search"
,
:with
=>
"Commi"
within
".ui-autocomplete"
do
within
".ui-autocomplete"
do
find
(
:xpath
,
"//a[.=
\"
#{
@project
.
code
}
/ Commits
\"
]"
).
click
find
(
:xpath
,
"//a[.=
\"
#{
@project
.
code
}
/ Commits
\"
]"
).
click
end
end
end
end
...
...
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