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
a2eda66b
Commit
a2eda66b
authored
Jul 02, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable issues sort. Recent issues on top. Fixed tests
parent
e00390b3
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
47 deletions
+29
-47
app/assets/javascripts/issues.js
app/assets/javascripts/issues.js
+0
-2
app/assets/stylesheets/gitlab_bootstrap.scss
app/assets/stylesheets/gitlab_bootstrap.scss
+1
-0
app/mailers/notify.rb
app/mailers/notify.rb
+2
-1
app/models/project.rb
app/models/project.rb
+1
-1
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+1
-0
app/views/issues/index.html.haml
app/views/issues/index.html.haml
+0
-21
app/views/issues/index.js.haml
app/views/issues/index.js.haml
+0
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+8
-3
lib/color.rb
lib/color.rb
+2
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+12
-16
spec/models/project_hooks_spec.rb
spec/models/project_hooks_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/assets/javascripts/issues.js
View file @
a2eda66b
...
@@ -51,7 +51,6 @@ function initIssuesSearch() {
...
@@ -51,7 +51,6 @@ function initIssuesSearch() {
if
(
terms
.
length
>=
2
||
terms
.
length
==
0
)
{
if
(
terms
.
length
>=
2
||
terms
.
length
==
0
)
{
$
.
get
(
href
,
{
'
f
'
:
status
,
'
terms
'
:
terms
,
'
milestone_id
'
:
milestone_id
},
function
(
response
)
{
$
.
get
(
href
,
{
'
f
'
:
status
,
'
terms
'
:
terms
,
'
milestone_id
'
:
milestone_id
},
function
(
response
)
{
$
(
'
#issues-table
'
).
html
(
response
);
$
(
'
#issues-table
'
).
html
(
response
);
setSortable
();
});
});
}
}
}
}
...
@@ -68,7 +67,6 @@ function initIssuesSearch() {
...
@@ -68,7 +67,6 @@ function initIssuesSearch() {
*/
*/
function
issuesPage
(){
function
issuesPage
(){
initIssuesSearch
();
initIssuesSearch
();
setSortable
();
$
(
"
#label_name
"
).
chosen
();
$
(
"
#label_name
"
).
chosen
();
$
(
"
#assignee_id
"
).
chosen
();
$
(
"
#assignee_id
"
).
chosen
();
$
(
"
#milestone_id
"
).
chosen
();
$
(
"
#milestone_id
"
).
chosen
();
...
...
app/assets/stylesheets/gitlab_bootstrap.scss
View file @
a2eda66b
...
@@ -201,6 +201,7 @@ a:focus {
...
@@ -201,6 +201,7 @@ a:focus {
.cred
{
color
:
#D12F19
;
}
.cred
{
color
:
#D12F19
;
}
.cgreen
{
color
:
#44aa22
;
}
.cgreen
{
color
:
#44aa22
;
}
.cblack
{
color
:
#111
;
}
.cblack
{
color
:
#111
;
}
.cdark
{
color
:
#444
}
.cwhite
{
color
:
#fff
!
important
}
.cwhite
{
color
:
#fff
!
important
}
/** COMMON STYLES **/
/** COMMON STYLES **/
...
...
app/mailers/notify.rb
View file @
a2eda66b
...
@@ -4,6 +4,7 @@ class Notify < ActionMailer::Base
...
@@ -4,6 +4,7 @@ class Notify < ActionMailer::Base
default_url_options
[
:host
]
=
Gitlab
.
config
.
web_host
default_url_options
[
:host
]
=
Gitlab
.
config
.
web_host
default_url_options
[
:protocol
]
=
Gitlab
.
config
.
web_protocol
default_url_options
[
:protocol
]
=
Gitlab
.
config
.
web_protocol
default_url_options
[
:port
]
=
Gitlab
.
config
.
web_port
default
from:
Gitlab
.
config
.
email_from
default
from:
Gitlab
.
config
.
email_from
...
...
app/models/project.rb
View file @
a2eda66b
...
@@ -13,7 +13,7 @@ class Project < ActiveRecord::Base
...
@@ -13,7 +13,7 @@ class Project < ActiveRecord::Base
has_many
:users
,
:through
=>
:users_projects
has_many
:users
,
:through
=>
:users_projects
has_many
:events
,
:dependent
=>
:destroy
has_many
:events
,
:dependent
=>
:destroy
has_many
:merge_requests
,
:dependent
=>
:destroy
has_many
:merge_requests
,
:dependent
=>
:destroy
has_many
:issues
,
:dependent
=>
:destroy
,
:order
=>
"closed,
position
"
has_many
:issues
,
:dependent
=>
:destroy
,
:order
=>
"closed,
created_at DESC
"
has_many
:milestones
,
:dependent
=>
:destroy
has_many
:milestones
,
:dependent
=>
:destroy
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:users_projects
,
:dependent
=>
:destroy
has_many
:notes
,
:dependent
=>
:destroy
has_many
:notes
,
:dependent
=>
:destroy
...
...
app/views/issues/_show.html.haml
View file @
a2eda66b
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
%p
.row_title
=
truncate
(
issue
.
title
,
:length
=>
100
)
%p
.row_title
=
truncate
(
issue
.
title
,
:length
=>
100
)
%span
.update-author
%span
.update-author
%small
.cdark
=
"#
#{
issue
.
id
}
"
-
if
issue
.
assignee
-
if
issue
.
assignee
assigned to
#{
issue
.
assignee_name
}
assigned to
#{
issue
.
assignee_name
}
-
else
-
else
...
...
app/views/issues/index.html.haml
View file @
a2eda66b
...
@@ -46,24 +46,3 @@
...
@@ -46,24 +46,3 @@
$
(
function
(){
$
(
function
(){
issuesPage
();
issuesPage
();
})
})
function
setSortable
(){
$
(
'
#issues-table
'
).
sortable
({
axis
:
'
y
'
,
dropOnEmpty
:
false
,
handle
:
'
.avatar
'
,
items
:
'
li
'
,
opacity
:
0.4
,
scroll
:
true
,
update
:
function
(){
$
.
ajax
({
type
:
'
post
'
,
data
:
$
(
'
#issues-table
'
).
sortable
(
'
serialize
'
),
dataType
:
'
script
'
,
complete
:
function
(
request
){
$
(
'
#issues-table
'
).
effect
(
'
highlight
'
);
},
url
:
"
#{
sort_project_issues_path
(
@project
)
}
"
})
}
});
}
app/views/issues/index.js.haml
View file @
a2eda66b
:plain
:plain
$('#issues-table').html("
#{
escape_javascript
(
render
(
'issues'
))
}
");
$('#issues-table').html("
#{
escape_javascript
(
render
(
'issues'
))
}
");
setSortable();
config/initializers/1_settings.rb
View file @
a2eda66b
...
@@ -3,7 +3,7 @@ class Settings < Settingslogic
...
@@ -3,7 +3,7 @@ class Settings < Settingslogic
class
<<
self
class
<<
self
def
web_protocol
def
web_protocol
self
.
web
[
'protocol'
]
||=
web
.
https
?
"https
://"
:
"http://
"
self
.
web
[
'protocol'
]
||=
web
.
https
?
"https
"
:
"http
"
end
end
def
web_host
def
web_host
...
@@ -18,10 +18,15 @@ class Settings < Settingslogic
...
@@ -18,10 +18,15 @@ class Settings < Settingslogic
self
[
'url'
]
||=
build_url
self
[
'url'
]
||=
build_url
end
end
def
web_port
web
[
'port'
]
||=
80
end
def
build_url
def
build_url
raw_url
=
self
.
web_protocol
raw_url
=
self
.
web_protocol
raw_url
<<
web
.
host
raw_url
<<
"://"
raw_url
<<
":
#{
web
.
port
}
"
if
web
.
port
.
to_i
!=
80
raw_url
<<
web_host
raw_url
<<
":
#{
web_port
}
"
if
web_port
.
to_i
!=
80
raw_url
raw_url
end
end
...
...
lib/color.rb
View file @
a2eda66b
module
Color
module
Color
extend
self
def
colorize
(
text
,
color_code
)
def
colorize
(
text
,
color_code
)
"
\033
[
#{
color_code
}#{
text
}
\033
[0m"
"
\033
[
#{
color_code
}#{
text
}
\033
[0m"
end
end
...
...
spec/mailers/notify_spec.rb
View file @
a2eda66b
...
@@ -4,10 +4,6 @@ describe Notify do
...
@@ -4,10 +4,6 @@ describe Notify do
include
EmailSpec
::
Helpers
include
EmailSpec
::
Helpers
include
EmailSpec
::
Matchers
include
EmailSpec
::
Matchers
before
:all
do
default_url_options
[
:host
]
=
Gitlab
.
config
.
web_host
end
let
(
:recipient
)
{
Factory
.
create
(
:user
,
:email
=>
'recipient@example.com'
)
}
let
(
:recipient
)
{
Factory
.
create
(
:user
,
:email
=>
'recipient@example.com'
)
}
let
(
:project
)
{
Factory
.
create
(
:project
)
}
let
(
:project
)
{
Factory
.
create
(
:project
)
}
...
@@ -18,7 +14,7 @@ describe Notify do
...
@@ -18,7 +14,7 @@ describe Notify do
end
end
describe
'for new users, the email'
do
describe
'for new users, the email'
do
let
(
:example_site_
url
)
{
root_url
}
let
(
:example_site_
path
)
{
root_path
}
let
(
:new_user
)
{
Factory
.
create
(
:user
,
:email
=>
'newguy@example.com'
)
}
let
(
:new_user
)
{
Factory
.
create
(
:user
,
:email
=>
'newguy@example.com'
)
}
subject
{
Notify
.
new_user_email
(
new_user
.
id
,
new_user
.
password
)
}
subject
{
Notify
.
new_user_email
(
new_user
.
id
,
new_user
.
password
)
}
...
@@ -40,7 +36,7 @@ describe Notify do
...
@@ -40,7 +36,7 @@ describe Notify do
end
end
it
'includes a link to the site'
do
it
'includes a link to the site'
do
should
have_body_text
/
#{
example_site_
url
}
/
should
have_body_text
/
#{
example_site_
path
}
/
end
end
end
end
...
@@ -68,7 +64,7 @@ describe Notify do
...
@@ -68,7 +64,7 @@ describe Notify do
end
end
it
'contains a link to the new issue'
do
it
'contains a link to the new issue'
do
should
have_body_text
/
#{
project_issue_
url
project
,
issue
}
/
should
have_body_text
/
#{
project_issue_
path
project
,
issue
}
/
end
end
end
end
...
@@ -92,7 +88,7 @@ describe Notify do
...
@@ -92,7 +88,7 @@ describe Notify do
end
end
it
'contains a link to the issue'
do
it
'contains a link to the issue'
do
should
have_body_text
/
#{
project_issue_
url
project
,
issue
}
/
should
have_body_text
/
#{
project_issue_
path
project
,
issue
}
/
end
end
end
end
end
end
...
@@ -110,7 +106,7 @@ describe Notify do
...
@@ -110,7 +106,7 @@ describe Notify do
end
end
it
'contains a link to the new merge request'
do
it
'contains a link to the new merge request'
do
should
have_body_text
/
#{
project_merge_request_
url
(
project
,
merge_request
)
}
/
should
have_body_text
/
#{
project_merge_request_
path
(
project
,
merge_request
)
}
/
end
end
it
'contains the source branch for the merge request'
do
it
'contains the source branch for the merge request'
do
...
@@ -142,7 +138,7 @@ describe Notify do
...
@@ -142,7 +138,7 @@ describe Notify do
end
end
it
'contains a link to the merge request'
do
it
'contains a link to the merge request'
do
should
have_body_text
/
#{
project_merge_request_
url
project
,
merge_request
}
/
should
have_body_text
/
#{
project_merge_request_
path
project
,
merge_request
}
/
end
end
end
end
...
@@ -172,7 +168,7 @@ describe Notify do
...
@@ -172,7 +168,7 @@ describe Notify do
end
end
describe
'on a project wall'
do
describe
'on a project wall'
do
let
(
:note_on_the_wall_
url
)
{
wall_project_url
(
project
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
let
(
:note_on_the_wall_
path
)
{
wall_project_path
(
project
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
subject
{
Notify
.
note_wall_email
(
recipient
.
id
,
note
.
id
)
}
subject
{
Notify
.
note_wall_email
(
recipient
.
id
,
note
.
id
)
}
...
@@ -183,7 +179,7 @@ describe Notify do
...
@@ -183,7 +179,7 @@ describe Notify do
end
end
it
'contains a link to the wall note'
do
it
'contains a link to the wall note'
do
should
have_body_text
/
#{
note_on_the_wall_
url
}
/
should
have_body_text
/
#{
note_on_the_wall_
path
}
/
end
end
end
end
...
@@ -211,7 +207,7 @@ describe Notify do
...
@@ -211,7 +207,7 @@ describe Notify do
describe
'on a merge request'
do
describe
'on a merge request'
do
let
(
:merge_request
)
{
Factory
.
create
(
:merge_request
,
:project
=>
project
)
}
let
(
:merge_request
)
{
Factory
.
create
(
:merge_request
,
:project
=>
project
)
}
let
(
:note_on_merge_request_
url
)
{
project_merge_request_url
(
project
,
merge_request
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
let
(
:note_on_merge_request_
path
)
{
project_merge_request_path
(
project
,
merge_request
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
before
(
:each
)
{
note
.
stub
(
:noteable
).
and_return
(
merge_request
)
}
before
(
:each
)
{
note
.
stub
(
:noteable
).
and_return
(
merge_request
)
}
subject
{
Notify
.
note_merge_request_email
(
recipient
.
id
,
note
.
id
)
}
subject
{
Notify
.
note_merge_request_email
(
recipient
.
id
,
note
.
id
)
}
...
@@ -223,13 +219,13 @@ describe Notify do
...
@@ -223,13 +219,13 @@ describe Notify do
end
end
it
'contains a link to the merge request note'
do
it
'contains a link to the merge request note'
do
should
have_body_text
/
#{
note_on_merge_request_
url
}
/
should
have_body_text
/
#{
note_on_merge_request_
path
}
/
end
end
end
end
describe
'on an issue'
do
describe
'on an issue'
do
let
(
:issue
)
{
Factory
.
create
(
:issue
,
:project
=>
project
)
}
let
(
:issue
)
{
Factory
.
create
(
:issue
,
:project
=>
project
)
}
let
(
:note_on_issue_
url
)
{
project_issue_url
(
project
,
issue
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
let
(
:note_on_issue_
path
)
{
project_issue_path
(
project
,
issue
,
:anchor
=>
"note_
#{
note
.
id
}
"
)
}
before
(
:each
)
{
note
.
stub
(
:noteable
).
and_return
(
issue
)
}
before
(
:each
)
{
note
.
stub
(
:noteable
).
and_return
(
issue
)
}
subject
{
Notify
.
note_issue_email
(
recipient
.
id
,
note
.
id
)
}
subject
{
Notify
.
note_issue_email
(
recipient
.
id
,
note
.
id
)
}
...
@@ -241,7 +237,7 @@ describe Notify do
...
@@ -241,7 +237,7 @@ describe Notify do
end
end
it
'contains a link to the issue note'
do
it
'contains a link to the issue note'
do
should
have_body_text
/
#{
note_on_issue_
url
}
/
should
have_body_text
/
#{
note_on_issue_
path
}
/
end
end
end
end
end
end
...
...
spec/models/project_hooks_spec.rb
View file @
a2eda66b
...
@@ -106,7 +106,7 @@ describe Project, "Hooks" do
...
@@ -106,7 +106,7 @@ describe Project, "Hooks" do
it
{
should
include
(
id:
@commit
.
id
)
}
it
{
should
include
(
id:
@commit
.
id
)
}
it
{
should
include
(
message:
@commit
.
safe_message
)
}
it
{
should
include
(
message:
@commit
.
safe_message
)
}
it
{
should
include
(
timestamp:
@commit
.
date
.
xmlschema
)
}
it
{
should
include
(
timestamp:
@commit
.
date
.
xmlschema
)
}
it
{
should
include
(
url:
"
http://localhost
/
#{
project
.
code
}
/commits/
#{
@commit
.
id
}
"
)
}
it
{
should
include
(
url:
"
#{
Gitlab
.
config
.
url
}
/
#{
project
.
code
}
/commits/
#{
@commit
.
id
}
"
)
}
context
"with a author"
do
context
"with a author"
do
subject
{
@data
[
:commits
].
first
[
:author
]
}
subject
{
@data
[
:commits
].
first
[
:author
]
}
...
...
spec/models/project_spec.rb
View file @
a2eda66b
...
@@ -46,7 +46,7 @@ describe Project do
...
@@ -46,7 +46,7 @@ describe Project do
it
"should return valid url to repo"
do
it
"should return valid url to repo"
do
project
=
Project
.
new
(
:path
=>
"somewhere"
)
project
=
Project
.
new
(
:path
=>
"somewhere"
)
project
.
url_to_repo
.
should
==
"git@localhost:
somewhere.git"
project
.
url_to_repo
.
should
==
Gitlab
.
config
.
ssh_path
+
"
somewhere.git"
end
end
it
"should return path to repo"
do
it
"should return path to repo"
do
...
...
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