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
Boxiang Sun
gitlab-ce
Commits
292a41cb
Commit
292a41cb
authored
Feb 24, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed comments for snippets. Tests fixed
parent
d41d8ffb
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
24 deletions
+26
-24
app/controllers/notes_controller.rb
app/controllers/notes_controller.rb
+2
-0
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+0
-1
app/views/notes/_create_common.js.haml
app/views/notes/_create_common.js.haml
+9
-0
app/views/notes/_create_line.js.haml
app/views/notes/_create_line.js.haml
+8
-0
app/views/notes/create.js.haml
app/views/notes/create.js.haml
+5
-18
app/views/snippets/show.html.haml
app/views/snippets/show.html.haml
+1
-4
spec/requests/projects_wall_spec.rb
spec/requests/projects_wall_spec.rb
+1
-1
No files found.
app/controllers/notes_controller.rb
View file @
292a41cb
...
@@ -13,6 +13,8 @@ class NotesController < ApplicationController
...
@@ -13,6 +13,8 @@ class NotesController < ApplicationController
@notes
=
case
params
[
:target_type
]
@notes
=
case
params
[
:target_type
]
when
"commit"
when
"commit"
then
project
.
commit_notes
(
project
.
commit
((
params
[
:target_id
]))).
fresh
.
limit
(
20
)
then
project
.
commit_notes
(
project
.
commit
((
params
[
:target_id
]))).
fresh
.
limit
(
20
)
when
"snippet"
then
project
.
snippets
.
find
(
params
[
:target_id
]).
notes
when
"wall"
when
"wall"
then
project
.
common_notes
.
order
(
"created_at DESC"
).
fresh
.
limit
(
20
)
then
project
.
common_notes
.
order
(
"created_at DESC"
).
fresh
.
limit
(
20
)
when
"issue"
when
"issue"
...
...
app/controllers/snippets_controller.rb
View file @
292a41cb
...
@@ -55,7 +55,6 @@ class SnippetsController < ApplicationController
...
@@ -55,7 +55,6 @@ class SnippetsController < ApplicationController
end
end
def
show
def
show
@notes
=
@snippet
.
notes
@note
=
@project
.
notes
.
new
(
:noteable
=>
@snippet
)
@note
=
@project
.
notes
.
new
(
:noteable
=>
@snippet
)
render_full_content
render_full_content
end
end
...
...
app/views/notes/_create_common.js.haml
0 → 100644
View file @
292a41cb
-
if
note
.
valid?
:plain
$("#new_note .errors").remove();
$('#new_note textarea').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/notes/_create_line.js.haml
0 → 100644
View file @
292a41cb
-
if
note
.
valid?
:plain
$(".per_line_form").hide();
$('#new_note textarea').val("");
$("a.line_note_reply_link[line_code='
#{
note
.
line_code
}
']").closest("tr").remove();
var trEl = $(".
#{
note
.
line_code
}
").parent();
trEl.after("
#{
escape_javascript
(
render
:partial
=>
"notes/per_line_show"
,
:locals
=>
{
:note
=>
note
})
}
");
trEl.after("
#{
escape_javascript
(
render
:partial
=>
"notes/reply_button"
,
:locals
=>
{
:line_code
=>
note
.
line_code
})
}
");
app/views/notes/create.js.haml
View file @
292a41cb
-
if
@note
.
valid?
-
if
@note
.
line_code
-
if
@note
.
line_code
=
render
"create_line"
,
:note
=>
@note
:plain
$(".per_line_form").hide();
$('#new_note textarea').val("");
$("a.line_note_reply_link[line_code='
#{
@note
.
line_code
}
']").closest("tr").remove();
var trEl = $(".
#{
@note
.
line_code
}
").parent();
trEl.after("
#{
escape_javascript
(
render
:partial
=>
"notes/per_line_show"
,
:locals
=>
{
:note
=>
@note
})
}
");
trEl.after("
#{
escape_javascript
(
render
:partial
=>
"notes/reply_button"
,
:locals
=>
{
:line_code
=>
@note
.
line_code
})
}
");
-
else
:plain
$("#new_note .errors").remove();
$('#new_note textarea').val("");
NoteList.prepend(
#{
@note
.
id
}
, "
#{
escape_javascript
(
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
@note
})
}
");
-
else
-
else
-
unless
@note
.
line_code
=
render
"create_common"
,
:note
=>
@note
:plain
$("#new_note").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
-# Enable submit button
:plain
:plain
$("#submit_note").removeAttr("disabled");
$("#submit_note").removeAttr("disabled");
app/views/snippets/show.html.haml
View file @
292a41cb
...
@@ -14,8 +14,5 @@
...
@@ -14,8 +14,5 @@
.data.no-padding
.data.no-padding
:erb
:erb
<%=
raw
@snippet
.
colorize
%>
<%=
raw
@snippet
.
colorize
%>
.clear
%br
.snippet_notes
=
render
"notes/notes"
.clear
=
render
"notes/notes"
,
:tid
=>
@snippet
.
id
,
:tt
=>
"snippet"
spec/requests/projects_wall_spec.rb
View file @
292a41cb
...
@@ -8,7 +8,7 @@ describe "Projects", "Wall" do
...
@@ -8,7 +8,7 @@ describe "Projects", "Wall" do
project
.
add_access
(
@user
,
:read
,
:write
)
project
.
add_access
(
@user
,
:read
,
:write
)
end
end
describe
"View notes on wall"
do
describe
"View notes on wall"
,
:js
=>
true
do
before
do
before
do
Factory
:note
,
:project
=>
project
,
:note
=>
"Project specs"
,
:author
=>
@user
Factory
:note
,
:project
=>
project
,
:note
=>
"Project specs"
,
:author
=>
@user
visit
wall_project_path
(
project
)
visit
wall_project_path
(
project
)
...
...
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