Skip to content

Commit

Permalink
UX: Improve layout of poll builder modal
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusaraj committed Aug 7, 2019
1 parent 24877a7 commit 78500fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Expand Up @@ -19,13 +19,13 @@


{{#if showMinMax}} {{#if showMinMax}}
<div class="input-group poll-number"> <div class="input-group poll-number">
{{input-tip validation=minMaxValueValidation}}
<label class="input-group-label">{{i18n 'poll.ui_builder.poll_config.min'}}</label> <label class="input-group-label">{{i18n 'poll.ui_builder.poll_config.min'}}</label>
{{input type='number' {{input type='number'
value=pollMin value=pollMin
valueAttribute="value" valueAttribute="value"
class="poll-options-min"}} class="poll-options-min"}}
</div> </div>
{{input-tip validation=minMaxValueValidation}}




<div class="input-group poll-number"> <div class="input-group poll-number">
Expand All @@ -44,17 +44,17 @@
valueAttribute="value" valueAttribute="value"
min="1" min="1"
class="poll-options-step"}} class="poll-options-step"}}
{{input-tip validation=minStepValueValidation}}
</div> </div>
{{input-tip validation=minStepValueValidation}}
{{/if}} {{/if}}
{{/if}} {{/if}}


{{#unless isNumber}} {{#unless isNumber}}
<div class="input-group poll-textarea"> <div class="input-group poll-textarea">
<label>{{i18n 'poll.ui_builder.poll_options.label'}}</label> <label>{{i18n 'poll.ui_builder.poll_options.label'}}</label>
{{textarea value=pollOptions autocomplete="discourse"}} {{textarea value=pollOptions autocomplete="discourse"}}
{{input-tip validation=minNumOfOptionsValidation}}
</div> </div>
{{input-tip validation=minNumOfOptionsValidation}}
{{/unless}} {{/unless}}


<div class="input-group poll-checkbox"> <div class="input-group poll-checkbox">
Expand Down
32 changes: 16 additions & 16 deletions plugins/poll/assets/stylesheets/common/poll-ui-builder.scss
@@ -1,3 +1,5 @@
$poll-margin: 10px;

.poll-ui-builder-form { .poll-ui-builder-form {
margin: 0; margin: 0;


Expand All @@ -8,31 +10,29 @@


.tip { .tip {
display: block; display: block;
margin-bottom: $poll-margin * 1.5;
margin-top: $poll-margin / 2;
font-size: $font-down-1;
} }


.input-group-label { .poll-select {
display: inline-block; margin-bottom: $poll-margin;
min-width: 55px; display: flex;
align-items: center;
} }


.poll-select { .input-group-label {
line-height: 3em; min-width: 85px;
} }


.poll-number { .poll-number {
margin: 8px 0; margin: $poll-margin 0;

display: flex;
.tip { align-items: center;
margin-bottom: 6px;
}


input { input {
width: 70px; width: 70px;
} }

input + .tip {
margin-top: 4px;
}
} }


.poll-textarea textarea { .poll-textarea textarea {
Expand All @@ -42,10 +42,10 @@
} }


.poll-select + .poll-textarea { .poll-select + .poll-textarea {
margin-top: 12px; margin-top: $poll-margin;
} }


.poll-checkbox { .poll-checkbox {
margin-top: 4px; margin-top: $poll-margin / 2;
} }
} }

1 comment on commit 78500fb

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Penar Musaraj posted:

This is better explained with a before / after screenshot:

image|690x425,100%

Please sign in to comment.