Crazyka51 commited on
Commit
5da5117
·
verified ·
1 Parent(s): 52fe4a0

Add functions to allow you to upload template files next js and their format, such as typescript and so on. - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +101 -0
index.html CHANGED
@@ -112,6 +112,16 @@
112
  <span>Categories</span>
113
  </a>
114
 
 
 
 
 
 
 
 
 
 
 
115
  <div class="py-2 mt-4 text-gray-400 uppercase text-xs font-semibold tracking-wider">System</div>
116
  <a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded-lg">
117
  <i class="fas fa-users mr-3"></i>
@@ -343,6 +353,13 @@
343
  </div>
344
  <i class="fas fa-chevron-right"></i>
345
  </button>
 
 
 
 
 
 
 
346
  </div>
347
  </div>
348
  </div>
@@ -463,7 +480,91 @@
463
  </div>
464
  </div>
465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
466
  <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  // Toggle sidebar collapse
468
  const sidebarToggle = document.getElementById('sidebarToggle');
469
  const sidebar = document.querySelector('.sidebar');
 
112
  <span>Categories</span>
113
  </a>
114
 
115
+ <div class="py-2 mt-4 text-gray-400 uppercase text-xs font-semibold tracking-wider">Templates</div>
116
+ <a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded-lg">
117
+ <i class="fas fa-file-code mr-3"></i>
118
+ <span>Template Files</span>
119
+ </a>
120
+ <a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded-lg">
121
+ <i class="fas fa-upload mr-3"></i>
122
+ <span>Upload Templates</span>
123
+ </a>
124
+
125
  <div class="py-2 mt-4 text-gray-400 uppercase text-xs font-semibold tracking-wider">System</div>
126
  <a href="#" class="flex items-center px-4 py-3 text-gray-300 hover:text-white hover:bg-gray-700 rounded-lg">
127
  <i class="fas fa-users mr-3"></i>
 
353
  </div>
354
  <i class="fas fa-chevron-right"></i>
355
  </button>
356
+ <button class="w-full flex items-center justify-between px-4 py-3 bg-indigo-50 text-indigo-600 rounded-lg hover:bg-indigo-100">
357
+ <div class="flex items-center">
358
+ <i class="fas fa-file-code mr-3"></i>
359
+ <span>Upload Template</span>
360
+ </div>
361
+ <i class="fas fa-chevron-right"></i>
362
+ </button>
363
  </div>
364
  </div>
365
  </div>
 
480
  </div>
481
  </div>
482
 
483
+ <!-- Template Upload Modal -->
484
+ <div id="templateModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
485
+ <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
486
+ <div class="p-6 border-b border-gray-200">
487
+ <h3 class="text-lg font-semibold text-gray-800">Upload Template Files</h3>
488
+ </div>
489
+ <div class="p-6">
490
+ <div class="mb-4">
491
+ <label class="block text-gray-700 text-sm font-medium mb-2">Template Type</label>
492
+ <select class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
493
+ <option>Next.js</option>
494
+ <option>React</option>
495
+ <option>Vue</option>
496
+ <option>Angular</option>
497
+ </select>
498
+ </div>
499
+ <div class="mb-4">
500
+ <label class="block text-gray-700 text-sm font-medium mb-2">File Format</label>
501
+ <select class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
502
+ <option>TypeScript (.tsx)</option>
503
+ <option>JavaScript (.jsx)</option>
504
+ <option>CSS Modules (.module.css)</option>
505
+ <option>SCSS (.scss)</option>
506
+ </select>
507
+ </div>
508
+ <div class="mb-6">
509
+ <label class="block text-gray-700 text-sm font-medium mb-2">Upload Files</label>
510
+ <div class="border-2 border-dashed border-gray-300 rounded-md p-6 text-center">
511
+ <i class="fas fa-file-upload text-3xl text-gray-400 mb-2"></i>
512
+ <p class="text-sm text-gray-500">Drag and drop files here or click to browse</p>
513
+ <input type="file" class="hidden" id="templateUpload" multiple>
514
+ <button class="mt-3 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 text-sm" onclick="document.getElementById('templateUpload').click()">
515
+ Select Files
516
+ </button>
517
+ </div>
518
+ </div>
519
+ <div class="flex justify-end space-x-3">
520
+ <button onclick="document.getElementById('templateModal').classList.add('hidden')" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">
521
+ Cancel
522
+ </button>
523
+ <button class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">
524
+ Upload Templates
525
+ </button>
526
+ </div>
527
+ </div>
528
+ </div>
529
+ </div>
530
+
531
  <script>
532
+ // Template upload functionality
533
+ document.querySelectorAll('[href="#"], button').forEach(btn => {
534
+ if (btn.textContent.includes('Upload Template') || btn.textContent.includes('Upload Templates')) {
535
+ btn.addEventListener('click', () => {
536
+ document.getElementById('templateModal').classList.remove('hidden');
537
+ });
538
+ }
539
+ });
540
+
541
+ // Handle file selection display
542
+ document.getElementById('templateUpload').addEventListener('change', function(e) {
543
+ const files = e.target.files;
544
+ if (files.length > 0) {
545
+ const fileList = document.createElement('div');
546
+ fileList.className = 'mt-3 text-sm text-left';
547
+
548
+ for (let i = 0; i < files.length; i++) {
549
+ const fileItem = document.createElement('div');
550
+ fileItem.className = 'flex items-center py-1';
551
+ fileItem.innerHTML = `
552
+ <i class="fas fa-file-code text-gray-500 mr-2"></i>
553
+ <span>${files[i].name}</span>
554
+ <span class="ml-auto text-xs text-gray-500">${(files[i].size / 1024).toFixed(2)} KB</span>
555
+ `;
556
+ fileList.appendChild(fileItem);
557
+ }
558
+
559
+ const uploadContainer = document.querySelector('.border-dashed');
560
+ const existingList = uploadContainer.querySelector('.text-left');
561
+ if (existingList) {
562
+ uploadContainer.replaceChild(fileList, existingList);
563
+ } else {
564
+ uploadContainer.appendChild(fileList);
565
+ }
566
+ }
567
+ });
568
  // Toggle sidebar collapse
569
  const sidebarToggle = document.getElementById('sidebarToggle');
570
  const sidebar = document.querySelector('.sidebar');