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
f59b7409
Commit
f59b7409
authored
May 14, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve user expirience while create/edit project settings
parent
bbd12591
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
222 additions
and
220 deletions
+222
-220
app/assets/javascripts/commits.js.coffee
app/assets/javascripts/commits.js.coffee
+3
-3
app/assets/javascripts/main.js.coffee
app/assets/javascripts/main.js.coffee
+3
-1
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+7
-3
app/views/projects/_errors.html.haml
app/views/projects/_errors.html.haml
+4
-0
app/views/projects/_form.html.haml
app/views/projects/_form.html.haml
+0
-151
app/views/projects/_new_form.html.haml
app/views/projects/_new_form.html.haml
+0
-48
app/views/projects/create.js.haml
app/views/projects/create.js.haml
+2
-4
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+150
-3
app/views/projects/new.html.haml
app/views/projects/new.html.haml
+50
-5
app/views/projects/update.js.haml
app/views/projects/update.js.haml
+3
-2
No files found.
app/assets/javascripts/commits.js.coffee
View file @
f59b7409
...
@@ -23,7 +23,7 @@ class CommitsList
...
@@ -23,7 +23,7 @@ class CommitsList
@
data
.
offset
=
limit
@
data
.
offset
=
limit
this
.
initLoadMore
()
this
.
initLoadMore
()
this
.
showProgress
()
;
this
.
showProgress
()
@
getOld
:
->
@
getOld
:
->
this
.
showProgress
()
this
.
showProgress
()
...
...
app/assets/javascripts/main.js.coffee
View file @
f59b7409
...
@@ -55,8 +55,10 @@ $ ->
...
@@ -55,8 +55,10 @@ $ ->
$
(
".one_click_select"
).
on
'click'
,
->
$
(
@
).
select
()
$
(
".one_click_select"
).
on
'click'
,
->
$
(
@
).
select
()
# Click a .appear-link, appear-data fadeout
# Click a .appear-link, appear-data fadeout
$
(
".appear-link"
).
on
'click'
,
->
$
(
".appear-link"
).
on
'click'
,
(
e
)
->
$
(
'.appear-data'
).
fadeIn
()
$
(
'.appear-data'
).
fadeIn
()
e
.
preventDefault
()
# Initialize chosen selects
# Initialize chosen selects
$
(
'select.chosen'
).
chosen
()
$
(
'select.chosen'
).
chosen
()
...
...
app/assets/javascripts/project.js.coffee
View file @
f59b7409
class
Project
class
Project
constructor
:
->
constructor
:
->
$
(
'.
new_project, .edit_project'
).
on
'ajax:before'
,
-
>
$
(
'.
project-edit-container'
).
on
'ajax:before'
,
=
>
$
(
'.project
_new_holder, .project_edit_hold
er'
).
hide
()
$
(
'.project
-edit-contain
er'
).
hide
()
$
(
'.save-project-loader'
).
show
()
$
(
'.save-project-loader'
).
show
()
$
(
'form #project_default_branch'
).
chosen
()
@
initEvents
()
initEvents
:
->
disableButtonIfEmptyField
'#project_name'
,
'.project-submit'
disableButtonIfEmptyField
'#project_name'
,
'.project-submit'
$
(
'#project_issues_enabled'
).
change
->
$
(
'#project_issues_enabled'
).
change
->
...
@@ -21,6 +24,7 @@ class Project
...
@@ -21,6 +24,7 @@ class Project
else
else
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
$
(
'#project_issues_tracker_id'
).
removeAttr
(
'disabled'
)
@
Project
=
Project
@
Project
=
Project
$
->
$
->
...
...
app/views/projects/_errors.html.haml
0 → 100644
View file @
f59b7409
-
if
@project
.
errors
.
any?
.alert.alert-error
%button
{
type:
"button"
,
class:
"close"
,
"data-dismiss"
=>
"alert"
}
×
=
@project
.
errors
.
full_messages
.
first
app/views/projects/_form.html.haml
deleted
100644 → 0
View file @
bbd12591
.row
.span3
%ul
.nav.nav-pills.nav-stacked
%li
.active
=
link_to
'Settings'
,
'#tab-settings'
,
'data-toggle'
=>
'tab'
%li
=
link_to
'Transfer'
,
'#tab-transfer'
,
'data-toggle'
=>
'tab'
%li
=
link_to
'Remove'
,
'#tab-remove'
,
'data-toggle'
=>
'tab'
.span9
.tab-content
.tab-pane.active
#tab-settings
.ui-box.white
%h5
.title
Settings:
.form-holder
=
form_for
(
@project
,
remote:
true
)
do
|
f
|
-
if
@project
.
errors
.
any?
.alert.alert-error
%ul
-
@project
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%fieldset
.clearfix.project_name_holder
=
f
.
label
:name
do
Project name is
.input
=
f
.
text_field
:name
,
placeholder:
"Example Project"
,
class:
"span5"
.clearfix
=
f
.
label
:description
do
Project description
%span
.light
(optional)
.input
=
f
.
text_area
:description
,
placeholder:
"awesome project"
,
class:
"span5"
,
rows:
3
,
maxlength:
250
-
unless
@project
.
empty_repo?
.clearfix
=
f
.
label
:default_branch
,
"Default Branch"
.input
=
f
.
select
(
:default_branch
,
@repository
.
branch_names
,
{})
-
if
can?
(
current_user
,
:change_public_mode
,
@project
)
%fieldset
.public-mode
%legend
Public mode:
.control-group
=
f
.
label
:public
,
class:
'control-label'
do
%span
Public access
.controls
=
f
.
check_box
:public
%span
.descr
If checked, this project can be cloned
%em
without any
authentication.
It will also be listed on the
#{
link_to
"public access directory"
,
public_root_path
}
.
%em
Any
user will have
#{
link_to
"Guest"
,
help_permissions_path
}
permissions on the repository.
%fieldset
.features
%legend
Labels:
.control-group
=
f
.
label
:label_list
,
"Labels"
,
class:
'control-label'
.controls
=
f
.
text_field
:label_list
,
maxlength:
2000
,
class:
"span5"
%p
.hint
Separate with comma.
%fieldset
.features
%legend
Features:
.control-group
=
f
.
label
:issues_enabled
,
"Issues"
,
class:
'control-label'
.controls
=
f
.
check_box
:issues_enabled
%span
.descr
Lightweight issue tracking system for this project
-
if
Project
.
issues_tracker
.
values
.
count
>
1
.control-group
=
f
.
label
:issues_tracker
,
"Issues tracker"
,
class:
'control-label'
.input
=
f
.
select
(
:issues_tracker
,
Project
.
issues_tracker
.
values
,
{},
{
disabled:
!
@project
.
issues_enabled
})
.clearfix
=
f
.
label
:issues_tracker_id
,
"Project name or id in issues tracker"
,
class:
'control-label'
.input
=
f
.
text_field
:issues_tracker_id
,
disabled:
!
@project
.
can_have_issues_tracker_id?
.control-group
=
f
.
label
:merge_requests_enabled
,
"Merge Requests"
,
class:
'control-label'
.controls
=
f
.
check_box
:merge_requests_enabled
%span
.descr
Submit changes to be merged upstream.
.control-group
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
.controls
=
f
.
check_box
:wiki_enabled
%span
.descr
Pages for project documentation
.control-group
=
f
.
label
:wall_enabled
,
"Wall"
,
class:
'control-label'
.controls
=
f
.
check_box
:wall_enabled
%span
.descr
Simple chat system for broadcasting inside project
.control-group
=
f
.
label
:snippets_enabled
,
"Snippets"
,
class:
'control-label'
.controls
=
f
.
check_box
:snippets_enabled
%span
.descr
Share code pastes with others out of git repository
.form-actions
=
f
.
submit
'Save'
,
class:
"btn btn-save"
.tab-pane
#tab-transfer
-
if
can?
(
current_user
,
:change_namespace
,
@project
)
.ui-box.ui-box-danger
%h5
.title
Transfer project
.errors-holder
.form-holder
=
form_for
(
@project
,
url:
transfer_project_path
(
@project
),
remote:
true
,
html:
{
class:
'transfer-project'
})
do
|
f
|
.control-group
=
f
.
label
:namespace_id
do
%span
Namespace
.controls
.clearfix
=
f
.
select
:namespace_id
,
namespaces_options
(
@project
.
namespace_id
||
Namespace
::
global_id
),
{
prompt:
'Choose a project namespace'
},
{
class:
'chosen'
}
%ul
%li
Be careful. Changing project namespace can have unintended side effects
%li
You can transfer project only to namespaces you can manage
%li
You will need to update your local repositories to point to the new location.
.form-actions
=
f
.
submit
'Transfer'
,
class:
"btn btn-remove"
-
else
%p
.nothing_here_message
Only project owner can transfer a project
.tab-pane
#tab-remove
-
if
can?
(
current_user
,
:remove_project
,
@project
)
.ui-box.ui-box-danger
%h5
.title
Remove project
.ui-box-body
%p
Remove of project will cause removing repository and all related resources like issues, merge requests etc.
%p
%strong
Removed project can not be restored!
=
link_to
'Remove project'
,
@project
,
confirm:
'Removed project can not be restored! Are you sure?'
,
method: :delete
,
class:
"btn btn-remove btn-small"
-
else
%p
.nothing_here_message
Only project owner can remove a project
app/views/projects/_new_form.html.haml
deleted
100644 → 0
View file @
bbd12591
=
form_for
(
@project
,
remote:
true
)
do
|
f
|
-
if
@project
.
errors
.
any?
.alert.alert-error
%span
=
@project
.
errors
.
full_messages
.
first
.clearfix.project_name_holder
=
f
.
label
:name
do
Project name is
.input
=
f
.
text_field
:name
,
placeholder:
"Example Project"
,
class:
"xxlarge"
=
f
.
submit
'Create project'
,
class:
"btn btn-create project-submit"
-
if
current_user
.
can_select_namespace?
.clearfix
=
f
.
label
:namespace_id
do
%span
Namespace
.input
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
),
{},
{
class:
'chosen'
}
.clearfix
.input
=
link_to
"#"
,
class:
'appear-link'
do
%i
.icon-upload-alt
%span
Import existing repository?
.clearfix.appear-data
=
f
.
label
:import_url
do
%span
Import existing repo
.input
=
f
.
text_field
:import_url
,
class:
'xlarge'
,
placeholder:
'https://github.com/randx/six.git'
.light
URL must be clonable
%p
.padded
New projects are private by default. You choose who can see the project and commit to repository.
%hr
-
if
current_user
.
can_create_group?
.clearfix
.input.light
Need a group for several dependent projects?
=
link_to
new_group_path
,
class:
"btn btn-tiny"
do
Create a group
-
if
current_user
.
can_create_team?
.clearfix
.input.light
Want to share a project between team?
=
link_to
new_team_path
,
class:
"btn btn-tiny"
do
Create a team
app/views/projects/create.js.haml
View file @
f59b7409
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
location.href = "
#{
project_path
(
@project
)
}
";
location.href = "
#{
project_path
(
@project
)
}
";
-
else
-
else
:plain
:plain
$('.project_new_holder').show();
$(".project-edit-errors").html("
#{
escape_javascript
(
render
(
'errors'
))
}
");
$("#new_project").replaceWith("
#{
escape_javascript
(
render
(
'new_form'
))
}
");
$('.save-project-loader').hide();
$('.save-project-loader').hide();
new Projects();
$('.project-edit-container').show();
$('select.chosen').chosen()
app/views/projects/edit.html.haml
View file @
f59b7409
=
render
"projects/settings_nav"
=
render
"projects/settings_nav"
.project
_edit_hold
er
.project
-edit-contain
er
%h3
.page_title
Edit Project
%h3
.page_title
Edit Project
%hr
%hr
=
render
"projects/form"
.project-edit-errors
%div
.save-project-loader.hide
.project-edit-content
.row
.span3
%ul
.nav.nav-pills.nav-stacked
%li
.active
=
link_to
'Settings'
,
'#tab-settings'
,
'data-toggle'
=>
'tab'
%li
=
link_to
'Transfer'
,
'#tab-transfer'
,
'data-toggle'
=>
'tab'
%li
=
link_to
'Remove'
,
'#tab-remove'
,
'data-toggle'
=>
'tab'
.span9
.tab-content
.tab-pane.active
#tab-settings
.ui-box.white
%h5
.title
Settings:
.form-holder
=
form_for
(
@project
,
remote:
true
)
do
|
f
|
%fieldset
.clearfix.project_name_holder
=
f
.
label
:name
do
Project name is
.input
=
f
.
text_field
:name
,
placeholder:
"Example Project"
,
class:
"span5"
.clearfix
=
f
.
label
:description
do
Project description
%span
.light
(optional)
.input
=
f
.
text_area
:description
,
placeholder:
"awesome project"
,
class:
"span5"
,
rows:
3
,
maxlength:
250
-
unless
@project
.
empty_repo?
.clearfix
=
f
.
label
:default_branch
,
"Default Branch"
.input
=
f
.
select
(
:default_branch
,
@repository
.
branch_names
,
{},
{
class:
'chosen'
})
-
if
can?
(
current_user
,
:change_public_mode
,
@project
)
%fieldset
.public-mode
%legend
Public mode:
.control-group
=
f
.
label
:public
,
class:
'control-label'
do
%span
Public access
.controls
=
f
.
check_box
:public
%span
.descr
If checked, this project can be cloned
%em
without any
authentication.
It will also be listed on the
#{
link_to
"public access directory"
,
public_root_path
}
.
%em
Any
user will have
#{
link_to
"Guest"
,
help_permissions_path
}
permissions on the repository.
%fieldset
.features
%legend
Labels:
.control-group
=
f
.
label
:label_list
,
"Labels"
,
class:
'control-label'
.controls
=
f
.
text_field
:label_list
,
maxlength:
2000
,
class:
"span5"
%p
.hint
Separate with comma.
%fieldset
.features
%legend
Features:
.control-group
=
f
.
label
:issues_enabled
,
"Issues"
,
class:
'control-label'
.controls
=
f
.
check_box
:issues_enabled
%span
.descr
Lightweight issue tracking system for this project
-
if
Project
.
issues_tracker
.
values
.
count
>
1
.control-group
=
f
.
label
:issues_tracker
,
"Issues tracker"
,
class:
'control-label'
.input
=
f
.
select
(
:issues_tracker
,
Project
.
issues_tracker
.
values
,
{},
{
disabled:
!
@project
.
issues_enabled
})
.clearfix
=
f
.
label
:issues_tracker_id
,
"Project name or id in issues tracker"
,
class:
'control-label'
.input
=
f
.
text_field
:issues_tracker_id
,
disabled:
!
@project
.
can_have_issues_tracker_id?
.control-group
=
f
.
label
:merge_requests_enabled
,
"Merge Requests"
,
class:
'control-label'
.controls
=
f
.
check_box
:merge_requests_enabled
%span
.descr
Submit changes to be merged upstream.
.control-group
=
f
.
label
:wiki_enabled
,
"Wiki"
,
class:
'control-label'
.controls
=
f
.
check_box
:wiki_enabled
%span
.descr
Pages for project documentation
.control-group
=
f
.
label
:wall_enabled
,
"Wall"
,
class:
'control-label'
.controls
=
f
.
check_box
:wall_enabled
%span
.descr
Simple chat system for broadcasting inside project
.control-group
=
f
.
label
:snippets_enabled
,
"Snippets"
,
class:
'control-label'
.controls
=
f
.
check_box
:snippets_enabled
%span
.descr
Share code pastes with others out of git repository
.form-actions
=
f
.
submit
'Save'
,
class:
"btn btn-save"
.tab-pane
#tab-transfer
-
if
can?
(
current_user
,
:change_namespace
,
@project
)
.ui-box.ui-box-danger
%h5
.title
Transfer project
.errors-holder
.form-holder
=
form_for
(
@project
,
url:
transfer_project_path
(
@project
),
remote:
true
,
html:
{
class:
'transfer-project'
})
do
|
f
|
.control-group
=
f
.
label
:namespace_id
do
%span
Namespace
.controls
.clearfix
=
f
.
select
:namespace_id
,
namespaces_options
(
@project
.
namespace_id
||
Namespace
::
global_id
),
{
prompt:
'Choose a project namespace'
},
{
class:
'chosen'
}
%ul
%li
Be careful. Changing project namespace can have unintended side effects
%li
You can transfer project only to namespaces you can manage
%li
You will need to update your local repositories to point to the new location.
.form-actions
=
f
.
submit
'Transfer'
,
class:
"btn btn-remove"
-
else
%p
.nothing_here_message
Only project owner can transfer a project
.tab-pane
#tab-remove
-
if
can?
(
current_user
,
:remove_project
,
@project
)
.ui-box.ui-box-danger
%h5
.title
Remove project
.ui-box-body
%p
Remove of project will cause removing repository and all related resources like issues, merge requests etc.
%p
%strong
Removed project can not be restored!
=
link_to
'Remove project'
,
@project
,
confirm:
'Removed project can not be restored! Are you sure?'
,
method: :delete
,
class:
"btn btn-remove btn-small"
-
else
%p
.nothing_here_message
Only project owner can remove a project
.save-project-loader.hide
%center
%center
=
image_tag
"ajax_loader.gif"
=
image_tag
"ajax_loader.gif"
%h3
Saving project. Please wait a moment, this page will automatically refresh when ready.
%h3
Saving project. Please wait a moment, this page will automatically refresh when ready.
app/views/projects/new.html.haml
View file @
f59b7409
.project_new_holder
.project-edit-container
%h3
.page_title
%h3
.page_title
New Project
New Project
%hr
%hr
=
render
'new_form'
.project-edit-errors
%div
.save-project-loader.hide
.project-edit-content
=
form_for
@project
,
remote:
true
do
|
f
|
.clearfix.project_name_holder
=
f
.
label
:name
do
Project name is
.input
=
f
.
text_field
:name
,
placeholder:
"Example Project"
,
class:
"xxlarge"
,
tabindex:
1
=
f
.
submit
'Create project'
,
class:
"btn btn-create project-submit"
,
tabindex:
3
-
if
current_user
.
can_select_namespace?
.clearfix
=
f
.
label
:namespace_id
do
%span
Namespace
.input
=
f
.
select
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
]
||
:current_user
),
{},
{
class:
'chosen'
,
tabindex:
2
}
.clearfix
.input
=
link_to
"#"
,
class:
'appear-link'
do
%i
.icon-upload-alt
%span
Import existing repository?
.clearfix.appear-data.import-url-data
=
f
.
label
:import_url
do
%span
Import existing repo
.input
=
f
.
text_field
:import_url
,
class:
'xlarge'
,
placeholder:
'https://github.com/randx/six.git'
.light
URL must be clonable
%p
.padded
New projects are private by default. You choose who can see the project and commit to repository.
%hr
-
if
current_user
.
can_create_group?
.clearfix
.input.light
Need a group for several dependent projects?
=
link_to
new_group_path
,
class:
"btn btn-tiny"
do
Create a group
-
if
current_user
.
can_create_team?
.clearfix
.input.light
Want to share a project between team?
=
link_to
new_team_path
,
class:
"btn btn-tiny"
do
Create a team
.save-project-loader.hide
%center
%center
=
image_tag
"ajax_loader.gif"
=
image_tag
"ajax_loader.gif"
%h3
Creating project
&
repository. Please wait a moment, this page will automatically refresh when ready.
%h3
Creating project
&
repository. Please wait a moment, this page will automatically refresh when ready.
app/views/projects/update.js.haml
View file @
f59b7409
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
location.href = "
#{
edit_project_path
(
@project
)
}
";
location.href = "
#{
edit_project_path
(
@project
)
}
";
-
else
-
else
:plain
:plain
$('.project_edit_holder').show();
$(".project-edit-errors").html("
#{
escape_javascript
(
render
(
'errors'
))
}
");
$(".edit_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
$('.save-project-loader').hide();
$('.save-project-loader').hide();
$('.project-edit-container').show();
$('.project-edit-content .btn-save').enableButton();
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