Skip to content

Commit

Permalink
fix button alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
wheelsandcogs committed Oct 30, 2024
1 parent e0502df commit d15babf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/controllers/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ export const importPreview = async (req: Request, res: Response, next: NextFunct

if (req.method === 'POST') {
try {
await req.swapi.confirmFileImport(dataset.id, revision.id, fileImport.id);
res.redirect(req.buildUrl(`/publish/${dataset.id}/sources`, req.language));
if (req.body.confirm === 'true') {
await req.swapi.confirmFileImport(dataset.id, revision.id, fileImport.id);
res.redirect(req.buildUrl(`/publish/${dataset.id}/sources`, req.language));
} else {
res.redirect(req.buildUrl(`/publish/${dataset.id}/upload`, req.language));
}
return;
} catch (err: any) {
res.status(500);
Expand Down
15 changes: 8 additions & 7 deletions src/views/publish/preview.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,19 @@
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-half">
<form method="post">
<% if (locals.revisit) { %>
<a href="<%= buildUrl(`/publish/${locals.datasetId}/change`, i18n.language) %>" class="govuk-button govuk-!-display-inline"><%= t('publish.preview.buttons.change_datatable') %></a>
<% } else { %>
<p class="govuk-body"><%= t('publish.preview.confirm_correct') %></p>
<!-- <a href="<%= buildUrl(`/publish/${locals.datasetId}/confirm`, i18n.language) %>" class="govuk-button govuk-!-display-inline"><%= t('buttons.continue') %></a> -->
<button type="submit" name="confirm" value="true" class="govuk-button govuk-!-display-inline" data-module="govuk-button">
<%= t('buttons.continue') %>
</button>
<a href="<%= buildUrl(`/publish/${locals.datasetId}/upload`, i18n.language) %>" class="govuk-button govuk-button--secondary govuk-!-display-inline"><%= t('publish.preview.buttons.choose_different') %></a>
<form method="post" role="continue">
<button type="submit" name="confirm" value="true" class="govuk-button govuk-!-display-inline" data-module="govuk-button" data-prevent-double-click="true">
<%= t('buttons.continue') %>
</button>
<button type="submit" name="confirm" value="false" class="govuk-button govuk-button--secondary govuk-!-display-inline" data-module="govuk-button">
<%= t('publish.preview.buttons.choose_different') %>
</button>
</form>
<% } %>
</form>
</div>
</div>
<% } %> <!-- Do I have data? -->
Expand Down

0 comments on commit d15babf

Please sign in to comment.