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
Kazuhiko Shiozaki
gitlab-ce
Commits
1d697880
Commit
1d697880
authored
Oct 25, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix encoding error, issues critical status added
parent
016012b1
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
99 additions
and
21 deletions
+99
-21
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+34
-0
app/controllers/issues_controller.rb
app/controllers/issues_controller.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+11
-0
app/views/commits/_commits.html.haml
app/views/commits/_commits.html.haml
+1
-1
app/views/commits/show.html.haml
app/views/commits/show.html.haml
+2
-2
app/views/issues/_form.html.haml
app/views/issues/_form.html.haml
+8
-4
app/views/issues/_issues.html.haml
app/views/issues/_issues.html.haml
+6
-1
app/views/issues/_show.html.haml
app/views/issues/_show.html.haml
+17
-3
app/views/projects/_recent_commits.html.haml
app/views/projects/_recent_commits.html.haml
+1
-1
app/views/projects/_recent_messages.html.haml
app/views/projects/_recent_messages.html.haml
+1
-1
app/views/projects/_tree_item.html.haml
app/views/projects/_tree_item.html.haml
+1
-1
db/migrate/20111025134235_add_high_label_to_issue.rb
db/migrate/20111025134235_add_high_label_to_issue.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
lib/commit_ext.rb
lib/commit_ext.rb
+6
-4
spec/requests/team_members_spec.rb
spec/requests/team_members_spec.rb
+3
-1
No files found.
app/assets/stylesheets/projects.css.scss
View file @
1d697880
...
@@ -647,3 +647,37 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
...
@@ -647,3 +647,37 @@ tbody tr:nth-child(2n) td, tbody tr.even td {
background
:
none
repeat
scroll
0
0
#FFBBBB
background
:
none
repeat
scroll
0
0
#FFBBBB
}
}
}
}
.tag
{
@include
round-borders-all
(
4px
);
padding
:
2px
4px
;
border
:none
;
&
.high
{
background
:
#D12F19
;
color
:white
;
}
&
.today
{
background
:
#44aa22
;
color
:white
;
}
&
.yours
{
background
:
#4466cc
;
color
:white
;
}
&
.notes
{
background
:
#2c5c66
;
color
:white
;
}
}
#issues-table
.issue
{
&
.critical
{
td
{
//background: #D12F19;
//color:#fff;
}
}
}
app/controllers/issues_controller.rb
View file @
1d697880
...
@@ -12,7 +12,7 @@ class IssuesController < ApplicationController
...
@@ -12,7 +12,7 @@ class IssuesController < ApplicationController
def
index
def
index
@issues
=
case
params
[
:f
].
to_i
@issues
=
case
params
[
:f
].
to_i
when
1
then
@project
.
issues
.
all
when
1
then
@project
.
issues
when
2
then
@project
.
issues
.
closed
when
2
then
@project
.
issues
.
closed
when
3
then
@project
.
issues
.
opened
.
assigned
(
current_user
)
when
3
then
@project
.
issues
.
opened
.
assigned
(
current_user
)
else
@project
.
issues
.
opened
else
@project
.
issues
.
opened
...
...
app/models/issue.rb
View file @
1d697880
...
@@ -18,11 +18,22 @@ class Issue < ActiveRecord::Base
...
@@ -18,11 +18,22 @@ class Issue < ActiveRecord::Base
:presence
=>
true
,
:presence
=>
true
,
:length
=>
{
:within
=>
0
..
2000
}
:length
=>
{
:within
=>
0
..
2000
}
scope
:critical
,
where
(
:critical
=>
true
)
scope
:non_critical
,
where
(
:critical
=>
false
)
scope
:opened
,
where
(
:closed
=>
false
)
scope
:opened
,
where
(
:closed
=>
false
)
scope
:closed
,
where
(
:closed
=>
true
)
scope
:closed
,
where
(
:closed
=>
true
)
scope
:assigned
,
lambda
{
|
u
|
where
(
:assignee_id
=>
u
.
id
)}
scope
:assigned
,
lambda
{
|
u
|
where
(
:assignee_id
=>
u
.
id
)}
acts_as_list
acts_as_list
def
today?
Date
.
today
==
created_at
.
to_date
end
def
new?
today?
&&
created_at
==
updated_at
end
end
end
# == Schema Information
# == Schema Information
#
#
...
...
app/views/commits/_commits.html.haml
View file @
1d697880
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
%p
%p
%strong
%strong
=
commit
.
truncated_message
=
truncate
(
commit
.
safe_message
,
:length
=>
60
)
=
link_to
"Browse Code"
,
tree_project_path
(
@project
,
:commit_id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"float:right"
=
link_to
"Browse Code"
,
tree_project_path
(
@project
,
:commit_id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"float:right"
=
link_to
truncate
(
commit
.
id
.
to_s
,
:length
=>
16
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"width:120px;float:right"
=
link_to
truncate
(
commit
.
id
.
to_s
,
:length
=>
16
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
),
:class
=>
"lite_button"
,
:style
=>
"width:120px;float:right"
%span
%span
...
...
app/views/commits/show.html.haml
View file @
1d697880
%h3
%h3
=
"[
#{
@commit
.
committer
}
]
#{
@commit
.
truncated_message
(
40
)
}
"
=
"[
#{
@commit
.
committer
}
]
#{
truncate
(
@commit
.
safe_message
)
}
"
-#= link_to 'Back', project_commits_path(@project), :class => "button"
-#= link_to 'Back', project_commits_path(@project), :class => "button"
%table
.round-borders
%table
.round-borders
%tr
%tr
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
%td
=
@commit
.
committed_date
%td
=
@commit
.
committed_date
%tr
%tr
%td
Message
%td
Message
%td
=
@commit
.
message
%td
=
@commit
.
safe_
message
%tr
%tr
%td
Tree
%td
Tree
%td
=
link_to
'Browse Code'
,
tree_project_path
(
@project
,
:commit_id
=>
@commit
.
id
)
%td
=
link_to
'Browse Code'
,
tree_project_path
(
@project
,
:commit_id
=>
@commit
.
id
)
...
...
app/views/issues/_form.html.haml
View file @
1d697880
...
@@ -5,17 +5,21 @@
...
@@ -5,17 +5,21 @@
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%li
=
msg
.span-
6
.span-
8
=
f
.
label
:title
=
f
.
label
:title
=
f
.
text_field
:title
,
:style
=>
"width:450px"
=
f
.
text_field
:title
,
:style
=>
"width:450px"
.span-
6
.span-
8
=
f
.
label
:content
=
f
.
label
:content
=
f
.
text_area
:content
,
:style
=>
"width:450px; height:130px"
=
f
.
text_area
:content
,
:style
=>
"width:450px; height:130px"
.span-
6
.append-bottom
.span-
8
.append-bottom
=
f
.
label
:assignee_id
=
f
.
label
:assignee_id
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
.span-1
=
f
.
label
:critical
,
"Critical"
%br
=
f
.
check_box
:critical
-
unless
@issue
.
new_record?
-
unless
@issue
.
new_record?
.span-
3
.right
.span-
2
.right
=
f
.
label
:closed
=
f
.
label
:closed
%br
%br
=
f
.
check_box
:closed
=
f
.
check_box
:closed
...
...
app/views/issues/_issues.html.haml
View file @
1d697880
%table
.round-borders
#issues-table
%table
.round-borders
#issues-table
%tr
%tr
-
if
can?
(
current_user
,
:admin_issue
,
@project
)
&&
!
params
[
:f
]
||
params
[
:f
]
==
"0"
%th
%th
Assignee
%th
Assignee
%th
ID
%th
ID
%th
Title
%th
Title
%th
Closed?
%th
Closed?
%th
%th
-
@issues
.
each
do
|
issue
|
-
@issues
.
critical
.
each
do
|
issue
|
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:issue
=>
issue
})
-
@issues
.
non_critical
.
each
do
|
issue
|
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:issue
=>
issue
})
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:issue
=>
issue
})
app/views/issues/_show.html.haml
View file @
1d697880
%tr
{
:id
=>
dom_id
(
issue
),
:class
=>
"issue"
,
:url
=>
project_issue_path
(
@project
,
issue
)
}
%tr
{
:id
=>
dom_id
(
issue
),
:class
=>
"issue #{issue.critical ? "
critical
" : ""}"
,
:url
=>
project_issue_path
(
@project
,
issue
)
}
-
if
can?
(
current_user
,
:admin_issue
,
@project
)
&&
!
params
[
:f
]
||
params
[
:f
]
==
"0"
%td
=
image_tag
"move.png"
,
:class
=>
[
:handle
,
:left
]
%td
%td
=
image_tag
"move.png"
,
:class
=>
[
:handle
,
:left
]
=
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;"
=
truncate
issue
.
assignee
.
name
,
:lenght
=>
20
=
truncate
issue
.
assignee
.
name
,
:lenght
=>
20
%td
##{issue.id}
%td
##{issue.id}
%td
=
html_escape
issue
.
title
%td
=
html_escape
issue
.
title
%br
-
if
issue
.
critical
%span
.tag.high
critical
-
if
issue
.
today?
%span
.tag.today
today
-#- if issue.author == current_user
-#%span.tag.yours yours
-#- if issue.notes.count > 0
-#%span.tag.notes
-#= issue.notes.count
-#notes
%td
%td
-
if
can?
current_user
,
:write_issue
,
@project
-
if
can?
current_user
,
:write_issue
,
@project
=
form_for
([
@project
,
issue
],
:remote
=>
true
)
do
|
f
|
=
form_for
([
@project
,
issue
],
:remote
=>
true
)
do
|
f
|
...
...
app/views/projects/_recent_commits.html.haml
View file @
1d697880
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
=
image_tag
"no_avatar.png"
,
:class
=>
"left"
,
:width
=>
40
,
:style
=>
"padding-right:5px;"
%p
{
:style
=>
"margin-bottom: 3px;"
}
%p
{
:style
=>
"margin-bottom: 3px;"
}
%strong
%strong
=
link_to
commit
.
truncated_message
(
60
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
=
link_to
truncate
(
commit
.
safe_message
,
:length
=>
60
),
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
%span
%span
%span
.author
%span
.author
...
...
app/views/projects/_recent_messages.html.haml
View file @
1d697880
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
-
css_class
=
"dash_commit"
-
css_class
=
"dash_commit"
-
commit
=
parent
-
commit
=
parent
-
item_code
=
commit
.
author
.
email
-
item_code
=
commit
.
author
.
email
-
link_item_name
=
commit
.
truncated_message
(
50
)
-
link_item_name
=
truncate
(
commit
.
safe_message
,
:length
=>
50
)
-
link_to_item
=
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
-
link_to_item
=
project_commit_path
(
@project
,
:id
=>
commit
.
id
)
-
else
-
else
-
css_class
=
"dash_wall"
-
css_class
=
"dash_wall"
...
...
app/views/projects/_tree_item.html.haml
View file @
1d697880
...
@@ -12,4 +12,4 @@
...
@@ -12,4 +12,4 @@
=
time_ago_in_words
(
content_commit
.
committed_date
)
=
time_ago_in_words
(
content_commit
.
committed_date
)
ago
ago
%td
%td
=
link_to
content_commit
.
truncated_message
(
40
),
project_commit_path
(
@project
,
content_commit
)
=
link_to
truncate
(
content_commit
.
safe_message
,
:length
=>
40
),
project_commit_path
(
@project
,
content_commit
)
db/migrate/20111025134235_add_high_label_to_issue.rb
0 → 100644
View file @
1d697880
class
AddHighLabelToIssue
<
ActiveRecord
::
Migration
def
change
add_column
:issues
,
:critical
,
:boolean
,
:default
=>
false
,
:null
=>
false
end
end
db/schema.rb
View file @
1d697880
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
2011102
1101550
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
2011102
5134235
)
do
create_table
"issues"
,
:force
=>
true
do
|
t
|
create_table
"issues"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
...
@@ -23,6 +23,7 @@ ActiveRecord::Schema.define(:version => 20111021101550) do
...
@@ -23,6 +23,7 @@ ActiveRecord::Schema.define(:version => 20111021101550) do
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
t
.
boolean
"closed"
,
:default
=>
false
,
:null
=>
false
t
.
boolean
"closed"
,
:default
=>
false
,
:null
=>
false
t
.
integer
"position"
,
:default
=>
0
t
.
integer
"position"
,
:default
=>
0
t
.
boolean
"critical"
,
:default
=>
false
,
:null
=>
false
end
end
create_table
"keys"
,
:force
=>
true
do
|
t
|
create_table
"keys"
,
:force
=>
true
do
|
t
|
...
...
lib/commit_ext.rb
View file @
1d697880
module
CommitExt
module
CommitExt
# Cause of encoding rails truncate raise error
def
safe_message
# this method is temporary decision
message
.
encode
(
"UTF-8"
,
def
truncated_message
(
size
=
80
)
:invalid
=>
:replace
,
message
.
length
>
size
?
(
message
[
0
..
(
size
-
1
)]
+
"..."
)
:
message
:undef
=>
:replace
,
:universal_newline
=>
true
,
:replace
=>
""
)
rescue
rescue
"-- invalid encoding for commit message"
"-- invalid encoding for commit message"
end
end
...
...
spec/requests/team_members_spec.rb
View file @
1d697880
...
@@ -10,7 +10,9 @@ describe "TeamMembers" do
...
@@ -10,7 +10,9 @@ describe "TeamMembers" do
describe
"View profile"
do
describe
"View profile"
do
it
"should be available"
do
it
"should be available"
do
visit
(
team_project_path
(
@project
))
visit
(
team_project_path
(
@project
))
find
(
:xpath
,
"//table[@id='team-table']//a[1]"
).
click
within
"#team-table"
do
click_link
(
@user
.
name
)
end
page
.
should
have_content
@user
.
skype
page
.
should
have_content
@user
.
skype
page
.
should_not
have_content
'Twitter'
page
.
should_not
have_content
'Twitter'
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