Third Commit

This commit is contained in:
sofordar 2025-01-30 13:07:48 +06:00
parent dcdbb14a38
commit 039890c725
48 changed files with 522 additions and 938 deletions

View File

@ -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! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = [] ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
# Application definition # Application definition
@ -120,18 +120,20 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/ # https://docs.djangoproject.com/en/5.1/howto/static-files/
# Static files (CSS, JavaScript, Images)
# ----------------------------
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR / 'staticfiles' # This is where collectstatic will place static files
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'), BASE_DIR / 'static', # Development static files location
] ]
STATICFILES_DIRS = [ # Media files (User uploads)
BASE_DIR / "media", # ---------------------------
] MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'
MEDIA_ROOT=BASE_DIR/'media'
MEDIA_URL="/media/"
STATIC_ROOT=BASE_DIR/'static'

View File

@ -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),
),
]

View File

@ -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/'),
),
]

View File

@ -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),
),
]

View File

@ -6,17 +6,17 @@ class resulation(models.Model):
pdftype = models.CharField(max_length=250) pdftype = models.CharField(max_length=250)
org_unit = models.CharField(max_length=250) org_unit = models.CharField(max_length=250)
topic = 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_number = models.CharField(max_length=50, blank=True, null=True)
m_date = models.DateField(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) first_party = models.CharField(max_length=250, blank=True, null=True)
second_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) contract_mou_date = models.DateField(blank=True, null=True)
closing_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) duration = models.CharField(max_length=250, blank=True, null=True)
res_con_mou_file = models.FileField(upload_to="resolution_files/%Y/%m/%d/") res_con_mou_file = models.CharField(max_length=250, blank=True, null=True)
attendance_file = models.FileField(upload_to="attendance_files/%Y/%m/%d/") attendance_file = models.CharField(max_length=250, blank=True, null=True)
def __str__(self): def __str__(self):

View File

@ -1,18 +1,19 @@
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include, re_path
import resulation.views import resulation.views
from misdghs import settings from django.conf.urls.static import static
from django.urls import path
from . import views
urlpatterns = [ urlpatterns = [
path('', resulation.views.Home, name='home'), path('', resulation.views.Home, name='home'),
path('resulation/', resulation.views.Savepdf, name='resulation'), path('resulation/', resulation.views.Savepdf, name='resulation'),
path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'),
path('deed/', resulation.views.Contract, name='deed'), path('deed/', resulation.views.Contract, name='deed'),
path('mou/', resulation.views.Mou, name='mou'), path('mou/', resulation.views.Mou, name='mou'),
path('viewresulation/', resulation.views.Viewresulation, name='viewresulation'),
] ]
if settings.DEBUG: 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) urlpatterns+=static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -1,15 +1,19 @@
from django.shortcuts import render, HttpResponse from django.shortcuts import render, HttpResponse, get_object_or_404
from .models import resulation from .models import resulation
from datetime import datetime
import os, uuid
import misdghs.settings
from django.http import FileResponse
# Create your views here. # Create your views here.
def Home(request): def Home(request):
return render(request,'resulation/home.html') return render(request,'resulation/home.html')
def Savepdf(request): # Changed function name to follow Python naming conventions def Savepdf(request):
message = '' if request.method == 'POST':
if request.method == "POST":
try: try:
# Get form data # Get text form fields
pdftype= request.POST.get('pdftype')
org_unit = request.POST.get('org_unit') org_unit = request.POST.get('org_unit')
topic = request.POST.get('topic') topic = request.POST.get('topic')
tittle = request.POST.get('tittle') tittle = request.POST.get('tittle')
@ -17,37 +21,59 @@ def Savepdf(request): # Changed function name to follow Python naming conventio
m_date = request.POST.get('m_date') m_date = request.POST.get('m_date')
m_venue = request.POST.get('m_venue') 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') attendance_file = request.FILES.get('attendance_file')
res_con_mou_file = request.FILES.get('res_con_mou_file') res_con_mou_file = request.FILES.get('res_con_mou_file')
# Create and save model instance # Create a new seminar instance with text fields
mydata = resulation( 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, org_unit=org_unit,
topic=topic, topic=topic,
tittle=tittle, tittle=tittle,
m_number=m_number, m_number=m_number,
m_date=m_date, m_date=m_date,
m_venue=m_venue, m_venue=m_venue,
attendance_file=attendance_file, attendance_file=path1,
res_con_mou_file=res_con_mou_file res_con_mou_file=path2,
) )
mydata.save() seminar.save()
print(path1)
message = "Data Inserted successfully" message = "Data Inserted successfully"
# Redirect after a successful save
# Redirect after successful save
return render(request, "resulation/home.html", {'message': message}) return render(request, "resulation/home.html", {'message': message})
except Exception as e: except Exception as e:
message = f"Error: {str(e)}" # Handle any errors (e.g., invalid file types or sizes)
return render(request, 'resulation/resulation.html', {'message': message}) print(f"Error processing form: {str(e)}")
return render(request, 'resulation/resulation.html', {'error': str(e)})
else: else:
# Render the form template
return render(request, 'resulation/resulation.html') return render(request, 'resulation/resulation.html')
def Viewresulation(request): def Viewresulation(request, pk):
# Get all records from database # Get all records from database
pdf_records = resulation.objects.all().order_by('-m_date') # Latest first 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): def Contract(request):
return render(request,'resulation/contract.html') return render(request,'resulation/contract.html')

View File

@ -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; }

View File

@ -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; }

177
static/css/form.css Normal file
View File

