Browse Source

Fix various issues in polls

Port front-end changes from a198add83b to glitch-soc
closed-social-glitch-2
Eugen Rochko 5 years ago
committed by Thibaut Girka
parent
commit
ba6ca3cd69
2 changed files with 4 additions and 2 deletions
  1. +3
    -2
      app/javascript/flavours/glitch/components/poll.js
  2. +1
    -0
      app/javascript/flavours/glitch/styles/polls.scss

+ 3
- 2
app/javascript/flavours/glitch/components/poll.js View File

@ -118,7 +118,7 @@ class Poll extends ImmutablePureComponent {
/>
{!showResults && <span className={classNames('poll__input', { checkbox: poll.get('multiple'), active })} />}
{showResults && <span className='poll__number'>{Math.floor(percent)}%</span>}
{showResults && <span className='poll__number'>{Math.round(percent)}%</span>}
{option.get('title')}
</label>
@ -146,7 +146,8 @@ class Poll extends ImmutablePureComponent {
<div className='poll__footer'>
{!showResults && <button className='button button-secondary' disabled={disabled} onClick={this.handleVote}><FormattedMessage id='poll.vote' defaultMessage='Vote' /></button>}
{showResults && !this.props.disabled && <span><button className='poll__link' onClick={this.handleRefresh}><FormattedMessage id='poll.refresh' defaultMessage='Refresh' /></button> · </span>}
<FormattedMessage id='poll.total_votes' defaultMessage='{count, plural, one {# vote} other {# votes}}' values={{ count: poll.get('votes_count') }} /> · {timeRemaining}
<FormattedMessage id='poll.total_votes' defaultMessage='{count, plural, one {# vote} other {# votes}}' values={{ count: poll.get('votes_count') }} />
{poll.get('expires_at') && <span> · {timeRemaining}</span>}
</div>
</div>
);

+ 1
- 0
app/javascript/flavours/glitch/styles/polls.scss View File

@ -82,6 +82,7 @@
border: 0;
color: $dark-text-color;
text-decoration: underline;
font-size: inherit;
&:hover,
&:focus,

Loading…
Cancel
Save