Skip to content

Commit

Permalink
Implement second version of CV export with working modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Feb 28, 2024
1 parent f8bc716 commit 0c5a3dc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
5 changes: 5 additions & 0 deletions app/controllers/people/export_cv_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class People::ExportCvController < ApplicationController
def show
render 'show'
end
end
6 changes: 2 additions & 4 deletions app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ def update
end

def show
if format_odt?
export
return
end
return export if format_odt?

@person = Person.includes(projects: :project_technologies,
person_roles: [:role, :person_role_level]).find(params.fetch(:id))
super
Expand Down
7 changes: 0 additions & 7 deletions app/views/application/_export_modal.html.haml

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/people/export_cv/_export_form.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
%form(action="/submit" method="post")
%label(for="test") Test:
%input(type="text" name="test" id="test")
2 changes: 2 additions & 0 deletions app/views/people/export_cv/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
= render "remote_modal", title: "Export" do
= render "export_form"
7 changes: 2 additions & 5 deletions app/views/people/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,5 @@
%div.mb-1= "#{language.language}: #{language.level} - #{language.certificate}"
= link_to "Show all", people_path

//%div{"data-controller"=>"remote-modal"}
// %button{"data-action"=>"click->remote-modal#maxVerstappen"} Export CV
%div
%button Export
%div.d-flex.justify-content-end
=link_to image_tag("plus-lg.svg", class: "text-primary")+ "Export", export_cv_person_path(@person), class: "btn text-primary", data: { turbo_frame: "remote_modal" }
3 changes: 2 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

resources :people do
member do
get 'export', to: 'people#export'
get 'export-cv', to: 'people/export_cv#show'
end

end
resources :skills

Expand Down

0 comments on commit 0c5a3dc

Please sign in to comment.