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
iv
gitlab-ce
Commits
7e76610d
Commit
7e76610d
authored
Sep 04, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the projects js file to coffeescript; refactor the clone panel switcher
parent
c1ff89fa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
45 deletions
+18
-45
app/assets/javascripts/projects.js.coffee
app/assets/javascripts/projects.js.coffee
+18
-22
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+0
-13
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+0
-5
app/views/refs/_head.html.haml
app/views/refs/_head.html.haml
+0
-5
No files found.
app/assets/javascripts/projects.js.coffee
View file @
7e76610d
function
Projects
()
{
window
.
Projects
=
->
$
(
"#project_name"
).
live
(
"change"
,
function
(){
$
(
"#project_name"
).
live
"change"
,
->
var
slug
=
slugify
(
$
(
this
).
val
());
slug
=
slugify
(
$
(
this
).
val
())
$
(
"#project_code"
).
val
(
slug
);
$
(
"#project_code"
).
val
(
slug
)
$
(
"#project_path"
).
val
(
slug
);
$
(
"#project_path"
).
val
(
slug
)
});
$
(
'.new_project, .edit_project'
).
live
(
'ajax:before'
,
function
()
{
$
(
".new_project, .edit_project"
).
live
"ajax:before"
,
->
$
(
'.project_new_holder, .project_edit_holder'
).
hide
();
$
(
".project_new_holder, .project_edit_holder"
).
hide
()
$
(
'.save-project-loader'
).
show
();
$
(
".save-project-loader"
).
show
()
});
$
(
'form #project_default_branch'
).
chosen
();
$
(
"form #project_default_branch"
).
chosen
()
disableButtonIfEmtpyField
"#project_name"
,
".project-submit"
disableButtonIfEmtpyField
(
"#project_name"
,
".project-submit"
)
# Git clone panel switcher
}
$
->
scope
=
$
(
'.project_clone_holder'
)
function
initGitCloneSwitcher
()
{
if
scope
.
length
>
0
var
link_sel
=
".project_clone_holder button"
;
$
(
'a, button'
,
scope
).
click
->
$
(
link_sel
).
bind
(
"click"
,
function
(
e
)
{
$
(
'a, button'
,
scope
).
removeClass
(
'active'
)
$
(
link_sel
).
removeClass
(
"active"
);
$
(
this
).
addClass
(
'active'
)
$
(
this
).
addClass
(
"active"
);
$
(
'#project_clone'
,
scope
).
val
(
$
(
this
).
data
(
'clone'
))
$
(
"#project_clone"
).
val
(
$
(
this
).
attr
(
"data-clone"
));
})
}
app/views/projects/empty.html.haml
View file @
7e76610d
...
@@ -36,16 +36,3 @@
...
@@ -36,16 +36,3 @@
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
.prepend-top-20
.prepend-top-20
=
link_to
'Remove project'
,
@project
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn danger right"
=
link_to
'Remove project'
,
@project
,
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn danger right"
:javascript
$
(
function
(){
var
link_sel
=
"
.project_clone_holder a
"
;
$
(
link_sel
).
bind
(
"
click
"
,
function
()
{
$
(
link_sel
).
removeClass
(
"
active
"
);
$
(
this
).
addClass
(
"
active
"
);
$
(
"
#project_clone
"
).
val
(
$
(
this
).
attr
(
"
data-clone
"
));
})
})
app/views/projects/show.html.haml
View file @
7e76610d
...
@@ -2,8 +2,3 @@
...
@@ -2,8 +2,3 @@
=
render
'clone_panel'
=
render
'clone_panel'
=
render
"events/event_last_push"
,
event:
@last_push
=
render
"events/event_last_push"
,
event:
@last_push
.content_list
=
render
@events
.content_list
=
render
@events
:javascript
$
(
function
(){
initGitCloneSwitcher
();
})
app/views/refs/_head.html.haml
View file @
7e76610d
...
@@ -12,8 +12,3 @@
...
@@ -12,8 +12,3 @@
%button
{
class:
"btn small active"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn small active"
,
:"data-clone"
=>
@project
.
ssh_url_to_repo
}
SSH
%button
{
class:
"btn small"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}
HTTP
%button
{
class:
"btn small"
,
:"data-clone"
=>
@project
.
http_url_to_repo
}
HTTP
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
class:
"one_click_select span5"
=
text_field_tag
:project_clone
,
@project
.
url_to_repo
,
class:
"one_click_select span5"
:javascript
$
(
function
(){
initGitCloneSwitcher
();
})
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