BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
15fa14f1
Commit
15fa14f1
authored
Nov 25, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid off modal window for issue create/edit
parent
16bd018f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
126 additions
and
87 deletions
+126
-87
issues.js
app/assets/javascripts/issues.js
+32
-0
application.css
app/assets/stylesheets/application.css
+3
-0
issues.css.scss
app/assets/stylesheets/issues.css.scss
+18
-0
projects.css.scss
app/assets/stylesheets/projects.css.scss
+7
-0
_form.html.haml
app/views/issues/_form.html.haml
+44
-23
create.js.haml
app/views/issues/create.js.haml
+2
-2
edit.html.haml
app/views/issues/edit.html.haml
+2
-32
edit.js.haml
app/views/issues/edit.js.haml
+2
-9
new.html.haml
app/views/issues/new.html.haml
+7
-0
new.js.haml
app/views/issues/new.js.haml
+1
-9
update.js.haml
app/views/issues/update.js.haml
+2
-2
issues_spec.rb
spec/requests/issues_spec.rb
+6
-10
No files found.
app/assets/javascripts/issues.js
0 → 100644
View file @
15fa14f1
function
switchToNewIssue
(
form
){
$
(
"#issues-table-holder"
).
hide
(
"slide"
,
{
direction
:
"left"
},
150
,
function
(){
$
(
".project-content"
).
append
(
form
);
$
(
'select#issue_assignee_id'
).
chosen
();
$
(
"#new_issue_dialog"
).
show
(
"slide"
,
{
direction
:
"right"
},
150
);
});
}
function
switchToEditIssue
(
form
){
$
(
"#issues-table-holder"
).
hide
(
"slide"
,
{
direction
:
"left"
},
150
,
function
(){
$
(
".project-content"
).
append
(
form
);
$
(
'select#issue_assignee_id'
).
chosen
();
$
(
"#edit_issue_dialog"
).
show
(
"slide"
,
{
direction
:
"right"
},
150
);
});
}
function
switchFromNewIssue
(){
backToIssues
();
}
function
switchFromEditIssue
(){
backToIssues
();
}
function
backToIssues
(){
$
(
"#edit_issue_dialog, #new_issue_dialog"
).
hide
(
"slide"
,
{
direction
:
"right"
},
150
,
function
(){
$
(
"#issues-table-holder"
).
show
(
"slide"
,
{
direction
:
"left"
},
150
,
function
()
{
$
(
"#edit_issue_dialog"
).
remove
();
$
(
"#new_issue_dialog"
).
remove
();
});
});
}
app/assets/stylesheets/application.css
View file @
15fa14f1
...
@@ -40,3 +40,6 @@
...
@@ -40,3 +40,6 @@
.prepend-top-10
{
.prepend-top-10
{
margin-top
:
10px
;
margin-top
:
10px
;
}
}
.no-borders
{
border
:
none
;
}
app/assets/stylesheets/issues.css.scss
View file @
15fa14f1
...
@@ -48,3 +48,21 @@
...
@@ -48,3 +48,21 @@
width
:
100%
;
width
:
100%
;
.data
p
{
font-size
:
16px
}
.data
p
{
font-size
:
16px
}
}
}
#issue_assignee_id
{
width
:
300px
;
}
.issue-form-holder
.ui-box
.data
{
margin
:
0
;
padding
:
0
;
}
body
.project-page
.issue-form-holder
table
.no-borders
tr
,
body
.project-page
.issue-form-holder
table
.no-borders
td
{
&
:hover
{
background
:none
;
}
}
app/assets/stylesheets/projects.css.scss
View file @
15fa14f1
...
@@ -387,3 +387,10 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up
...
@@ -387,3 +387,10 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up
body
.project-page
.team_member_new
.span-6
,
.team_member_edit
.span-6
{
padding
:
10px
0
;
}
body
.project-page
.team_member_new
.span-6
,
.team_member_edit
.span-6
{
padding
:
10px
0
;
}
body
.projects-page
input
.text.git-url.project_list_url
{
width
:
165px
;
}
body
.projects-page
input
.text.git-url.project_list_url
{
width
:
165px
;
}
body
.project-page
table
.no-borders
tr
,
body
.project-page
table
.no-borders
td
{
border
:none
;
}
app/views/issues/_form.html.haml
View file @
15fa14f1
%div
%div
.issue-form-holder
=
form_for
[
@project
,
@issue
],
:remote
=>
"true"
do
|
f
|
.issue-show-holder.ui-box
-
if
@issue
.
errors
.
any?
%h3
%ul
=
@issue
.
new_record?
?
"New issue"
:
"Edit Issue #
#{
@issue
.
id
}
"
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
-
unless
@issue
.
new_record?
%li
=
msg
.right
-
if
@issue
.
closed
%span
.tag.high
Resolved
-
else
%span
.tag.today
Open
=
form_for
[
@project
,
@issue
],
:remote
=>
"true"
do
|
f
|
.data
%table
.no-borders
-
if
@issue
.
errors
.
any?
%tr
%td
Errors
%td
#error_explanation
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
%span
=
msg
%br
.form-row
%tr
=
f
.
label
:title
%td
=
f
.
label
:title
=
f
.
text_area
:title
,
:style
=>
"width:450px; height:100px"
,
:maxlength
=>
255
%td
=
f
.
text_area
:title
,
:style
=>
"width:450px; height:100px"
,
:maxlength
=>
255
.form-row
=
f
.
label
:assignee_id
%tr
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
%td
=
f
.
label
:assignee_id
.form-row
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
=
f
.
label
:critical
,
"Critical"
%br
%tr
=
f
.
check_box
:critical
%td
=
f
.
label
:critical
,
"Critical"
-
unless
@issue
.
new_record?
%td
=
f
.
check_box
:critical
.form-row
=
f
.
label
:closed
-
unless
@issue
.
new_record?
%br
%tr
=
f
.
check_box
:closed
%td
=
f
.
label
:closed
.form-row
%td
=
f
.
check_box
:closed
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
.right
-
if
request
.
xhr?
=
link_to_function
"Back"
,
"backToIssues();"
,
:class
=>
"grey-button"
-
else
=
link_to
"Back"
,
[
@project
,
@issue
],
:class
=>
"grey-button"
app/views/issues/create.js.haml
View file @
15fa14f1
-
if
@issue
.
valid?
-
if
@issue
.
valid?
:plain
:plain
$("#new_issue_dialog").dialog("close"
);
switchFromNewIssue(
);
$("#issues-table").prepend("
#{
escape_javascript
(
render
(
:partial
=>
'show'
,
:locals
=>
{
:issue
=>
@issue
}
))
}
");
$("#issues-table").prepend("
#{
escape_javascript
(
render
(
:partial
=>
'show'
,
:locals
=>
{
:issue
=>
@issue
}
))
}
");
$.ajax({type: "GET", url: location.href, dataType: "script"});
$.ajax({type: "GET", url: location.href, dataType: "script"});
-
else
-
else
:plain
:plain
$("#new_issue_dialog").empty();
$("#new_issue_dialog").empty();
$("#new_issue_dialog").append("
#{
escape_javascript
(
render
(
'form'
))
}
");
$("#new_issue_dialog").append("
#{
escape_javascript
(
render
(
'form'
))
}
");
$('select#issue_assignee_id').
selectmenu({width:300}
);
$('select#issue_assignee_id').
chosen(
);
app/views/issues/edit.html.haml
View file @
15fa14f1
%div
.issue-form-holder
=
render
"form"
=
form_for
[
@project
,
@issue
]
do
|
f
|
-
if
@issue
.
errors
.
any?
%ul
-
@issue
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%table
%thead
%th
Name
%th
Value
%tr
%td
=
f
.
label
:title
%td
=
f
.
text_area
:title
,
:style
=>
"width:450px; height:100px"
,
:maxlength
=>
255
%tr
%td
=
f
.
label
:assignee_id
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
-#%tr
%td= f.label :branch_name
%td= f.select(:branch_name, @project.heads.map(&:name), { :include_blank => "Select git branch" })
%tr
%td
=
f
.
label
:critical
,
"Critical"
%br
%td
=
f
.
check_box
:critical
-
unless
@issue
.
new_record?
%tr
%td
=
f
.
label
:closed
%td
=
f
.
check_box
:closed
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
'select#issue_branch_name'
).
selectmenu
({
width
:
300
});
$
(
'select#issue_assignee_id'
).
chosen
();
$
(
'select#issue_assignee_id'
).
selectmenu
({
width
:
300
});
});
});
app/views/issues/edit.js.haml
View file @
15fa14f1
:plain
:plain
var edit_issue_dialog = $("<div id='edit_issue_dialog'></div>");
var edit_issue_dialog = $("<div id='edit_issue_dialog'></div>");
edit_issue_dialog.html("
#{
escape_javascript
(
render
(
'form'
))
}
");
edit_issue_dialog.html("
#{
escape_javascript
(
render
(
'form'
))
}
");
$(edit_issue_dialog).dialog({
switchToEditIssue(edit_issue_dialog);
width: 500,
resizable: false,
draggable: false,
title: "Issue ##{@issue.id}
#{
"[CLOSED]"
if
@issue
.
closed
}
",
close: function(event, ui) { $("#edit_issue_dialog").remove();},
modal: true
});
$('select#issue_assignee_id').selectmenu({width:300});
app/views/issues/new.html.haml
0 → 100644
View file @
15fa14f1
=
render
"form"
:javascript
$
(
function
(){
$
(
'select#issue_assignee_id'
).
chosen
();
});
app/views/issues/new.js.haml
View file @
15fa14f1
:plain
:plain
var new_issue_dialog = $("<div id='new_issue_dialog'></div>");
var new_issue_dialog = $("<div id='new_issue_dialog'></div>");
new_issue_dialog.html("
#{
escape_javascript
(
render
(
'form'
))
}
");
new_issue_dialog.html("
#{
escape_javascript
(
render
(
'form'
))
}
");
$(new_issue_dialog).dialog({
switchToNewIssue(new_issue_dialog);
width: 500,
resizable: false,
draggable: false,
title: "Add new issue",
modala: true,
close: function(event, ui) { $("#new_issue_dialog").remove();}
});
$('select#issue_assignee_id').selectmenu({width:300});
app/views/issues/update.js.haml
View file @
15fa14f1
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
-
else
-
else
-
if
@issue
.
valid?
-
if
@issue
.
valid?
:plain
:plain
$("#edit_issue_dialog").dialog("close");
updatePage();
updatePage();
switchFromEditIssue();
-
else
-
else
:plain
:plain
$("#edit_issue_dialog").empty();
$("#edit_issue_dialog").empty();
$("#edit_issue_dialog").append("
#{
escape_javascript
(
render
(
'form'
))
}
");
$("#edit_issue_dialog").append("
#{
escape_javascript
(
render
(
'form'
))
}
");
$('select#issue_assignee_id').
selectmenu({width:300}
);
$('select#issue_assignee_id').
chosen(
);
spec/requests/issues_spec.rb
View file @
15fa14f1
...
@@ -95,18 +95,16 @@ describe "Issues" do
...
@@ -95,18 +95,16 @@ describe "Issues" do
click_link
"New Issue"
click_link
"New Issue"
end
end
it
"should open new issue
popup
"
do
it
"should open new issue
form
"
do
page
.
should
have_content
(
"
Add n
ew issue"
)
page
.
should
have_content
(
"
N
ew issue"
)
end
end
describe
"fill in"
do
describe
"fill in"
do
describe
'assign to me'
do
describe
'assign to me'
do
before
do
before
do
fill_in
"issue_title"
,
:with
=>
"bug 345"
fill_in
"issue_title"
,
:with
=>
"bug 345"
click_link
"Select user"
page
.
execute_script
(
"$('#issue_assignee_id').show();"
)
within
"#issue_assignee_id-menu"
do
select
@user
.
name
,
:from
=>
"issue_assignee_id"
click_link
@user
.
name
end
end
end
it
{
expect
{
click_button
"Save"
}.
to
change
{
Issue
.
count
}.
by
(
1
)
}
it
{
expect
{
click_button
"Save"
}.
to
change
{
Issue
.
count
}.
by
(
1
)
}
...
@@ -129,10 +127,8 @@ describe "Issues" do
...
@@ -129,10 +127,8 @@ describe "Issues" do
describe
'assign to other'
do
describe
'assign to other'
do
before
do
before
do
fill_in
"issue_title"
,
:with
=>
"bug 345"
fill_in
"issue_title"
,
:with
=>
"bug 345"
click_link
"Select user"
page
.
execute_script
(
"$('#issue_assignee_id').show();"
)
within
"#issue_assignee_id-menu"
do
select
@user2
.
name
,
:from
=>
"issue_assignee_id"
click_link
@user2
.
name
end
end
end
it
{
expect
{
click_button
"Save"
}.
to
change
{
Issue
.
count
}.
by
(
1
)
}
it
{
expect
{
click_button
"Save"
}.
to
change
{
Issue
.
count
}.
by
(
1
)
}
...
...
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