πŸ“„ κ²Œμ‹œκΈ€ 볡사 μ»΄ν¬λ„ŒνŠΈ

:discourse2: μš”μ•½ Copy postλŠ” 각 κ²Œμ‹œλ¬Όμ˜ κ²Œμ‹œλ¬Ό μ œμ–΄μ— λ²„νŠΌμ„ ν‘œμ‹œν•˜μ—¬ κ²Œμ‹œλ¬Ό 전체 λ‚΄μš©μ„ μ‚¬μš©μžμ˜ ν΄λ¦½λ³΄λ“œμ— λ³΅μ‚¬ν•©λ‹ˆλ‹€.
:eyeglasses: 미리보기 Discourse Theme Creatorμ—μ„œ 미리보기
:hammer_and_wrench: μ €μž₯μ†Œ 링크 https://github.com/discourse/discourse-copy-post
:open_book: Discourse ν…Œλ§ˆμ— μ²˜μŒμ΄μ‹ κ°€μš”? Discourse ν…Œλ§ˆ μ‚¬μš© 초보자 κ°€μ΄λ“œ

이 ν…Œλ§ˆ μ»΄ν¬λ„ŒνŠΈ μ„€μΉ˜

μ„€μ •

이름 μ„€λͺ…
copy_type ν΄λ¦½λ³΄λ“œμ— μ €μž₯ν•  볡사 ν…μŠ€νŠΈ μœ ν˜•(Markdown λ˜λŠ” HTML)을 μ„ νƒν•©λ‹ˆλ‹€.
copy_button_allowed_groups 볡사 λ²„νŠΌμ„ μ‚¬μš©ν•  수 μžˆλŠ” 그룹을 μ„ νƒν•©λ‹ˆλ‹€. 기본적으둜 Trust Level 1 그룹의 λͺ¨λ“  μ‚¬μš©μžμ—κ²Œ ν‘œμ‹œλ©λ‹ˆλ‹€.
λ²ˆμ—­ κΈ°λ³Έκ°’
title 이 κ²Œμ‹œλ¬Όμ˜ λ‚΄μš© 볡사

μŠ€ν¬λ¦°μƒ·

μ΄λ―Έμ§€λŠ” κ°€μž₯ μ˜κ°μ„ μ€€ μ˜ν™”μ— λŒ€ν•΄ ν† λ‘ ν•˜λŠ” λ‹€μ–‘ν•œ 닡변이 ν¬ν•¨λœ 포럼 ν† λ‘  μŠ€λ ˆλ“œλ₯Ό λ³΄μ—¬μ€λ‹ˆλ‹€. Trees와 Albania에 λŒ€ν•œ μ½”λ©˜νŠΈλ₯Ό ν¬ν•¨ν•©λ‹ˆλ‹€. (AI μΊ‘μ…˜)


:discourse2: μš°λ¦¬κ°€ ν˜ΈμŠ€νŒ…ν•˜λ‚˜μš”? ν…Œλ§ˆ μ»΄ν¬λ„ŒνŠΈλŠ” Standard, Business 및 Enterprise ν”Œλžœμ—μ„œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

26개의 μ’‹μ•„μš”

What happens to formatting and media?

2개의 μ’‹μ•„μš”

@Zup

May need to make some improvements in this area but currently:

  • media is not copied
  • formatting will be gone (i.e. plain text only) however, line breaks from <p> tags will be present.
3개의 μ’‹μ•„μš”

Hope this can be updated to include media and formatting when pasted in Discourse.

2개의 μ’‹μ•„μš”

@Zup

Yes, definitely something I’ll be looking to improve in the future.

However, in the meantime, I’ve added a setting to copy the raw HTML content instead. If you set this to true, the copy button will copy the raw HTML of the post instead of the plain text. This way you should have the formatting and media.

4개의 μ’‹μ•„μš”

Super! :clap:

Maybe a second button, Duplicate, (in the moderator gear icon area?) to automatically copy the entire contents of the post into a new topic with "DUPLICATE: " appended to the beginning of the title?

Anyway, very handy as is, thanks!

4개의 μ’‹μ•„μš”

Maybe make the button do a request to /raw/topic_id/post_number so you can copy the real post content? This way it will act like the very useful Reddit Enhancement Suite β€œSource” button.

7개의 μ’‹μ•„μš”

