wintercms / wn-pages-plugin

Static Pages plugin for Winter CMS
https://wintercms.com/
MIT License
9 stars 21 forks source link

Add button to duplicate pages #7

Closed der-On closed 11 months ago

der-On commented 2 years ago

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 commented 2 years ago

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

der-On commented 2 years ago

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

I'll do some screenshots.

der-On commented 2 years ago

@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 commented 2 years ago

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.

LukeTowers commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

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

bennothommo commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@bennothommo Is there anything holding this back?

LukeTowers commented 2 years ago

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