Skip to content
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
b146527
Added HTML sub-tab to FD2 School Tab
DSonBuss Apr 11, 2025
2535ec7
Added sample Harvest Report text to the HTML sub-tab of the FD2 Schoo…
DSonBuss Apr 13, 2025
dcb8905
Added nonfunctional Title input and Generate Report buttons to the FD…
DSonBuss Apr 14, 2025
fa8c8a2
Added Crop input to the FD2School HTML sub-tab
DSonBuss Apr 16, 2025
5169d11
Added Field input to the FD2School HTML sub-tab
DSonBuss Apr 16, 2025
0d4d800
Added start and end date imputs to the FD2School HTML sub-tab
DSonBuss Apr 16, 2025
9a34ff9
Rearranged the elements on the FD2School HTML sub-tab to be more in l…
DSonBuss Apr 16, 2025
5627308
Added sample harvest report data table to the bottom of the FD2School…
DSonBuss Apr 16, 2025
5b24f37
Added Vue1 sub-tab to the FD2School tab
DSonBuss Apr 17, 2025
90b9d88
Added basic Vue capabilities to the FD2School Vue1 sub-tab, including…
DSonBuss Apr 17, 2025
37e0741
Updated the FD2-School Vue1 subtab so that the date and crop input el…
DSonBuss May 3, 2025
d09199c
Added a placeholder report title in the case that the harvest report …
DSonBuss May 3, 2025
72d9bcf
Changed the crop and area dropdown inputs so that options are generat…
DSonBuss May 3, 2025
54caea8
Changed the harvest report table is generated from an array of object…
DSonBuss May 3, 2025
5e1447d
Added Vue DevTools compatibility to the FD2-School Vue1 sub-tab
DSonBuss May 3, 2025
ce206a3
Merge branch 'main' into MatthewBuss-03-Vue1
DSonBuss May 4, 2025
2868864
Added Vue2 sub-tab to the FD2-School tab
DSonBuss May 4, 2025
10f4548
Made the harvest report table in the FD2-School Vue2 sub-tab start em…
DSonBuss May 4, 2025
532b5af
Abstracted the update functionality of the harvest report table to a …
DSonBuss May 4, 2025
fa0e437
Added row column to the harvest report table
DSonBuss May 4, 2025
d3b23c5
Added column of Delete buttons to the harvest report table that remov…
DSonBuss May 4, 2025
b62c4f1
Gave the harvest report table a default state that indicates there ar…
DSonBuss May 4, 2025
b62827e
Restricted the date input elements to prevent the start date coming a…
DSonBuss May 4, 2025
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
30 changes: 30 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/fd2_school.module
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ function fd2_school_menu() {
);

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

// Add a sub-tab named HTML with content in ./html/html.html.
$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,
);

// Add a sub-tab named Vue1 with content in ./vue1/vue1.html.
$items['farm/fd2-school/vue1'] = array(
'title' => 'Vue1',
'type' => MENU_LOCAL_TASK,
'page callback' => 'fd2_school_view',
'page arguments' => array('vue1'),
'access arguments' => array('view fd2 school'),
'weight' => 110,
);

// Add a sub-tab named Vue2 with content in ./vue2/vue2.html.
$items['farm/fd2-school/vue2'] = array(
'title' => 'Vue2',
'type' => MENU_LOCAL_TASK,
'page callback' => 'fd2_school_view',
'page arguments' => array('vue2'),
'access arguments' => array('view fd2 school'),
'weight' => 110,
);

return $items;
};
Expand Down
82 changes: 82 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/html/html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>

<label for=”title”>Title:</label>
<input type="text" id="title" name="title"
value="My Sample Harvest Report"/>
<br><br>
<label for="start"> Start: </label>
<input
type="date"
id="start"
name="start"
value="2020-05-05"
min="2014-01-01"
max="2022-01-01" />

<label for="end"> End: </label>
<input
type="date"
id="end"
name="end"
value="2020-05-15"
min="2020-05-05"
max="2022-01-01" />

<br><br>

<label for="crop"> Crop: </label>
<select id="crop" name="crop">
<option>Broccoli</option>
<option selected>Kale</option>
<option>Peas</option>
</select>

<label for="field"> Area: </label>
<select id="field" name="field">
<option selected>All</option>
<option>Chuau-1</option>
<option>SQ7</option>
</select>

<br><br>
<input type="button" value="Generate Report" />

<hr>

<h1>My Sample Harvest Report</h1>
<p>Details:
<ul>
<li><b>Farm:</b>Sample Farm</li>
<li><b>User:</b>manager1</li>
<li><b>Language:</b>English</li>
<br>
<li><b>Start:</b>05/01/2018</li>
<li><b>End:</b>05/15/2018</li>
<li><b>Crop:</b>Kale</li>
</ul>
</p>

<table border="1">
<tr>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
</tr>
<tr>
<td>05/02/2011</td>
<td>Chuau-1</td>
<td>Kale</td>
<td>10</td>
<td>Bunches</td>
</tr>
<tr>
<td>05/05/2011</td>
<td>SQ7</td>
<td>Kale</td>
<td>7</td>
<td>Bunches</td>
</tr>
</table>
101 changes: 101 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/vue1/vue1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<div v-cloak id="harvest-report">
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>

