Nevermind, I found the error! I was calling the 'setUserName' macro AFTER I was calling 'simpleroles Admin' ... so on startup it was username=Your Last Name, which is not an Admin role ... stupid mistake. Thanks for all the help!
v/r, Scott On Oct 18, 11:59 am, Scott Masterson <[email protected]> wrote: > I tried this, but it doesn't work - the editTiddler button never > shows, regardless of the username entered: > > <!--{{{--> > <div macro="simpleroles Admin"> > <div class='toolbar' macro='toolbar collapseOthers collapseTiddler > closeTiddler jump editTiddler'></div> > <div class='title' macro='view title'></div> > <div class='subtitle'><span macro='view modified date'></span></ > div> > <div class='viewer' macro='view text wikified'></div> > <span macro='setUserName'></span> > <div class='tagClear'></div> > </div> > <div macro="simpleroles !Admin"> > <div class='toolbar' macro='toolbar collapseOthers collapseTiddler > closeTiddler jump'></div> > <div class='title' macro='view title'></div> > <div class='subtitle'><span macro='view modified date'></span></ > div> > <div class='viewer' macro='view text wikified'></div> > <span macro='setUserName'></span> > <div class='tagClear'></div> > </div> > <!--}}}--> > > This works fine, but doesn't use the SimpleRolesPlugin (so I'd have to > explicitly define the list, which I don't want to do): > <!--{{{--> > <div class='toolbar' macro="showWhen config.options.txtUserName == > 'XXX' "> > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > jump editTiddler'></span> > </div> > <div class='toolbar' macro="else"> > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > jump'></span> > </div> > <div class='title' macro='view title'></div> > <div class='subtitle'><span macro='view modified date'></span></div> > <div class='viewer' macro='view text wikified'></div> > <span macro='setUserName'></span> > <div class='tagClear'></div> > <!--}}}--> > > As I understand it, the <span macro='setUserName'></span> line will > force the user to enter their username at startup, but then once > that's done it won't ask for it again - and in practice that's how it > works (which is what I want). Could that be causing a problem with > SimpleRolesPlugin. > > Also, I eliminated the "PowerUser" role in the SimpleRolesPlugin and > SimpleRolesConfig, as I don't need it. > > Thanks for the assistance, I'm trying to get this last problem fixed > before I go on vacation this afternoon! > > v/r, > Scott > > On Oct 18, 10:34 am, whatever <[email protected]> wrote: > > > > > You don't need to add the class. Anyway, this is what one of my > > ViewTemplates looks, so you can compare: > > > <!--{{{--> > > <div macro="simpleroles Admin"> > > <div class='toolbar' macro='toolbar > > [[ToolbarCommands::ViewToolbar]]'></div> > > <div class='title' macro='view title'></div> > > <div class='subtitle'><span macro='view modifier link'></span>, <span > > macro='view modified date'></span> (<span macro='message > > views.wikified.createdPrompt'></span> <span macro='view created > > date'></span>)</div> > > <div macro='showWhenTagged PMaC'> > > <div macro='showWhen config.options.chkLearningMode==true'> > > <div macro='annotations'></div> > > </div> > > </div> > > <div class='tagged' macro='tagging'></div> > > <div class='tagged' macro='tags'></div> > > <div class='viewer' macro='view text wikified'></div> > > <div class='viewer'> > > <span macro='showWhenTagged Customer'> > > <span macro='formTiddler formCustomer'></span> > > </span> > > </div> > > <div class='tagClear'></div> > > <span macro='autoRefresh'></span> > > </div> > > <div macro="simpleroles !Admin"> > > <div class='title' macro='view title'></div> > > <div macro='showWhenTagged PMaC'> > > <div macro='showWhen config.options.chkLearningMode==true'> > > <div macro='annotations'></div> > > </div> > > </div> > > <div class='viewer' macro='view text wikified'></div> > > <div class='viewer'> > > <span macro='showWhenTagged translator_dashboard'> > > <span macro='formTiddler formTranslatorDashboardUserView'></span> > > </span> > > <span macro='showWhenTagged Admin'> > > <span macro='tiddler ./non-Admin'></span> > > </span> > > </div> > > <span macro='autoRefresh'></span> > > </div> > > <!--}}}--> > > > Hope it helps. Also, see the original thread on SimpleRolesPlugin (1). > > Otherwise, can you put a sample online, so we can take a look? > > > (1)https://groups.google.com/group/tiddlywiki/browse_thread/thread/1041f... > > > w > > > On 18 okt., 15:54, Scott Masterson <[email protected]> > > wrote: > > > > Didn't work (I did add class='toolbar', but that didn't affect it): > > > > <div class='toolbar' macro="simpleroles Admin"> > > > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > > > jump editTiddler'></span> > > > </div> > > > <div class='toolbar' macro="simpleroles !Admin"> > > > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > > > jump'></span> > > > </div> > > > > Now I don't get the macro error, but the "edit" button is gone and > > > doesn't come back for any username. ??? > > > > v/r, > > > Scott > > > > On Oct 18, 9:11 am, whatever <[email protected]> wrote: > > > > > Hi! > > > > > Try this: > > > > > <div macro="simpleroles Admin"> > > > > all the stuff for admins > > > > </div> > > > > <div macro="simpleroles !Admin"> > > > > all the stuff for everyone else > > > > </div> > > > > > w > > > > > On 18 okt., 13:53, Scott Masterson <[email protected]> > > > > wrote: > > > > > > Good morning all, > > > > > > I'm almost finished building a TW-based quiz for the folks in my > > > > > division, and am having a problem with my HideWhenPlugin syntax. I'm > > > > > using the SimpleRolesPlugin to determine what content gets seen > > > > > (hiding answers from quiz-takers), but when I try to use it with the > > > > > HideWhenPlugin, I get "error in macro <<showWhen>>. The goal is to > > > > > show the "edit" button for "Admin" roles, but not show it for everyone > > > > > else. > > > > > > Here's what I have so far (in ViewTemplate): > > > > > > <div class='toolbar' macro="showWhen > > > > > window.simpleRoles.contains('Admin')"> > > > > > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > > > > > jump editTiddler'></span> > > > > > </div> > > > > > <div class='toolbar' macro="else"> > > > > > <span macro='toolbar collapseOthers collapseTiddler closeTiddler > > > > > jump'></span> > > > > > </div> > > > > > > Any thoughts? > > > > > > v/r, > > > > > Scott- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.

