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
9f73388f
Commit
9f73388f
authored
Jan 10, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6002 from jhollingsworth/feature/clone-panel-twbs3
Update clone panel to use input group.
parents
95e6a5dc
04baf0b5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
44 deletions
+29
-44
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+1
-1
app/assets/stylesheets/sections/projects.scss
app/assets/stylesheets/sections/projects.scss
+8
-20
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+3
-2
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+1
-2
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+2
-4
app/views/projects/wikis/git_access.html.haml
app/views/projects/wikis/git_access.html.haml
+8
-9
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+6
-6
No files found.
app/assets/javascripts/project.js.coffee
View file @
9f73388f
...
@@ -35,7 +35,7 @@ $ ->
...
@@ -35,7 +35,7 @@ $ ->
$
(
'a, button'
,
scope
).
removeClass
'active'
$
(
'a, button'
,
scope
).
removeClass
'active'
$
(
@
).
addClass
'active'
$
(
@
).
addClass
'active'
$
(
'#project_clone'
,
scope
).
val
$
(
@
).
data
'clone'
$
(
'#project_clone'
,
scope
).
val
$
(
@
).
data
'clone'
$
(
".clone"
).
text
(
""
).
append
'git remote add origin '
+
$
(
@
).
data
'clone'
$
(
".clone"
).
text
(
""
).
append
$
(
@
).
data
'clone'
# Ref switcher
# Ref switcher
$
(
'.project-refs-select'
).
on
'change'
,
->
$
(
'.project-refs-select'
).
on
'change'
,
->
...
...
app/assets/stylesheets/sections/projects.scss
View file @
9f73388f
...
@@ -72,45 +72,33 @@
...
@@ -72,45 +72,33 @@
}
}
.git-clone-holder
{
.git-clone-holder
{
margin-right
:
45px
;
.project-home-dropdown
+
&
{
border
:
1px
solid
#E1E1E1
;
margin-right
:
45px
;
@include
border-radius
(
4px
);
}
input
[
type
=
"text"
],
.btn
,
.btn
{
.form-control
{
border
:
none
;
border
:
1px
solid
#E1E1E1
;
@include
border-radius
(
0px
);
border-left
:
1px
solid
#E1E1E1
;
box-shadow
:
none
;
box-shadow
:
none
;
padding
:
6px
9px
;
padding
:
6px
9px
;
}
}
.btn
{
.btn
{
float
:
left
;
background
:
none
;
background
:
none
;
color
:
#29b
;
color
:
#29b
;
&
:first-child
{
@include
border-radius-left
(
4px
);
border-left
:
0px
;
}
&
.active
{
&
.active
{
color
:
#333
;
color
:
#333
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
}
}
input
[
type
=
"text"
]
{
.form-control
{
cursor
:
auto
;
cursor
:
auto
;
@extend
.monospace
;
@extend
.monospace
;
background
:
#FAFAFA
;
background
:
#FAFAFA
;
width
:
100%
;
width
:
100%
;
}
}
.protocol-clone
{
overflow
:
hidden
;
}
}
}
.project-visibility-level-holder
{
.project-visibility-level-holder
{
...
...
app/helpers/projects_helper.rb
View file @
9f73388f
...
@@ -180,8 +180,9 @@ module ProjectsHelper
...
@@ -180,8 +180,9 @@ module ProjectsHelper
title
title
end
end
def
default_url_to_repo
def
default_url_to_repo
(
project
=
nil
)
current_user
?
@project
.
url_to_repo
:
@project
.
http_url_to_repo
project
=
project
||
@project
current_user
?
project
.
url_to_repo
:
project
.
http_url_to_repo
end
end
def
default_clone_protocol
def
default_clone_protocol
...
...
app/views/projects/_home_panel.html.haml
View file @
9f73388f
...
@@ -11,8 +11,7 @@
...
@@ -11,8 +11,7 @@
-
unless
empty_repo
-
unless
empty_repo
.project-home-dropdown
.project-home-dropdown
=
render
"dropdown"
=
render
"dropdown"
.form-horizontal
=
render
"shared/clone_panel"
=
render
"shared/clone_panel"
.project-home-extra.row
.project-home-extra.row
.col-md-8
.col-md-8
...
...
app/views/projects/empty.html.haml
View file @
9f73388f
...
@@ -29,8 +29,7 @@
...
@@ -29,8 +29,7 @@
touch README
touch README
git add README
git add README
git commit -m 'first commit'
git commit -m 'first commit'
%span
.clone
=
"git remote add origin
#{
default_url_to_repo
}
"
git remote add origin
#{
content_tag
(
:span
,
default_url_to_repo
,
class:
'clone'
)
}
:preserve
git push -u origin master
git push -u origin master
%fieldset
%fieldset
...
@@ -38,8 +37,7 @@
...
@@ -38,8 +37,7 @@
%pre
.dark
%pre
.dark
:preserve
:preserve
cd existing_git_repo
cd existing_git_repo
%span
.clone
=
"git remote add origin
#{
default_url_to_repo
}
"
git remote add origin
#{
content_tag
(
:span
,
default_url_to_repo
,
class:
'clone'
)
}
:preserve
git push -u origin master
git push -u origin master
-
if
can?
current_user
,
:remove_project
,
@project
-
if
can?
current_user
,
:remove_project
,
@project
...
...
app/views/projects/wikis/git_access.html.haml
View file @
9f73388f
=
render
'nav'
=
render
'nav'
%h3
.page-title
.row
Git access for
.col-sm-6
%strong
=
@gollum_wiki
.
path_with_namespace
%h3
.page-title
Git access for
%strong
=
@gollum_wiki
.
path_with_namespace
.form-horizontal.pull-right
.col-sm-6
.git-clone-holder
=
render
"shared/clone_panel"
,
project:
@gollum_wiki
%button
{
class:
"btn active"
,
:"data-clone"
=>
@gollum_wiki
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn"
,
:"data-clone"
=>
@gollum_wiki
.
http_url_to_repo
}=
gitlab_config
.
protocol
.
upcase
=
text_field_tag
:project_clone
,
@gollum_wiki
.
url_to_repo
,
class:
"one_click_select form-control"
,
readonly:
true
.git-empty
.git-empty
%fieldset
%fieldset
...
@@ -19,7 +18,7 @@
...
@@ -19,7 +18,7 @@
%legend
Clone Your Wiki:
%legend
Clone Your Wiki:
%pre
.dark
%pre
.dark
:preserve
:preserve
git clone
#{
@gollum_wiki
.
ssh_url_to_repo
}
git clone
#{
content_tag
(
:span
,
default_url_to_repo
(
@gollum_wiki
),
class:
'clone'
)
}
cd
#{
@gollum_wiki
.
path
}
cd
#{
@gollum_wiki
.
path
}
%legend
Start Gollum And Edit Locally:
%legend
Start Gollum And Edit Locally:
...
...
app/views/shared/_clone_panel.html.haml
View file @
9f73388f
.git-clone-holder
-
project
=
project
||
@project
.protocol-btns
.git-clone-holder.input-group
%button
{
class:
"btn #{ 'active' if default_clone_protocol == 'ssh' }"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
.input-group-btn
%button
{
class:
"btn #{ 'active' if default_clone_protocol == '
http' }"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}=
gitlab_config
.
protocol
.
upcase
%button
{
class:
"btn #{ 'active' if default_clone_protocol == '
ssh' }"
,
:"data-clone"
=>
project
.
ssh_url_to_repo
}
SSH
.protocol-clon
e
%button
{
class:
"btn #{ 'active' if default_clone_protocol == 'http' }"
,
:"data-clone"
=>
project
.
http_url_to_repo
}=
gitlab_config
.
protocol
.
upcas
e
=
text_field_tag
:project_clone
,
default_url_to_repo
,
class:
"one_click_select span4
"
,
readonly:
true
=
text_field_tag
:project_clone
,
default_url_to_repo
(
project
),
class:
"one_click_select form-control
"
,
readonly:
true
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