diff --git a/Gemfile b/Gemfile index bae0a4348316fa8bbe8488f473ed80d498e23753..6668b8b91a44e3a449f9c4b8b7d95a5586f910c3 100644 --- a/Gemfile +++ b/Gemfile @@ -149,6 +149,10 @@ gem 'ransack', github: 'activerecord-hackery/ransack' # For rendering inline SVG elements gem 'inline_svg' +# PDF generation +gem 'wicked_pdf' +gem 'wkhtmltopdf-binary' + # ================================================================================================= # Data Exports # ================================================================================================= diff --git a/Gemfile.lock b/Gemfile.lock index 7659cb557fc84433e665c1714f21bfe9fcb1f588..b6b27ae42003f95b56c0b0054cbfbd0386336893 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -528,6 +528,10 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) + wicked_pdf (2.8.2) + activesupport + ostruct + wkhtmltopdf-binary (0.12.6.8) xpath (3.2.0) nokogiri (~> 1.8) zebra-datepicker-rails (1.9.7) @@ -622,6 +626,8 @@ DEPENDENCIES turbolinks (>= 5.2.0) tzinfo-data web-console (>= 4.2.0) + wicked_pdf + wkhtmltopdf-binary zebra-datepicker-rails zip-zip diff --git a/app/controllers/draft_contracts_controller.rb b/app/controllers/draft_contracts_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..5e41f156b6c286cf16ab6875c018bc0c9b04dfda --- /dev/null +++ b/app/controllers/draft_contracts_controller.rb @@ -0,0 +1,84 @@ +class DraftContractsController < ApplicationController + load_and_authorize_resource + before_action :authorize_user! + + def authorize_user! + unless @draft_contract.user == current_user || + current_user.has_role?(:client, @draft_contract.project) || + current_user.has_role?(:coordinator, @draft_contract.course_edition) || + current_user.role_admin? + redirect_to draft_contracts_path, alert: 'You are not authorized to view this contract.' + end + end + + def index + add_breadcrumb('My draft contracts') + if current_user.role_admin? + @draft_contracts = DraftContract.all + else + @draft_contracts = [] + DraftContract.find_each do |contract| + if contract.user == current_user || current_user.has_role?(:client, contract.project) || current_user.has_role?(:coordinator, contract.course_edition) + @draft_contracts.append(contract) + end + end + end + end + + def show + @current_stage = 2 + end + + def pdf + pdf_data = @draft_contract.generate_pdf + send_data(pdf_data, type: 'application/pdf', disposition: 'inline', filename: 'contract.pdf') + end + + def new + @draft_contract = DraftContract.new + end + + def create + @draft_contract = DraftContract.new(draft_contract_params) + @draft_contract.user = current_user + + if @draft_contract.save + redirect_to draft_contracts_path, notice: 'Draft contract was successfully created.' + else + render :new, status: :unprocessable_entity + end + end + + def update + if @draft_contract.update(draft_contract_params) + redirect_to draft_contracts_path, notice: 'Draft contract was successfully updated.' + else + render :edit, status: :unprocessable_entity + end + end + + private + + def draft_contract_params + params.require(:draft_contract).permit( + :offerer_id, :group_id, :project_id, :course_edition_id, + :student_signature, :company_signature, :coordinator_signature, + :university_institution, :university_faculty, :university_address, + :university_telephone_number, :university_email, + :internship_host_company, :internship_host_telephone_number, :internship_host_email, + :intern_name, :intern_telephone_number, :intern_email, + :internship_intern_name, :internship_intern_address, :internship_intern_telephone_number, :internship_intern_email, + :non_eu_v_number, :study_programme, + :university_mentor_name, :university_mentor_address, :university_mentor_telephone_number, :university_mentor_email, + :internship_supervisor_name, :internship_supervisor_function, :internship_supervisor_address, + :internship_supervisor_telephone_number, :internship_supervisor_email, + :study_advisor_name, :study_advisor_telephone_number, :study_advisor_email, + :project_title, :project_subject, :project_description, + :internship_period_from, :internship_period_to, + :internship_location, :course_code, :ects, + :internship_pay, :expense_allowance, :leave, + :insurance_article_16_4, :insurance_article_16_6, + :background_knowledge + ) + end +end diff --git a/app/models/draft_contract.rb b/app/models/draft_contract.rb index 716b9c2e6bfe1833d770cf5e5944a4791d32ad31..18e3701a99a6d00414058dd6896ea68e945f3022 100644 --- a/app/models/draft_contract.rb +++ b/app/models/draft_contract.rb @@ -9,30 +9,38 @@ class DraftContract < ApplicationRecord has_one_attached :company_signature has_one_attached :coordinator_signature - after_commit :finalize_contract, if: :fully_signed? + after_commit :convert_into_contract!, if: -> { persisted? && fully_signed? } def all_signatures_present? student_signature.attached? && company_signature.attached? && coordinator_signature.attached? end def generate_pdf - WickedPdf.new.pdf_from_string( - ApplicationController.render( - template: 'draft_contracts/contract_pdf.html.erb', - locals: { contract: self } - ) + # TODO: It would probably be a good idea to render a pdf on each update and cache it to avoid invoking wkhtmltopdf on each page load + + contract_html = ActionController::Renderer.for(ApplicationController).render_to_string( + template: 'draft_contracts/_contract', + locals: { contract: self }, + layout: false ) + WickedPdf.new.pdf_from_string(contract_html) end - def finalize_contract - Contract.create!( + def convert_into_contract! + contract = Contract.new( user: user, offerer: offerer, group: group, project: project, - course_edition: course_edition, - file: generate_pdf + course_edition: course_edition ) + contract.file.attach(io: StringIO.new(generate_pdf), filename: 'contract.pdf', content_type: 'application/pdf') + contract.save! + destroy! end + + def fully_signed? + false + end end diff --git a/app/views/draft_contracts/_contract.html.erb b/app/views/draft_contracts/_contract.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..1f040398c542f95c75eb639f8a9074c1e438ceac --- /dev/null +++ b/app/views/draft_contracts/_contract.html.erb @@ -0,0 +1,1432 @@ +<% current_stage ||= nil %> +<div class="contract"> + <h2>Internship Agreement for Academic Education</h2> + <div>Changes to these terms and conditions shall not be accepted and will have no legal effect between the parties + </div> + + <div class="contract-section"> + <h3>University:</h3> + <p> + <strong>Institution:</strong> + <%= contract.university_institution %> + </p> + <p> + <strong>Faculty/Department:</strong> + <%= contract.university_faculty %> + </p> + <p> + <strong>Address:</strong> + <%= contract.university_address %> + </p> + <p> + <strong>Telephone number:</strong> + <%= contract.university_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.university_email %> + </p> + </div> + + <!-- Internship Host Company Details --> + <div class="contract-section"> + <h3>Internship Host</h3> + <p> + <strong>Internship host/company:</strong> + <%= contract.internship_host_company %> + </p> + <p> + <strong>Telephone number:</strong> + <%= contract.internship_host_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.internship_host_email %> + </p> + </div> + + <div class="contract-section"> + <h3>Intern</h3> + <p> + <strong>Name:</strong> + <%= contract.intern_name %> + <% if current_stage == 1 %> + <%= f.text_field :intern_name %> + <% end %> + </p> + <p> + <strong>Telephone Number:</strong> + <%= contract.intern_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.intern_email %> + </p> + </div> + <div class="contract-section"> + <h3>Details of agreement</h3> + <div>Internship agreement between the University, the Internship host and the Intern</div> + <a href="https://filelist.tudelft.nl/Studentenportal/Faculteitspecifiek/IO/Onderwijs/Stage%20aanbod/Links/Stageovereenkomst_EN_def_IDE.pdf">See + explanatory notes</a> + </div> + + <div class="contract-section"> + <h3>Details of Internship Agreement</h3> + <div class="contract-section two-columns"> + <div class="column"> + <h4>Intern</h4> + </div> + + <div class="column"> + <p> + <strong>Name:</strong> + <%= contract.internship_intern_name %> + <% if current_stage == 1 %> + <%= f.text_field :internship_intern_name %> + <% end %> + </p> + <p> + <strong>Address:</strong> + <%= contract.internship_intern_address %> + </p> + <p> + <strong>Telephone Number:</strong> + <%= contract.internship_intern_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.internship_intern_email %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Non-EU/EEA Student</h4> + </div> + <div class="column"> + <p> + <strong>V number:</strong> + <%= contract.non_eu_v_number %> + <% if current_stage == 1 %> + <%= f.text_field :non_eu_v_number %> + <% end %> + </p> + + <p>Hereby declares that they: + <ol> + <li>are registered as a student at a Dutch educational institution for the term of this agreement;</li> + <li>hold a valid Dutch student or residence permit, which at least covers the period of the + Internship. + </li> + <li>A copy of the residence permit shall be attached to this agreement.</li> + <li>A copy of this agreement should be in the possession of the University and + the Internship host. + </li> + </ol> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Study programme (delete if not applicable):</h4> + </div> + <div class="column"> + <p> + Bachelor/Master <%= contract.study_programme %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>University mentor</h4> + </div> + <div class="column"> + <p> + <strong>Name:</strong> + <%= contract.university_mentor_name %> + </p> + <p> + <strong>Address:</strong> + <%= contract.university_mentor_address %> + </p> + <p> + <strong>Telephone Number:</strong> + <%= contract.university_mentor_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.university_mentor_email %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>University supervisor</h4> + </div> + <div class="column"> + <p> + <strong>Name:</strong> + <%= contract.internship_supervisor_name %> + </p> + <p> + <strong>Function:</strong> + <%= contract.internship_supervisor_function %> + </p> + <p> + <strong>Address:</strong> + <%= contract.internship_supervisor_address %> + </p> + <p> + <strong>Telephone Number:</strong> + <%= contract.internship_supervisor_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.internship_supervisor_email %> + </p> + </div> + </div> + <div class="contract-section two-columns"> + <div class="column"> + <h4>Optional: Study adviser</h4> + </div> + <div class="column"> + <p> + <strong>Name:</strong> + <%= contract.study_advisor_name %> + </p> + <p> + <strong>Telephone Number:</strong> + <%= contract.study_advisor_telephone_number %> + </p> + <p> + <strong>Email:</strong> + <%= contract.study_advisor_email %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Project Details</h4> + </div> + <div class="column"> + <p> + <strong>Title:</strong> + <%= contract.project_title %> + </p> + <p> + <strong>Subject:</strong> + <%= contract.project_subject %> + </p> + <p> + <strong>Description:</strong> + <%= contract.project_description %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Internship Period</h4> + </div> + <div class="column"> + <p> + <div>From: + <%= contract.internship_period_from %> + To: + <%= contract.internship_period_to %> + </div> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Internship Location</h4> + </div> + <div class="column"> + <p> + <%= contract.internship_location %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Course code</h4> + </div> + <div class="column"> + <p> + <%= contract.course_code %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>The number of Internship ECTS credits</h4> + </div> + <div class="column"> + <p> + <%= contract.ects %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Internship pay [1]</h4> + </div> + <div class="column"> + <p> + € <%= contract.internship_pay %> gross per month + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Expense allowance [2]</h4> + </div> + <div class="column"> + <p> + € <%= contract.expense_allowance %> net per month + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Leave</h4> + </div> + <div class="column"> + <p> + The Intern is entitled to <%= contract.leave %> days of leave + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Optional provisions insurance/ + MAT/PIC + (see article 16.6</h4> + </div> + <div class="column"> + <p>Declares that</p> + <p> + Article 16.4 + <%= contract.insurance_article_16_4 == true ? 'Is applicable' : 'Is not applicable' %> + </p> + <p> + Article 16.6 + <%= contract.insurance_article_16_6 == true ? 'Is applicable' : 'Is not applicable' %> + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Specification of the background + knowledge (including computer + software) contributed for the + purposes of the Internship by + the University and/or Intern</h4> + </div> + <div class="column"> + <p><%= contract.background_knowledge %> </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Particulars</h4> + </div> + <div class="column"> + <ul> + <li> + Please note that for certain countries (outside the EEA), a research permit may be required + (for instance: <a href=https://www.cbd.int/abs/text/>https://www.cbd.int/abs/text/</a> + and + <a href=https://www.nvwa.nl/onderwerpen/nagoya-protocol>https://www.nvwa.nl/onderwerpen/nagoya-protocol</a> + ) + </li> + <li> + Possibly by the final assessor in Article 6(4) approved as the competent delegate + <........................................>; + </li> + <li> + Any deviation from the confidentiality obligation of the confidential information in the + Internship Report mentioned in Art. 10(2), can be extended with a substantiated appeal to + the University to a maximum of 5 years, in principle, and, for long-term breeding processes + or drug development including labs and bioinformatic processes that serve this purpose, + or other particularly sensitive knowledge and technology that may have negative consequences for the + national security of our country and damage to Dutch innovative capacity, + up to < > years. + </li> + <li> + There may be grounds for the applicable exception terms of confidentiality to be agreed in + writing between the Internship host and the Intern/University before the end of the Internship Agreement, + whereby such agreed terms will form part of this Internship Agreement. + </li> + <li>Other</li> + </ul> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Particulars in case of emergency + (for instance, due to coronavirus)</h4> + </div> + <div class="column"> + <ul> + <li>The Intern shall have a duty to comply with the health measures applicable in the country + and taken by the Internship host; + </li> + <li>The Internship supervisor is the primary contact person for the Intern in cases of emergency;</li> + <li>The Internship supervisor takes responsibility if any assistance is necessary (e.g. contact + with embassy); + </li> + <li>Intern, University mentor and Internship supervisor come to an alternative for how the + Internship work plan is executed if the Intern is unable to complete their Internship on + location. + </li> + <li>Other....</li> + </ul> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Company in-house regulations + and instructions</h4> + </div> + <div class="column"> + <p> + The company-specific terms and conditions (in-house rules, code of conduct, allowances, + attendance registration, leave arrangements, sickness reporting, etc.) may be added here + and apply to the Intern in accordance with Article 9.2 Terms and Conditions of the Internship + Agreement. + </p> + </div> + </div> + + <div class="contract-section two-columns"> + <div class="column"> + <h4>Version number 1.0</h4> + </div> + <div class="column"> + <p> + After consultation with the private sector in an online consultation, this Internship Agreement + was adopted by the Executive Board of Universities of the Netherlands (UNL) on June 24, 2022. + </p> + </div> + </div> + </div> + <div> + <p> + (1) Reimbursements will be specified in gross amounts, except where they are intended as direct compensation for + expenses incurred by the Intern, which are to + be paid by the Internship host, based on agreements. Internship pay represents a reimbursement of expenses. From a + fiscal point of view, a paid employment + relationship exists with the institution providing the internship if the internship allowance (Article 7.1) is + more than just a reimbursement of expenses on the basis + of which social security contributions (including tax on wages) must be withheld in that case. Viewed from the + perspective of labour law, there is no relationship + of employment and thus no contract of employment within the meaning of Article 7:610 of the Dutch Civil Code, but + rather learning on the job, whereby employer + liability (Article 7:658 of the Dutch Civil Code) does apply.</p> + <p>(2) An allowance for reasonable travel or expenses is not deemed to constitute income. The Internship host will + not withhold any social contributions (including tax on + wages) from actual travel or reasonable study costs.</p> + </div> + <div>The following constitutes an inseparable and integral part of this Internship Agreement: + <ul> + <li> + The Terms & Conditions attached to this Internship Agreement for Academic Education are accepted by the + University, + Intern and Internship host upon signing the Internship Agreement. + </li> + <li> + National agreements on intellectual property and students: + <a href="https://filelist.tudelft.nl/Studentenportal/Faculteitspecifiek/IO/Onderwijs/Stage%20aanbod/Links/Stageovereenkomst_EN_def_IDE.pdf">Addendum + Guidelines Intellectual Property and Students</a>. + </li> + </ul> + </div> + + <div> + The undersigned parties declare that they have read and fully understood the agreement and the accompanying 'Terms + and Conditions of Internship Agreement for Academic Education'. + <p>The parties to this Internship Agreement have agreed as such on:</p> + </div> + + <div class="contract-section three-columns"> + <!-- First Column: Intern --> + <div class="column"> + <h4>Intern</h4> + <p><strong>Digital Signature:</strong></p> + <p><strong>Name:</strong></p> + </div> + + <!-- Second Column: Internship Host --> + <div class="column"> + <h4>On behalf of the Internship Host</h4> + <p><strong>Digital Signature:</strong></p> + <p><strong>Name:</strong></p> + <p><strong>Position:</strong></p> + </div> + + <!-- Third Column: University --> + <div class="column"> + <h4>On behalf of the University</h4> + <p><strong>Digital Signature:</strong></p> + <p><strong>Name:</strong></p> + <p><strong>Position:</strong></p> + </div> + </div> + + <div>Please ensure that the University signatory is authorised to sign the Internship Agreement. If in doubt, please + contact + the lawyer of the relevant University department. If desired, all pages of this Internship Agreement can be + initialled. + </div> + + <h4>Article 1: Definitions</h4> + <p><strong>1.1 </strong>Study programme: a Bachelor's or Master's + programme of study within the University, listed in + the CROHO register. + </p> + <p><strong>1.2 </strong> + University mentor: a Study programme lecturer + who assumes responsibility for supervising and + assessing an Internship and/or thesis on behalf of + the University. + </p> + <p><strong>1.3 </strong>Internship coordinator: a supervisor of the + Internship procedures acting on behalf of the Study + programme. + </p> + <p><strong>1.4 </strong>Internship regulations: regulations drawn up by the + Study programme, which include the regulations + that it has drawn up for Internships, including their + objectives and substance.</p> + <p><strong>1.5 </strong>Internship work plan: a plan drawn up by the Intern + that sets out the educational activities and work that + have been stipulated in consultation with the Study + programme and the Internship host, and that the + Intern will be performing during their Internship. If + necessary, a data management plan may constitute + part of this.</p> + <p><strong>1.6 </strong> + Internship supervisor: an Internship host staff + member who assists the Intern in the workplace + during their Internship. + </p> + <p><strong>1.7 </strong> + Internship: practical placement that constitutes part + of the curriculum. + </p> + <p><strong>1.8 </strong> + Internship host: Internship organisation. + </p> + <p><strong>1.9 </strong> + Internship Agreement: the agreement between the + University, the Internship host and the Intern, or + between the University and the Intern. + </p> + <p><strong>1.10 </strong> + Intern: a student enrolled in a Study programme with + whom an Internship Agreement is concluded. + </p> + <p><strong>1.11 </strong> + University: the institution where the Intern is enrolled + as a student. + </p> + <h4>Article 2 PURPOSE OF THE INTERNSHIP</h4> + <p><strong>2.1 </strong>The Intern shall be afforded an opportunity to acquire + practical experience with an Internship host for the + purposes of their University Study programme where + the Intern is enrolled. + </p> + <p><strong>2.2 </strong> + Their Internship constitutes part of the curriculum. + The mandatory components of the Internship are + set out in the applicable study guide, the Education + and Examination Regulations and/or in the Internship + Regulations of the University. + </p> + <p><strong>2.3 </strong>The purpose of the Internship and the activities to be + performed are included in the Internship work plan + attached to the Internship Agreement. + </p> + <h4>Article 3 DEDICATED HOURS</h4> + <div>The Intern's dedicated working hours shall be identical to + those applicable within the Internship host's organisation, + with a maximum of 8 hours per day unless otherwise + stipulated in the Internship work plan. Furthermore, the + Intern shall be entitled to participate in educational activities + at the University (Article 8.3) at the times specified in + the Internship work plan, including consultation with the + University mentor. + </div> + <h4>Article 4 THE INTERN'S STATUS</h4> + <p><strong>4.1 </strong>The Internship is designed to expand the Intern's + knowledge, skills and experience for the benefit + of their Study programme. As such, this Internship + Agreement does not seek to serve as a contract of + employment under the terms of Article 7:610 of the + Dutch Civil Code, nor is it intended to be as such + either. + </p> + <p><strong>4.2 </strong> + The Intern shall remain registered as a student at the + University during the Internship. + </p> + <p><strong>4.3 </strong>The Internship will be carried out under the + responsibility and supervision of the Study programme + in which the Intern is enrolled. + </p> + <p><strong>4.4 </strong>No restrictions may arise pursuant to the Internship + in relation to the Intern's future work with other + institutions or businesses.</p> + <p><strong>4.5 </strong>The Internship host will not enter into any other + type of (temporary) employment, including hiring + or employment on any other basis, with the Intern + in addition to this Internship Agreement for the + period indicated on the cover page under 'Details of + Internship Agreement'.</p> + <p><strong>4.6 </strong> + The Intern will not enter into any other commitments + with the Internship host, its suppliers, clients or other + relations in addition to this Internship Agreement, + during the period stated in the Internship Agreement + </p> + + <h4>Article 5 SUPERVISION</h4> + <p><strong>5.1 </strong>The Internship supervisor shall oversee the progress + of the Internship on behalf of the Internship host. + </p> + <p><strong>5.2 </strong> + The Internship supervisor and the Intern shall consult + each other with some regularity, or as required, + for the purposes of mentoring and on a number of + evaluation occasions, preferably halfway through the + Internship period and after it has ended. + </p> + <p><strong>5.3 </strong>The Intern will submit an Internship work plan to the + University mentor and the Internship supervisor one + (1) month before the start of the Internship, in which + the supervision will be made specific. The University + mentor and the Intern arrange a progress meeting + with each other at least once. + </p> + <p><strong>5.4 </strong>The Internship supervisor and the University mentor + shall conduct an evaluation interview with the Intern + at least once.</p> + <h4>Article 6 ASSESSMENT</h4> + <p><strong>6.1 </strong>In accordance with the relevant guidelines in + the Internship Regulations and/or Education and + Examination Regulations, the Internship supervisor + fills in an evaluation form provided by the University. + </p> + <p><strong>6.2 </strong> + The examiner prepares the final assessment in + accordance with the guidelines mentioned in Article + 6(1). + </p> + <p><strong>6.3 </strong>The assessment shall be discussed with the Intern. + </p> + <p><strong>6.4 </strong>The examiner shall be responsible for the final + assessment of the Internship.</p> + + <h4>Article 7 PAYMENTS</h4> + <p><strong>7.1 </strong>In the event that the Intern receives Internship + pay, the Internship host shall withhold any salary + deductions and the customary premiums. + </p> + <p><strong>7.2 </strong> + To the extent that it concerns expenses incurred by + the Intern on behalf of the Internship host and does + not concern travel costs from the home address to + the Internship location, these expenses will be borne + by the Internship host and may be submitted by the + Intern to the Internship host, subject to the internal + standards used by the Internship host for expense + claims. + </p> + <p><strong>7.3 </strong>With regard to costs relating to commuting, + arrangements may be made between the Intern and + the Internship host. + </p> + + <h4>Article 8 TIME OFF AND ILLNESS</h4> + <p><strong>8.1 </strong>The Intern shall be entitled to time off. In principle, + the accrual of time off will be the same as the + Internship host's leave arrangements. The Internship + supervisor may only accede to a request for + additional time off in consultation with a University + mentor. + </p> + <p><strong>8.2 </strong> + The procedure for extraordinary leave and the Work + and Care Act (Wet arbeid en zorg) shall, in principle,[3] + apply as they do in relation to the Internship host's + employees. In the event that the Intern takes time off + in excess of the number of agreed days of leave, the + Internship period shall be extended by the excess. + </p> + <p><strong>8.3 </strong>No days off need be taken for educational activities + such as examinations, resits and Internship review + days. + </p> + <p><strong>8.4 </strong>In the event that they are sick, the Intern shall report + this to the Internship supervisor in accordance with + the Internship host's rules. + The same shall occur when providing a report of + recovery. Any agreed expense arrangements shall not + apply during the period of illness or leisure time. + </p> + <p><strong>8.5 </strong>If the Intern is sick for longer than two (2) weeks, + they shall also notify the University mentor of this. + </p> + + <h4>Article 9 INTERNAL RULES AND INSTRUCTIONS ISSUED BY THE INTERNSHIP HOST</h4> + <p><strong>9.1 </strong>The Internship host shall present the Intern with + its internal rules and regulations and/or codes of + conduct that are applicable in relation to its staff. + The Intern shall have a duty to comply with these + regulations. The Intern shall have a duty to heed + the Internship supervisor and/or University mentor's + instructions. + </p> + <p><strong>9.2 </strong> + In the event of a serious conflict between the + internal regulations and this Internship Agreement, + the Internship coordinator, University mentor or the + Examination Board shall decide whether the Intern + may commence the Internship under the internal + regulations of the Internship host. + </p> + + <h4>Article 10 CONFIDENTIAL INFORMATION</h4> + <p><strong>10.1 </strong>The Intern/University and the Internship host + are obliged to keep the knowledge, data and + other information they receive from each other + confidential. This includes the trade secrets of these + parties that become known to the Intern/University + and the Internship host during the internship period + and that the parties know or can reasonably suspect + must be kept secret and may not be disclosed to + third parties, hereinafter referred to as 'Confidential + Information'. This confidentiality shall be valid + indefinitely. All information and results developed in the + framework of the Internship assignment will be + kept confidential by the parties until the Internship + report is complete and the agreement between the + Internship provider and the Intern/University on its + publication and confidentiality has been established + in accordance with Article 12. Confidentiality does not apply in instances where + Confidential Information, in the context of the + assessment and supervision of the Internship + assignment (e.g. the Internship report or the + graduation report), must necessarily be shared + with the University. The Intern may only share this + Confidential Information with the University once + the Internship host has given explicit permission. + The Internship host may also impose conditions on + the sharing of this Confidential Information with the + University, but without preventing the Intern from + being assessed or graduating. + The same rules apply to the Intern as to employees + of the Internship host with respect to Confidential + Information. Where the Trade Secrets Act [4] applies, + the Intern shall: + a. refrain from invoking any right that the Intern may + have or may be entitled to under that Act as holder + of those trade secrets, and + b. comply with all obligations that this Law imposes + on a holder of trade secrets, including the + obligation to take reasonable steps to keep such + trade secrets confidential. The Intern may include Confidential Information + about the Internship host in a confidential attachment + of the Internship report, only if necessary and + relevant for the Internship and after prior written + agreement with the Internship host. + </p> + <p><strong>10.2 </strong> + If the Internship host has given permission to include + Confidential Information in the Internship report, + thesis or other report, the confidentiality obligations + as set out in this Article will not apply to the entire + Internship report, thesis or other report but only to + the separate components containing the Confidential + Information. As an exception to the indefinite + duration of confidentiality referred to in paragraph + 1 of this Article, the confidentiality period for these + components of the Internship report, thesis or + other report will be as short as possible, in principle + not exceeding two (2) years in order to be able to + establish IP rights or publish peer review articles. + On the basis of a substantiated request, the + Internship host may consult the University to keep + certain Confidential Information of the Internship + report, thesis or other report confidential for up to + five (5) years. This longer period requires thorough + argumentation as to the reason and the duration of + the period and is included on the cover page of this + agreement under Particulars. In highly exceptional cases, such as long- term + breeding programmes or drug development, including + lab and bioinformatic processes that serve this + purpose, or other particularly sensitive knowledge + and technology with negative consequences for the + national security of our country and impairment of + Dutch innovative strength, a longer period may be + agreed in consultation with the University. + </p> + + <p><strong>10.3 </strong> + University employees or other persons working + for the University who, by virtue of their position + and statutory duties, have access to Confidential + Information of the Internship host, are bound, in + addition to this Agreement, by the obligation of + non- disclosure in accordance with the Collective + Labour Agreement (CAO) for Dutch Universities, + the professional code and/or applicable complaints + or disputes regulations. To the extent that such an + employee or other person has access to Confidential + Information belonging to the Internship host: + a. the employee shall refrain from invoking any right + that the employee may have or may be entitled + to under the Trade Secrets Act as holder of those + trade secrets, and + b. they shall comply with all obligations that the + aforementioned Law imposes on a holder of + trade secrets, including the obligation to take + reasonable steps to keep such trade secrets + confidential. + </p> + + <p><strong>10.4 </strong> + This duty of confidentiality shall not apply in relation + to information that demonstrably: + a. was already publicly available when it was + obtained; or + b. became publicly available other than through the + actions or negligence of the Parties; or + c. was already in the possession of the Parties + before the commencement of the Internship, + provided that this information has not been + directly or indirectly obtained from the Internship + host, the University or Intern; or + d. was produced independently by the Parties + without using any information supplied by the + Internship host, University or Intern; + e. may be released with the written permission of the + Parties; and/or + f. must be disclosed by the Parties by virtue of a + statutory obligation, by virtue of an irrevocable + decision of a competent public court or by virtue + of an otherwise binding and unassailable decision + of any administrative body, any regulatory or + self-regulating body or authority (including the + University's Scientific Integrity Committee or the + National Scientific Integrity Initiative (LOWI), on the + understanding that in such a case: I. the University and, in the given case, the Intern + will enable the Internship host to take such + steps as may be in the Internship host's interest + in confidentiality; and + II. only that part of the Confidential Information + that is described in the relevant provision or in + the relevant decision will be disclosed and only + to the bodies, authorities and (legal) persons + named therein. + </p> + + <p><strong>10.5 </strong> + In the event that the Internship host believes that + the Intern has violated the duty of confidentiality or + has failed to take reasonable steps to refrain from + disclosing trade secrets, the Internship host will hold + the Intern accountable and consult the University. In the event of a proven violation, the University + may call the Intern to account and take appropriate + measures. Under no circumstances shall the + University be liable for the Intern's failure to comply + with their duty of confidentiality. + In the event of established liability by one of + the parties to this agreement for breach of + confidentiality, liability shall be limited to the amount + that will be paid out on the basis of the liability + insurance taken out. + If no payment is made by the insurer due to + demonstrable intent or gross negligence, in principle, + no limitation of liability shall apply. + </p> + + <h4>Article 11 BACKGROUND INFORMATION, + CONTRIBUTED KNOWLEDGE, OUTCOMES + AND INTELLECTUAL PROPERTY</h4> + <p><strong>11.1 </strong>The knowledge and know-how (background + information) provided by the Internship host for the + purposes of the Internship, including any intellectual + property rights to the same, remain the property + of or are held by the Internship host and do not + create any rights of use outside the framework of + the Internship. The background information provided + by the University for the purposes of the Internship, + including the intellectual property rights vested in it, + will remain the property of the University and will not + create any rights of use. + </p> + <p><strong>11.2 </strong> + Any intellectual property rights to outcomes + produced by the Intern while carrying out their + Internship, including any in an Internship report, + thesis or any other research findings, such as a + report, written machine language and/or source + code but excluding the copyright to the Internship + report or other report or thesis shall be vested in the + Internship host, unless: + a. The University can demonstrate that it has made + a substantial contribution to the creation of the + results generated; or + b. The results generated by the Intern (including + know-how or an invention) that are not related to + the subject matter of the Internship assignment + and have been written, created or invented + solely by the Intern during free time and without + the use of Confidential Information, background + information and facilities of the Internship host. + Any copyright on an Internship report, thesis or + any other research findings, such as a report, shall + constitute the Intern's intellectual property. + </p> + <p><strong>11.3 </strong>Insofar as necessary, the Intern transfers the + intellectual property rights referred to in Article 11(2) + to the Internship host in advance and delivers them + to the Internship host, which transfer and delivery + the Internship host accepts. Acting at the Internship + host's request, the Intern shall do anything else + required to assign such intellectual property rights, + such as sign any documents needed for the transfer, + application for and/or registration of such intellectual + property rights. + </p> + <p><strong>11.4 </strong>If the Intern is subject to applicable law (e.g. + patent law or copyright law) and as elaborated in + the Appendix: 'Addendum Guidelines Intellectual + Property and Students', which is part of this + Internship Agreement, is entitled to compensation + for lack of intellectual property rights, the Internship + host, as the entitled party, is responsible for the + payment thereof. + </p> + <p><strong>11.5 </strong>Prototypes and work products made within the + framework of the Internship (including any crosses + of genetic material, established DNA profiles, cell + cultures, etc.) will be the property of the Internship + host, unless otherwise agreed by the Parties.</p> + <p><strong>11.6 </strong> + The University shall be entitled to use any nonconfidential outcomes produced during the Internship, + at all times, for its internal, non-commercial research + purposes or its educational, public relations and/or + application purposes free of any royalties. + </p> + <p><strong>11.7 </strong> + If the Intern has made a patentable invention, the + Internship host will ensure that the Intern is listed as + an inventor or co- inventor in the patent application + and patent, respectively. + </p> + <p><strong>11.8 </strong> + If the University can demonstrate that it has made + a substantial contribution to the creation of the + results generated, then the rights to these results + and intellectual property belong to the University. + If the right to final results, to which the University + has made a substantial contribution, is indivisible + or cannot be divided into partial rights, a joint + intellectual property right exists for both the + University and the Internship host. In order to avoid + joint intellectual property as much as possible, + the University is willing to assign the ownership of + any outcome or intellectual property right to the + Internship host in return for a competitive fee (which + is to be agreed on). In such a case, the University + shall receive a free licence from the Internship + host for educational, non- commercial research, + publication and public relations purposes. The + transfer of intellectual property rights belonging + to the University to the Internship host may not be + withheld by the University on unreasonable grounds. + If there are (joint) rights to results that accrue to the + University, the Internship host and University will + establish prior to the graduation session which rights + to the results are (1) jointly owned, (2) owned by the + University, or (3) owned by the Internship host. + </p> + <p><strong>11.9 </strong> + Prior to any publication and, if applicable, prior to + the registration of intellectual property rights, the + parties will inform each other in writing about the + results generated by them in the Internship and the + intellectual property rights vested or to be vested in + them. + </p> + <p><strong>11.10 </strong> + Unless otherwise agreed, any costs involved in the + application for and/or maintenance of a patent shall + be borne by the applicant. + </p> + <p><strong>11.11 </strong> + The foregoing provisions shall also apply mutatis + mutandis to source code developed over the course + of a graduation project. + </p> + + <h4>Article 12 RIGHT OF DISCLOSURE</h4> + <p><strong>12.1 </strong>If the Intern gives a presentation, the Internship + report, thesis or report will be made public. + Publication also includes uploading to the University's + repository as described in Article 12(2). In doing so, + the Intern will take the provisions of Article 10.2 into + account regarding the embargo arrangements. The + Intern will provide the Internship host with a draft of + the thesis report (including the title and summary) + no later than one (1) month before the thesis report + is officially submitted and, if required, the intended + public final presentation. The Internship host has + the right to have the graduation report placed under + embargo if the Internship host believes that its + (potential) intellectual property rights or commercial + interests will be harmed. The embargo period shall, + in principle, not exceed two (2) years but may, in + exceptional cases, be extended to five (5) years, + with the exception of a longer period for long-term + innovation processes in the sectors next to the + relevant knowledge security aspects, as referred to + under Particulars on the cover page of this Internship + Agreement. The extension to five (5) years based + on specific Particulars must be approved by the appropriate body of the University. Approval may not + be withheld on unreasonable grounds. The Internship host has - in exceptional cases - + the right to demand the removal of information + from the graduation report in order to protect its + business interests. The Internship host will make + the required removal known to the Intern within + fourteen (14) days of receiving the draft of the thesis + report. If this has removed information necessary + for the University's review of the thesis report, + this information can be included in a confidential + attachment. The Internship host determines if and + what information may be included in a confidential + attachment. The provisions of Article 10.2 shall apply + to the confidential attachment. + If the University is of the opinion that, due to the + lack of information, the thesis report cannot be + adequately assessed, thus preventing graduation, + the University and Internship host will consult with + each other to reach a reasonable and equitable + solution for all parties within a reasonable period of + time. + </p> + <p><strong>12.2 </strong> + When uploading the Internship report or other report + or thesis, the Intern shall confer on the University the + right to publish such a report through its repository. + The confidential attachment will not be uploaded by + the Intern. + </p> + + <p><strong>12.3 </strong> + If an embargo is agreed on, it will not apply to the + metadata in the repository. Where an embargo is + granted, the Internship host shall verify whether the + formulation of the title, summary or other metadata + needs to be revised before the Intern uploads the + relevant report. This shall not affect the Intern's right + to submit the full graduation report to the University + mentor and/or examiners. + </p> + + <h4>Article 13 FEES AND LICENCES FOR SOFTWARE USE</h4> + <p><strong>13.1 </strong> + Any software that the University supplies for + educational purposes may not be used for + commercial purposes. + </p> + <p><strong>13.2 </strong> + Insofar as the Internship host and/or the Intern has/ + have any commercial interest in the production of + a usable product, any additional costs which the + Intern needs to incur in order to do this (the costs of + the software and any licensing obligations, amongst + other things) shall be borne by the Internship host, + unless otherwise agreed. + </p> + <p><strong>13.3 </strong> + The University shall not be liable for any expenses + referred to in paragraph 2. + </p> + <h4>Article 14 PERSONAL DATA</h4> + <p><strong>14.1 </strong> + Insofar as any personal data is used during their + Internship, the Intern shall treat it with strict + confidentiality, shall comply with all of the stipulated + policy and security rules and shall not copy such + personal data to mobile media. The Internship host + is responsible for ensuring that the Intern is properly + informed of the Internship host's applicable policies + and safety regulations in this regard. + </p> + <p><strong>14.2 </strong> + The Internship host shall only process the Intern's + personal data for the purposes of executing this + Internship Agreement. The Internship host shall + ensure that data processing occurs in accordance + with the General Data Protection Regulation. This + shall entail that the Internship host will: + a. not process more of the Intern's data than is + necessary for the purposes of executing this + Internship Agreement; + b. ensure that the data is correct; + c. not store any data for longer than is necessary + for the purposes of executing this Internship + Agreement; + d. ensure that only those persons who have been + designated for this purpose have access to the + Intern's data. + The Intern may invoke their rights in respect of the + processing of their data in accordance with the + General Data Protection Regulation. + </p> + + <h4>Article 15 INTERNSHIP DISPUTES</h4> + <p><strong>15.1 </strong> + Should there be any difficulties during the Internship, + the Intern and the Internship supervisor shall + first endeavour to resolve them through close + consultation. + </p> + <p><strong>15.2 </strong> + In the event that consultations between the Intern + and the Internship supervisor do not produce a + solution that is acceptable to both parties, any such + dispute may be brought before the University mentor. + </p> + <p><strong>15.3 </strong> + In the event that the Internship supervisor, the + University mentor and the Intern are unable to reach + a solution, the disputes will be submitted to the + Internship coordinator and/or, depending on the + importance of the dispute, to the programme director, + the Director of the Educational Institute or the + Examining Board. + </p> + + <h4>Article 16 LIABILITY AND INSURANCE</h4> + <p><strong>16.1 </strong> + In accordance with Section 7:658(4) of the Dutch + Civil Code or similar legislation and regulations + applicable in the country in which the Internship + occurs, the Internship host shall be liable for any + injury or loss that the Intern may suffer while + performing Internship activities.[5] + </p> + <p><strong>16.2 </strong> + The Internship host shall be liable for damage + caused by the Intern towards third parties during + the performance of the Internship activities. The + Internship host will not be liable on that basis, if it + can be demonstrated that it has fulfilled its duty + of care and/or if there is demonstrable deliberate + recklessness or intent on the part of the Intern. + </p> + <p><strong>16.3 </strong> + The Intern shall have a duty to take out private + third-party liability and health insurance,[6] while + accident insurance is also recommended. + </p> + <p><strong>16.4 </strong> + As secondary cover, the University may take out + collective liability and accident insurance for its + students and Interns. + </p> + <p><strong>16.5 </strong> + The Internship host will make every effort to + protect the Intern from any form of harassment or + discrimination in the workplace. + </p> + <p><strong>16.6 </strong> + Should the Intern work with genetic material, the Intern + shall be required to use such material in accordance + with all legislation and government regulations and + guidelines that are applicable in respect of such + material, including, where applicable, the terms and + conditions of the country in which that material + originates - Mutually Agreed Terms (MAT) - and/or + prior informed consent - Prior Informed Consent (PIC) + - and shall provide the University with all the requisite + licences and permits when requested to do so. + </p> + <h4>Article 17 TERMINATION OF INTERNSHIP + AGREEMENT</h4> + <p><strong>17.1 </strong> + An Internship shall terminate: + a. At the end of the agreed period; + b. As soon as the Intern ceases to be registered as a + student of the University; + c. By the mutual consent of parties; or + d. In the event that the Internship host goes insolvent, + is granted a moratorium on payments or its legal + persona is dissolved. + </p> + <p><strong>17.2 </strong> + The Internship host is entitled to immediately + terminate the Internship Agreement after hearing the + Internship supervisor and the Intern concerned: + a. In the event that the Internship host is of the + opinion that the Intern repeatedly fails to comply + with its rules or instructions in spite of a warning + and/or conducts themselves in such other way + that the Internship host cannot reasonably + be required to continue to cooperate with the + Internship. + b. If the Intern or the University fail to comply with + their duty of confidentiality in relation to the + Internship host pursuant to Article 10. + The Internship host shall immediately notify the + University mentor of a decision referred to under (a) + and (b) through the Internship supervisor. + </p> + <p><strong>17.3 </strong> + After hearing the Internship supervisor and the Intern + in question, the University is entitled to terminate the + Internship Agreement immediately and withdraw the + Intern: + a. If, in the opinion of the University, the Internship + does not meet the educational objectives or + does not proceed in accordance with what has + been agreed in this Internship Agreement, or if + the Internship cannot reasonably be required to + continue the Internship with the Internship host. + b. where regulations governing privacy and + harassment have been contravened. The University + shall immediately notify the Internship supervisor + of such a decision through the intervention of a + University mentor. + </p> + <p><strong>17.4 </strong> + After consulting with the Internship supervisor and + the University mentor, the Internship Agreement + may be terminated with immediate effect if the + Intern cannot reasonably be required to continue the + Internship. + </p> + <p><strong>17.5 </strong> + Rights and obligations that, by their nature, should + survive termination of the Agreement, such as those + relating to non- disclosure of Confidential Information + and personal data, shall survive termination of this + Agreement. + </p> + <h4>Article 18 SUSPENSIVE CONDITION</h4> + <p><strong>18.1 </strong> + This agreement has been concluded subject to the + suspensive condition that the Intern satisfies the + conditions governing admission to an Internship by + no later than the start of the Internship period. The + precise conditions applicable for admission to an + Internship are stipulated in the applicable Education + and Examination and/or Internship Regulations. + </p> + <h4>Article 19 APPLICABLE LAW AND DISPUTES</h4> + <p><strong>19.1 </strong> + This Internship Agreement shall be governed by + and construed in accordance with the law of the + Netherlands. + </p> + <p><strong>19.2 </strong> + If a dispute arises, the parties will endeavour to + find a solution in mutual consultation in accordance + with the provisions of Article 15 of these 'Terms and + Conditions of the Internship Agreement'. Should the + parties fail to do so, they shall resort to the district + court of the district in which the University has its + registered office. The Dutch court of law shall enjoy + exclusive jurisdiction to hear a dispute. + </p> + <h4>Article 20 FINAL PROVISION</h4> + <p><strong>20.1 </strong> + In the event of conflict between this Internship + Agreement and any other contract that the Intern + signs with the Internship host, this agreement shall + prevail. + </p> + <p><strong>20.2 </strong> + In the event of a conflict of interpretation, the + contents of the Dutch language version shall prevail. + </p> + + <p>(3) For instance, this does not include care leave. Interns also do not fall under the responsibility of the + in-house medical officer.</p> + <p>(4) + <a href='https://wetten.overheid.nl/BWBR0041459/2018-10-23'>https://wetten.overheid.nl/BWBR0041459/2018-10-23</a> + and + <a href=https://business.gov.nl/regulation/trade-secret-protection/>https://business.gov.nl/regulation/trade-secret-protection/</a> + </p> + + <p>(5) By definition, this liability cannot be excluded. + For clarity: + <ul> + <li>In accordance with Chapter 6, Article 170 of the Dutch Civil Code, the Internship Provider is liable in the + first instance for damage caused by subordinates (in + this case also including interns) to third parties, and on the basis of Article 7:661 of the Dutch Civil Code for + damage caused by the Intern to the property of the + Internship Provider itself. + </li> + <li>In the unlikely event that the liability insurance of the Internship Provider provides no cover or insufficient + cover, the Intern must first take out his/her own private + liability insurance; if no cover can be found in the aforementioned actions, the collective liability insurance of + the University (if taken out) may still be used as a + safety net for third-party actions relating to legal liability. + </li> + <li>It is strongly recommended that the Intern takes out his/her own accident insurance.</li> + <li>Damage involving or by a motor vehicle is excluded from coverage by the University</li> + </ul> + </p> + <p>(6) See link and switch to + English:<a href='https://filelist.tudelft.nl/Studentenportal/Faculteitspecifiek/IO/Onderwijs/Stage%20aanbod/Links/Stageovereenkomst_EN_def_IDE.pdf'> + You are studying or doing an internship | Wet Langdurige Zorg (Wlz) | SVB</a></p> + + <div> (digitale) initials:</div> + <div class="contract-section three-columns"> + <div class="column"> + <div>University</div> + </div> + + <div class="column"> + <div>Internship Host</div> + </div> + + <div class="column"> + <div>Intern</div> + </div> + </div> + + <%= yield :form_actions %> +</div> +<style> + .contract { + font-family: "Times New Roman", serif; + border: 2px solid #000; + padding: 20px; + margin: 20px auto; + width: 80%; + background-color: #f9f9f9; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + } + + .contract h2 { + text-align: center; + text-transform: uppercase; + text-decoration: underline; + font-weight: bold; + } + + .contract h3 { + margin-top: 20px; + text-transform: uppercase; + border-bottom: 1px solid #000; + padding-bottom: 5px; + } + + .contract-section { + margin-bottom: 20px; + } + + .contract p { + margin: 10px 0; + line-height: 1.5; + } + + .contract strong { + font-weight: bold; + } + + .contract .form-actions { + text-align: center; + margin-top: 30px; + } + + .contract .btn-primary { + padding: 10px 20px; + background-color: #004085; + color: #fff; + border: none; + cursor: pointer; + } + + .contract .btn-primary:hover { + background-color: #002752; + } + + .contract h4 { + font-style: italic; + margin-top: 15px; + text-decoration: underline; + } + + .two-columns { + display: flex; + gap: 20px; + } + + .two-columns .column { + flex: 1; + } + + .two-columns .column:first-child { + max-width: 200px; + font-weight: bold; + padding-right: 20px; + border-right: 1px solid #000; /* Vertical line between columns */ + } + + .two-columns .column p { + margin: 10px 0; + } + + .three-columns { + display: flex; + gap: 20px; + margin-top: 20px; + } + + .three-columns .column { + flex: 1; + padding: 15px; + border: 1px solid #000; + border-radius: 8px; + background-color: #f9f9f9; + text-align: left; + } + + .three-columns h4 { + text-align: left; + margin-bottom: 10px; + text-transform: uppercase; + font-size: 1.1em; + } + + .three-columns p { + margin: 8px 0; + text-align: left; + } +</style> diff --git a/app/views/draft_contracts/contract_pdf.html.erb b/app/views/draft_contracts/contract_pdf.html.erb deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/app/views/draft_contracts/index.html.erb b/app/views/draft_contracts/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e9c284f0be3cb8f0cb0198aebce78be5697c1490 --- /dev/null +++ b/app/views/draft_contracts/index.html.erb @@ -0,0 +1,27 @@ +<% content_for :header do %> + <h1>Draft Contracts</h1> + <p>Overview of draft contracts</p> +<% end %> +<div class="panel panel-info"> + <div class="panel-heading"> + Draft Contracts + </div> + <table class="table table-bordered mbz"> + <tr> + <th>Project</th> + <th>Group</th> + <th>Offerer</th> + <th>Status</th> + <th></th> + </tr> + <% @draft_contracts.each do |contract| %> + <tr> + <td><%= contract.project.display_name %></td> + <td><%= contract.group.display_name %></td> + <td><%= contract.offerer.display_name %></td> + <td><%= contract.all_signatures_present? ? 'Fully Signed' : 'Pending Signatures' %></td> + <td><%= link_to 'View', draft_contract_path(contract), class: 'btn btn-primary' %></td> + </tr> + <% end %> + </table> +</div> diff --git a/app/views/draft_contracts/show.html.erb b/app/views/draft_contracts/show.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..b7b79054777d15dce193d17bb87c781476521584 --- /dev/null +++ b/app/views/draft_contracts/show.html.erb @@ -0,0 +1,8 @@ +<%= form_with model: @draft_contract, local: true do |f| %> + <% content_for :form_actions do %> + <div class="form-actions"> + <%= f.submit 'Save Changes', class: 'btn btn-primary' %> + </div> + <% end %> + <%= render 'contract', contract: @draft_contract, current_stage: @current_stage, f: f %> +<% end %> diff --git a/config/initializers/wicked_pdf.rb b/config/initializers/wicked_pdf.rb new file mode 100644 index 0000000000000000000000000000000000000000..f5566fbd26a8f832d2be54574c03095ceeea0b2a --- /dev/null +++ b/config/initializers/wicked_pdf.rb @@ -0,0 +1,30 @@ +# WickedPDF Global Configuration +# +# Use this to set up shared configuration options for your entire application. +# Any of the configuration options shown here can also be applied to single +# models by passing arguments to the `render :pdf` call. +# +# To learn more, check out the README: +# +# https://github.com/mileszs/wicked_pdf/blob/master/README.md + +WickedPdf.configure do |config| + # Path to the wkhtmltopdf executable: This usually isn't needed if using + # one of the wkhtmltopdf-binary family of gems. + # config.exe_path = '/usr/local/bin/wkhtmltopdf' + # or + # config.exe_path = Gem.bin_path('wkhtmltopdf-binary', 'wkhtmltopdf') + + # Needed for wkhtmltopdf 0.12.6+ to use many wicked_pdf asset helpers + # config.enable_local_file_access = true + + # Layout file to be used for all PDFs + # (but can be overridden in `render :pdf` calls) + # config.layout = 'pdf.html' + + # Using wkhtmltopdf without an X server can be achieved by enabling the + # 'use_xvfb' flag. This will wrap all wkhtmltopdf commands around the + # 'xvfb-run' command, in order to simulate an X server. + # + # config.use_xvfb = true +end diff --git a/config/routes/normal.rb b/config/routes/normal.rb index ad156226c54a0a4397ab82468b0293f5f9e8d7a8..ead75af5f748beb4760353f7b0db017d72e78b51 100644 --- a/config/routes/normal.rb +++ b/config/routes/normal.rb @@ -26,6 +26,11 @@ resources :generic_projects, path: 'projects' do end resources :groups, only: :index +resources :draft_contracts do + member do + get 'pdf' + end +end # Course related resources :course_editions, only: %i[show edit] do