logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

login_form.vue (3238B)


  1. <template>
  2. <div class="login panel panel-default">
  3. <!-- Default panel contents -->
  4. <div class="panel-heading">
  5. <h1 class="title">
  6. {{ $t('login.login') }}
  7. </h1>
  8. </div>
  9. <div class="panel-body">
  10. <form
  11. class="login-form"
  12. @submit.prevent="submit"
  13. >
  14. <template v-if="isPasswordAuth">
  15. <div class="form-group">
  16. <label for="username">{{ $t('login.username') }}</label>
  17. <input
  18. id="username"
  19. v-model="user.username"
  20. :disabled="loggingIn"
  21. class="input form-control"
  22. :placeholder="$t('login.placeholder')"
  23. >
  24. </div>
  25. <div class="form-group">
  26. <label for="password">{{ $t('login.password') }}</label>
  27. <input
  28. id="password"
  29. ref="passwordInput"
  30. v-model="user.password"
  31. :disabled="loggingIn"
  32. class="input form-control"
  33. type="password"
  34. >
  35. </div>
  36. <div class="form-group">
  37. <router-link :to="{name: 'password-reset'}">
  38. {{ $t('password_reset.forgot_password') }}
  39. </router-link>
  40. </div>
  41. </template>
  42. <div
  43. v-if="isTokenAuth"
  44. class="form-group"
  45. >
  46. <p>{{ $t('login.description') }}</p>
  47. </div>
  48. <div class="form-group">
  49. <div class="login-bottom">
  50. <div>
  51. <router-link
  52. v-if="registrationOpen"
  53. :to="{name: 'registration'}"
  54. class="register"
  55. >
  56. {{ $t('login.register') }}
  57. </router-link>
  58. </div>
  59. <button
  60. :disabled="loggingIn"
  61. type="submit"
  62. class="btn button-default"
  63. >
  64. {{ $t('login.login') }}
  65. </button>
  66. </div>
  67. </div>
  68. </form>
  69. </div>
  70. <div
  71. v-if="error"
  72. class="form-group"
  73. >
  74. <div class="alert error">
  75. {{ error }}
  76. <button
  77. class="button-unstyled"
  78. @click="clearError"
  79. >
  80. <FAIcon
  81. class="fa-scale-110 fa-old-padding"
  82. icon="times"
  83. />
  84. </button>
  85. </div>
  86. </div>
  87. </div>
  88. </template>
  89. <script src="./login_form.js"></script>
  90. <style lang="scss">
  91. .login-form {
  92. display: flex;
  93. flex-direction: column;
  94. padding: 0.6em;
  95. .btn {
  96. min-height: 2em;
  97. width: 10em;
  98. }
  99. .register {
  100. flex: 1 1;
  101. }
  102. .login-bottom {
  103. margin-top: 1em;
  104. display: flex;
  105. flex-direction: row;
  106. align-items: center;
  107. justify-content: space-between;
  108. }
  109. .form-group {
  110. display: flex;
  111. flex-direction: column;
  112. padding: 0.3em 0.5em 0.6em;
  113. line-height: 24px;
  114. }
  115. .form-bottom {
  116. display: flex;
  117. padding: 0.5em;
  118. height: 32px;
  119. button {
  120. width: 10em;
  121. }
  122. p {
  123. margin: 0.35em;
  124. padding: 0.35em;
  125. display: flex;
  126. }
  127. }
  128. .error {
  129. text-align: center;
  130. animation-name: shakeError;
  131. animation-duration: 0.4s;
  132. animation-timing-function: ease-in-out;
  133. }
  134. }
  135. </style>