Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Tayyaba 03 vue2 #166

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions farmdata2/farmdata2_modules/fd2_school/HTML/HTML.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This is my subtab</p>
11 changes: 9 additions & 2 deletions farmdata2/farmdata2_modules/fd2_school/fd2_school.module
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ function fd2_school_menu() {
'weight' => -100,
);

// Add items blocks for new sub-tabs here.

$items['farm/fd2-school/html'] = array (
'title' => 'HTML',
'type' => MENU_LOCAL_TASK,
'page callback' => 'fd2_school_view',
'page arguments' => array('HTML'),
'access arguments' => array('view fd2 school'),
'weight' => 110
);

return $items;
};

Expand Down
106 changes: 106 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Harvest Report</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
font-style: italic;
text-align: center;
}
hr {
margin-top: 30px;
margin-bottom: 30px;
}
ul {
list-style-type: none;
padding-left: 0;
}
li::before {
content: "\2022";
font-weight: bold;
display: inline-block;
width: 1em;
margin-left: -1em;
}
table {
border: 1px solid black;
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid black;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h1>Harvest Report</h1>
<em>mockup</em>
<hr>
<h2>Harvest Report Form</h2>
<form>
<label for="crop">Crop:</label>
<select id="crop" name="crop">
<option value="broccoli">Broccoli</option>
<option value="kale" selected>Kale</option>
<option value="peas">Peas</option>
</select><br><br>
<label for="field">Area:</label>
<select id="field" name="field">
<option value="all" selected>All</option>
<option value="chuau-1">Chuau-1</option>
<option value="sq7">SQ7</option>
</select><br><br>
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" name="startDate" min="2014-01-01" max="2022-01-01" value="2020-05-05"><br><br>
<label for="endDate">End Date:</label>
<input type="date" id="endDate" name="endDate" min="2020-05-05" max="2022-01-01" value="2020-05-15"><br><br>
<label for="title">Title:</label><br>
<input type="text" id="title" name="title"><br><br>
<input type="submit" value="Generate Report">
</form>
<hr>
<h2>Actual Report</h2>
<table>
<tr>
<th>Date</th>
<th>Field</th>
<th>Crop</th>
<th>Quantity (lbs)</th>
<th>Worker</th>
</tr>
<tr>
<td>2020-05-01</td>
<td>Chuau-1</td>
<td>Kale</td>
<td>50</td>
<td>John Doe</td>
</tr>
<tr>
<td>2020-05-05</td>
<td>SQ7</td>
<td>Broccoli</td>
<td>40</td>
<td>Jane Smith</td>
</tr>
<tr>
<td>2020-05-10</td>
<td>Chuau-1</td>
<td>Peas</td>
<td>30</td>
<td>Michael Johnson</td>
</tr>
</table>
</body>
</html>


107 changes: 107 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue1 Harvest Report</title>
<style>
[v-cloak] {
display: none;
}
</style>
</head>
<body>

<div id="app" v-cloak>
<input type="date" v-model="reportStartDate">
<input type="date" v-model="reportEndDate">
<select v-model="selectedCrop">
<option v-for="crop in crops" :value="crop">{{ crop }}</option>
</select>
<select v-model="selectedArea">
<option v-for="area in areas" :value="area">{{ area }}</option>
</select>

<h3>Report Start Date: {{ reportStartDate }}</h3>
<h3>Report End Date: {{ reportEndDate }}</h3>
<h3>Selected Crop: {{ selectedCrop }}</h3>
<h3>Selected Area: {{ selectedArea }}</h3>

<label for="title">Title:</label>
<input type="text" id="title" name="title" v-model="reportTitle"><br><br>
<h1>{{ reportTitle !== '' ? reportTitle : 'Mock Harvest Report' }}</h1>
</div>


<h2>Harvest Report Form</h2>
<form>
<form>
<label for="crop">Crop:</label>
<select id="crop" name="crop" v-model="selectedCrop">
<option v-for="crop in crops" :value="crop">{{ crop }}</option>
</select><br><br>
<label for="field">Area:</label>
<!-- Dropdown for the list of areas -->
<select id="field" name="field" v-model="selectedArea">
<option v-for="area in areas" :value="area">{{ area }}</option>
</select><br><br>
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" name="startDate" v-model="reportStartDate" min="2014-01-01" max="2022-01-01" value="2020-05-05"><br><br>
<label for="endDate">End Date:</label>
<input type="date" id="endDate" name="endDate" v-model="reportEndDate" min="2020-05-05" max="2022-01-01" value="2020-05-15"><br><br>
<label for="title">Title:</label><br>
<input type="text" id="title" name="title" v-model="reportTitle"><br><br>
<input type="submit" value="Generate Report">
</form>
</form>


<hr>
<h2>Actual Report</h2>
<table>
<tr>
<th>Date</th>
<th>Field</th>
<th>Crop</th>
<th>Quantity (lbs)</th>
<th>Worker</th>
</tr>
<tr v-for="log in harvestLogs">
<td>{{ log.date }}</td>
<td>{{ log.area }}</td>
<td>{{ log.crop }}</td>
<td>{{ log.quantity }}</td>
<td>{{ log.worker }}</td>
</tr>
</table>

<script src="https://unpkg.com/vue@2"></script>
<script>
var app = new Vue({
el: '#app',
data: {
reportStartDate: '',
reportEndDate: '',
selectedCrop: '',
selectedArea: '',
reportTitle: '',
crops: ["Broccoli", "Kale", "Peas"],
areas: ["Chuau-1", "SQ7"],
harvestLogs: [
{ date: "2020-05-01", area: "Chuau-1", crop: "Kale", quantity: 50, worker: "John Doe" },
{ date: "2020-05-05", area: "SQ7", crop: "Broccoli", quantity: 40, worker: "Jane Smith" },
{ date: "2020-05-10", area: "Chuau-1", crop: "Peas", quantity: 30, worker: "Michael Johnson" }
]
}
});
Vue.config.devtools = true;

</script>
</body>
</html>






105 changes: 105 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue1 Harvest Report</title>
<style>
[v-cloak] {
display: none;
}
</style>
</head>
<body>

<div id="app" v-cloak>
<input type="date" v-model="reportStartDate" :max="reportEndDate">
<input type="date" v-model="reportEndDate" :min="reportStartDate">
<select v-model="selectedCrop">
<option v-for="crop in crops" :value="crop">{{ crop }}</option>
</select>
<select v-model="selectedArea">
<option v-for="area in areas" :value="area">{{ area }}</option>
</select>

<h3>Report Start Date: {{ reportStartDate }}</h3>
<h3>Report End Date: {{ reportEndDate }}</h3>
<h3>Selected Crop: {{ selectedCrop }}</h3>
<h3>Selected Area: {{ selectedArea }}</h3>

<label for="title">Title:</label>
<input type="text" id="title" name="title" v-model="reportTitle"><br><br>
<h1>{{ reportTitle !== '' ? reportTitle : 'Mock Harvest Report' }}</h1>
</div>


<h2>Harvest Report Form</h2>
<form>
<label for="crop">Crop:</label>
<select id="crop" name="crop" v-model="selectedCrop">
<option v-for="crop in crops" :value="crop">{{ crop }}</option>
</select><br><br>
<label for="field">Area:</label>

<select id="field" name="field" v-model="selectedArea">
<option v-for="area in areas" :value="area">{{ area }}</option>
</select><br><br>
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" name="startDate" v-model="reportStartDate" :max="reportEndDate"><br><br>
<label for="endDate">End Date:</label>
<input type="date" id="endDate" name="endDate" v-model="reportEndDate" :min="reportStartDate"><br><br>
<label for="title">Title:</label><br>
<input type="text" id="title" name="title" v-model="reportTitle"><br><br>
<input type="button" value="Generate Report" @click="generateReport">
</form>


<hr>
<h2>Actual Report</h2>
<table>
<tr>
<th>Date</th>
<th>Field</th>
<th>Crop</th>
<th>Yields</th>
<th>Unit</th>
</tr>
<tr v-for="log in harvestLogs">
<td>{{ log.date }}</td>
<td>{{ log.area }}</td>
<td>{{ log.crop }}</td>
<td>{{ log.yields }}</td>
<td>{{ log.unit }}</td>
</tr>
</table>

<script src="https://unpkg.com/vue@2"></script>
<script>
var app = new Vue({
el: '#app',
data: {
reportStartDate: '',
reportEndDate: '',
selectedCrop: '',
selectedArea: '',
reportTitle: '',
crops: ["Broccoli", "Kale", "Peas"],
areas: ["Chuau-1", "SQ7"],
harvestLogs: []
},
methods: {
generateReport: function() {
this.harvestLogs.push({
date: '',
area: '',
crop: '',
yields: '',
unit: ''
});
}
}
});
</script>
</body>
</html>