Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add class to hide elements if guest visitor [#100512234] #140

Merged
merged 1 commit into from Aug 12, 2015

Conversation

dougmartin
Copy link
Member

NOTE: This PR has been changed to a more generic role based class system instead of a guest visitor focused change. The body tag now has a 'xxx-visitor' class assigned per role, eg 'guest-visitor' and 'author-visitor'. There are additional classes created in a loop in the web.scss file to:

  1. Hide an element from all visitors: body .hide-from-all-visitors
  2. Show an element for only a specific role: body.guest-visitor .show-to-guest-visitor
  3. Show an element inline for only a specific role: body.guest-visitor .show-inline-to-guest-visitor
  4. Hide an element for only a specific role: body.guest-visitor .hide-from-guest-visitor

To show the "Create Activity" button only to authors the ITSI project landing page content needs to have the linked wrapped in an element with the "hide-from-all-visitors show-to-author-visitor" classes. I've added it to https://itsi-master-staging.concord.org/itsi already.

<p class="hide-from-all-visitors show-to-author-visitor">
  <a href="https://itsi-master-staging.concord.org/eresources/433/copy" class="button pie" target="_blank">Create ITSI Activity</a>
</p>

@scytacki
Copy link
Member

Now that I see this, it should be hide-if-not-author instead. Or perhaps
less negative show-only-to-authors

from my phone
On Aug 11, 2015 5:43 AM, "Doug Martin" notifications@github.com wrote:

NOTE: To hide the "Create Activity" button the ITSI project landing page
content needs to have the linked wrapped in an element with the
"hide-if-guest-visitor" class. I've added it to
https://itsi-master-staging.concord.org/itsi already.

Create ITSI Activity


You can view, comment on, or merge this pull request online at:

#140
Commit Summary

  • Add class to hide elements if guest visitor [#100512234]

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#140.

@dougmartin
Copy link
Member Author

@scytacki I've made the PR a more generic role based class system. See the PR description for updated info.

@scytacki
Copy link
Member

Looks good to me. 👍

scytacki added a commit that referenced this pull request Aug 12, 2015
…om-anon

Add class to hide elements if guest visitor [#100512234]
@scytacki scytacki merged commit 80b5dd5 into master Aug 12, 2015
@scytacki scytacki deleted the hide-create-button-from-anon branch August 12, 2015 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants