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
1
Merge Requests
1
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
nexedi
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
Hide 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
@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
app/controllers/projects_controller.rb
View file @
0f77d24b
...
...
@@ -61,7 +61,7 @@ class ProjectsController < Projects::ApplicationController
flash
[
:notice
]
=
_
(
"Project '%{project_name}' was successfully updated."
)
%
{
project_name:
@project
.
name
}
format
.
html
do
redirect_to
(
edit_project_path
(
@project
))
redirect_to
(
edit_project_path
(
@project
,
anchor:
'js-general-project-settings'
))
end
else
flash
.
now
[
:alert
]
=
result
[
:message
]
...
...
@@ -174,7 +174,7 @@ class ProjectsController < Projects::ApplicationController
)
rescue
::
Projects
::
HousekeepingService
::
LeaseTaken
=>
ex
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-project-advanced-settings'
),
alert:
ex
.
to_s
)
end
...
...
@@ -183,7 +183,7 @@ class ProjectsController < Projects::ApplicationController
@project
.
add_export_job
(
current_user:
current_user
)
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."
)
)
end
...
...
@@ -195,7 +195,7 @@ class ProjectsController < Projects::ApplicationController
send_file
export_project_path
,
disposition:
'attachment'
else
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."
)
)
end
...
...
@@ -208,7 +208,7 @@ class ProjectsController < Projects::ApplicationController
flash
[
:alert
]
=
_
(
"Project export could not be deleted."
)
end
redirect_to
(
edit_project_path
(
@project
))
redirect_to
(
edit_project_path
(
@project
,
anchor:
'js-export-project'
))
end
def
generate_new_export
...
...
@@ -216,7 +216,7 @@ class ProjectsController < Projects::ApplicationController
export
else
redirect_to
(
edit_project_path
(
@project
),
edit_project_path
(
@project
,
anchor:
'js-export-project'
),
alert:
_
(
"Project export could not be deleted."
)
)
end
...
...
app/views/projects/edit.html.haml
View file @
0f77d24b
...
...
@@ -15,6 +15,7 @@
.settings-content
.project-edit-errors
=
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
.row
.form-group.col-md-9
...
...
@@ -75,6 +76,7 @@
Enable or disable certain project features and choose access levels.
.settings-content
=
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
%script
.js-project-permissions-form-data
{
type:
"application/json"
}=
project_permissions_panel_data
(
@project
)
.js-project-permissions-form
...
...
@@ -94,6 +96,7 @@
=
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
|
%input
{
name:
'update_section'
,
type:
'hidden'
,
value:
'js-merge-request-settings'
}
=
render
'projects/merge_request_settings'
,
form:
f
=
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?
:plain
location.href = "
#{
edit_project_path
(
@project
)
}
";
location.href = "
#{
edit_project_path
(
@project
,
anchor:
params
[
:update_section
])
}
";
location.reload();
-
else
:plain
$(".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