Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
a2a3f8a1
Commit
a2a3f8a1
authored
1 year ago
by
Arnaud Levy
Browse files
Options
Downloads
Patches
Plain Diff
climate
parent
e18423b4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/admin/communication/extranets/contacts_controller.rb
+18
-17
18 additions, 17 deletions
...lers/admin/communication/extranets/contacts_controller.rb
with
18 additions
and
17 deletions
app/controllers/admin/communication/extranets/contacts_controller.rb
+
18
−
17
View file @
a2a3f8a1
...
...
@@ -11,22 +11,7 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
.
ordered
.
page
(
params
[
:organizations_page
])
}
format
.
xlsx
{
# params[export] can be "people" oe "organizations"
export
=
params
[
'export'
]
case
params
[
'export'
]
when
'people'
@people
=
@extranet
.
connected_people
.
ordered
when
'organizations'
@organizations
=
@extranet
.
connected_organizations
.
ordered
else
raise
ActionController
::
RoutingError
.
new
(
'Not Found'
)
end
filename
=
"
#{
export
}
-
#{
Time
.
now
.
strftime
(
"%Y%m%d%H%M%S"
)
}
.xlsx"
response
.
headers
[
'Content-Disposition'
]
=
"attachment; filename=
#{
filename
}
"
render
"admin/university/
#{
export
}
/index"
}
format
.
xlsx
{
export
}
end
...
...
@@ -54,7 +39,6 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
head
:ok
end
protected
def
load_object
...
...
@@ -62,4 +46,21 @@ class Admin::Communication::Extranets::ContactsController < Admin::Communication
object_id
=
params
[
:objectId
]
@object
=
object_type
.
constantize
.
find
object_id
end
def
export
# params[export] can be "people" or "organizations"
export
=
params
[
'export'
]
case
params
[
'export'
]
when
'people'
@people
=
@extranet
.
connected_people
.
ordered
when
'organizations'
@organizations
=
@extranet
.
connected_organizations
.
ordered
else
raise
ActionController
::
RoutingError
.
new
(
'Not Found'
)
end
filename
=
"
#{
export
}
-
#{
Time
.
now
.
strftime
(
"%Y%m%d%H%M%S"
)
}
.xlsx"
response
.
headers
[
'Content-Disposition'
]
=
"attachment; filename=
#{
filename
}
"
render
"admin/university/
#{
export
}
/index"
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment