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
05edd5e6
Commit
05edd5e6
authored
Apr 15, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download export now working
parent
41163fd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+10
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+5
-2
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/projects_controller.rb
View file @
05edd5e6
...
@@ -190,11 +190,15 @@ class ProjectsController < Projects::ApplicationController
...
@@ -190,11 +190,15 @@ class ProjectsController < Projects::ApplicationController
::
Projects
::
ImportExport
::
ExportService
.
new
(
@project
,
current_user
).
execute
::
Projects
::
ImportExport
::
ExportService
.
new
(
@project
,
current_user
).
execute
redirect_to
(
redirect_to
(
project_path
(
@project
),
edit_
project_path
(
@project
),
notice:
"Project export successfully started"
notice:
"Project export successfully started"
)
)
end
end
def
download_export
send_file
export_project_path
,
disposition:
'attachment'
end
def
toggle_star
def
toggle_star
current_user
.
toggle_star
(
@project
)
current_user
.
toggle_star
(
@project
)
@project
.
reload
@project
.
reload
...
@@ -256,4 +260,9 @@ class ProjectsController < Projects::ApplicationController
...
@@ -256,4 +260,9 @@ class ProjectsController < Projects::ApplicationController
def
get_id
def
get_id
project
.
repository
.
root_ref
project
.
repository
.
root_ref
end
end
def
export_project_path
# TODO: move this, probably to ImportExport and refactor
File
.
join
(
Settings
.
shared
[
'path'
],
'tmp/project_exports'
,
@project
.
path_with_namespace
,
'project.tar.gz'
)
end
end
end
app/views/projects/edit.html.haml
View file @
05edd5e6
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
method: :post
,
class:
"btn btn-default"
method: :post
,
class:
"btn btn-default"
.panel.panel-default
.panel.panel-default
.panel-heading
Export
.panel-heading
Export
project
.errors-holder
.errors-holder
.panel-body
.panel-body
%p
%p
...
@@ -141,9 +141,12 @@
...
@@ -141,9 +141,12 @@
%br
%br
.form-actions
.form-actions
=
link_to
'
E
xport'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
=
link_to
'
Generate new e
xport'
,
export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
method: :post
,
class:
"btn btn-default"
=
link_to
'Download export'
,
download_export_namespace_project_path
(
@project
.
namespace
,
@project
),
method: :post
,
class:
"btn btn-default"
-
if
can?
current_user
,
:archive_project
,
@project
-
if
can?
current_user
,
:archive_project
,
@project
-
if
@project
.
archived?
-
if
@project
.
archived?
...
...
config/routes.rb
View file @
05edd5e6
...
@@ -434,6 +434,7 @@ Rails.application.routes.draw do
...
@@ -434,6 +434,7 @@ Rails.application.routes.draw do
post
:toggle_star
post
:toggle_star
post
:markdown_preview
post
:markdown_preview
post
:export
post
:export
post
:download_export
get
:autocomplete_sources
get
:autocomplete_sources
get
:activity
get
:activity
end
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