undefined / new-app.html
IngStrange's picture
add form for new app
bfa0bcc verified
Raw
History Blame Contribute Delete
14.9 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AppVoyage - New App</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.active-nav-item {
background: rgba(124, 58, 237, 0.1);
border-left: 4px solid #7c3aed;
}
.file-upload {
border: 2px dashed #d1d5db;
transition: all 0.3s;
}
.file-upload:hover {
border-color: #7c3aed;
background-color: rgba(124, 58, 237, 0.05);
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
<div class="flex items-center justify-center h-16 px-4 border-b border-gray-200">
<div class="flex items-center">
<i data-feather="box" class="w-6 h-6 text-purple-600"></i>
<span class="ml-2 text-xl font-bold text-gray-800">AppVoyage</span>
</div>
</div>
<div class="flex-1 overflow-y-auto">
<nav class="px-4 py-6 space-y-1">
<a href="dashboard.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="home" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Dashboard
</a>
<a href="apps.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="grid" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Apps
</a>
<a href="users.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="users" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Users
</a>
<a href="#" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="settings" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Settings
</a>
</nav>
</div>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<img class="h-9 w-9 rounded-full" src="http://static.photos/people/200x200/10" alt="User avatar">
<div class="ml-3">
<p class="text-sm font-medium text-gray-700">John Doe</p>
<a href="#" class="text-xs font-medium text-purple-600 hover:text-purple-500">Sign out</a>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex-1 overflow-auto">
<header class="bg-white shadow-sm">
<div class="flex justify-between items-center px-6 py-4">
<h1 class="text-2xl font-semibold text-gray-800">Add New App</h1>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200">
<i data-feather="bell"></i>
</button>
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200">
<i data-feather="help-circle"></i>
</button>
</div>
</div>
</header>
<main class="p-6">
<form id="appForm" class="space-y-6">
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Basic Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="appName" class="block text-sm font-medium text-gray-700 mb-1">App Name</label>
<input type="text" id="appName" name="appName" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
<div>
<label for="appType" class="block text-sm font-medium text-gray-700 mb-1">App Type</label>
<select id="appType" name="appType" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="">Select type</option>
<option value="web">Web App</option>
<option value="mobile">Mobile App</option>
<option value="ussd">USSD</option>
<option value="api">API</option>
</select>
</div>
<div>
<label for="appUrl" class="block text-sm font-medium text-gray-700 mb-1">App URL</label>
<input type="url" id="appUrl" name="appUrl"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
placeholder="https://">
</div>
<div>
<label for="appStatus" class="block text-sm font-medium text-gray-700 mb-1">Status</label>
<select id="appStatus" name="appStatus"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="active">Active</option>
<option value="inactive">Inactive</option>
<option value="development">In Development</option>
</select>
</div>
</div>
<div class="mt-6">
<label for="appDescription" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
<textarea id="appDescription" name="appDescription" rows="3"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"></textarea>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">App Images</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="file-upload p-6 rounded-lg text-center cursor-pointer">
<input type="file" id="appLogo" name="appLogo" accept="image/*" class="hidden">
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="upload" class="w-10 h-10 text-gray-400 mb-2"></i>
<p class="text-sm text-gray-500">Upload Logo (PNG, JPG)</p>
<p class="text-xs text-gray-400 mt-1">Recommended: 200x200 px</p>
</div>
</div>
<div class="file-upload p-6 rounded-lg text-center cursor-pointer">
<input type="file" id="appScreenshot" name="appScreenshot" accept="image/*" class="hidden">
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="image" class="w-10 h-10 text-gray-400 mb-2"></i>
<p class="text-sm text-gray-500">Upload Screenshot</p>
<p class="text-xs text-gray-400 mt-1">Recommended: 16:9 ratio</p>
</div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Additional Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="appCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
<select id="appCategory" name="appCategory"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="finance">Finance</option>
<option value="health">Health</option>
<option value="education">Education</option>
<option value="ecommerce">E-commerce</option>
<option value="entertainment">Entertainment</option>
<option value="utility">Utility</option>
</select>
</div>
<div>
<label for="appTags" class="block text-sm font-medium text-gray-700 mb-1">Tags</label>
<input type="text" id="appTags" name="appTags"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
placeholder="Separate tags with commas">
</div>
<div>
<label for="appOwner" class="block text-sm font-medium text-gray-700 mb-1">Owner/Team</label>
<input type="text" id="appOwner" name="appOwner"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
<div>
<label for="appLaunchDate" class="block text-sm font-medium text-gray-700 mb-1">Launch Date</label>
<input type="date" id="appLaunchDate" name="appLaunchDate"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
</div>
</div>
<div class="flex justify-end space-x-3">
<button type="button" class="px-6 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
Cancel
</button>
<button type="submit" class="px-6 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500">
Save App
</button>
</div>
</form>
</main>
</div>
</div>
<script>
feather.replace();
// Handle file upload UI
document.querySelectorAll('.file-upload').forEach(uploadDiv => {
const fileInput = uploadDiv.querySelector('input[type="file"]');
uploadDiv.addEventListener('click', () => fileInput.click());
fileInput.addEventListener('change', (e) => {
if (e.target.files.length > 0) {
uploadDiv.innerHTML = `
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="check-circle" class="w-10 h-10 text-green-500 mb-2"></i>
<p class="text-sm text-gray-700">${e.target.files[0].name}</p>
<p class="text-xs text-gray-500 mt-1">${(e.target.files[0].size / 1024).toFixed(2)} KB</p>
</div>
`;
feather.replace();
}
});
});
// Form submission
document.getElementById('appForm').addEventListener('submit', function(e) {
e.preventDefault();
Swal.fire({
title: 'App Created!',
text: 'Your new app has been added successfully.',
icon: 'success',
confirmButtonText: 'OK',
confirmButtonColor: '#7c3aed'
}).then(() => {
window.location.href = 'apps.html';
});
});
</script>
</body>
</html>