Similar component already exists: Raw Post Button.

Adding a copy button to the modal of that component would combine both approaches, what do you think @keegan @Johani?

4개의 μ’‹μ•„μš”

@md-misko Yup I think that’s a great idea. Since I created a widget for the copy button, I believe it can be quite simply copied over to be used in the modal.

4개의 μ’‹μ•„μš”

Is there any trick to show the button to logged in users only?

1개의 μ’‹μ•„μš”

@Jagster

There is now! :smiley: I’ve added a setting to apply a minimum trust level to show the widget. Configuring it to 0 will make it so only logged in users can see the button.

3개의 μ’‹μ•„μš”

Why can’t we put two thumbs up when it is earned :wink:

2개의 μ’‹μ•„μš”

:+1: :+1:

Now @keegan has them. :smiley:

1개의 μ’‹μ•„μš”

This wasn’t working on a new install.
The min_trust_level wasn’t selectable in Admin.
edit: component was functioning but wasn’t displaying correctly in Admin

I forked the repo and got it working but I set min_trust_level as an integer
So (5) = β€˜disabled’ (0-4) as expected. So a small rewrite.

I haven’t done a PR … as it’s a simplification .. perhaps someone else can confirm the component isn’t working?

2개의 μ’‹μ•„μš”

Hey @geoff777 I’ve tested this on a new install and it seems to be working correctly for me.
Also if I do apply those changes, the issue with using setting the min_trust_level as an integer in the settings.yml file is that the 0 value isn’t appearing in the dropdown.

2개의 μ’‹μ•„μš”

Any of values, except disabled, isn’t appearing in the box when selected. AFAIK any of values is in use, though.

4개의 μ’‹μ•„μš”

Ah sorry, my mistake, I thought you meant you changed the strings in the enum to integers, but you meant you used the integer type instead. Yes, that seems like a better approach. I’ve updated the theme component to support that. Hopefully this should fix any of the issues.

3개의 μ’‹μ•„μš”

This is a great TC! In our use case we want our authors to copy full posts and paste them into an external editor of a course website. It would be great if you could copy the whole post including media in HTML or just rich text format.

1개의 μ’‹μ•„μš”

이전에 이 κΈ°λŠ₯을 μ‚¬μš©ν•˜μ…¨λ˜ 뢄듀을 μœ„ν•΄ μ•ˆλ‚΄λ“œλ¦½λ‹ˆλ‹€. 이제 이 κΈ°λŠ₯을 개인 ν”„λ‘œμ νŠΈμ—μ„œ official #customization:theme-component둜 μ „ν™˜ν–ˆμŠ΅λ‹ˆλ‹€ :tada:. 이에 따라 μ΅œμ‹  Discourse λ²„μ „μ—μ„œ μ˜¬λ°”λ₯΄κ²Œ μž‘λ™ν•˜λ„λ‘ ꡬ성 μš”μ†Œλ₯Ό ν˜„λŒ€ν™”ν•˜κΈ° μœ„ν•΄ λͺ‡ κ°€μ§€ λ³€κ²½ 사항을 μ μš©ν–ˆμŠ΅λ‹ˆλ‹€.

섀정도 μ—…λ°μ΄νŠΈν–ˆμŠ΅λ‹ˆλ‹€. 이제 μ‹ λ’° μˆ˜μ€€(Trust Level)만 선택할 수 μžˆλŠ” 것이 μ•„λ‹ˆλΌ, 볡사 λ²„νŠΌ μ‚¬μš©μ΄ ν—ˆμš©λ˜λŠ” λͺ¨λ“  그룹을 선택할 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ copy_type 섀정을 μΆ”κ°€ν•˜μ—¬ λ³΅μ‚¬λœ ν…μŠ€νŠΈκ°€ κ²Œμ‹œλ¬Όμ˜ HTML λ§ˆν¬μ—…μΈμ§€, μ•„λ‹ˆλ©΄ 원본 Markdown인지 선택할 수 μžˆλ„λ‘ ν–ˆμŠ΅λ‹ˆλ‹€.

6개의 μ’‹μ•„μš”

I think it doesn’t work when you select β€œeveryone” in the dropdown. At least I couldn’t find the button until I selected another group. (I know that problem also affects other plugins and components)

4개의 μ’‹μ•„μš”