mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Apply prettier to hbs files
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
<label class="poll-breakdown-chart-label">{{@group}}</label>
|
||||
<canvas class="poll-breakdown-chart-chart"></canvas>
|
||||
<canvas class="poll-breakdown-chart-chart"></canvas>
|
||||
@@ -5,7 +5,10 @@
|
||||
{{on "mouseout" @onMouseOut}}
|
||||
role="button"
|
||||
>
|
||||
<span class="poll-breakdown-option-color" style={{this.colorPreviewStyle}}></span>
|
||||
<span
|
||||
class="poll-breakdown-option-color"
|
||||
style={{this.colorPreviewStyle}}
|
||||
></span>
|
||||
|
||||
<span class="poll-breakdown-option-count">
|
||||
{{#if this.showPercentage}}
|
||||
@@ -15,4 +18,4 @@
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="poll-breakdown-option-text">{{html-safe @option.html}}</span>
|
||||
</li>
|
||||
</li>
|
||||
@@ -4,26 +4,52 @@
|
||||
{{this.title}}
|
||||
</p>
|
||||
|
||||
<div class="poll-breakdown-total-votes">{{i18n "poll.breakdown.votes" count=this.model.poll.voters}}</div>
|
||||
<div class="poll-breakdown-total-votes">{{i18n
|
||||
"poll.breakdown.votes"
|
||||
count=this.model.poll.voters
|
||||
}}</div>
|
||||
|
||||
<ul class="poll-breakdown-options">
|
||||
{{#each this.model.poll.options as |option index|}}
|
||||
<PollBreakdownOption @option={{option}} @index={{index}} @totalVotes={{this.totalVotes}} @optionsCount={{this.model.poll.options.length}} @displayMode={{this.displayMode}} @highlightedOption={{this.highlightedOption}} @onMouseOver={{fn (mut this.highlightedOption) index}} @onMouseOut={{fn (mut this.highlightedOption) null}} />
|
||||
<PollBreakdownOption
|
||||
@option={{option}}
|
||||
@index={{index}}
|
||||
@totalVotes={{this.totalVotes}}
|
||||
@optionsCount={{this.model.poll.options.length}}
|
||||
@displayMode={{this.displayMode}}
|
||||
@highlightedOption={{this.highlightedOption}}
|
||||
@onMouseOver={{fn (mut this.highlightedOption) index}}
|
||||
@onMouseOut={{fn (mut this.highlightedOption) null}}
|
||||
/>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="poll-breakdown-body">
|
||||
<div class="poll-breakdown-body-header">
|
||||
<label class="poll-breakdown-body-header-label">{{i18n "poll.breakdown.breakdown"}}</label>
|
||||
<label class="poll-breakdown-body-header-label">{{i18n
|
||||
"poll.breakdown.breakdown"
|
||||
}}</label>
|
||||
|
||||
<ComboBox @content={{this.groupableUserFields}} @value={{this.groupedBy}} @nameProperty="label" @class="poll-breakdown-dropdown" @onChange={{action this.setGrouping}} />
|
||||
<ComboBox
|
||||
@content={{this.groupableUserFields}}
|
||||
@value={{this.groupedBy}}
|
||||
@nameProperty="label"
|
||||
@class="poll-breakdown-dropdown"
|
||||
@onChange={{action this.setGrouping}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="poll-breakdown-charts">
|
||||
{{#each this.charts as |chart|}}
|
||||
<PollBreakdownChart @group={{get chart "group"}} @options={{get chart "options"}} @displayMode={{this.displayMode}} @highlightedOption={{this.highlightedOption}} @setHighlightedOption={{fn (mut this.highlightedOption)}} />
|
||||
<PollBreakdownChart
|
||||
@group={{get chart "group"}}
|
||||
@options={{get chart "options"}}
|
||||
@displayMode={{this.displayMode}}
|
||||
@highlightedOption={{this.highlightedOption}}
|
||||
@setHighlightedOption={{fn (mut this.highlightedOption)}}
|
||||
/>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</DModalBody>
|
||||
</DModalBody>
|
||||
@@ -1,15 +1,30 @@
|
||||
<DModalBody @title="poll.ui_builder.title" @class="poll-ui-builder">
|
||||
<div class="input-group poll-type">
|
||||
<a href {{on "click" (fn this.updatePollType "regular")}} class="poll-type-value poll-type-value-regular {{if this.isRegular "active"}}">
|
||||
<a
|
||||
href
|
||||
{{on "click" (fn this.updatePollType "regular")}}
|
||||
class="poll-type-value poll-type-value-regular
|
||||
{{if this.isRegular 'active'}}"
|
||||
>
|
||||
{{i18n "poll.ui_builder.poll_type.regular"}}
|
||||
</a>
|
||||
|
||||
<a href {{on "click" (fn this.updatePollType "multiple")}} class="poll-type-value poll-type-value-multiple {{if this.isMultiple "active"}}">
|
||||
<a
|
||||
href
|
||||
{{on "click" (fn this.updatePollType "multiple")}}
|
||||
class="poll-type-value poll-type-value-multiple
|
||||
{{if this.isMultiple 'active'}}"
|
||||
>
|
||||
{{i18n "poll.ui_builder.poll_type.multiple"}}
|
||||
</a>
|
||||
|
||||
{{#if this.showNumber}}
|
||||
<a href {{on "click" (fn this.updatePollType "number")}} class="poll-type-value poll-type-value-number {{if this.isNumber "active"}}">
|
||||
<a
|
||||
href
|
||||
{{on "click" (fn this.updatePollType "number")}}
|
||||
class="poll-type-value poll-type-value-number
|
||||
{{if this.isNumber 'active'}}"
|
||||
>
|
||||
{{i18n "poll.ui_builder.poll_type.number"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
@@ -17,7 +32,9 @@
|
||||
|
||||
{{#if this.showAdvanced}}
|
||||
<div class="input-group poll-title">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_title.label"}}</label>
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_title.label"
|
||||
}}</label>
|
||||
<Input @value={{this.pollTitle}} />
|
||||
</div>
|
||||
{{/if}}
|
||||
@@ -25,8 +42,13 @@
|
||||
{{#unless this.isNumber}}
|
||||
<div class="poll-options">
|
||||
{{#if this.showAdvanced}}
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_options.label"}}</label>
|
||||
<Textarea @value={{this.pollOptionsText}} {{on "input" (action "onOptionsTextChange")}} />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_options.label"
|
||||
}}</label>
|
||||
<Textarea
|
||||
@value={{this.pollOptionsText}}
|
||||
{{on "input" (action "onOptionsTextChange")}}
|
||||
/>
|
||||
{{#if this.showMinNumOfOptionsValidation}}
|
||||
{{#unless this.minNumOfOptionsValidation.ok}}
|
||||
<InputTip @validation={{this.minNumOfOptionsValidation}} />
|
||||
@@ -35,16 +57,32 @@
|
||||
{{else}}
|
||||
{{#each this.pollOptions as |option|}}
|
||||
<div class="input-group poll-option-value">
|
||||
<Input @value={{option.value}} @enter={{action "addOption" option}} />
|
||||
<Input
|
||||
@value={{option.value}}
|
||||
@enter={{action "addOption" option}}
|
||||
/>
|
||||
{{#if this.canRemoveOption}}
|
||||
<DButton @icon="trash-alt" @action={{action "removeOption" option}} />
|
||||
<DButton
|
||||
@icon="trash-alt"
|
||||
@action={{action "removeOption" option}}
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
<div class="poll-option-controls">
|
||||
<DButton @class="btn-default" @icon="plus" @label="poll.ui_builder.poll_options.add" @action={{action "addOption" this.pollOptions.lastObject}} />
|
||||
{{#if (and this.showMinNumOfOptionsValidation (not this.minNumOfOptionsValidation.ok))}}
|
||||
<DButton
|
||||
@class="btn-default"
|
||||
@icon="plus"
|
||||
@label="poll.ui_builder.poll_options.add"
|
||||
@action={{action "addOption" this.pollOptions.lastObject}}
|
||||
/>
|
||||
{{#if
|
||||
(and
|
||||
this.showMinNumOfOptionsValidation
|
||||
(not this.minNumOfOptionsValidation.ok)
|
||||
)
|
||||
}}
|
||||
<InputTip @validation={{this.minNumOfOptionsValidation}} />
|
||||
{{/if}}
|
||||
</div>
|
||||
@@ -55,19 +93,40 @@
|
||||
{{#unless this.isRegular}}
|
||||
<div class="options">
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.min"}}</label>
|
||||
<Input @type="number" @value={{this.pollMin}} class="poll-options-min" min="1" />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_config.min"
|
||||
}}</label>
|
||||
<Input
|
||||
@type="number"
|
||||
@value={{this.pollMin}}
|
||||
class="poll-options-min"
|
||||
min="1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.max"}}</label>
|
||||
<Input @type="number" @value={{this.pollMax}} class="poll-options-max" min="1" />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_config.max"
|
||||
}}</label>
|
||||
<Input
|
||||
@type="number"
|
||||
@value={{this.pollMax}}
|
||||
class="poll-options-max"
|
||||
min="1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{{#if this.isNumber}}
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.step"}}</label>
|
||||
<Input @type="number" @value={{this.pollStep}} min="1" class="poll-options-step" />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_config.step"
|
||||
}}</label>
|
||||
<Input
|
||||
@type="number"
|
||||
@value={{this.pollStep}}
|
||||
min="1"
|
||||
class="poll-options-step"
|
||||
/>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
@@ -79,32 +138,69 @@
|
||||
|
||||
{{#if this.showAdvanced}}
|
||||
<div class="input-group poll-allowed-groups">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_groups.label"}}</label>
|
||||
<GroupChooser @content={{this.siteGroups}} @value={{this.pollGroups}} @onChange={{action (mut this.pollGroups)}} @labelProperty="name" @valueProperty="name" />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_groups.label"
|
||||
}}</label>
|
||||
<GroupChooser
|
||||
@content={{this.siteGroups}}
|
||||
@value={{this.pollGroups}}
|
||||
@onChange={{action (mut this.pollGroups)}}
|
||||
@labelProperty="name"
|
||||
@valueProperty="name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="input-group poll-date">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.automatic_close.label"}}</label>
|
||||
<DateTimeInput @date={{this.pollAutoClose}} @onChange={{action (mut this.pollAutoClose)}} @clearable={{true}} @useGlobalPickerContainer={{true}} />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.automatic_close.label"
|
||||
}}</label>
|
||||
<DateTimeInput
|
||||
@date={{this.pollAutoClose}}
|
||||
@onChange={{action (mut this.pollAutoClose)}}
|
||||
@clearable={{true}}
|
||||
@useGlobalPickerContainer={{true}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="input-group poll-select">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_result.label"}}</label>
|
||||
<ComboBox @content={{this.pollResults}} @value={{this.pollResult}} @class="poll-result" @valueProperty="value" @onChange={{action (mut this.pollResult)}} />
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_result.label"
|
||||
}}</label>
|
||||
<ComboBox
|
||||
@content={{this.pollResults}}
|
||||
@value={{this.pollResult}}
|
||||
@class="poll-result"
|
||||
@valueProperty="value"
|
||||
@onChange={{action (mut this.pollResult)}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{{#unless this.isNumber}}
|
||||
<div class="input-group poll-select column">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_chart_type.label"}}</label>
|
||||
<label class="input-group-label">{{i18n
|
||||
"poll.ui_builder.poll_chart_type.label"
|
||||
}}</label>
|
||||
|
||||
<div class="radio-group">
|
||||
<RadioButton @id="poll-chart-type-bar" @name="poll-chart-type" @value="bar" @selection={{this.chartType}} />
|
||||
<label for="poll-chart-type-bar">{{d-icon "chart-bar"}} {{i18n "poll.ui_builder.poll_chart_type.bar"}}</label>
|
||||
<RadioButton
|
||||
@id="poll-chart-type-bar"
|
||||
@name="poll-chart-type"
|
||||
@value="bar"
|
||||
@selection={{this.chartType}}
|
||||
/>
|
||||
<label for="poll-chart-type-bar">{{d-icon "chart-bar"}}
|
||||
{{i18n "poll.ui_builder.poll_chart_type.bar"}}</label>
|
||||
</div>
|
||||
|
||||
<div class="radio-group">
|
||||
<RadioButton @id="poll-chart-type-pie" @name="poll-chart-type" @value="pie" @selection={{this.chartType}} />
|
||||
<label for="poll-chart-type-pie">{{d-icon "chart-pie"}} {{i18n "poll.ui_builder.poll_chart_type.pie"}}</label>
|
||||
<RadioButton
|
||||
@id="poll-chart-type-pie"
|
||||
@name="poll-chart-type"
|
||||
@value="pie"
|
||||
@selection={{this.chartType}}
|
||||
/>
|
||||
<label for="poll-chart-type-pie">{{d-icon "chart-pie"}}
|
||||
{{i18n "poll.ui_builder.poll_chart_type.pie"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
@@ -121,9 +217,28 @@
|
||||
</DModalBody>
|
||||
|
||||
<div class="modal-footer">
|
||||
<DButton @action={{action "insertPoll"}} @icon="chart-bar" @class="btn-primary" @label="poll.ui_builder.insert" @disabled={{this.disableInsert}} />
|
||||
<DButton
|
||||
@action={{action "insertPoll"}}
|
||||
@icon="chart-bar"
|
||||
@class="btn-primary"
|
||||
@label="poll.ui_builder.insert"
|
||||
@disabled={{this.disableInsert}}
|
||||
/>
|
||||
|
||||
<DButton @label="cancel" @class="btn-flat" @action={{route-action "closeModal"}} />
|
||||
<DButton
|
||||
@label="cancel"
|
||||
@class="btn-flat"
|
||||
@action={{route-action "closeModal"}}
|
||||
/>
|
||||
|
||||
<DButton @action={{action "toggleAdvanced"}} @class="btn-default show-advanced" @icon="cog" @title={{if this.showAdvanced "poll.ui_builder.hide_advanced" "poll.ui_builder.show_advanced"}} />
|
||||
</div>
|
||||
<DButton
|
||||
@action={{action "toggleAdvanced"}}
|
||||
@class="btn-default show-advanced"
|
||||
@icon="cog"
|
||||
@title={{if
|
||||
this.showAdvanced
|
||||
"poll.ui_builder.hide_advanced"
|
||||
"poll.ui_builder.show_advanced"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
Reference in New Issue
Block a user