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
Jérome Perrin
gitlab-ce
Commits
67c623d8
Commit
67c623d8
authored
Dec 18, 2015
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds dropdown for cloning
parent
c82691b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
15 deletions
+49
-15
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+9
-2
app/views/projects/buttons/_star.html.haml
app/views/projects/buttons/_star.html.haml
+16
-5
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+24
-8
No files found.
app/assets/stylesheets/pages/projects.scss
View file @
67c623d8
...
@@ -91,10 +91,9 @@
...
@@ -91,10 +91,9 @@
}
}
}
}
.
input-group
{
.
git-clone-holder
{
display
:
inline-table
;
display
:
inline-table
;
position
:
relative
;
position
:
relative
;
top
:
17px
;
}
}
.project-repo-buttons
{
.project-repo-buttons
{
...
@@ -103,6 +102,7 @@
...
@@ -103,6 +102,7 @@
.count-buttons
{
.count-buttons
{
display
:
block
;
display
:
block
;
margin-bottom
:
12px
;
}
}
.btn
{
.btn
{
...
@@ -187,6 +187,13 @@
...
@@ -187,6 +187,13 @@
margin-right
:
45px
;
margin-right
:
45px
;
}
}
.clone-options
{
display
:
table-cell
;
a
.btn
{
width
:
100%
;
}
}
.form-control
{
.form-control
{
cursor
:
auto
;
cursor
:
auto
;
@extend
.monospace
;
@extend
.monospace
;
...
...
app/views/projects/buttons/_star.html.haml
View file @
67c623d8
-
if
current_user
-
if
current_user
=
link_to
toggle_star_namespace_project_path
(
@project
.
namespace
,
@project
),
class:
'btn star-btn toggle-star has_tooltip'
,
method: :post
,
remote:
true
,
title:
"Star project"
do
=
link_to
toggle_star_namespace_project_path
(
@project
.
namespace
,
@project
),
class:
'btn star-btn toggle-star has_tooltip'
,
method: :post
,
remote:
true
,
title:
"Star project"
do
=
icon
(
'star fw'
)
-
if
current_user
.
starred?
(
@project
)
-
if
current_user
.
starred?
(
@project
)
=
icon
(
'star fw'
)
%span
.starred
Unstar
%span
.starred
Unstar
-
else
-
else
=
icon
(
'star-o fw'
)
%span
Star
%span
Star
%div
.count-with-arrow
%div
.count-with-arrow
%span
.arrow
%span
.arrow
...
@@ -14,16 +15,26 @@
...
@@ -14,16 +15,26 @@
$
(
'
.project-home-panel .toggle-star
'
).
on
(
'
ajax:success
'
,
function
(
e
,
data
,
status
,
xhr
)
{
$
(
'
.project-home-panel .toggle-star
'
).
on
(
'
ajax:success
'
,
function
(
e
,
data
,
status
,
xhr
)
{
var
$this
=
$
(
this
);
var
$this
=
$
(
this
);
var
$starSpan
=
$this
.
find
(
'
span
'
);
var
$starSpan
=
$this
.
find
(
'
span
'
);
var
$starIcon
=
$this
.
find
(
'
i
'
);
$this
$this
.
parent
()
.
parent
()
.
find
(
'
span.count
'
)
.
find
(
'
span.count
'
)
.
text
(
data
.
star_count
);
.
text
(
data
.
star_count
);
if
(
$starSpan
.
hasClass
(
'
starred
'
)){
if
(
$starSpan
.
hasClass
(
'
starred
'
)){
$starSpan
.
removeClass
(
'
starred
'
);
$starSpan
$starSpan
.
text
(
'
Star
'
);
.
removeClass
(
'
starred
'
)
.
text
(
'
Star
'
);
$starIcon
.
removeClass
(
'
fa-star
'
)
.
addClass
(
'
fa-star-o
'
);
}
else
{
}
else
{
$starSpan
.
addClass
(
'
starred
'
);
$starSpan
$starSpan
.
text
(
'
Unstar
'
);
.
addClass
(
'
starred
'
)
.
text
(
'
Unstar
'
);
$starIcon
.
removeClass
(
'
fa-star-o
'
)
.
addClass
(
'
fa-star
'
);
}
}
})
})
.
on
(
'
ajax:error
'
,
function
(
e
,
xhr
,
status
,
error
)
{
.
on
(
'
ajax:error
'
,
function
(
e
,
xhr
,
status
,
error
)
{
...
...
app/views/shared/_clone_panel.html.haml
View file @
67c623d8
-
project
=
project
||
@project
-
project
=
project
||
@project
.git-clone-holder.input-group
.input-group-addon.git-protocols
.git-clone-holder
.btn-group.clone-options
%a
.clone-dropdown-btn.btn
{
href:
'#'
,
'data-toggle'
=>
'dropdown'
}
%span
SSH
=
icon
(
'angle-down'
)
%ul
.dropdown-menu.dropdown-menu-right.clone-options-dropdown
%li
%a
{
href:
'#'
}
SSH
%li
%a
{
href:
'#'
}
HTTPS
=
text_field_tag
:project_clone
,
default_url_to_repo
(
project
),
class:
"js-select-on-focus form-control"
,
readonly:
true
.input-group-btn
.input-group-btn
=
ssh_clone_button
(
project
)
=
clipboard_button
(
clipboard_target:
'#project_clone'
)
.input-group-btn
=
http_clone_button
(
project
)
:javascript
=
text_field_tag
:project_clone
,
default_url_to_repo
(
project
),
class:
"js-select-on-focus form-control"
,
readonly:
true
$
(
'
ul.clone-options-dropdown a
'
).
on
(
'
click
'
,
function
(
e
){
.input-group-btn
e
.
preventDefault
();
=
clipboard_button
(
clipboard_target:
'#project_clone'
)
var
$this
=
$
(
this
);
$
(
'
a.clone-dropdown-btn span
'
).
text
(
$this
.
text
());
console
.
log
(
"
got it
"
,
$
(
this
).
text
());
});
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