Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to duplicate pages #7

Merged
merged 7 commits into from
Dec 13, 2023

Conversation

der-On
Copy link
Contributor

@der-On der-On commented Mar 14, 2022

This PR adds a "duplicate" button to each static page. With it a static page can be easily duplicated.

We use it to create "template" pages for site editors that then simply can be duplicated and edited.
Especially with sites containing repeaters it is not possible to copy paste content from one page to another and having a starting point always helps site editors.

@LukeTowers
Copy link
Member

Do you have a screenshot or screen recording of this in action?

assets/js/pages-page.js Show resolved Hide resolved
controllers/Index.php Outdated Show resolved Hide resolved
controllers/Index.php Show resolved Hide resolved
@der-On
Copy link
Contributor Author

der-On commented Mar 15, 2022

Do you have a screenshot or screen recording of this in action?

I'll do some screenshots.

@der-On
Copy link
Contributor Author

der-On commented Mar 15, 2022

@LukeTowers here you see the new duplicate button and what happens when you click it:
Bildschirmfoto am 2022-03-15 um 08 44 31-fullpage
Bildschirmfoto am 2022-03-15 um 08 44 43-fullpage

@der-On
Copy link
Contributor Author

der-On commented Mar 15, 2022

I've also added a label to the duplicate button as the icon is not really self explanatory. I hope I've got all translations correct.

lang/nl/lang.php Outdated Show resolved Hide resolved
@LukeTowers
Copy link
Member

@der-On please revert the changes to translations for languages that you don't actually speak. Generally it's better if people see the fallback (English) rather than a google translated version which could be wildly incorrect.

@der-On
Copy link
Contributor Author

der-On commented Mar 15, 2022

@der-On please revert the changes to translations for languages that you don't actually speak. Generally it's better if people see the fallback (English) rather than a google translated version which could be wildly incorrect.

Absolutely right. Did so. I speak englisch, german, slovakian and a little french. The dutch translation was already corrected above.

@LukeTowers
Copy link
Member

Thanks @der-On! Looks good to me, will wait on @bennothommo for final review of this.

@bennothommo
Copy link
Member

Last change that I would request is to remove the label "Duplicate" next to the icon for the duplicate button, and use a tooltip instead, like the "delete" button next to it. Duplicating a page is not a primary action, so I think it would be better to minimise it's UI footprint.

@LukeTowers
Copy link
Member

Hmm, I don't personally mind it having the label there. It's not like it's taking up too much space, and the icon by itself can be pretty hard to see / understand what it's there for. If anything having the label there improves the context clues that the delete button and the calendar icon have purpose.

Thoughts?

@bennothommo
Copy link
Member

It's a subjective topic, but since you'll likely be using the duplicate button much less than the save or preview buttons, I don't think it's necessarily important enough to be prominent. Perhaps the icon can be changed to better reflect its use?

@LukeTowers
Copy link
Member

The icon is probably fine, can't think of a better one off the top of my head. Unless anyone has strong arguments in favour of keeping the label instead of turning it into a tooltip for display on hover over I'm fine with either approach.

@der-On
Copy link
Contributor Author

der-On commented Mar 16, 2022

The icon is probably fine, can't think of a better one off the top of my head. Unless anyone has strong arguments in favour of keeping the label instead of turning it into a tooltip for display on hover over I'm fine with either approach.

Completely fine with that. I will turn it into a tooltip. It's a secondary action and thus should use less space.

@der-On
Copy link
Contributor Author

der-On commented May 12, 2022

@bennothommo Is there anything holding this back?

@LukeTowers
Copy link
Member

@bennothommo will leave for you to merge for handling the release

@LukeTowers LukeTowers changed the title allows duplicating page Add button to duplicate pages Dec 13, 2023
@LukeTowers LukeTowers merged commit fbd2713 into wintercms:main Dec 13, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants