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
41163fd5
Commit
41163fd5
authored
Apr 14, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some experimental UI stuff to test export
parent
0852f539
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+9
-0
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+1
-0
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+13
-0
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/projects_controller.rb
View file @
41163fd5
...
...
@@ -186,6 +186,15 @@ class ProjectsController < Projects::ApplicationController
)
end
def
export
::
Projects
::
ImportExport
::
ExportService
.
new
(
@project
,
current_user
).
execute
redirect_to
(
project_path
(
@project
),
notice:
"Project export successfully started"
)
end
def
toggle_star
current_user
.
toggle_star
(
@project
)
@project
.
reload
...
...
app/services/projects/import_export/export_service.rb
View file @
41163fd5
module
Projects
module
ImportExport
class
ExportService
<
BaseService
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
path_with_namespace
)
save_project_tree
...
...
app/views/projects/edit.html.haml
View file @
41163fd5
...
...
@@ -132,6 +132,19 @@
=
link_to
'Housekeeping'
,
housekeeping_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
.panel.panel-default
.panel-heading
Export
.errors-holder
.panel-body
%p
Downloads a compressed version of the project that can be imported.
%br
.form-actions
=
link_to
'Export'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
-
if
can?
current_user
,
:archive_project
,
@project
-
if
@project
.
archived?
.panel.panel-success
...
...
config/routes.rb
View file @
41163fd5
...
...
@@ -433,6 +433,7 @@ Rails.application.routes.draw do
post
:housekeeping
post
:toggle_star
post
:markdown_preview
post
:export
get
:autocomplete_sources
get
:activity
end
...
...
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