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
Léo-Paul Géneau
gitlab-ce
Commits
0f77d24b
Commit
0f77d24b
authored
Aug 08, 2018
by
Mike Greiling
Committed by
Tim Zallmann
Aug 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep project settings sections expanded after submitting form
parent
6aa56a70
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
app/controllers/projects/avatars_controller.rb
app/controllers/projects/avatars_controller.rb
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+6
-6
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+3
-0
app/views/projects/update.js.haml
app/views/projects/update.js.haml
+2
-1
No files found.
app/controllers/projects/avatars_controller.rb
View file @
0f77d24b
...
@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController
...
@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project
.
save
@project
.
save
redirect_to
edit_project_path
(
@project
),
status: :found
redirect_to
edit_project_path
(
@project
,
anchor:
'js-general-project-settings'
),
status: :found
end
end
end
end
app/controllers/projects_controller.rb
View file @
0f77d24b
...
@@ -61,7 +61,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -61,7 +61,7 @@ class ProjectsController < Projects::ApplicationController
flash
[
:notice
]
=
_
(
"Project '%{project_name}' was successfully updated."
)
%
{
project_name:
@project
.
name
}
flash
[
:notice
]
=
_
(
"Project '%{project_name}' was successfully updated."
)
%
{
project_name:
@project
.
name
}
format
.
html
do
format
.
html
do
redirect_to
(
edit_project_path
(
@project
))
redirect_to
(
edit_project_path
(
@project
,
anchor:
'js-general-project-settings'
))
end
end
else
else
flash
.
now
[
:alert
]
=
result
[
:message
]
flash
.
now
[
:alert
]
=
result
[
:message
]
...
@@ -174,7 +174,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -174,7 +174,7 @@ class ProjectsController < Projects::ApplicationController
)
)
rescue
::
Projects
::
HousekeepingService
::
LeaseTaken
=>
ex
rescue
::
Projects
::
HousekeepingService
::
LeaseTaken
=>
ex
redirect_to
(
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-project-advanced-settings'
),
alert:
ex
.
to_s
alert:
ex
.
to_s
)
)
end
end
...
@@ -183,7 +183,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -183,7 +183,7 @@ class ProjectsController < Projects::ApplicationController
@project
.
add_export_job
(
current_user:
current_user
)
@project
.
add_export_job
(
current_user:
current_user
)
redirect_to
(
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-export-project'
),
notice:
_
(
"Project export started. A download link will be sent by email."
)
notice:
_
(
"Project export started. A download link will be sent by email."
)
)
)
end
end
...
@@ -195,7 +195,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -195,7 +195,7 @@ class ProjectsController < Projects::ApplicationController
send_file
export_project_path
,
disposition:
'attachment'
send_file
export_project_path
,
disposition:
'attachment'
else
else
redirect_to
(
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-export-project'
),
alert:
_
(
"Project export link has expired. Please generate a new export from your project settings."
)
alert:
_
(
"Project export link has expired. Please generate a new export from your project settings."
)
)
)
end
end
...
@@ -208,7 +208,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -208,7 +208,7 @@ class ProjectsController < Projects::ApplicationController
flash
[
:alert
]
=
_
(
"Project export could not be deleted."
)
flash
[
:alert
]
=
_
(
"Project export could not be deleted."
)
end
end
redirect_to
(
edit_project_path
(
@project
))
redirect_to
(
edit_project_path
(
@project
,
anchor:
'js-export-project'
))
end
end
def
generate_new_export
def
generate_new_export
...
@@ -216,7 +216,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -216,7 +216,7 @@ class ProjectsController < Projects::ApplicationController
export
export
else
else
redirect_to
(
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-export-project'
),
alert:
_
(
"Project export could not be deleted."
)
alert:
_
(
"Project export could not be deleted."
)
)
)
end
end
...
...
app/views/projects/edit.html.haml
View file @
0f77d24b
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
.settings-content
.settings-content
.project-edit-errors
.project-edit-errors
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"edit-project"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"edit-project"
},
authenticity_token:
true
do
|
f
|
%input
{
name:
'update_section'
,
type:
'hidden'
,
value:
'js-general-project-settings'
}
%fieldset
%fieldset
.row
.row
.form-group.col-md-9
.form-group.col-md-9
...
@@ -75,6 +76,7 @@
...
@@ -75,6 +76,7 @@
Enable or disable certain project features and choose access levels.
Enable or disable certain project features and choose access levels.
.settings-content
.settings-content
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"sharing-permissions-form"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"sharing-permissions-form"
},
authenticity_token:
true
do
|
f
|
%input
{
name:
'update_section'
,
type:
'hidden'
,
value:
'js-shared-permissions'
}
-# haml-lint:disable InlineJavaScript
-# haml-lint:disable InlineJavaScript
%script
.js-project-permissions-form-data
{
type:
"application/json"
}=
project_permissions_panel_data
(
@project
)
%script
.js-project-permissions-form-data
{
type:
"application/json"
}=
project_permissions_panel_data
(
@project
)
.js-project-permissions-form
.js-project-permissions-form
...
@@ -94,6 +96,7 @@
...
@@ -94,6 +96,7 @@
=
render_if_exists
'shared/promotions/promote_mr_features'
=
render_if_exists
'shared/promotions/promote_mr_features'
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"merge-request-settings-form"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"merge-request-settings-form"
},
authenticity_token:
true
do
|
f
|
%input
{
name:
'update_section'
,
type:
'hidden'
,
value:
'js-merge-request-settings'
}
=
render
'projects/merge_request_settings'
,
form:
f
=
render
'projects/merge_request_settings'
,
form:
f
=
f
.
submit
'Save changes'
,
class:
"btn btn-save qa-save-merge-request-changes"
=
f
.
submit
'Save changes'
,
class:
"btn btn-save qa-save-merge-request-changes"
...
...
app/views/projects/update.js.haml
View file @
0f77d24b
-
if
@project
.
valid?
-
if
@project
.
valid?
:plain
:plain
location.href = "
#{
edit_project_path
(
@project
)
}
";
location.href = "
#{
edit_project_path
(
@project
,
anchor:
params
[
:update_section
])
}
";
location.reload();
-
else
-
else
:plain
:plain
$(".project-edit-errors").html("
#{
escape_javascript
(
render
(
'errors'
))
}
");
$(".project-edit-errors").html("
#{
escape_javascript
(
render
(
'errors'
))
}
");
...
...
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