diff --git a/.changeset/quiet-news-compete.md b/.changeset/quiet-news-compete.md new file mode 100644 index 000000000..a5a3c3f70 --- /dev/null +++ b/.changeset/quiet-news-compete.md @@ -0,0 +1,5 @@ +--- +'frontend-gelinkt-notuleren': minor +--- + +Add copy parts link to the agendapoint file options diff --git a/app/components/decision-copy.gjs b/app/components/decision-copy.gjs new file mode 100644 index 000000000..e81c67b6a --- /dev/null +++ b/app/components/decision-copy.gjs @@ -0,0 +1,71 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { htmlSafe } from '@ember/template'; +import { generateExportTextFromEditorDocument } from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document'; +import { copyStringToClipboard } from 'frontend-gelinkt-notuleren/utils/copy-string-to-clipboard'; +import AuToolbar from '@appuniversum/ember-appuniversum/components/au-toolbar'; +import AuMainContainer from '@appuniversum/ember-appuniversum/components/au-main-container'; +import AuHeading from '@appuniversum/ember-appuniversum/components/au-heading'; +import DownloadMeetingPart from './download-meeting-part'; +import DecisionCopyParts from './decision-copy-parts'; +import t from 'ember-intl/helpers/t'; +export default class DecisionCopy extends Component { + @action + async copyToClipboard(text) { + await copyStringToClipboard({ html: text }); + } + + get previewDocument() { + return htmlSafe( + generateExportTextFromEditorDocument(this.model.document, true), + ); + } + + +} diff --git a/app/controllers/meetings/download/copy.js b/app/controllers/meetings/download/copy.js deleted file mode 100644 index 8c98c43fb..000000000 --- a/app/controllers/meetings/download/copy.js +++ /dev/null @@ -1,18 +0,0 @@ -import Controller from '@ember/controller'; -import { action } from '@ember/object'; -import { htmlSafe } from '@ember/template'; -import { generateExportTextFromEditorDocument } from '../../../utils/generate-export-from-editor-document'; -import { copyStringToClipboard } from '../../../utils/copy-string-to-clipboard'; - -export default class MeetingsDownloadCopyController extends Controller { - @action - async copyToClipboard(text) { - await copyStringToClipboard({ html: text }); - } - - get previewDocument() { - return htmlSafe( - generateExportTextFromEditorDocument(this.model.document, true), - ); - } -} diff --git a/app/router.js b/app/router.js index dfd852279..43941b615 100644 --- a/app/router.js +++ b/app/router.js @@ -51,6 +51,7 @@ Router.map(function () { this.route('attachments'); this.route('show'); this.route('revisions'); + this.route('copy'); }); this.route('meetings', function () { diff --git a/app/routes/agendapoints/copy.js b/app/routes/agendapoints/copy.js new file mode 100644 index 000000000..d54e75cd0 --- /dev/null +++ b/app/routes/agendapoints/copy.js @@ -0,0 +1,11 @@ +import Route from '@ember/routing/route'; +import { service } from '@ember/service'; + +export default class MeetingsDownloadCopyRoute extends Route { + @service store; + async model() { + const { documentContainer } = this.modelFor('agendapoints'); + const document = await documentContainer.currentVersion; + return { container: documentContainer, document }; + } +} diff --git a/app/templates/agendapoints/copy.hbs b/app/templates/agendapoints/copy.hbs new file mode 100644 index 000000000..baebcbbdc --- /dev/null +++ b/app/templates/agendapoints/copy.hbs @@ -0,0 +1,10 @@ + + <:links> + + + {{t 'agendapoint.back-to-agendapoint'}} + + {{t 'copy-options.heading'}} + {{@model.document.title}} + + \ No newline at end of file diff --git a/app/templates/agendapoints/edit.hbs b/app/templates/agendapoints/edit.hbs index 22142aa39..734e465a1 100644 --- a/app/templates/agendapoints/edit.hbs +++ b/app/templates/agendapoints/edit.hbs @@ -36,6 +36,10 @@ @document={{this.editorDocument}} @forPublish={{true}} /> + + + {{t 'agendapoint.copy-parts-link'}} + - - - - {{t 'download.back-to-meeting'}} - - - {{t 'download.back-to-download'}} - - {{t 'copy-options.heading'}} - {{@model.document.title}} - - - - - - - - - {{t 'copy-options.heading'}} - {{@model.document.title}} - - - - - - -

{{t - 'copy-options.disclaimer' - }}

-
+ <:links> + - -
-
-
\ No newline at end of file + {{t 'download.back-to-meeting'}} + + + {{t 'download.back-to-download'}} + + {{t 'copy-options.heading'}} + {{@model.document.title}} + + \ No newline at end of file diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 88bb22925..bee4547ea 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -5,6 +5,7 @@ agendapoint: revisions: Revisions restore: Restore back-to-meeting: Return to the meeting of {adminBody} on {date} + back-to-agendapoint: Return to the agendapoint saved-versions: 'Saved document versions:' current-version: Current version modify-warning: 'When modifying the document to an older version, subsequent newer versions disappear irretrievably:' @@ -15,6 +16,7 @@ agendapoint: published: This article has already been published. Published agenda items are not editable. saving: Saving... making-copy: Making copy... + copy-parts-link: Copy decision parts administrative-body-select: period: 'period' diff --git a/translations/nl-BE.yaml b/translations/nl-BE.yaml index eaf136023..177e61d90 100644 --- a/translations/nl-BE.yaml +++ b/translations/nl-BE.yaml @@ -5,6 +5,7 @@ agendapoint: revisions: Versies restore: Herstel back-to-meeting: Terug naar zitting van {adminBody} op {date} + back-to-agendapoint: Terug naar agendapunt saved-versions: 'Opgeslagen documentversies:' current-version: Huidige versie modify-warning: 'Bij het aanpassen van het document naar een oudere versie, verdwijnen volgende nieuwere versies onherroepelijk:' @@ -15,6 +16,7 @@ agendapoint: published: Dit artikel is reeds gepubliceerd. Gepubliceerde agendapunten zijn niet editeerbaar. saving: Bezig met opslaan making-copy: Kopie aan het maken + copy-parts-link: Kopieer besluit en onderdelen administrative-body-select: period: 'period'