72 lines
2.8 KiB
HTML
72 lines
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>MerchantsOfHope.org - Test Page</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 20px;
|
|
}
|
|
.job-card {
|
|
border: 1px solid #ccc;
|
|
border-radius: 8px;
|
|
padding: 1rem;
|
|
margin-bottom: 1rem;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.btn {
|
|
display: inline-block;
|
|
padding: 10px 20px;
|
|
background-color: #0072ce;
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 4px;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 1rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>MerchantsOfHope.org - Job Listings Test</h1>
|
|
<p>This page simulates what the JavaScript would render by fetching data from the API.</p>
|
|
|
|
<div id="job-listings">
|
|
<p>Loading job listings...</p>
|
|
</div>
|
|
|
|
<script>
|
|
// Simulate what the JavaScript would do
|
|
fetch('http://192.168.3.6:20001/positions')
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
const jobListingsContainer = document.getElementById('job-listings');
|
|
jobListingsContainer.innerHTML = '';
|
|
|
|
if (data.positions && data.positions.length > 0) {
|
|
data.positions.forEach(position => {
|
|
const jobCard = document.createElement('div');
|
|
jobCard.className = 'job-card';
|
|
jobCard.innerHTML = `
|
|
<h4>${position.title || 'Untitled Position'}</h4>
|
|
<p>TSYS Group • ${position.location || 'Location'}</p>
|
|
<p>${position.description || 'No description available.'}</p>
|
|
<p><strong>Salary Range:</strong> $${parseInt(position.salary_min).toLocaleString()} - $${parseInt(position.salary_max).toLocaleString()}</p>
|
|
<a href="/positions/${position.id || '#'}" class="btn">View Details</a>
|
|
`;
|
|
jobListingsContainer.appendChild(jobCard);
|
|
});
|
|
} else {
|
|
jobListingsContainer.innerHTML = '<p>No job positions available at this time. Please check back later.</p>';
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('Error fetching job listings:', error);
|
|
const jobListingsContainer = document.getElementById('job-listings');
|
|
jobListingsContainer.innerHTML = '<p>Error loading job listings. Please try again later.</p>';
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |