Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. <template name="loginButtons">
  2. <div id="login-buttons" class="login-buttons-dropdown-align-{{align}}">
  3. {{#if currentUser}}
  4. {{#if loggingIn}}
  5. {{! We aren't actually logged in yet; we're just setting Meteor.userId
  6. optimistically during an at-startup login-with-token. We expose this
  7. state so other UIs can treat it specially, but we'll just treat it
  8. as logged out. }}
  9. {{#if dropdown}}
  10. {{> _loginButtonsLoggingIn }}
  11. {{else}}
  12. <div class="login-buttons-with-only-one-button">
  13. {{> _loginButtonsLoggingInSingleLoginButton }}
  14. </div>
  15. {{/if}}
  16. {{else}}
  17. {{> _loginButtonsLoggedIn}}
  18. {{/if}}
  19. {{else}}
  20. {{> _loginButtonsLoggedOut}}
  21. {{/if}}
  22. </div>
  23. </template>
  24.  
  25. <template name="_loginButtonsLoggedIn">
  26. {{#if dropdown}}
  27. {{> _loginButtonsLoggedInDropdown}}
  28. {{else}}
  29. <div class="login-buttons-with-only-one-button">
  30. {{> _loginButtonsLoggedInSingleLogoutButton}}
  31. </div>
  32. {{/if}}
  33. </template>
  34.  
  35. <template name="_loginButtonsLoggedOut">
  36. {{#if services}} {{! if at least one service is configured }}
  37. {{#if configurationLoaded}}
  38. {{#if dropdown}} {{! if more than one service configured, or password is configured}}
  39. {{> _loginButtonsLoggedOutDropdown}}
  40. {{else}}
  41. {{#with singleService}} {{! at this point there must be only one configured services }}
  42. <div class="login-buttons-with-only-one-button">
  43. {{#if loggingIn}}
  44. {{> _loginButtonsLoggingInSingleLoginButton}}
  45. {{else}}
  46. {{> _loginButtonsLoggedOutSingleLoginButton}}
  47. {{/if}}
  48. </div>
  49. {{/with}}
  50. {{/if}}
  51. {{/if}}
  52. {{else}}
  53. <div class="no-services">No login services configured</div>
  54. {{/if}}
  55. </template>
  56.  
  57. <!-- used in various places to display messages to user -->
  58. <template name="_loginButtonsMessages">
  59. {{#if errorMessage}}
  60. <div class="message error-message">{{errorMessage}}</div>
  61. {{/if}}
  62. {{#if infoMessage}}
  63. <div class="message info-message">{{infoMessage}}</div>
  64. {{/if}}
  65. </template>
  66.  
  67. <template name="_loginButtonsLoggingIn">
  68. {{> _loginButtonsLoggingInPadding}}
  69. <div class="loading">&nbsp;</div>
  70. {{> _loginButtonsLoggingInPadding}}
  71. </template>
  72.  
  73. <template name="_loginButtonsLoggingInPadding">
  74. {{#unless dropdown}}
  75. {{! invisible div used for correct height of surrounding div. this ensures
  76. that the _loginButtons template is always the same height
  77. and the rest of the page doesn't move up and down }}
  78. <div class="login-buttons-padding">
  79. <div class="login-button single-login-button" style="visibility: hidden;" id="login-buttons-logout">&nbsp;</div>
  80. </div>
  81. {{else}}
  82. {{! just add some padding }}
  83. <div class="login-buttons-padding"></div>
  84. {{/unless}}
  85. </template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement