diff options
| author | Bobby <[email protected]> | 2022-05-01 00:17:22 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-05-01 00:17:22 -0400 |
| commit | 50c8c294e2e23566887a47a3180c180675d64add (patch) | |
| tree | de9cc1d4ec012683da687568709a49a3eecf6923 /interface/views | |
| parent | 017e8b42d953136140e0ff6d12559b86d1a330d5 (diff) | |
| download | Welfare-Schemes-DMQL-50c8c294e2e23566887a47a3180c180675d64add.tar.xz Welfare-Schemes-DMQL-50c8c294e2e23566887a47a3180c180675d64add.zip | |
login function with a new main page
Diffstat (limited to 'interface/views')
| -rw-r--r-- | interface/views/citizens.ejs | 51 | ||||
| -rw-r--r-- | interface/views/index.ejs | 95 | ||||
| -rw-r--r-- | interface/views/partials/head.ejs | 2 | ||||
| -rw-r--r-- | interface/views/partials/navbar.ejs | 39 | ||||
| -rw-r--r-- | interface/views/partials/scripts.ejs | 9 |
5 files changed, 118 insertions, 78 deletions
diff --git a/interface/views/citizens.ejs b/interface/views/citizens.ejs new file mode 100644 index 0000000..97c98fa --- /dev/null +++ b/interface/views/citizens.ejs @@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <%- include('partials/head') %> + </head> + + <body> + <%- include('partials/navbar') %> + <table class="ui selectable table"> + <thead> + <tr> + <th>Citizen ID</th> + <th>First Name</th> + <th>Middle Name</th> + <th>Last Name</th> + <th>Address</th> + <th>Mobile Number</th> + <th>Date of Birth</th> + <th>Gender</th> + <th>Marital Status</th> + <th>Disabled</th> + <th>Disabled Percentage</th> + <th>Caste</th> + <th>Village ID</th> + </tr> + </thead> + <tbody> + <% for(var i=0; i < citizens.length; i++) { %> + <tr> + <td><%= citizens[i].citizen_id %></td> + <td><%= citizens[i].first_name %></td> + <td> + <%= citizens[i].middle_name ? citizens[i].middle_name : '-' %> + </td> + <td><%= citizens[i].last_name %></td> + <td><%= citizens[i].address %></td> + <td><%= citizens[i].mobile_num %></td> + <td><%= citizens[i].dob %></td> + <td><%= citizens[i].gender %></td> + <td><%= citizens[i].marital_status %></td> + <td><%= citizens[i].disabled %></td> + <td><%= citizens[i].disbaled_percentage %></td> + <td><%= citizens[i].caste %></td> + <td><%= citizens[i].village_id %></td> + </tr> + <% } %> + </tbody> + </table> + </body> + <%- include('partials/scripts') %> +</html> diff --git a/interface/views/index.ejs b/interface/views/index.ejs index 827334b..6848aa3 100644 --- a/interface/views/index.ejs +++ b/interface/views/index.ejs @@ -5,46 +5,61 @@ </head> <body> + <div class="ui modal login"> + <i class="close icon"></i> + <div class="header">Log in to continue</div> + <div + class="ui padded container segment" + style="border: none; box-shadow: none" + > + <form class="ui form" method="post" onsubmit="login(event)"> + <div class="field"> + <label>Username</label> + <input + placeholder="Username" + name="username" + type="text" + autocomplete="off" + id="username" + /> + </div> + <div class="field"> + <label>Password</label> + <input + type="password" + name="password" + placeholder="password" + id="password" + /> + </div> + <div class="ui primary submit button" id="submit">Submit</div> + <div class="ui error message"></div> + </form> + </div> + </div> <%- include('partials/navbar') %> - <table class="ui selectable table"> - <thead> - <tr> - <th>Citizen ID</th> - <th>First Name</th> - <th>Middle Name</th> - <th>Last Name</th> - <th>Address</th> - <th>Mobile Number</th> - <th>Date of Birth</th> - <th>Gender</th> - <th>Marital Status</th> - <th>Disabled</th> - <th>Disabled Percentage</th> - <th>Caste</th> - <th>Village ID</th> - </tr> - </thead> - <tbody> - <% for(var i=0; i < citizens.length; i++) { %> - <tr> - <td><%= citizens[i].citizen_id %></td> - <td><%= citizens[i].first_name %></td> - <td> - <%= citizens[i].middle_name ? citizens[i].middle_name : '-' %> - </td> - <td><%= citizens[i].last_name %></td> - <td><%= citizens[i].address %></td> - <td><%= citizens[i].mobile_num %></td> - <td><%= citizens[i].dob %></td> - <td><%= citizens[i].gender %></td> - <td><%= citizens[i].marital_status %></td> - <td><%= citizens[i].disabled %></td> - <td><%= citizens[i].disbaled_percentage %></td> - <td><%= citizens[i].caste %></td> - <td><%= citizens[i].village_id %></td> - </tr> - <% } %> - </tbody> - </table> + <div class="ui main container segment"> + <div class="ui cards"> + <div class="card"> + <div class="content"> + <div class="header">Citizens</div> + <div class="description"> + Provides the details of all the citizens in the database + </div> + </div> + <div class="extra content"> + <div class="ui basic green button" onclick="route('citizens')"> + View Data + </div> + </div> + </div> + </div> + </div> </body> + <%- include('partials/scripts') %> + <script> + $(".ui.dropdown").dropdown(); + $(".login.modal").modal("attach events", ".loginButton", "show"); + </script> + <script src="/login.js"></script> </html> diff --git a/interface/views/partials/head.ejs b/interface/views/partials/head.ejs index c43233a..c4b963e 100644 --- a/interface/views/partials/head.ejs +++ b/interface/views/partials/head.ejs @@ -3,5 +3,3 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Welfare Schemes | <%= title %></title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css"> -<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script> diff --git a/interface/views/partials/navbar.ejs b/interface/views/partials/navbar.ejs index 2939438..91880fb 100644 --- a/interface/views/partials/navbar.ejs +++ b/interface/views/partials/navbar.ejs @@ -45,44 +45,11 @@ <div class="right menu"> <div class="item"> <div class="ui icon input"> - <input type="text" placeholder="Search..."> + <input type="text" placeholder="Search..." /> <i class="search link icon"></i> </div> </div> - <a class="ui item loginButton"> - Log in - </a> + <a class="ui item loginButton" id="loginButton"> Log in </a> + <a class="ui item loginButton" id="logoutButton" onclick="logout(event)"> Log out</a> </div> </div> -<div class="ui modal login"> - <i class="close icon"></i> - <div class="header"> - Log in to continue - </div> - <div class="ui padded container segment" style="border: none; box-shadow: none;"> - <div class="ui form "> - <div class="field"> - <label>Username</label> - <input type="text" placeholder="Username"> - </div> - <div class="field"> - <label>Password</label> - <input type="password" placeholder="Password"> - </div> - </div> - </div> - - <div class="actions"> - <div class="ui black deny button"> - Cancel - </div> - <div class="ui positive right labeled icon button"> - Continue - <i class="checkmark icon"></i> - </div> - </div> -</div> -<script> - $(".ui.dropdown").dropdown(); - $(".login.modal").modal("attach events", ".loginButton", "show"); -</script> diff --git a/interface/views/partials/scripts.ejs b/interface/views/partials/scripts.ejs new file mode 100644 index 0000000..a90467a --- /dev/null +++ b/interface/views/partials/scripts.ejs @@ -0,0 +1,9 @@ +<script + src="https://code.jquery.com/jquery-3.1.1.min.js" + integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" + crossorigin="anonymous" +></script> +<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script> +<script src="/verify.js"></script> +<script src="/router.js"></script> +<script src="/logout.js"></script> |
