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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
8a23682f
Commit
8a23682f
authored
Nov 04, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored too
parent
ca1e3d05
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
56 additions
and
53 deletions
+56
-53
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+1
-1
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+7
-4
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+9
-1
app/views/commits/show.js.haml
app/views/commits/show.js.haml
+1
-8
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+12
-1
app/views/issues/show.js.haml
app/views/issues/show.js.haml
+1
-2
app/views/notes/_load.js.haml
app/views/notes/_load.js.haml
+10
-0
app/views/notes/_notes.html.haml
app/views/notes/_notes.html.haml
+12
-13
app/views/notes/create.js.haml
app/views/notes/create.js.haml
+1
-0
app/views/projects/wall.html.haml
app/views/projects/wall.html.haml
+1
-14
app/views/projects/wall.js.haml
app/views/projects/wall.js.haml
+1
-9
No files found.
app/assets/stylesheets/projects.css.scss
View file @
8a23682f
...
...
@@ -540,7 +540,7 @@ input.ssh_project_url {
font-size
:
14px
;
}
.wall_pag
e
{
#new_not
e
{
#note_note
{
height
:
25px
;
}
...
...
app/controllers/commits_controller.rb
View file @
8a23682f
...
...
@@ -28,12 +28,15 @@ class CommitsController < ApplicationController
def
show
@commit
=
project
.
repo
.
commits
(
params
[
:id
]).
first
@notes
=
project
.
notes
.
where
(
:noteable_id
=>
@commit
.
id
,
:noteable_type
=>
"Commit"
)
@notes
=
project
.
notes
.
where
(
:noteable_id
=>
@commit
.
id
,
:noteable_type
=>
"Commit"
)
.
order
(
"created_at DESC"
).
limit
(
20
)
@note
=
@project
.
notes
.
new
(
:noteable_id
=>
@commit
.
id
,
:noteable_type
=>
"Commit"
)
respond_to
do
|
format
|
format
.
html
# show.html.erb
format
.
js
respond_to
do
|
format
|
format
.
html
format
.
js
do
@notes
=
@notes
.
where
(
"id > ?"
,
params
[
:last_id
])
if
params
[
:last_id
]
@notes
=
@notes
.
where
(
"id < ?"
,
params
[
:first_id
])
if
params
[
:first_id
]
end
end
end
end
app/controllers/issues_controller.rb
View file @
8a23682f
...
...
@@ -35,8 +35,16 @@ class IssuesController < ApplicationController
end
def
show
@notes
=
@issue
.
notes
.
order
(
"created_at
ASC"
)
@notes
=
@issue
.
notes
.
order
(
"created_at
DESC"
).
limit
(
20
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@issue
)
respond_to
do
|
format
|
format
.
html
format
.
js
do
@notes
=
@notes
.
where
(
"id > ?"
,
params
[
:last_id
])
if
params
[
:last_id
]
@notes
=
@notes
.
where
(
"id < ?"
,
params
[
:first_id
])
if
params
[
:first_id
]
end
end
end
def
create
...
...
app/views/commits/show.js.haml
View file @
8a23682f
-#:plain
$("#side-commit-preview").remove();
var side = $("<div id='side-commit-preview'></div>");
side.html("#{escape_javascript(render "commits/show")}");
$("##{dom_id(@project)}").parent().append(side);
$("##{dom_id(@project)}").addClass("span-14");
:plain
$("#notes-list").html("
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
=
render
"notes/load"
app/views/issues/show.html.haml
View file @
8a23682f
%h2
=
"Issue #
#{
@issue
.
id
}
-
#{
html_escape
(
@issue
.
title
)
}
"
.left.width-65p
-#= simple_format html_escape(@issue.content)
.issue_notes
=
render
"notes/notes"
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
.right.width-30p
.span-8
-
if
@issue
.
closed
...
...
@@ -55,3 +57,12 @@
.right
=
link_to
'Destroy'
,
[
@project
,
@issue
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"lbutton delete-issue negative"
,
:id
=>
"destroy_issue_
#{
@issue
.
id
}
"
.clear
:javascript
$
(
function
(){
$
(
"
#note_note
"
).
live
(
"
click
"
,
function
(){
$
(
this
).
css
(
"
height
"
,
"
100px
"
);
$
(
'
.attach_holder
'
).
show
();
});
NoteList
.
init
(
"
wall
"
,
#{
@notes
.
last
.
id
}
,
#{
@notes
.
first
.
id
}
);
});
app/views/issues/show.js.haml
View file @
8a23682f
:plain
$("#notes-list").html("
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
=
render
"notes/load"
app/views/notes/_load.js.haml
0 → 100644
View file @
8a23682f
-
unless
@notes
.
blank?
-
if
params
[
:last_id
]
:plain
NoteList.prepend(
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
-
if
params
[
:first_id
]
:plain
NoteList.append(
#{
@notes
.
last
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
app/views/notes/_notes.html.haml
View file @
8a23682f
-
if
controller
.
action_name
==
"wall"
%ul
#notes-list
=
render
"notes/notes_list"
-
else
%ul
#notes-list
=
render
"notes/notes_list"
%br
%br
-
if
can?
current_user
,
:write_note
,
@project
=
render
"notes/form"
-
if
can?
current_user
,
:write_note
,
@project
=
render
"notes/form"
.clear
%hr
%ul
#notes-list
=
render
"notes/notes_list"
:javascript
$
(
'
.delete-note
'
).
live
(
'
ajax:success
'
,
function
()
{
...
...
@@ -20,8 +16,11 @@
$
(
"
#submit_note
"
).
removeAttr
(
"
disabled
"
);
})
-#- if ["issues", "projects"].include?(controller.controller_name)
:javascript
$(function(){
var int =self.setInterval("updatePage('ref=#{params[:ref]}')", 20000
);
$
(
function
(){
$
(
"
#note_note
"
).
live
(
"
click
"
,
function
(){
$
(
this
).
css
(
"
height
"
,
"
100px
"
);
$
(
'
.attach_holder
'
).
show
(
);
});
NoteList
.
init
(
"
wall
"
,
#{
@notes
.
last
.
try
(
:id
)
||
0
}
,
#{
@notes
.
first
.
try
(
:id
)
||
0
}
);
});
app/views/notes/create.js.haml
View file @
8a23682f
...
...
@@ -2,6 +2,7 @@
:plain
$("#new_note .errors").remove();
$('#note_note').val("");
NoteList.prepend(
#{
@note
.
id
}
, "
#{
escape_javascript
(
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
@note
})
}
");
-
else
:plain
$("#new_note").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
...
...
app/views/projects/wall.html.haml
View file @
8a23682f
%div
.wall_page
-
if
can?
current_user
,
:write_note
,
@project
=
render
"notes/form"
.clear
%hr
=
render
"notes/notes"
=
render
"notes/notes"
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
:javascript
$
(
function
(){
$
(
"
#note_note
"
).
live
(
"
click
"
,
function
(){
$
(
this
).
css
(
"
height
"
,
"
100px
"
);
$
(
'
.attach_holder
'
).
show
();
});
NoteList
.
init
(
"
wall
"
,
#{
@notes
.
last
.
id
}
,
#{
@notes
.
first
.
id
}
);
});
app/views/projects/wall.js.haml
View file @
8a23682f
-
unless
@notes
.
blank?
-
if
params
[
:last_id
]
:plain
NoteList.prepend(
#{
@notes
.
first
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
-
if
params
[
:first_id
]
:plain
NoteList.append(
#{
@notes
.
last
.
id
}
, "
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
=
render
"notes/load"
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