diff --git a/app/views/exports/_ad_hoc_exports.html.haml b/app/views/exports/_ad_hoc_exports.html.haml new file mode 100644 index 000000000..daaa6bfae --- /dev/null +++ b/app/views/exports/_ad_hoc_exports.html.haml @@ -0,0 +1,27 @@ +%h1.govuk-heading-m + Ad-hoc exports + +%table.govuk-table + %thead.govuk-table__head + %tr.govuk-table__row + %th.govuk-table__header{scope: "col"} + Purpose + %th.govuk-table__header{scope: "col"} + = t("table.export.header.format") + %th.govuk-table__header{scope: "col"} + = t("table.header.default.actions") + %tbody.govuk-table__body + %tr.govuk-table__row + %td.govuk-table__cell + Activities continuing under GB-GOV-26 + %td.govuk-table__cell + CSV + %td.govuk-table__cell + = a11y_action_link("Download", continuing_activities_exports_path(format: "csv")) + %tr.govuk-table__row + %td.govuk-table__cell + Activities not continuing under GB-GOV-26 + %td.govuk-table__cell + CSV + %td.govuk-table__cell + = a11y_action_link("Download", non_continuing_activities_exports_path(format: "csv")) diff --git a/app/views/exports/_fund_exports.html.haml b/app/views/exports/_fund_exports.html.haml new file mode 100644 index 000000000..419395fa8 --- /dev/null +++ b/app/views/exports/_fund_exports.html.haml @@ -0,0 +1,40 @@ +%table.govuk-table + %thead.govuk-table__head + %tr.govuk-table__row + %th.govuk-table__header{scope: "col"} + = t("table.export.header.fund") + %th.govuk-table__header{scope: "col"} + = t("table.export.header.format") + %th.govuk-table__header{scope: "col"} + = t("table.header.default.actions") + %tbody.govuk-table__body + - @funds.each do |fund| + %tr.govuk-table__row + %td.govuk-table__cell + = t("table.export.external_income.name", fund: fund.name) + %td.govuk-table__cell + CSV + %td.govuk-table__cell + = a11y_action_link("Download", external_income_exports_path(fund_id: fund.id, format: "csv"), t("table.export.external_income.name", fund: fund.name), ["govuk-link--no-visited-state"]) + - @funds.each do |fund| + %tr.govuk-table__row + %td.govuk-table__cell + = t("table.export.budgets.name", fund: fund.name) + %td.govuk-table__cell + CSV + %td.govuk-table__cell + = a11y_action_link("Download", budgets_exports_path(fund_id: fund.id, format: "csv"), t("table.export.budgets.name", fund: fund.name), ["govuk-link--no-visited-state"]) + - @funds.each do |fund| + %tr.govuk-table__row + %td.govuk-table__cell + = t("table.export.spending_breakdown.name", fund: fund.name) + %td.govuk-table__cell + CSV + %td.govuk-table__cell + - if fund.activity.spending_breakdown_filename + = a11y_action_link("Download", spending_breakdown_download_export_path(fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) + = "(last generated at #{l(fund.activity.spending_breakdown_generated_at, format: :detailed)})" + %br + = a11y_action_link("Request new", spending_breakdown_exports_path(fund_id: fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) + - else + = a11y_action_link("Request", spending_breakdown_exports_path(fund_id: fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) diff --git a/app/views/exports/_level_b_exports.html.haml b/app/views/exports/_level_b_exports.html.haml new file mode 100644 index 000000000..1c75768a9 --- /dev/null +++ b/app/views/exports/_level_b_exports.html.haml @@ -0,0 +1,21 @@ +%h1.govuk-heading-m + Level B exports + +%table.govuk-table + %thead.govuk-table__head + %tr.govuk-table__row + %th.govuk-table__header{scope: "col"} + Fund + %th.govuk-table__header{scope: "col"} + = t("table.export.header.format") + %th.govuk-table__header{scope: "col"} + = t("table.header.default.actions") + %tbody.govuk-table__body + - @funds.each do |fund| + %tr.govuk-table__row + %td.govuk-table__cell + = t("table.export.level_b.name", fund: fund.name) + %td.govuk-table__cell + CSV + %td.govuk-table__cell + = a11y_action_link("Download", level_b_exports_path(fund_id: fund.id, format: "csv"), t("table.export.level_b.name", fund: fund.name), ["govuk-link--no-visited-state"]) diff --git a/app/views/exports/_partner_organisation_exports.html.haml b/app/views/exports/_partner_organisation_exports.html.haml new file mode 100644 index 000000000..eb90ccc56 --- /dev/null +++ b/app/views/exports/_partner_organisation_exports.html.haml @@ -0,0 +1,18 @@ +%h1.govuk-heading-m + = t("page_content.export.organisations.title") + +%table.govuk-table + %thead.govuk-table__head + %tr.govuk-table__row + %th.govuk-table__header{scope: "col"} + = t("table.header.organisation.name") + %th.govuk-table__header{scope: "col"} + = t("table.header.default.actions") + + %tbody.govuk-table__body + - @organisations.each do |organisation| + %tr.govuk-table__row + %td.govuk-table__cell + = organisation.name + %td.govuk-table__cell + = a11y_action_link("View exports", exports_organisation_path(organisation), "for #{organisation.name}", ["govuk-link--no-visited-state"]) diff --git a/app/views/exports/index.html.haml b/app/views/exports/index.html.haml index ee2f90609..692916c47 100644 --- a/app/views/exports/index.html.haml +++ b/app/views/exports/index.html.haml @@ -9,113 +9,11 @@ .govuk-grid-row.activity-page .govuk-grid-column-full - %table.govuk-table - %thead.govuk-table__head - %tr.govuk-table__row - %th.govuk-table__header{scope: "col"} - = t("table.export.header.fund") - %th.govuk-table__header{scope: "col"} - = t("table.export.header.format") - %th.govuk-table__header{scope: "col"} - = t("table.header.default.actions") - %tbody.govuk-table__body - - @funds.each do |fund| - %tr.govuk-table__row - %td.govuk-table__cell - = t("table.export.external_income.name", fund: fund.name) - %td.govuk-table__cell - CSV - %td.govuk-table__cell - = a11y_action_link("Download", external_income_exports_path(fund_id: fund.id, format: "csv"), t("table.export.external_income.name", fund: fund.name), ["govuk-link--no-visited-state"]) - - @funds.each do |fund| - %tr.govuk-table__row - %td.govuk-table__cell - = t("table.export.budgets.name", fund: fund.name) - %td.govuk-table__cell - CSV - %td.govuk-table__cell - = a11y_action_link("Download", budgets_exports_path(fund_id: fund.id, format: "csv"), t("table.export.budgets.name", fund: fund.name), ["govuk-link--no-visited-state"]) - - @funds.each do |fund| - %tr.govuk-table__row - %td.govuk-table__cell - = t("table.export.spending_breakdown.name", fund: fund.name) - %td.govuk-table__cell - CSV - %td.govuk-table__cell - - if fund.activity.spending_breakdown_filename - = a11y_action_link("Download", spending_breakdown_download_export_path(fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) - = "(last generated at #{l(fund.activity.spending_breakdown_generated_at, format: :detailed)})" - %br - = a11y_action_link("Request new", spending_breakdown_exports_path(fund_id: fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) - - else - = a11y_action_link("Request", spending_breakdown_exports_path(fund_id: fund.id), t("table.export.spending_breakdown.name", fund: fund.name), ["govuk-link--no-visited-state"]) + = render partial: "fund_exports" - if ROLLOUT.active?(:level_b_exports, current_user) - %h1.govuk-heading-m - Level B exports + = render partial: "level_b_exports" - %table.govuk-table - %thead.govuk-table__head - %tr.govuk-table__row - %th.govuk-table__header{scope: "col"} - Fund - %th.govuk-table__header{scope: "col"} - = t("table.export.header.format") - %th.govuk-table__header{scope: "col"} - = t("table.header.default.actions") - %tbody.govuk-table__body - - @funds.each do |fund| - %tr.govuk-table__row - %td.govuk-table__cell - = t("table.export.level_b.name", fund: fund.name) - %td.govuk-table__cell - CSV - %td.govuk-table__cell - = a11y_action_link("Download", level_b_exports_path(fund_id: fund.id, format: "csv"), t("table.export.level_b.name", fund: fund.name), ["govuk-link--no-visited-state"]) + = render partial: "ad_hoc_exports" - %h1.govuk-heading-m - Ad-hoc exports - - %table.govuk-table - %thead.govuk-table__head - %tr.govuk-table__row - %th.govuk-table__header{scope: "col"} - Purpose - %th.govuk-table__header{scope: "col"} - = t("table.export.header.format") - %th.govuk-table__header{scope: "col"} - = t("table.header.default.actions") - %tbody.govuk-table__body - %tr.govuk-table__row - %td.govuk-table__cell - Activities continuing under GB-GOV-26 - %td.govuk-table__cell - CSV - %td.govuk-table__cell - = a11y_action_link("Download", continuing_activities_exports_path(format: "csv")) - %tr.govuk-table__row - %td.govuk-table__cell - Activities not continuing under GB-GOV-26 - %td.govuk-table__cell - CSV - %td.govuk-table__cell - = a11y_action_link("Download", non_continuing_activities_exports_path(format: "csv")) - - %h1.govuk-heading-m - = t("page_content.export.organisations.title") - - %table.govuk-table - %thead.govuk-table__head - %tr.govuk-table__row - %th.govuk-table__header{scope: "col"} - = t("table.header.organisation.name") - %th.govuk-table__header{scope: "col"} - = t("table.header.default.actions") - - %tbody.govuk-table__body - - @organisations.each do |organisation| - %tr.govuk-table__row - %td.govuk-table__cell - = organisation.name - %td.govuk-table__cell - = a11y_action_link("View exports", exports_organisation_path(organisation), "for #{organisation.name}", ["govuk-link--no-visited-state"]) + = render partial: "partner_organisation_exports"