<p>This avoids admins from having to manually change end periods in the database.</p>
<p>Most of this diff is the helper to display durations in the dropdown menu in more friendly terms than e.g. "8766 hours". The hours are carefully picked to show up as rounded durations. It's possible to pick particular hours that don't fit the pattern, e.g. 36 hours, but handling those situations was becoming an exercise in over-engineering.</p>
<p><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/360803/57766250-52d9e980-7707-11e9-971d-ac5867c9dc5d.png"><img src="https://user-images.githubusercontent.com/360803/57766250-52d9e980-7707-11e9-971d-ac5867c9dc5d.png" alt="Screenshot from 2019-05-15 11-44-47" style="max-width:100%;"></a></p>
<p>I also wanted to preserve the "0 hours" label since that's how those blocks are referred to in common parlance, and to avoid e.g. "about 1 month" and similar vagueness, so that precluded using the standard rails time_to_words helpers.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/2225'>https://github.com/openstreetmap/openstreetmap-website/pull/2225</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Allow user_blocks to be created for longer periods</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225/files#diff-0">app/helpers/user_blocks_helper.rb</a>
(15)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225/files#diff-1">app/views/user_blocks/edit.html.erb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225/files#diff-2">app/views/user_blocks/new.html.erb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225/files#diff-3">config/locales/en.yml</a>
(19)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225/files#diff-4">config/settings.yml</a>
(2)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2225.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2225.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2225.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2225.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2225?email_source=notifications&email_token=AAK2OLKO6AWY7BUBKQCN5OLPVPMCZA5CNFSM4HNBRRVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4DQ3A">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLI7PSBMCMFKEPWZORLPVPMCZANCNFSM4HNBRRVA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLO77TJDECTXFV7H6PLPVPMCZA5CNFSM4HNBRRVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4DQ3A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2225?email_source=notifications\u0026email_token=AAK2OLKO6AWY7BUBKQCN5OLPVPMCZA5CNFSM4HNBRRVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4DQ3A",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2225?email_source=notifications\u0026email_token=AAK2OLKO6AWY7BUBKQCN5OLPVPMCZA5CNFSM4HNBRRVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GT4DQ3A",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>