aboutsummaryrefslogtreecommitdiff
path: root/interface/views
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-05-01 01:02:38 -0400
committerGitHub <[email protected]>2022-05-01 01:02:38 -0400
commitb0b1938f0e2ae2d159f0a616f8043d0b7f24f2eb (patch)
tree71ed919b888e83fb49d619d1ba338dcba43b245c /interface/views
parentfd8acf8d1b04368763a97d1452565aa71dcc118a (diff)
parentd527bddaeb3083d2a5ec787626e512eb45d3a967 (diff)
downloadWelfare-Schemes-DMQL-b0b1938f0e2ae2d159f0a616f8043d0b7f24f2eb.tar.xz
Welfare-Schemes-DMQL-b0b1938f0e2ae2d159f0a616f8043d0b7f24f2eb.zip
Merge pull request #4 from luciferreeves/main
Main page changes
Diffstat (limited to 'interface/views')
-rw-r--r--interface/views/citizens.ejs51
-rw-r--r--interface/views/index.ejs103
-rw-r--r--interface/views/partials/head.ejs7
-rw-r--r--interface/views/partials/navbar.ejs17
-rw-r--r--interface/views/partials/scripts.ejs9
5 files changed, 141 insertions, 46 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..99dc89b 100644
--- a/interface/views/index.ejs
+++ b/interface/views/index.ejs
@@ -5,46 +5,69 @@
</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">
+ <pre>
+ Gender Statistics:<br>
+ =====================<br>
+ Male: <%= genderDistribution[0].genderCount %><br>
+ Female: <%= genderDistribution[1].genderCount %><br>
+ ---------------------<br>
+ Total: <%= genderDistribution[0].genderCount + genderDistribution[1].genderCount %>
+ </pre>
+ 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..1296994 100644
--- a/interface/views/partials/head.ejs
+++ b/interface/views/partials/head.ejs
@@ -3,5 +3,8 @@
<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>
+<style>
+ pre, code{
+ white-space:normal;
+ }
+</style>
diff --git a/interface/views/partials/navbar.ejs b/interface/views/partials/navbar.ejs
index 6a46ff3..34116ea 100644
--- a/interface/views/partials/navbar.ejs
+++ b/interface/views/partials/navbar.ejs
@@ -1,5 +1,5 @@
<div class="ui menu">
- <a class="item active"> Home </a>
+ <a class="item"> Home </a>
<div class="ui pointing dropdown link item">
<span class="text">View Data</span>
<i class="dropdown icon"></i>
@@ -42,7 +42,16 @@
</div>
</div>
</div>
+ <div class="right menu">
+ <div class="item">
+ <div class="ui icon input">
+ <input type="text" placeholder="Search..." />
+ <i class="search link icon"></i>
+ </div>
+ </div>
+ <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>
-<script>
- $(".ui.dropdown").dropdown();
-</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>