0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-table-field.hbs

186 Zeilen
4 KiB
Handlebars

2024-11-22 16:45:50 +01:00
{{#if this.hasValue}}
{{#if this.isText}}
{{this.value.value}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isLongtext}}
<div class="wizard-table-long-text">
2024-11-22 16:45:50 +01:00
<p class="wizard-table-long-text-content {{this.textState}}">
{{this.value.value}}
</p>
<a href {{action "expandText"}}>
2024-11-22 16:45:50 +01:00
{{this.toggleText}}
</a>
</div>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isComposer}}
<div class="wizard-table-long-text">
2023-07-10 08:55:54 +02:00
<p
class="wizard-table-composer-text wizard-table-long-text-content
2024-11-22 16:45:50 +01:00
{{this.textState}}"
2023-07-10 08:55:54 +02:00
>
2024-11-22 16:45:50 +01:00
{{this.value.value}}
</p>
<a href {{action "expandText"}}>
2024-11-22 16:45:50 +01:00
{{this.toggleText}}
</a>
</div>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isComposerPreview}}
{{d-icon "comment-alt"}}
<span class="wizard-table-composer-text">
2023-07-10 08:55:54 +02:00
{{i18n "admin.wizard.submissions.composer_preview"}}:
2024-11-22 16:45:50 +01:00
{{this.value.value}}
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isTextOnly}}
{{this.value.value}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isDate}}
<span class="wizard-table-icon-item">
2024-11-22 16:45:50 +01:00
{{d-icon "calendar"}}{{this.value.value}}
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isTime}}
<span class="wizard-table-icon-item">
2024-11-22 16:45:50 +01:00
{{d-icon "clock"}}{{this.value.value}}
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isDateTime}}
<span class="wizard-table-icon-item" title={{this.value.value}}>
{{d-icon "calendar"}}{{format-date this.value.value format="medium"}}
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isNumber}}
{{this.value.value}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isCheckbox}}
{{#if this.checkboxValue}}
<span class="wizard-table-icon-item checkbox-true">
2024-11-22 16:45:50 +01:00
{{d-icon "check"}}{{this.value.value}}
</span>
{{else}}
<span class="wizard-table-icon-item checkbox-false">
2024-11-22 16:45:50 +01:00
{{d-icon "times"}}{{this.value.value}}
</span>
{{/if}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isUrl}}
<span class="wizard-table-icon-item url">
{{d-icon "link"}}
2024-11-22 16:45:50 +01:00
<a target="_blank" rel="noopener noreferrer" href={{this.value.value}}>
{{this.value.value}}
</a>
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isUpload}}
<a
target="_blank"
rel="noopener noreferrer"
class="attachment"
2024-11-22 16:45:50 +01:00
href={{this.file.url}}
download
>
2024-11-22 16:45:50 +01:00
{{this.file.original_filename}}
</a>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isDropdown}}
<span class="wizard-table-icon-item">
{{d-icon "check-square"}}
2024-11-22 16:45:50 +01:00
{{this.value.value}}
</span>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isTag}}
{{#each this.value.value as |tag|}}
{{discourse-tag tag}}
{{/each}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isCategory}}
<strong>
{{i18n "admin.wizard.submissions.category_id"}}:
</strong>
<a
target="_blank"
rel="noopener noreferrer"
2024-11-22 16:45:50 +01:00
href={{this.categoryUrl}}
title={{this.value.value}}
>
2024-11-22 16:45:50 +01:00
{{this.value.value}}
</a>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isTopic}}
2024-06-20 11:25:57 +02:00
<strong>
{{i18n "admin.wizard.submissions.topic_id"}}:
</strong>
2024-11-22 16:45:50 +01:00
{{#each this.value.value as |topic|}}
2024-06-20 11:25:57 +02:00
<a
target="_blank"
rel="noopener noreferrer"
href={{topic.url}}
title={{topic.fancy_title}}
>
{{topic.id}}
</a>
{{/each}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isGroup}}
<strong>
{{i18n "admin.wizard.submissions.group_id"}}:
</strong>
2024-11-22 16:45:50 +01:00
{{this.value.value}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isUserSelector}}
{{#each this.submittedUsers as |user|}}
{{d-icon "user"}}
<a
target="_blank"
rel="noopener noreferrer"
href={{user.url}}
title={{user.username}}
>
{{user.username}}
</a>
{{/each}}
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isUser}}
<LinkTo @route="user" @model={{this.value.username}}>
{{avatar this.value imageSize="tiny"}}
2024-01-26 16:18:11 +01:00
</LinkTo>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.showUsername}}
2023-07-10 08:55:54 +02:00
<a
target="_blank"
rel="noopener noreferrer"
2024-11-22 16:45:50 +01:00
href={{this.userProfileUrl}}
title={{this.username}}
2023-07-10 08:55:54 +02:00
>
2024-11-22 16:45:50 +01:00
{{this.username}}
</a>
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.isSubmittedAt}}
<span class="date" title={{this.value}}>
{{raw-date this.value}}
</span>
{{/if}}
{{else}}
&mdash;
2023-07-10 08:55:54 +02:00
{{/if}}