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
ca1e3d05
Commit
ca1e3d05
authored
Nov 04, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wall login in progress
parent
687290a0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
110 additions
and
74 deletions
+110
-74
app/assets/images/ajax-loader.gif
app/assets/images/ajax-loader.gif
+0
-0
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+2
-2
app/assets/javascripts/note.js
app/assets/javascripts/note.js
+65
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+10
-35
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+8
-6
app/views/notes/_notes.html.haml
app/views/notes/_notes.html.haml
+2
-2
app/views/notes/_show.html.haml
app/views/notes/_show.html.haml
+9
-11
app/views/notes/create.js.haml
app/views/notes/create.js.haml
+0
-1
app/views/projects/wall.html.haml
app/views/projects/wall.html.haml
+5
-15
app/views/projects/wall.js.haml
app/views/projects/wall.js.haml
+9
-2
No files found.
app/assets/images/ajax-loader.gif
View replaced file @
687290a0
View file @
ca1e3d05
6.66 KB
|
W:
|
H:
4.08 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/assets/javascripts/application.js
View file @
ca1e3d05
...
@@ -20,6 +20,6 @@ $(function(){
...
@@ -20,6 +20,6 @@ $(function(){
$
(
'
select#tag
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#tag
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
});
});
function
updatePage
(){
function
updatePage
(
data
){
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
dataType
:
"
script
"
});
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
data
,
data
Type
:
"
script
"
});
}
}
app/assets/javascripts/note.js
0 → 100644
View file @
ca1e3d05
var
NoteList
=
{
first_id
:
0
,
last_id
:
0
,
resource_name
:
null
,
init
:
function
(
resource_name
,
first_id
,
last_id
)
{
this
.
resource_name
=
resource_name
;
this
.
first_id
=
first_id
;
this
.
last_id
=
last_id
;
this
.
initRefresh
();
this
.
initLoadMore
();
},
getOld
:
function
()
{
$
(
'
.loading
'
).
show
();
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
"
first_id=
"
+
this
.
first_id
,
complete
:
function
(){
$
(
'
.loading
'
).
hide
()},
dataType
:
"
script
"
});
},
append
:
function
(
id
,
html
)
{
this
.
first_id
=
id
;
$
(
"
#notes-list
"
).
append
(
html
);
this
.
initLoadMore
();
},
prepend
:
function
(
id
,
html
)
{
this
.
last_id
=
id
;
$
(
"
#notes-list
"
).
prepend
(
html
);
},
getNew
:
function
()
{
// refersh notes list
$
.
ajax
({
type
:
"
GET
"
,
url
:
location
.
href
,
data
:
"
last_id=
"
+
this
.
last_id
,
dataType
:
"
script
"
});
},
initRefresh
:
function
()
{
// init timer
var
int
=
setInterval
(
"
NoteList.getNew()
"
,
20000
);
},
initLoadMore
:
function
()
{
$
(
window
).
bind
(
'
scroll
'
,
function
(){
if
(
$
(
window
).
scrollTop
()
==
$
(
document
).
height
()
-
$
(
window
).
height
()){
$
(
window
).
unbind
(
'
scroll
'
);
NoteList
.
getOld
();
}
});
}
}
app/assets/stylesheets/projects.css.scss
View file @
ca1e3d05
...
@@ -421,31 +421,6 @@ input.ssh_project_url {
...
@@ -421,31 +421,6 @@ input.ssh_project_url {
list-style
:none
;
list-style
:none
;
margin
:
0px
;
margin
:
0px
;
padding
:
0px
;
padding
:
0px
;
li
{
display
:list-item
;
padding
:
8px
;
margin
:
0px
;
background
:
#F7FBFC
;
border-top
:
1px
solid
#E2EAEE
;
&
:first-child
{
border-top
:
none
;
}
&
:nth-child
(
2n
+
1
)
{
background
:
white
;
}
p
{
margin-bottom
:
4px
;
font-size
:
13px
;
color
:
#111
;
}
}
cite
{
&
.ago
{
color
:
#666
;
}
}
}
}
.notes_count
{
.notes_count
{
...
@@ -460,14 +435,6 @@ input.ssh_project_url {
...
@@ -460,14 +435,6 @@ input.ssh_project_url {
right
:
6px
;
right
:
6px
;
top
:
6px
;
top
:
6px
;
}
}
.note_author
{
float
:left
;
width
:
60px
;
}
.note_content
{
float
:left
;
width
:
650px
;
}
.issue_notes
{
.issue_notes
{
.note_content
{
.note_content
{
...
@@ -556,8 +523,7 @@ input.ssh_project_url {
...
@@ -556,8 +523,7 @@ input.ssh_project_url {
}
}
.commit
,
.commit
,
.message
,
.message
{
#notes-list
{
.author
{
.author
{
background
:
#eaeaea
;
background
:
#eaeaea
;
color
:
#333
;
color
:
#333
;
...
@@ -719,3 +685,12 @@ table.highlighttable pre{
...
@@ -719,3 +685,12 @@ table.highlighttable pre{
.project-refs-select
{
.project-refs-select
{
width
:
200px
;
width
:
200px
;
}
}
body
.project-page
#notes-list
.note
{
padding
:
10px
;
border-bottom
:
1px
solid
#eee
;
overflow
:
hidden
;
display
:
block
;}
body
.project-page
#notes-list
.note
{
padding
:
10px
;
border-bottom
:
1px
solid
#eee
;
overflow
:
hidden
;
display
:
block
;}
body
.project-page
#notes-list
.note
img
{
float
:
left
;
margin-right
:
10px
;}
body
.project-page
#notes-list
.note
span
.note-title
{
display
:
block
;}
body
.project-page
#notes-list
.note
span
.note-title
{
margin-bottom
:
10px
}
body
.project-page
#notes-list
.note
span
.note-author
{
color
:
#999
;
font-weight
:
normal
;
font-style
:
italic
;}
body
.project-page
#notes-list
.note
span
.note-author
strong
{
font-weight
:
bold
;
font-style
:
normal
;}
app/controllers/projects_controller.rb
View file @
ca1e3d05
...
@@ -86,12 +86,14 @@ class ProjectsController < ApplicationController
...
@@ -86,12 +86,14 @@ class ProjectsController < ApplicationController
def
wall
def
wall
@note
=
Note
.
new
@note
=
Note
.
new
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@project
.
common_notes
.
order
(
"created_at DESC"
)
@notes
=
@notes
.
fresh
.
limit
(
20
)
@notes
=
case
params
[
:view
]
respond_to
do
|
format
|
when
"week"
then
@notes
.
since
((
Date
.
today
-
7
.
days
).
at_beginning_of_day
)
format
.
html
when
"all"
then
@notes
.
all
format
.
js
do
when
"day"
then
@notes
.
since
(
Date
.
today
.
at_beginning_of_day
)
@notes
=
@notes
.
where
(
"id > ?"
,
params
[
:last_id
])
if
params
[
:last_id
]
else
@notes
.
fresh
.
limit
(
10
)
@notes
=
@notes
.
where
(
"id < ?"
,
params
[
:first_id
])
if
params
[
:first_id
]
end
end
end
end
end
...
...
app/views/notes/_notes.html.haml
View file @
ca1e3d05
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
$
(
"
#submit_note
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#submit_note
"
).
removeAttr
(
"
disabled
"
);
})
})
-
if
[
"issues"
,
"projects"
].
include?
(
controller
.
controller_name
)
-
#-
if ["issues", "projects"].include?(controller.controller_name)
:javascript
:javascript
$(function(){
$(function(){
var
int
=
self
.
setInterval
(
"
updatePage()
"
,
20000
);
var int =self.setInterval("updatePage(
'ref=#{params[:ref]}'
)", 20000);
});
});
app/views/notes/_show.html.haml
View file @
ca1e3d05
%li
{
:id
=>
dom_id
(
note
)}
%li
{
:id
=>
dom_id
(
note
),
:class
=>
"note"
}
%div
.note_author
=
image_tag
gravatar_icon
(
note
.
author
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
=
image_tag
gravatar_icon
(
note
.
author
.
email
),
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
%div
.note_content.left
%div
.note-author
%strong
=
note
.
author_name
=
time_ago_in_words
(
note
.
updated_at
)
-
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
=>
"lbutton delete-note right negative"
%div
.note-title
=
markdown
(
note
.
note
)
=
markdown
(
note
.
note
)
-
if
note
.
attachment
.
url
-
if
note
.
attachment
.
url
Attachment:
Attachment:
=
link_to
note
.
attachment_identifier
,
note
.
attachment
.
url
,
:target
=>
"_blank"
=
link_to
note
.
attachment_identifier
,
note
.
attachment
.
url
,
:target
=>
"_blank"
%br
%br
%span
.author
=
note
.
author
.
name
%cite
.ago
=
time_ago_in_words
(
note
.
updated_at
)
ago
%br
-
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
=>
"lbutton delete-note right negative"
.clear
.clear
app/views/notes/create.js.haml
View file @
ca1e3d05
-
if
@note
.
valid?
-
if
@note
.
valid?
:plain
:plain
$("#new_note .errors").remove();
$("#new_note .errors").remove();
updatePage();
$('#note_note').val("");
$('#note_note').val("");
-
else
-
else
:plain
:plain
...
...
app/views/projects/wall.html.haml
View file @
ca1e3d05
%div
.wall_page
%div
.wall_page
-
if
can?
current_user
,
:write_note
,
@project
-
if
can?
current_user
,
:write_note
,
@project
=
render
"notes/form"
=
render
"notes/form"
.right
=
form_tag
wall_project_path
(
@project
),
:method
=>
:get
do
.span-2
=
radio_button_tag
:view
,
"recent"
,
(
params
[
:view
]
||
"recent"
)
==
"recent"
,
:onclick
=>
"this.form.submit()"
,
:id
=>
"recent_view"
=
label_tag
"recent_view"
,
"Recent"
.span-2
=
radio_button_tag
:view
,
"day"
,
params
[
:view
]
==
"day"
,
:onclick
=>
"this.form.submit()"
,
:id
=>
"day_view"
=
label_tag
"day_view"
,
"Today"
.span-2
=
radio_button_tag
:view
,
"week"
,
params
[
:view
]
==
"week"
,
:onclick
=>
"this.form.submit()"
,
:id
=>
"week_view"
=
label_tag
"week_view"
,
"Week"
.span-2
=
radio_button_tag
:view
,
"all"
,
params
[
:view
]
==
"all"
,
:onclick
=>
"this.form.submit()"
,
:id
=>
"all_view"
=
label_tag
"all_view"
,
"All"
.clear
.clear
%br
%hr
%hr
=
render
"notes/notes"
=
render
"notes/notes"
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
"
#note_note
"
).
live
(
"
click
"
,
function
(){
$
(
"
#note_note
"
).
live
(
"
click
"
,
function
(){
$
(
this
).
css
(
"
height
"
,
"
100px
"
);
$
(
this
).
css
(
"
height
"
,
"
100px
"
);
$
(
'
.attach_holder
'
).
show
();
$
(
'
.attach_holder
'
).
show
();
});
});
NoteList
.
init
(
"
wall
"
,
#{
@notes
.
last
.
id
}
,
#{
@notes
.
first
.
id
}
);
});
});
app/views/projects/wall.js.haml
View file @
ca1e3d05
:plain
-
unless
@notes
.
blank?
$("#notes-list").html("
#{
escape_javascript
(
render
(
:partial
=>
'notes/notes_list'
))
}
");
-
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'
))
}
");
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