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
Tatuya Kamada
gitlab-ce
Commits
c160aae6
Commit
c160aae6
authored
Jun 24, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated compare dropdowns
Closes #18891
parent
ad806f32
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
18 deletions
+43
-18
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+3
-2
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+8
-3
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+18
-0
app/views/projects/compare/_form.html.haml
app/views/projects/compare/_form.html.haml
+8
-12
app/views/projects/compare/_ref_dropdown.html.haml
app/views/projects/compare/_ref_dropdown.html.haml
+5
-0
app/views/shared/_ref_switcher.html.haml
app/views/shared/_ref_switcher.html.haml
+1
-1
No files found.
app/assets/javascripts/project.js.coffee
View file @
c160aae6
...
@@ -67,7 +67,7 @@ class @Project
...
@@ -67,7 +67,7 @@ class @Project
selectable
:
true
selectable
:
true
filterable
:
true
filterable
:
true
filterByText
:
true
filterByText
:
true
fieldName
:
'ref'
fieldName
:
$dropdown
.
data
(
'field-name'
)
renderRow
:
(
ref
)
->
renderRow
:
(
ref
)
->
if
ref
.
header
?
if
ref
.
header
?
$
(
'<li />'
)
$
(
'<li />'
)
...
@@ -87,5 +87,6 @@ class @Project
...
@@ -87,5 +87,6 @@ class @Project
toggleLabel
:
(
obj
,
$el
)
->
toggleLabel
:
(
obj
,
$el
)
->
$el
.
text
().
trim
()
$el
.
text
().
trim
()
clicked
:
(
e
)
->
clicked
:
(
e
)
->
unless
$dropdown
.
hasClass
(
'js-compare-dropdown'
)
$dropdown
.
closest
(
'form'
).
submit
()
$dropdown
.
closest
(
'form'
).
submit
()
)
)
app/assets/stylesheets/framework/dropdowns.scss
View file @
c160aae6
...
@@ -48,9 +48,6 @@
...
@@ -48,9 +48,6 @@
border
:
1px
solid
$dropdown-toggle-border-color
;
border
:
1px
solid
$dropdown-toggle-border-color
;
border-radius
:
$border-radius-base
;
border-radius
:
$border-radius-base
;
outline
:
0
;
outline
:
0
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
overflow
:
hidden
;
.fa
{
.fa
{
position
:
absolute
;
position
:
absolute
;
...
@@ -61,6 +58,14 @@
...
@@ -61,6 +58,14 @@
font-size
:
10px
;
font-size
:
10px
;
}
}
.dropdown-toggle-text
{
display
:
block
;
min-height
:
19px
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
overflow
:
hidden
;
}
&
:hover
,
{
&
:hover
,
{
border-color
:
$dropdown-toggle-hover-border-color
;
border-color
:
$dropdown-toggle-hover-border-color
;
...
...
app/assets/stylesheets/pages/projects.scss
View file @
c160aae6
...
@@ -632,3 +632,21 @@ pre.light-well {
...
@@ -632,3 +632,21 @@ pre.light-well {
width
:
300px
;
width
:
300px
;
}
}
}
}
.compare-input-group
{
&
.input-group
.input-group-addon
{
@media
(
min-width
:
$screen-sm-min
)
{
width
:
1%
;
}
}
.dropdown-menu-toggle
{
width
:
100%
;
border-top-left-radius
:
0
;
border-bottom-left-radius
:
0
;
}
.dropdown-menu
{
width
:
300px
;
}
}
app/views/projects/compare/_form.html.haml
View file @
c160aae6
...
@@ -3,14 +3,18 @@
...
@@ -3,14 +3,18 @@
-
if
params
[
:to
]
&&
params
[
:from
]
-
if
params
[
:to
]
&&
params
[
:from
]
=
link_to
'switch'
,
{
from:
params
[
:to
],
to:
params
[
:from
]},
{
class:
'commits-compare-switch has-tooltip'
,
title:
'Switch base of comparison'
}
=
link_to
'switch'
,
{
from:
params
[
:to
],
to:
params
[
:from
]},
{
class:
'commits-compare-switch has-tooltip'
,
title:
'Switch base of comparison'
}
.form-group
.form-group
.input-group.inline-input-group
=
hidden_field_tag
:from
,
params
[
:from
]
.input-group.inline-input-group.compare-input-group.dropdown
%span
.input-group-addon
from
%span
.input-group-addon
from
=
text_field_tag
:from
,
params
[
:from
],
class:
"form-control"
,
required:
true
=
dropdown_toggle
h
(
params
[
:from
].
presence
||
''
),
{
toggle:
"dropdown"
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
field_name:
'from'
,
selected:
params
[
:from
]
},
{
toggle_class:
"js-project-refs-dropdown js-compare-dropdown"
}
=
render
"ref_dropdown"
=
"..."
=
"..."
.form-group
.form-group
.input-group.inline-input-group
=
hidden_field_tag
:to
,
params
[
:to
]
.input-group.inline-input-group.compare-input-group.dropdown
%span
.input-group-addon
to
%span
.input-group-addon
to
=
text_field_tag
:to
,
params
[
:to
],
class:
"form-control"
,
required:
true
=
dropdown_toggle
h
(
params
[
:from
].
presence
||
''
),
{
toggle:
"dropdown"
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
field_name:
'to'
,
selected:
params
[
:to
]
},
{
toggle_class:
"js-project-refs-dropdown js-compare-dropdown"
}
=
render
"ref_dropdown"
=
button_tag
"Compare"
,
class:
"btn btn-create commits-compare-btn"
=
button_tag
"Compare"
,
class:
"btn btn-create commits-compare-btn"
-
if
@merge_request
.
present?
-
if
@merge_request
.
present?
...
@@ -19,11 +23,3 @@
...
@@ -19,11 +23,3 @@
=
link_to
create_mr_path
,
class:
'prepend-left-10 btn'
do
=
link_to
create_mr_path
,
class:
'prepend-left-10 btn'
do
=
icon
(
"plus"
)
=
icon
(
"plus"
)
Create Merge Request
Create Merge Request
:javascript
var
availableTags
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
$
(
"
#from, #to
"
).
autocomplete
({
source
:
availableTags
,
minLength
:
1
});
app/views/projects/compare/_ref_dropdown.html.haml
0 → 100644
View file @
c160aae6
.dropdown-menu.dropdown-menu-selectable
=
dropdown_title
"Switch branch/tag"
=
dropdown_filter
"Search branches and tags"
=
dropdown_content
=
dropdown_loading
app/views/shared/_ref_switcher.html.haml
View file @
c160aae6
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
-
@options
&&
@options
.
each
do
|
key
,
value
|
-
@options
&&
@options
.
each
do
|
key
,
value
|
=
hidden_field_tag
key
,
value
,
id:
nil
=
hidden_field_tag
key
,
value
,
id:
nil
.dropdown
.dropdown
=
dropdown_toggle
dropdown_toggle_text
,
{
toggle:
"dropdown"
,
selected:
dropdown_toggle_text
,
ref:
@ref
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
)
},
{
toggle_class:
"js-project-refs-dropdown"
}
=
dropdown_toggle
dropdown_toggle_text
,
{
toggle:
"dropdown"
,
selected:
dropdown_toggle_text
,
field_name:
'ref'
,
ref:
@ref
,
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
)
},
{
toggle_class:
"js-project-refs-dropdown"
}
.dropdown-menu.dropdown-menu-selectable
{
class:
(
"dropdown-menu-align-right"
if
local_assigns
[
:align_right
])
}
.dropdown-menu.dropdown-menu-selectable
{
class:
(
"dropdown-menu-align-right"
if
local_assigns
[
:align_right
])
}
=
dropdown_title
"Switch branch/tag"
=
dropdown_title
"Switch branch/tag"
=
dropdown_filter
"Search branches and tags"
=
dropdown_filter
"Search branches and tags"
...
...
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