<label for=”title”>Title:</label>

<input type="text" id="title" name="title"
value="My Sample Harvest Report" v-model="reportTitle"/>
<br><br>
<label for="start"> Start: </label>
<input v-model="startDate"
type="date"
id="start"
name="start"
min="2014-01-01"
max="2022-01-01" />

<label for="end"> End: </label>
<input v-model="endDate"
type="date"
id="end"
name="end"
min="2020-05-05"
max="2022-01-01" />

<br><br>

<label for="crop"> Crop: </label>
<select id="crop" name="crop" v-model="crop">
<option v-for="cropOption in crops"> {{cropOption}}</option>
</select>

<label for="field"> Area: </label>
<select id="field" name="field">
<option v-for="area in areas"> {{area}} </option>
</select>

<br><br>
<input type="button" value="Generate Report" />

<hr>

<h1> {{reportTitle=="" ? "Mock Harvest Report" : reportTitle}} </h1>
<p>Details:
<ul>
<li><b>Farm:</b>Sample Farm</li>
<li><b>User:</b>manager1</li>
<li><b>Language:</b>English</li>
<br>
<li><b>Start:</b>{{startDate}}</li>
<li><b>End:</b>{{endDate}}</li>
<li><b>Crop:</b>{{crop}}</li>
</ul>
</p>

<table border="1">
<tr>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
</tr>
<tr v-for="report in reports">
<td>{{report.date}}</td>
<td>{{report.area}}</td>
<td>{{report.crop}}</td>
<td>{{report.yield}}</td>
<td>{{report.units}}</td>
</tr>
</table>
</div>

<script>
var vue = new Vue({
el: "#harvest-report",
data: {
reportTitle: "My Sample Harvest Report",
startDate: "2020-05-05",
endDate: "2020-05-15",
crop: "Kale",
crops: [
"Broccoli",
"Kale",
"Peas",
],
areas: [
"All",
"Chuau-1",
"SQ7",
],
reports: [
{date: "2018-05-02", area: "Chuau-1", crop: "Kale", yield: 10, units: "Bunches"},
{date: "2018-05-05", area: "SQ7", crop: "Kale", yield: 7, units: "Bunches"},
],
}

})

Vue.config.devtools = true;
</script>
114 changes: 114 additions & 0 deletions farmdata2/farmdata2_modules/fd2_school/vue2/vue2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<div v-cloak id="harvest-report">
<h1>Harvest Report</h1>
<p>This page is a <i>mockup</i> of a simplified harvest report.</p>

<label for=”title”>Title:</label>

<input type="text" id="title" name="title"
value="My Sample Harvest Report" v-model="reportTitle"/>
<br><br>
<label for="start"> Start: </label>
<input v-model="startDate"
type="date"
id="start"
name="start"
min="2014-01-01"
:max="endDate"/>

<label for="end"> End: </label>
<input v-model="endDate"
type="date"
id="end"
name="end"
:min="startDate"
max="2022-01-01" />

<br><br>

<label for="crop"> Crop: </label>
<select id="crop" name="crop" v-model="crop">
<option v-for="cropOption in crops"> {{cropOption}}</option>
</select>

<label for="field"> Area: </label>
<select id="field" name="field">
<option v-for="area in areas"> {{area}} </option>
</select>

<br><br>
<input type="button" value="Generate Report" @click="saveReport"/>

<hr>

<h1> {{reportTitle=="" ? "Mock Harvest Report" : reportTitle}} </h1>
<p>Details:
<ul>
<li><b>Farm:</b>Sample Farm</li>
<li><b>User:</b>manager1</li>
<li><b>Language:</b>English</li>
<br>
<li><b>Start:</b>{{startDate}}</li>
<li><b>End:</b>{{endDate}}</li>
<li><b>Crop:</b>{{crop}}</li>
</ul>
</p>

<table border="1">
<tr v-if="reports == ''"> <th>There are no matching records!</th></tr>
<tr v-else>
<th>Row</th>
<th>Date</th>
<th>Area</th>
<th>Crop</th>
<th>Yield</th>
<th>Units</th>
<th>Delete</th>
</tr>

<tr v-for="(report, index) in reports">
<td>{{index + 1}}</td>
<td>{{report.date }}</td>
<td>{{report.area}}</td>
<td>{{report.crop}}</td>
<td>{{report.yield}}</td>
<td>{{report.units}}</td>
<td> <input type="button" value="Delete" @click="deleteReport(index)"/> </td>
</tr>
</table>
</div>

<script>
var vue = new Vue({
el: "#harvest-report",
data: {
reportTitle: "My Sample Harvest Report",
startDate: "2020-05-05",
endDate: "2020-05-15",
crop: "Kale",
crops: [
"Broccoli",
"Kale",
"Peas",
],
areas: [
"All",
"Chuau-1",
"SQ7",
],
reports: [

],
},
methods: {
saveReport: function() {
this.reports.push({date: "2018-05-02", area: "Chuau-1", crop: "Kale", yield: 10, units: "Bunches"})
},
deleteReport: function(index) {
this.reports.splice(index, 1)
}
}

})

Vue.config.devtools = true;
</script>