@ -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;
}
}

View File

@ -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;
}
}

89
static/css/style.css Normal file
View File

@ -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;
}

67
static/css/table.css Normal file
View File

@ -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;
}

View File

@ -4,119 +4,37 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>MIS</title> <title>MIS</title>
<style> <link rel="stylesheet" href="{% static 'css/style.css' %}">
body { <link rel="stylesheet" href="{% static 'css/form.css' %}">
font-family: Arial, sans-serif; <link rel="stylesheet" href="{% static 'css/table.css' %}">
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;
}
</style>
</head> </head>
<body> <body>
<div class="navbar"> <div class="navbar">
<div class="logo-container"> <div class="logo-container">
<div class="logo"> <div class="logo">
<img src="{% static 'images/icon.png'%}">
</div> </div>
<div class="company-name">Management Information System (MIS)</div> <div class="company-name">Management Information System (MIS)</div>
</div> </div>
<div class="menu-container"> <div class="menu-container">
<a href="http://localhost:8000/">Home</a> <a href="http://localhost:8000/rcm">Home</a>
<div class="dropdown"> <div class="dropdown">
<a href="#" class="dropdown-btn">Doccument</a> <a href="#" class="dropdown-btn"> ↑ Upload</a>
<div class="dropdown-content"> <div class="dropdown-content">
<a href="http://localhost:8000/viewresulation">View Resulations</a> <a href="http://localhost:8000/rcm/resulation">Resulation</a>
<a href="http://localhost:8000/resulation">Upload Resulation</a> <a href="http://localhost:8000/deed">Contract</a>
<a href="#">View Contracts</a> <a href="http://localhost:8000/">MoU</a>
<a href="http://localhost:8000/deed">Upload Contract</a> </div>
<a href="#">View MoUs</a> </div>
<a href="http://localhost:8000/">Upload MoU</a> <div class="dropdown">
<a href="#" class="dropdown-btn">View</a>
<div class="dropdown-content">
<a href="http://localhost:8000/rcm/viewresulation">Resulations</a>
<a href="#">Contracts</a>
<a href="#">MoUs</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -190,7 +190,7 @@
<table class="form-table"> <table class="form-table">
<tr> <tr>
<th>Type of Upload</th> <th>Type of Upload</th>
<td><input type="text" name="org_unit" value="Meeting Minutes" readonly></td> <td><input type="text" name="pdftype" value="Meeting Minutes" readonly></td>
</tr> </tr>
<tr> <tr>

View File

@ -1,85 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<style> {% load static %}
.table-container {
max-width: 1200px;
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: 100%;
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;
}
</style>
<div class="table-container"> <div class="table-container">
<div class="table-header"> <div class="table-header">
<h2>PDF Records</h2> <h2>PDF Records</h2>
<input type="text" id="searchInput" class="search-box" placeholder="Search records..."> <input type="text" id="searchInput" class="search-box" placeholder="Search records...">
</div> </div>
{% if pdf_records %} {% if pdf_records %}
<table class="records-table"> <table class="records-table" aria-label="PDF Records">
<thead> <thead>
<tr> <tr>
<th>ID</th>
<th>Type</th>
<th>Organization</th> <th>Organization</th>
<th>Topic</th> <th>Topic</th>
<th>Title</th> <th>Title</th>
@ -93,6 +25,8 @@
<tbody> <tbody>
{% for record in pdf_records %} {% for record in pdf_records %}
<tr> <tr>
<td>{{ record.eid }}</td>
<td>{{ record.pdftype }}</td>
<td>{{ record.org_unit }}</td> <td>{{ record.org_unit }}</td>
<td>{{ record.topic }}</td> <td>{{ record.topic }}</td>
<td>{{ record.tittle }}</td> <td>{{ record.tittle }}</td>
@ -100,39 +34,46 @@
<td>{{ record.m_date|date:"d M Y" }}</td> <td>{{ record.m_date|date:"d M Y" }}</td>
<td>{{ record.m_venue }}</td> <td>{{ record.m_venue }}</td>
<td> <td>
<a href="{{ record.attendance_file.url }}" class="download-link" download> <a href="{{ record.attendance_file.url }}">Download</a>
Download
</a>
</td> </td>
<td> <td>
<a href="{{ record.res_con_mou_file.url }}" class="download-link" download> {% if record.res_con_mou_file %}
Download <a href="{{ record.res_con_mou_file.url }}">Download</a>
</a> {% endif %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %} {% else %}
<div class="no-records"> <p>No records found.</p>
No records found.
</div>
{% endif %} {% endif %}
</div> </div>
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.getElementById('searchInput').addEventListener('input', function() {
const searchInput = document.getElementById('searchInput'); const searchTerm = this.value.toLowerCase();
const tableRows = document.querySelectorAll('.records-table tbody tr'); const rows = document.querySelectorAll('tr');
searchInput.addEventListener('input', function(e) { rows.forEach((row, index) => {
const searchTerm = e.target.value.toLowerCase(); // Skip the header row
if (index === 0) {
return;
}
tableRows.forEach(row => { const cells = row.cells;
const text = row.textContent.toLowerCase(); let match = false;
row.style.display = text.includes(searchTerm) ? '' : 'none';
}); for (let i = 0; i < cells.length; i++) {
if (cells[i].textContent.toLowerCase().includes(searchTerm)) {
match = true;
break;
}
}
row.style.display = match ? 'table-row' : 'none';
}); });
}); });
</script> </script>
{% endblock content %} {% endblock content %}