diff --git a/media/attendance_files/2025/01/26/Attendance.pdf b/media/attendance_files/attendance_0c97e6f8-b729-4c69-ba01-15228935f27c.pdf similarity index 100% rename from media/attendance_files/2025/01/26/Attendance.pdf rename to media/attendance_files/attendance_0c97e6f8-b729-4c69-ba01-15228935f27c.pdf diff --git a/media/resolution_files/2025/01/26/Resulation.pdf b/media/attendance_files/attendance_1b92e9a7-8f29-4af4-9ad1-47ae41e74c33.pdf similarity index 100% rename from media/resolution_files/2025/01/26/Resulation.pdf rename to media/attendance_files/attendance_1b92e9a7-8f29-4af4-9ad1-47ae41e74c33.pdf diff --git a/media/attendance_files/attendance_1c6390d8-adfe-481c-a2cd-fc8476d1c225.pdf b/media/attendance_files/attendance_1c6390d8-adfe-481c-a2cd-fc8476d1c225.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/attendance_files/attendance_1c6390d8-adfe-481c-a2cd-fc8476d1c225.pdf differ diff --git a/media/attendance_files/attendance_6984e06c-ee28-41ff-9823-ff4344a6d37f.pdf b/media/attendance_files/attendance_6984e06c-ee28-41ff-9823-ff4344a6d37f.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/attendance_files/attendance_6984e06c-ee28-41ff-9823-ff4344a6d37f.pdf differ diff --git a/media/attendance_files/attendance_9f414abd-7adf-4fdd-9208-47769216ed85.pdf b/media/attendance_files/attendance_9f414abd-7adf-4fdd-9208-47769216ed85.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/attendance_files/attendance_9f414abd-7adf-4fdd-9208-47769216ed85.pdf differ diff --git a/media/attendance_files/attendance_bbf94d2c-9cc5-4eff-a28e-2bc8fb801761.pdf b/media/attendance_files/attendance_bbf94d2c-9cc5-4eff-a28e-2bc8fb801761.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/attendance_files/attendance_bbf94d2c-9cc5-4eff-a28e-2bc8fb801761.pdf differ diff --git a/media/resolution_files/res_con_0f1191a5-307b-4722-b89b-3d7a6bd0b4c6.pdf b/media/resolution_files/res_con_0f1191a5-307b-4722-b89b-3d7a6bd0b4c6.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/resolution_files/res_con_0f1191a5-307b-4722-b89b-3d7a6bd0b4c6.pdf differ diff --git a/media/resolution_files/res_con_7ffe081b-5ce6-4966-97a6-60b2f3caddec.pdf b/media/resolution_files/res_con_7ffe081b-5ce6-4966-97a6-60b2f3caddec.pdf new file mode 100644 index 0000000..ab2f67d Binary files /dev/null and b/media/resolution_files/res_con_7ffe081b-5ce6-4966-97a6-60b2f3caddec.pdf differ diff --git a/media/resolution_files/res_con_9f9a48cc-190e-4ffa-a849-3e6ca9b52467.pdf b/media/resolution_files/res_con_9f9a48cc-190e-4ffa-a849-3e6ca9b52467.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/resolution_files/res_con_9f9a48cc-190e-4ffa-a849-3e6ca9b52467.pdf differ diff --git a/media/resolution_files/res_con_c806c1aa-5e74-45ae-821b-02bfae98333c.pdf b/media/resolution_files/res_con_c806c1aa-5e74-45ae-821b-02bfae98333c.pdf new file mode 100644 index 0000000..7ddcbe5 Binary files /dev/null and b/media/resolution_files/res_con_c806c1aa-5e74-45ae-821b-02bfae98333c.pdf differ diff --git a/media/resolution_files/res_con_da006cd1-758e-4922-84b2-143d8df0ca9c.pdf b/media/resolution_files/res_con_da006cd1-758e-4922-84b2-143d8df0ca9c.pdf new file mode 100644 index 0000000..86c87c5 Binary files /dev/null and b/media/resolution_files/res_con_da006cd1-758e-4922-84b2-143d8df0ca9c.pdf differ diff --git a/media/resolution_files/res_con_e1bab1de-30a6-47c5-a13e-beb8bc4026e6.pdf b/media/resolution_files/res_con_e1bab1de-30a6-47c5-a13e-beb8bc4026e6.pdf new file mode 100644 index 0000000..86c87c5 Binary files /dev/null and b/media/resolution_files/res_con_e1bab1de-30a6-47c5-a13e-beb8bc4026e6.pdf differ diff --git a/misdghs/__pycache__/__init__.cpython-311.pyc b/misdghs/__pycache__/__init__.cpython-311.pyc index d452e94..dc8d1e0 100644 Binary files a/misdghs/__pycache__/__init__.cpython-311.pyc and b/misdghs/__pycache__/__init__.cpython-311.pyc differ diff --git a/misdghs/__pycache__/settings.cpython-311.pyc b/misdghs/__pycache__/settings.cpython-311.pyc index b45df6a..8a40470 100644 Binary files a/misdghs/__pycache__/settings.cpython-311.pyc and b/misdghs/__pycache__/settings.cpython-311.pyc differ diff --git a/misdghs/__pycache__/urls.cpython-311.pyc b/misdghs/__pycache__/urls.cpython-311.pyc index 0fc6d76..0c4adad 100644 Binary files a/misdghs/__pycache__/urls.cpython-311.pyc and b/misdghs/__pycache__/urls.cpython-311.pyc differ diff --git a/misdghs/__pycache__/wsgi.cpython-311.pyc b/misdghs/__pycache__/wsgi.cpython-311.pyc index 2e68500..eb5ac91 100644 Binary files a/misdghs/__pycache__/wsgi.cpython-311.pyc and b/misdghs/__pycache__/wsgi.cpython-311.pyc differ diff --git a/misdghs/settings.py b/misdghs/settings.py index 80aa826..a35aa1e 100644 --- a/misdghs/settings.py +++ b/misdghs/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = 'django-insecure-t%o4!$(z&7*ft5zradmq(aqr^a8_p)5fn=okyvr76!n1de81oh # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["localhost", "127.0.0.1"] # Application definition @@ -120,18 +120,20 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.1/howto/static-files/ + +# Static files (CSS, JavaScript, Images) +# ---------------------------- STATIC_URL = '/static/' +STATIC_ROOT = BASE_DIR / 'staticfiles' # This is where collectstatic will place static files STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'static'), + BASE_DIR / 'static', # Development static files location ] -STATICFILES_DIRS = [ - BASE_DIR / "media", -] +# Media files (User uploads) +# --------------------------- +MEDIA_URL = '/media/' +MEDIA_ROOT = BASE_DIR / 'media' -MEDIA_ROOT=BASE_DIR/'media' -MEDIA_URL="/media/" -STATIC_ROOT=BASE_DIR/'static' diff --git a/resulation/__pycache__/__init__.cpython-311.pyc b/resulation/__pycache__/__init__.cpython-311.pyc index cb639b0..9c593ac 100644 Binary files a/resulation/__pycache__/__init__.cpython-311.pyc and b/resulation/__pycache__/__init__.cpython-311.pyc differ diff --git a/resulation/__pycache__/admin.cpython-311.pyc b/resulation/__pycache__/admin.cpython-311.pyc index c98fea7..6807a92 100644 Binary files a/resulation/__pycache__/admin.cpython-311.pyc and b/resulation/__pycache__/admin.cpython-311.pyc differ diff --git a/resulation/__pycache__/apps.cpython-311.pyc b/resulation/__pycache__/apps.cpython-311.pyc index be48ec6..c4cbb5d 100644 Binary files a/resulation/__pycache__/apps.cpython-311.pyc and b/resulation/__pycache__/apps.cpython-311.pyc differ diff --git a/resulation/__pycache__/models.cpython-311.pyc b/resulation/__pycache__/models.cpython-311.pyc index e5faa79..34e05f2 100644 Binary files a/resulation/__pycache__/models.cpython-311.pyc and b/resulation/__pycache__/models.cpython-311.pyc differ diff --git a/resulation/__pycache__/urls.cpython-311.pyc b/resulation/__pycache__/urls.cpython-311.pyc index 02251c4..b789b9a 100644 Binary files a/resulation/__pycache__/urls.cpython-311.pyc and b/resulation/__pycache__/urls.cpython-311.pyc differ diff --git a/resulation/__pycache__/views.cpython-311.pyc b/resulation/__pycache__/views.cpython-311.pyc index 40a9be9..e25a3e6 100644 Binary files a/resulation/__pycache__/views.cpython-311.pyc and b/resulation/__pycache__/views.cpython-311.pyc differ diff --git a/resulation/migrations/0007_alter_resulation_m_venue_alter_resulation_tittle.py b/resulation/migrations/0007_alter_resulation_m_venue_alter_resulation_tittle.py new file mode 100644 index 0000000..c8c34ed --- /dev/null +++ b/resulation/migrations/0007_alter_resulation_m_venue_alter_resulation_tittle.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-27 15:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resulation', '0006_rename_savepdf_resulation'), + ] + + operations = [ + migrations.AlterField( + model_name='resulation', + name='m_venue', + field=models.CharField(blank=True, max_length=250, null=True), + ), + migrations.AlterField( + model_name='resulation', + name='tittle', + field=models.CharField(blank=True, max_length=250, null=True), + ), + ] diff --git a/resulation/migrations/0008_alter_resulation_attendance_file_and_more.py b/resulation/migrations/0008_alter_resulation_attendance_file_and_more.py new file mode 100644 index 0000000..cb44c25 --- /dev/null +++ b/resulation/migrations/0008_alter_resulation_attendance_file_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-28 06:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resulation', '0007_alter_resulation_m_venue_alter_resulation_tittle'), + ] + + operations = [ + migrations.AlterField( + model_name='resulation', + name='attendance_file', + field=models.FileField(blank=True, upload_to='attendance_files/'), + ), + migrations.AlterField( + model_name='resulation', + name='res_con_mou_file', + field=models.FileField(blank=True, upload_to='res_con_mou_files/'), + ), + ] diff --git a/resulation/migrations/0009_alter_resulation_attendance_file_and_more.py b/resulation/migrations/0009_alter_resulation_attendance_file_and_more.py new file mode 100644 index 0000000..07767e2 --- /dev/null +++ b/resulation/migrations/0009_alter_resulation_attendance_file_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.5 on 2025-01-28 09:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resulation', '0008_alter_resulation_attendance_file_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='resulation', + name='attendance_file', + field=models.CharField(blank=True, max_length=250, null=True), + ), + migrations.AlterField( + model_name='resulation', + name='res_con_mou_file', + field=models.CharField(blank=True, max_length=250, null=True), + ), + ] diff --git a/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc b/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc index 0902d2d..ae94248 100644 Binary files a/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc and b/resulation/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc index a2e88a2..836c973 100644 Binary files a/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0002_remove_savepdf_minutes_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc index 64ebe98..eb7a311 100644 Binary files a/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc and b/resulation/migrations/__pycache__/0003_alter_savepdf_m_date_alter_savepdf_m_number.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc index 10ef91b..4364b3b 100644 Binary files a/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0004_alter_savepdf_options_alter_savepdf_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc index a1ce2c9..780900c 100644 Binary files a/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc and b/resulation/migrations/__pycache__/0005_alter_savepdf_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc index 74bea73..2fcb05f 100644 Binary files a/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc and b/resulation/migrations/__pycache__/0006_rename_savepdf_resulation.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc new file mode 100644 index 0000000..871b4f0 Binary files /dev/null and b/resulation/migrations/__pycache__/0007_alter_resulation_m_venue_alter_resulation_tittle.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc new file mode 100644 index 0000000..81f7198 Binary files /dev/null and b/resulation/migrations/__pycache__/0008_alter_resulation_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc new file mode 100644 index 0000000..9229521 Binary files /dev/null and b/resulation/migrations/__pycache__/0009_alter_resulation_attendance_file_and_more.cpython-311.pyc differ diff --git a/resulation/migrations/__pycache__/__init__.cpython-311.pyc b/resulation/migrations/__pycache__/__init__.cpython-311.pyc index 670a0f6..0633b8d 100644 Binary files a/resulation/migrations/__pycache__/__init__.cpython-311.pyc and b/resulation/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/resulation/models.py b/resulation/models.py index 4f4d13c..1811880 100644 --- a/resulation/models.py +++ b/resulation/models.py @@ -6,17 +6,17 @@ class resulation(models.Model): pdftype = models.CharField(max_length=250) org_unit = models.CharField(max_length=250) topic = models.CharField(max_length=250) - tittle = models.CharField(max_length=250) # Note: "tittle" might be a typo of "title" + tittle = models.CharField(max_length=250, blank=True, null=True) # Note: "tittle" might be a typo of "title" m_number = models.CharField(max_length=50, blank=True, null=True) m_date = models.DateField(blank=True, null=True) - m_venue = models.CharField(max_length=250) + m_venue = models.CharField(max_length=250, blank=True, null=True) first_party = models.CharField(max_length=250, blank=True, null=True) second_party = models.CharField(max_length=250, blank=True, null=True) contract_mou_date = models.DateField(blank=True, null=True) closing_date = models.DateField(blank=True, null=True) duration = models.CharField(max_length=250, blank=True, null=True) - res_con_mou_file = models.FileField(upload_to="resolution_files/%Y/%m/%d/") - attendance_file = models.FileField(upload_to="attendance_files/%Y/%m/%d/") + res_con_mou_file = models.CharField(max_length=250, blank=True, null=True) + attendance_file = models.CharField(max_length=250, blank=True, null=True) def __str__(self): diff --git a/resulation/urls.py b/resulation/urls.py index c766548..75939b1 100644 --- a/resulation/urls.py +++ b/resulation/urls.py @@ -1,18 +1,19 @@ from django.conf import settings -from django.conf.urls.static import static from django.contrib import admin -from django.urls import path, include +from django.urls import path, include, re_path import resulation.views -from misdghs import settings +from django.conf.urls.static import static +from django.urls import path +from . import views urlpatterns = [ path('', resulation.views.Home, name='home'), path('resulation/', resulation.views.Savepdf, name='resulation'), + path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'), path('deed/', resulation.views.Contract, name='deed'), path('mou/', resulation.views.Mou, name='mou'), - path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'), -] +] if settings.DEBUG: - urlpatterns+=static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + urlpatterns+= static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns+=static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/resulation/views.py b/resulation/views.py index 3bd1dbb..eac4a84 100644 --- a/resulation/views.py +++ b/resulation/views.py @@ -1,53 +1,79 @@ -from django.shortcuts import render, HttpResponse +from django.shortcuts import render, HttpResponse, get_object_or_404 from .models import resulation +from datetime import datetime +import os, uuid +import misdghs.settings +from django.http import FileResponse # Create your views here. def Home(request): return render(request,'resulation/home.html') -def Savepdf(request): # Changed function name to follow Python naming conventions - message = '' - if request.method == "POST": +def Savepdf(request): + if request.method == 'POST': try: - # Get form data + # Get text form fields + pdftype= request.POST.get('pdftype') org_unit = request.POST.get('org_unit') topic = request.POST.get('topic') tittle = request.POST.get('tittle') m_number = request.POST.get('m_number') m_date = request.POST.get('m_date') m_venue = request.POST.get('m_venue') - - # For file uploads, use request.FILES, not request.POST + + # Get file uploads attendance_file = request.FILES.get('attendance_file') res_con_mou_file = request.FILES.get('res_con_mou_file') - - # Create and save model instance - mydata = resulation( + + # Create a new seminar instance with text fields + if attendance_file: + new_filename = f"attendance_{uuid.uuid4()}.pdf" + path1 = os.path.join('media', 'attendance_files', new_filename) + with open(path1, 'wb') as destination: + for chunk in attendance_file.chunks(): + destination.write(chunk) + + if res_con_mou_file: + new_filename = f"res_con_{uuid.uuid4()}.pdf" + path2 = os.path.join('media', 'resolution_files', new_filename) + print(path2) + with open(path2, 'wb') as destination: + for chunk in res_con_mou_file.chunks(): + destination.write(chunk) + seminar = resulation( + pdftype=pdftype, org_unit=org_unit, topic=topic, tittle=tittle, m_number=m_number, m_date=m_date, m_venue=m_venue, - attendance_file=attendance_file, - res_con_mou_file=res_con_mou_file - ) - mydata.save() + attendance_file=path1, + res_con_mou_file=path2, + ) + seminar.save() + print(path1) message = "Data Inserted successfully" - - # Redirect after successful save + # Redirect after a successful save return render(request, "resulation/home.html", {'message': message}) - + except Exception as e: - message = f"Error: {str(e)}" - return render(request, 'resulation/resulation.html', {'message': message}) - else: + # Handle any errors (e.g., invalid file types or sizes) + print(f"Error processing form: {str(e)}") + return render(request, 'resulation/resulation.html', {'error': str(e)}) + + else: + # Render the form template return render(request, 'resulation/resulation.html') -def Viewresulation(request): +def Viewresulation(request, pk): # Get all records from database pdf_records = resulation.objects.all().order_by('-m_date') # Latest first - return render(request, 'resulation/viewresulation.html', {'pdf_records': pdf_records}) + return render(request, response, 'resulation/viewresulation.html', {'pdf_records': pdf_records}) + + + + def Contract(request): return render(request,'resulation/contract.html') diff --git a/static/SimpleBlog.css b/static/SimpleBlog.css deleted file mode 100644 index 5377af8..0000000 --- a/static/SimpleBlog.css +++ /dev/null @@ -1,314 +0,0 @@ -/******************************************** - AUTHOR: Erwin Aligam - WEBSITE: http://www.styleshout.com/ - TEMPLATE NAME: SimpleBlog 1.0 - TEMPLATE CODE: S-0007 - VERSION: 1.0 - *******************************************/ - -/******************************************** - HTML ELEMENTS -********************************************/ - -/* Top Elements */ -* { margin: 0; padding: 0; } - -body { - background: #FFF; - font: normal 70%/1.5em Verdana, Tahoma, Verdana, sans-serif; - color: #333; - text-align: center; -} -/* links */ -a { - background: inherit; - text-decoration: none; - color: #667F99; -} -a:hover { - background: inherit; - color: #996800; -} -/* headers */ -h1, h2, h3 { - font-family: Verdana, Tahoma, 'Trebuchet MS', Sans-serif; - font-weight: Bold; -} -h1 { font-size: 120%; } -h2 { font-size: 110%; text-transform: uppercase; } -h3 { font-size: 110%; color: #007E80; } - -h1, h2, h3, p { - margin: 0; - padding: 10px; -} -ul, ol { - margin: 10px 20px; - padding: 0 20px; -} - -/* images */ -img { - border: 2px solid #CCC; -} -img.float-right { - margin: 5px 0px 5px 10px; -} -img.float-left { - margin: 5px 10px 5px 0px; -} - -code { - margin: 5px 0; - padding: 10px; - text-align: left; - display: block; - overflow: auto; - font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace ; - /* white-space: pre; */ - background: #FAFAFA; - border: 1px solid #f2f2f2; -} -acronym { - cursor: help; - border-bottom: 1px solid #777; -} - -/* blockquote */ -blockquote { - margin: 10px; - padding: 0 0 0 28px; - border: 1px solid #f2f2f2; - background: #FAFAFA url(quote.gif) no-repeat 5px 5px; -} - -/* form elements */ -form { - margin:10px; padding: 0 5px; - border: 1px solid #f2f2f2; - background-color: #FAFAFA; -} -label { - display:block; - font-weight:bold; - margin:5px 0; -} -input { - padding:2px; - border:1px solid #eee; - font: normal 1em Verdana, sans-serif; - color:#777; -} -textarea { - width:400px; - padding:2px; - font: normal 1em Verdana, sans-serif; - border:1px solid #eee; - height:100px; - display:block; - color:#777; -} -input.button { - margin: 0; - font: bolder 12px Arial, Sans-serif; - border: 1px solid #CCC; - padding: 2px 3px; - background: #FFF; - color: #275F6C; -} -/* search form */ -form.search { - padding: 0; margin: 0; - vertical-align: bottom; - border: none; - background-color: transparent; -} -form.search input.textbox { - margin: 0; padding: 1px; - width: 120px; - border: 1px solid #CCC; - background: #FFF; - color: #333; -} -form.search input.button { - height: 20px; - padding: 1px 3px; - width: 60px; -} - -/******************************************** - LAYOUT -********************************************/ -#wrap { - width: 833px; - background: url(bg.jpg) repeat-y center top; - margin: 0 auto; - text-align: left; -} -#content-wrap { - position: relative; - width: 91%; - margin: 0 auto; - padding: 0; -} -/* header */ -#header { - position: relative; - width: 833px; - height: 100px; - background: #FFF url(header.jpg) no-repeat center top; - margin: 0; padding: 0; - font-size: 14px; - color: #FFF; -} -#header h1#logo { - position: absolute; - margin: 0; padding: 0; - font: bold 42px 'Trebuchet MS', Arial, Sans-serif; - letter-spacing: -2px; - color: #FFF; - text-transform: none; - - /* change the values of top and Left to adjust the position of the logo*/ - top: 19px; left: 53px; -} -#header h2#slogan { - position: absolute; - z-index: 9999999; - margin: 0; padding: 0; - font: bold 12px 'Trebuchet MS', Arial, Sans-serif; - text-transform: none; - color: #FFF; - - /* change the values of top and Left to adjust the position of the slogan*/ - top: 65px; left:75px; -} -#header #searchform { - float: right; - padding: 45px 40px 0 0; - display: inline; -} -/* menu */ -#menu { - clear: both; - width: 833px; - height: 26px; - background: #FFF url(menubg.jpg) repeat-y; - margin: 0; - font: bolder 12px/26px Tahoma, Verdana, Arial, Sans-Serif; -} -#menu ul{ - margin: 0; padding: 0 0 0 35px; -} -#menu ul li { - float: left; - list-style: none; -} -#menu ul li a { - display: block; - text-decoration: none; - padding: 0 10px; - background: inherit; - color: #FFF; -} -#menu ul li a:hover { - background: #FFF; - color: #333; -} -#menu ul li#current a { - background: #30899F; - color: #FFF; -} - -/* Main */ -#main { - float: left; - width: 72%; - padding: 0; margin: 0; -} -#main h1 { - color: #667F99; - border-bottom: 1px solid #CCCCCC; - background: #F6F6F6 url(arrow.gif) no-repeat 5px 50%; - padding: 3px 0 3px 20px; - margin: 10px 0 0 0; -} - -.post-footer { - background-color: #FAFAFA; - padding: 5px; margin: 20px 10px 0 10px; - border: 1px solid #f2f2f2; - font-size: 95%; -} -.post-footer .date { - background: url(clock.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} -.post-footer .comments { - background: url(comment.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} -.post-footer .readmore { - background: url(page.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} - -/* sidebar */ -#sidebar { - float: right; - width: 26%; - padding: 0; margin: 0; -} -#sidebar h1 { - margin: 10px 0 0 0; - padding: 3px 10px; - font: bold 120% Tahoma, Verdana, Sans-Serif; - color: #FFF; - background: #B6B8BB; -} -#sidebar ul.sidemenu { - list-style: none; - text-align: left; - margin: 3px 0px 8px 0; padding: 0; - text-decoration: none; -} -#sidebar ul.sidemenu li { - border-bottom: 1px solid #EFF0F1; - background: url(bullet.gif) no-repeat 2px 3px ; - padding: 2px 0 2px 25px; - margin: 0 2px; -} - -* html body #sidebar ul.sidemenu li { height: 1%; } - -#sidebar ul.sidemenu a { - font-weight: bold; - padding: 2px 0; - background: none; -} - -/* footer */ -#footer { - clear: both; - color: #66737B; - font: normal 90% Verdana, Tahoma, sans-serif; - background: #FFF url(footerbg.jpg) no-repeat center top; - width: 833px; - height: 60px; - text-align: center; - padding: 8px 0 0 0; - margin: 0 auto; -} -#footer a { text-decoration: none; } - -/* alignment classes */ -.float-left { float: left; } -.float-right { float: right; } -.align-left { text-align: left; } -.align-right { text-align: right; } - -/* additional classes */ -.clear { clear: both; } -.gray { color: #CCC; } - - diff --git a/static/css/SimpleBlog.css b/static/css/SimpleBlog.css deleted file mode 100644 index 5377af8..0000000 --- a/static/css/SimpleBlog.css +++ /dev/null @@ -1,314 +0,0 @@ -/******************************************** - AUTHOR: Erwin Aligam - WEBSITE: http://www.styleshout.com/ - TEMPLATE NAME: SimpleBlog 1.0 - TEMPLATE CODE: S-0007 - VERSION: 1.0 - *******************************************/ - -/******************************************** - HTML ELEMENTS -********************************************/ - -/* Top Elements */ -* { margin: 0; padding: 0; } - -body { - background: #FFF; - font: normal 70%/1.5em Verdana, Tahoma, Verdana, sans-serif; - color: #333; - text-align: center; -} -/* links */ -a { - background: inherit; - text-decoration: none; - color: #667F99; -} -a:hover { - background: inherit; - color: #996800; -} -/* headers */ -h1, h2, h3 { - font-family: Verdana, Tahoma, 'Trebuchet MS', Sans-serif; - font-weight: Bold; -} -h1 { font-size: 120%; } -h2 { font-size: 110%; text-transform: uppercase; } -h3 { font-size: 110%; color: #007E80; } - -h1, h2, h3, p { - margin: 0; - padding: 10px; -} -ul, ol { - margin: 10px 20px; - padding: 0 20px; -} - -/* images */ -img { - border: 2px solid #CCC; -} -img.float-right { - margin: 5px 0px 5px 10px; -} -img.float-left { - margin: 5px 10px 5px 0px; -} - -code { - margin: 5px 0; - padding: 10px; - text-align: left; - display: block; - overflow: auto; - font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace ; - /* white-space: pre; */ - background: #FAFAFA; - border: 1px solid #f2f2f2; -} -acronym { - cursor: help; - border-bottom: 1px solid #777; -} - -/* blockquote */ -blockquote { - margin: 10px; - padding: 0 0 0 28px; - border: 1px solid #f2f2f2; - background: #FAFAFA url(quote.gif) no-repeat 5px 5px; -} - -/* form elements */ -form { - margin:10px; padding: 0 5px; - border: 1px solid #f2f2f2; - background-color: #FAFAFA; -} -label { - display:block; - font-weight:bold; - margin:5px 0; -} -input { - padding:2px; - border:1px solid #eee; - font: normal 1em Verdana, sans-serif; - color:#777; -} -textarea { - width:400px; - padding:2px; - font: normal 1em Verdana, sans-serif; - border:1px solid #eee; - height:100px; - display:block; - color:#777; -} -input.button { - margin: 0; - font: bolder 12px Arial, Sans-serif; - border: 1px solid #CCC; - padding: 2px 3px; - background: #FFF; - color: #275F6C; -} -/* search form */ -form.search { - padding: 0; margin: 0; - vertical-align: bottom; - border: none; - background-color: transparent; -} -form.search input.textbox { - margin: 0; padding: 1px; - width: 120px; - border: 1px solid #CCC; - background: #FFF; - color: #333; -} -form.search input.button { - height: 20px; - padding: 1px 3px; - width: 60px; -} - -/******************************************** - LAYOUT -********************************************/ -#wrap { - width: 833px; - background: url(bg.jpg) repeat-y center top; - margin: 0 auto; - text-align: left; -} -#content-wrap { - position: relative; - width: 91%; - margin: 0 auto; - padding: 0; -} -/* header */ -#header { - position: relative; - width: 833px; - height: 100px; - background: #FFF url(header.jpg) no-repeat center top; - margin: 0; padding: 0; - font-size: 14px; - color: #FFF; -} -#header h1#logo { - position: absolute; - margin: 0; padding: 0; - font: bold 42px 'Trebuchet MS', Arial, Sans-serif; - letter-spacing: -2px; - color: #FFF; - text-transform: none; - - /* change the values of top and Left to adjust the position of the logo*/ - top: 19px; left: 53px; -} -#header h2#slogan { - position: absolute; - z-index: 9999999; - margin: 0; padding: 0; - font: bold 12px 'Trebuchet MS', Arial, Sans-serif; - text-transform: none; - color: #FFF; - - /* change the values of top and Left to adjust the position of the slogan*/ - top: 65px; left:75px; -} -#header #searchform { - float: right; - padding: 45px 40px 0 0; - display: inline; -} -/* menu */ -#menu { - clear: both; - width: 833px; - height: 26px; - background: #FFF url(menubg.jpg) repeat-y; - margin: 0; - font: bolder 12px/26px Tahoma, Verdana, Arial, Sans-Serif; -} -#menu ul{ - margin: 0; padding: 0 0 0 35px; -} -#menu ul li { - float: left; - list-style: none; -} -#menu ul li a { - display: block; - text-decoration: none; - padding: 0 10px; - background: inherit; - color: #FFF; -} -#menu ul li a:hover { - background: #FFF; - color: #333; -} -#menu ul li#current a { - background: #30899F; - color: #FFF; -} - -/* Main */ -#main { - float: left; - width: 72%; - padding: 0; margin: 0; -} -#main h1 { - color: #667F99; - border-bottom: 1px solid #CCCCCC; - background: #F6F6F6 url(arrow.gif) no-repeat 5px 50%; - padding: 3px 0 3px 20px; - margin: 10px 0 0 0; -} - -.post-footer { - background-color: #FAFAFA; - padding: 5px; margin: 20px 10px 0 10px; - border: 1px solid #f2f2f2; - font-size: 95%; -} -.post-footer .date { - background: url(clock.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} -.post-footer .comments { - background: url(comment.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} -.post-footer .readmore { - background: url(page.gif) no-repeat left center; - padding-left: 20px; margin: 0 10px 0 5px; -} - -/* sidebar */ -#sidebar { - float: right; - width: 26%; - padding: 0; margin: 0; -} -#sidebar h1 { - margin: 10px 0 0 0; - padding: 3px 10px; - font: bold 120% Tahoma, Verdana, Sans-Serif; - color: #FFF; - background: #B6B8BB; -} -#sidebar ul.sidemenu { - list-style: none; - text-align: left; - margin: 3px 0px 8px 0; padding: 0; - text-decoration: none; -} -#sidebar ul.sidemenu li { - border-bottom: 1px solid #EFF0F1; - background: url(bullet.gif) no-repeat 2px 3px ; - padding: 2px 0 2px 25px; - margin: 0 2px; -} - -* html body #sidebar ul.sidemenu li { height: 1%; } - -#sidebar ul.sidemenu a { - font-weight: bold; - padding: 2px 0; - background: none; -} - -/* footer */ -#footer { - clear: both; - color: #66737B; - font: normal 90% Verdana, Tahoma, sans-serif; - background: #FFF url(footerbg.jpg) no-repeat center top; - width: 833px; - height: 60px; - text-align: center; - padding: 8px 0 0 0; - margin: 0 auto; -} -#footer a { text-decoration: none; } - -/* alignment classes */ -.float-left { float: left; } -.float-right { float: right; } -.align-left { text-align: left; } -.align-right { text-align: right; } - -/* additional classes */ -.clear { clear: both; } -.gray { color: #CCC; } - - diff --git a/static/css/form.css b/static/css/form.css new file mode 100644 index 0000000..e9ee48a --- /dev/null +++ b/static/css/form.css @@ -0,0 +1,177 @@ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + line-height: 1.6; + color: #333; + max-width: 80%; + margin: 0 auto; + padding: 20px; + background-color: #f4f6f9; +} + +.form-container { + max-width: 800px; + margin: 20px auto; + padding: 20px; + background: #ffffff; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); +} + +h1 { + color: #2c3e50; + text-align: center; + border-bottom: 3px solid #3498db; + padding-bottom: 10px; + margin-bottom: 20px; + font-size: 24px; + font-weight: bold; +} + +h3 { + color: #2980b9; + margin-top: 25px; + border-left: 4px solid #3498db; + padding-left: 10px; +} + +p { + text-align: justify; + margin-bottom: 15px; +} + +list { + display: block; + margin-left: 30px; +} + +list li { + margin-bottom: 10px; + position: relative; + padding-left: 20px; +} + +list li::before { + content: '•'; + color: #3498db; + font-weight: bold; + position: absolute; + left: -20px; +} + +.form-title { + color: #2c3e50; + text-align: center; + margin-bottom: 30px; + font-size: 24px; + font-weight: bold; +} + +.form-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 15px; +} + +.form-table th { + text-align: left; + padding: 8px; + color: #34495e; + font-weight: 600; + width: 30%; + vertical-align: middle; +} + +.form-table input[type="text"], +.form-table input[type="date"] { + width: 90%; + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 14px; + transition: border-color 0.3s; +} + +.form-table input[type="text"]:focus, +.form-table input[type="date"]:focus { + border-color: #3498db; + outline: none; + box-shadow: 0 0 5px rgba(52,152,219,0.3); +} + +.form-table input[type="file"] { + padding: 8px 0; +} + +.submit-btn { + background-color: #3498db; + color: white; + padding: 10px 20px; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + transition: background-color 0.3s; +} + +.submit-btn:hover { + background-color: #2980b9; +} + +.file-input-wrapper { + position: relative; +} + +.file-input-label { + display: inline-block; + background-color: #f8f9fa; + padding: 8px 12px; + border: 1px solid #ddd; + border-radius: 4px; + cursor: pointer; +} + +.alert { + background-color: #d4edda; + color: #155724; + padding: 15px; + margin: 10px 0; + border-radius: 4px; + border: 1px solid #c3e6cb; + animation: fadeOut 5s forwards; +} + +@keyframes fadeOut { + 0% { opacity: 1; } + 90% { opacity: 1; } + 100% { opacity: 0; } +} + +/* Responsive design */ +@media (max-width: 768px) { + .form-container { + margin: 10px; + padding: 15px; + } + + .form-table th { + width: 100%; + display: block; + } + + .form-table td { + width: 100%; + display: block; + } + + body { + padding: 10px; + } + + h1 { + font-size: 24px; + } + + h3 { + font-size: 20px; + } +} \ No newline at end of file diff --git a/static/css/home.css b/static/css/home.css deleted file mode 100644 index a2f8c0d..0000000 --- a/static/css/home.css +++ /dev/null @@ -1,78 +0,0 @@ -body { - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - line-height: 1.6; - color: #333; - max-width: 800px; - margin: 0 auto; - padding: 20px; - background-color: #f4f6f9; -} - -h1 { - color: #2c3e50; - text-align: center; - border-bottom: 3px solid #3498db; - padding-bottom: 10px; - margin-bottom: 20px; -} - -h3 { - color: #2980b9; - margin-top: 25px; - border-left: 4px solid #3498db; - padding-left: 10px; -} - -p { - text-align: justify; - margin-bottom: 15px; -} - -list { - display: block; - margin-left: 30px; -} - -list li { - margin-bottom: 10px; - position: relative; - padding-left: 20px; -} - -list li::before { - content: '•'; - color: #3498db; - font-weight: bold; - position: absolute; - left: -20px; -} - -.alert { - background-color: #d4edda; - color: #155724; - padding: 15px; - margin: 10px 0; - border-radius: 4px; - border: 1px solid #c3e6cb; - animation: fadeOut 5s forwards; -} - -@keyframes fadeOut { - 0% { opacity: 1; } - 90% { opacity: 1; } - 100% { opacity: 0; } -} - -@media (max-width: 600px) { - body { - padding: 10px; - } - - h1 { - font-size: 24px; - } - - h3 { - font-size: 20px; - } -} \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..f4e59c8 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,89 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f4f4f4; +} + +.navbar { + background-color: #2c3e50; + display: flex; + align-items: center; + padding: 0 20px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +.logo-container { + display: flex; + align-items: center; + margin-right: 30px; +} + +.logo { + width: 50px; + height: 50px; + background-color: white; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10px; +} + +.logo img { + max-width: 40px; + max-height: 40px; +} + +.company-name { + color: white; + font-size: 20px; + font-weight: bold; +} + +.menu-container { + display: flex; + flex-grow: 1; +} + +.menu-container a { + color: white; + text-decoration: none; + padding: 14px 16px; + transition: background-color 0.3s; +} + +.dropdown { + position: relative; +} + +.dropdown-btn { + cursor: pointer; + display: flex; + align-items: center; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: white; + min-width: 200px; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); + z-index: 1000; + top: 100%; + border-radius: 4px; +} + +.dropdown:hover .dropdown-content { + display: block; +} + +.dropdown-content a { + color: #2c3e50; + padding: 12px 16px; + display: block; +} + +.dropdown-content a:hover { + background-color: #f1f1f1; +} \ No newline at end of file diff --git a/static/css/table.css b/static/css/table.css new file mode 100644 index 0000000..cc183ef --- /dev/null +++ b/static/css/table.css @@ -0,0 +1,67 @@ +.table-container { + max-width: 100%; + margin: 20px auto; + padding: 20px; + background: #ffffff; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); + overflow-x: auto; +} + +.records-table { + width: 80%%; + border-collapse: collapse; + margin-top: 20px; +} + +.records-table th, +.records-table td { + padding: 12px; + text-align: left; + border-bottom: 1px solid #ddd; +} + +.records-table th { + background-color: #f8f9fa; + font-weight: 600; + color: #2c3e50; +} + +.records-table tr:hover { + background-color: #f5f5f5; +} + +.download-link { + display: inline-block; + padding: 6px 12px; + background-color: #3498db; + color: white; + text-decoration: none; + border-radius: 4px; + font-size: 14px; + transition: background-color 0.3s; +} + +.download-link:hover { + background-color: #2980b9; +} + +.table-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 20px; +} + +.search-box { + padding: 8px; + border: 1px solid #ddd; + border-radius: 4px; + width: 200px; +} + +.no-records { + text-align: center; + padding: 20px; + color: #666; +} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 1f8472d..ce0939d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,119 +4,37 @@