User State Classes

Basileus
Basileus
edited November 2016 in Campaign Portal Building

This was originally about hiding the Media Library from everyone but the GMs, but user state classes only seem to work for the public layout (not dashboard), so just so something useful is here, this is a list of all the user state classes, so you can target certain types of users with specific styling, but it only seems to affect the public layout (dashboard layout doesn't seem to be affected, at least in my testing so far):


  • .ascendant-user

  • .free-user

  • .logged-out

  • .campaign-member

  • .campaign-game-master

I leave the original post below although it didn't quite work out the way I wanted...

ORIGINAL CONTENT: I know the topic of hiding the Media Library button from players has come up periodically, and the answer (that I have seen) has usually been to hide it entirely and just comment out that CSS when you need to access it (or bookmark the URL so you don't need the hyperlink). If you want to have it visible to GMs only by user state, this should work:


/* HIDE MEDIA LIBRARY EXCEPT GMS */
.file-docker {display:none;}
.campaign-game-master .file-docker {display: list-item;}

 


 

Post edited by Basileus on

Comments

  • weasel0
    weasel0
    Posts: 435

    And Star-ed.

     

    Starred? Stared? Huh...the Grammer hammer in me is confused on that one.

  • cgregory
    cgregory
    Posts: 780 edited November 2016

    You can't affect non public pages because you can't grant access to pages they don't already have access to. Public pages work because you can change what people with access see, even if you decide they see nothing.

    Edit:

    You can probably also use the user state to leave the media library button, but remove the delete button based on user states. 

    Post edited by cgregory on

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Basileus
    Basileus
    Posts: 585 edited November 2016

    @cgregory: I'm not sure I follow your point - the idea is to simply remove the link for people who already have it (players), not give it to non-members. What I ran into was that while everything seemed to work as expected for the public pages, the user state classes didn't seem to apply to dashboard layout views - removing the link to the Media Library based on user state worked fine on all the public pages, but all the rules were ignored/didn't apply in the dashboard view.

    EDIT: Upon further testing at a non-3am time of day, I'm not convinced the user state classes were ever working at all. They are documented in the OP Advanced Styling Guide, if anyone wants to hack away at them: https://docs.google.com/document/d/1MbAEdvqqwXg3PRwbVXMvZY0ndJKsCA_lHyB57256vHM/edit?pli=1

    Post edited by Basileus on
  • Bortas
    Bortas
    Posts: 645

    Oh man, a way for public users to be able to see map icons would be amazing.

    -bort

  • cgregory
    cgregory
    Posts: 780 edited November 2016

    @Basileus: Sorry, I thought you were trying to allow not members of a campaign to view non-public parts of a campaign, not just removing the link in the non-public parts.

    If I remember correctly the main issue was that people didn't want users deleting things from the media library by accident. You can use the user states to accomplish that.

    .delete-link.icon-kub-trash.expand.alert {

        display: none;

    }

    .campaign-game-master .delete-link.icon-kub-trash.expand.alert {

        display: inline-block;

    }

    .delete-link.expand.alert {

    display: none;

    }

    .campaign-game-master .delete-link.icon-kub-trash.expand.alert {

        display: inline-block;

    }

    Post edited by cgregory on

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Basileus
    Basileus
    Posts: 585

    Interesting, the user state does seem to work for that element. I wonder why it doesn seem to apply to the dashboard navigation items...?

    Oh well, that accomplishes the same end goal (help keep players from accidentally deleting stuff).

Sign In or Register to comment.

March 2024
Wrath of the Highborn

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions