about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-05 03:51:18 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-05 21:35:03 +0100
commitba6ca3cd69118a764628cc4ee0269293aedc8ee0 (patch)
treed9285c1c162dcf5bd077011b14cb49b3b6eb2661 /app/javascript/flavours/glitch
parent7f27ee35a811c596522513efc0d5e38d85008d04 (diff)
Fix various issues in polls
Port front-end changes from a198add83bb527c32fa0e01404338562b157da99 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch')
-rw-r--r--app/javascript/flavours/glitch/components/poll.js5
-rw-r--r--app/javascript/flavours/glitch/styles/polls.scss1
2 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js
index e9124aefa..182491af8 100644
--- a/app/javascript/flavours/glitch/components/poll.js
+++ b/app/javascript/flavours/glitch/components/poll.js
@@ -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>
     );
diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss
index f42496559..7c6e61d63 100644
--- a/app/javascript/flavours/glitch/styles/polls.scss
+++ b/app/javascript/flavours/glitch/styles/polls.scss
@@ -82,6 +82,7 @@
     border: 0;
     color: $dark-text-color;
     text-decoration: underline;
+    font-size: inherit;
 
     &:hover,
     &:focus,