logo

pleroma-fe

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

login_form.vue (3199B)


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