This is an automated email from the ASF dual-hosted git repository.

martin_s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva.git


The following commit(s) were added to refs/heads/master by this push:
     new 12d234b  Login form
12d234b is described below

commit 12d234b4c6c52cbc204ae849082e8a8825e4f65e
Author: Martin Stockhammer <[email protected]>
AuthorDate: Sun Jul 5 21:05:52 2020 +0200

    Login form
---
 .../main/archiva-web/src/app/app.component.html    | 15 +++++-----
 .../src/main/archiva-web/src/app/app.module.ts     |  2 ++
 .../src/{styles.scss => app/logindata.ts}          | 21 +++++--------
 .../app/modules/general/login/login.component.html | 34 +++++++++++++++++++++-
 .../app/modules/general/login/login.component.ts   | 13 ++++++++-
 .../src/main/archiva-web/src/index.html            |  2 +-
 .../src/main/archiva-web/src/styles.scss           | 15 ++++++++++
 7 files changed, 77 insertions(+), 25 deletions(-)

diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.component.html
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.component.html
index 6f31f96..667b139 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.component.html
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.component.html
@@ -16,8 +16,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
 -->
-<div class="app">
-
+<div class="app d-flex flex-column" >
   <header>
     <nav class="navbar navbar-expand-md fixed-top navbar-light " 
style="background-color: #c6cbd2;">
       <a class="navbar-brand" routerLink="/">
@@ -59,14 +58,14 @@
     </nav>
   </header>
 
-  <main>
-    <div class="container-fluid">
+  <main class="container-fluid flex-fill">
+    <div >
         <router-outlet></router-outlet>
     </div>
   </main>
 
-  <hr>
-  <div class="footer">
+  <hr />
+  <footer class="container-fluid">
     <div class="container">
       <div class="row">
         <div class="col-12">
@@ -74,6 +73,6 @@
         </div>
       </div>
     </div>
-  </div>
+  </footer>
 
-</div>
+</div>
\ No newline at end of file
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
index 3be9131..e991091 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app.module.ts
@@ -27,6 +27,7 @@ import { AboutComponent } from 
'./modules/general/about/about.component';
 import { LoginComponent } from './modules/general/login/login.component';
 import { NotFoundComponent } from 
'./modules/general/not-found/not-found.component';
 import { SidemenuComponent } from 
'./modules/general/sidemenu/sidemenu.component';
+import {FormsModule} from "@angular/forms";
 
 @NgModule({
   declarations: [
@@ -41,6 +42,7 @@ import { SidemenuComponent } from 
'./modules/general/sidemenu/sidemenu.component
   imports: [
     BrowserModule,
     AppRoutingModule,
+    FormsModule,
   ],
   providers: [],
   bootstrap: [AppComponent]
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/logindata.ts
similarity index 72%
copy from 
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
copy to 
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/logindata.ts
index b31b9a0..4aec82e 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/logindata.ts
@@ -7,8 +7,7 @@
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -16,18 +15,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-/* You can add global styles to this file, and also import other style files */
-
-$archiva-orange: #f46e1b;
-$primary: $archiva-orange;
-
-body {
-  color: black;
-  font-weight: 400;
-  padding-top: 5rem;
-}
-
-@import "~bootstrap/scss/bootstrap";
 
+export class Logindata {
 
+    constructor(
+        public username: string,
+        public password: string
+    ) {  }
 
+}
\ No newline at end of file
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.html
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.html
index cf12d1d..bfab352 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.html
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.html
@@ -16,4 +16,36 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
 -->
-<p>Login</p>
+<div class="container-md" >
+<div class="row">
+    <div class="col-6">
+        <form (ngSubmit)="onSubmit()" #loginForm="ngForm">
+            <div class="form-group">
+                <label for="username" i18n="loginform|">Username</label>
+                <input type="text" class="form-control" id="username" 
aria-describedby="usernameHelp"
+                       required name="username"
+                       [(ngModel)]="model.username" #username="ngModel"
+                >
+                <small id="usernameHelp" class="form-text text-muted" 
i18n="inputhelp|">Enter your username.</small>
+
+                <div [hidden]="username.valid || username.pristine"
+                     class="alert alert-danger" i18n>
+                    Username is required
+                </div>
+            </div>
+            <div class="form-group">
+                <label for="password" i18n="loginform|">Password</label>
+                <input type="password" class="form-control" id="password" 
name="password"
+                    required="required"  [(ngModel)]="model.password" 
#password="ngModel"
+                >
+                <small id="passwordHelp" class="form-text text-muted" 
i18n="inputhelp|">Enter your password.</small>
+                <div [hidden]="password.valid || password.pristine"
+                     class="alert alert-danger" i18n>
+                    Password is required
+                </div>
+            </div>
+            <button type="submit" class="btn btn-primary">Submit</button>
+        </form>
+    </div>
+</div>
+</div>
\ No newline at end of file
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.ts
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.ts
index 7a89137..bb018b6 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.ts
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/general/login/login.component.ts
@@ -17,6 +17,9 @@
  * under the License.
  */
 import { Component, OnInit } from '@angular/core';
+// noinspection ES6UnusedImports
+import { FormsModule } from "@angular/forms";
+import { Logindata } from "../../../logindata";
 
 @Component({
   selector: 'app-login',
@@ -25,7 +28,15 @@ import { Component, OnInit } from '@angular/core';
 })
 export class LoginComponent implements OnInit {
 
-  constructor() { }
+  model = new Logindata('', '');
+
+  submitted = false;
+
+  onSubmit() { this.submitted = true; }
+
+  get diagnostic() { return JSON.stringify(this.submitted); }
+
+  constructor() {  }
 
   ngOnInit(): void {
   }
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/index.html
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/index.html
index a1038bd..537bebf 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/index.html
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/index.html
@@ -25,7 +25,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
 </head>
-<body>
+<body >
   <app-root></app-root>
 </body>
 </html>
diff --git 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
index b31b9a0..78150ac 100644
--- 
a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
+++ 
b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/styles.scss
@@ -21,10 +21,25 @@
 $archiva-orange: #f46e1b;
 $primary: $archiva-orange;
 
+
+html {
+  height: 100%;
+}
+.app {
+  height: 100%;
+}
+
+
 body {
   color: black;
   font-weight: 400;
   padding-top: 5rem;
+  min-height:100%;
+  height: 100%;
+}
+
+.flex-fill {
+  flex:1 1 auto;
 }
 
 @import "~bootstrap/scss/bootstrap";

Reply via email to