<p>In the application helpers we have a few methods that allow features to be shown and hidden using CSS, based on the logged in user_id. The methods have pretty much remained as they were when added in <a class="commit-link" href="https://github.com/openstreetmap/openstreetmap-website/commit/51195c450d16e35a62bff2bbf6c9dd0923bd0db4"><tt>51195c4</tt></a></p>
<p>Elsewhere in the codebase we take a more "normal" approach, which is to e.g. not add the html to the page based on the conditions, rather than this approach of adding the html to the page unconditionally and then hiding it with CSS.</p>
<p>If I had to guess, I would say that the approach was intended to allow more aggressive page fragment caching, but as far as I'm aware we don't actually do anything like this (or perhaps never have done?). Or maybe I've misunderstood their purpose entirely.</p>
<p>I propose removing these methods and converting their uses to e.g. "if current_user..." as per elsewhere on the site, but I thought I'd ask here first - do we actually need them?</p>
<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/issues/1862">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLWQ8ybjzTMGtQDezRyyBbpn3wndvks5tyosXgaJpZM4T_EN5">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLTkQYOysw8QyWYOFMlOFL3A3ihgbks5tyosXgaJpZM4T_EN5.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/1862"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Is there still a need for if_user and friends? (#1862)"}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/openstreetmap-website/issues/1862"}}}</script>
<script type="application/ld+json">{"@type":"MessageCard","@context":"http://schema.org/extensions","hideOriginalBody":"false","originator":"37567f93-e2a7-4e2a-ad37-a9160fc62647","title":"Is there still a need for if_user and friends? (#1862)","sections":[{"text":"","activityTitle":"**Andy Allan**","activityImage":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","activitySubtitle":"@gravitystorm","facts":[{"name":"Repository: ","value":"openstreetmap/openstreetmap-website"},{"name":"Issue #: ","value":1862}]}],"potentialAction":[{"name":"Add a comment","@type":"ActionCard","inputs":[{"isMultiLine":true,"@type":"TextInput","id":"IssueComment","isRequired":false}],"actions":[{"name":"Comment","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"IssueComment\",\"repositoryFullName\":\"openstreetmap/openstreetmap-website\",\"issueId\":1862,\"IssueComment\":\"{{IssueComment.value}}\"}"}]},{"name":"Close issue","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"IssueClose\",\"repositoryFullName\":\"openstreetmap/openstreetmap-website\",\"issueId\":1862}"},{"targets":[{"os":"default","uri":"https://github.com/openstreetmap/openstreetmap-website/issues/1862"}],"@type":"OpenUri","name":"View on GitHub"},{"name":"Unsubscribe","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"MuteNotification\",\"threadId\":335299449}"}],"themeColor":"26292E"}</script>