diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..e3f99b3 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index e061640..307821c 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 2a36fd6..a4ac441 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..aec4316 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,14 @@ from django.contrib import admin +from .models import Hospital, DepartmentChief -# Register your models here. +@admin.register(Hospital) +class HospitalAdmin(admin.ModelAdmin): + list_display = ('name', 'state', 'city') + list_filter = ('state',) + search_fields = ('name', 'city') + +@admin.register(DepartmentChief) +class DepartmentChiefAdmin(admin.ModelAdmin): + list_display = ('name', 'department', 'hospital', 'email') + list_filter = ('department', 'hospital__state') + search_fields = ('name', 'email', 'hospital__name') \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..8df85e4 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,40 @@ +# Generated by Django 5.2.7 on 2026-01-28 14:27 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Hospital', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('state', models.CharField(choices=[('BW', 'Baden-Württemberg'), ('BY', 'Bayern'), ('BE', 'Berlin'), ('BB', 'Brandenburg'), ('HB', 'Bremen'), ('HH', 'Hamburg'), ('HE', 'Hessen'), ('MV', 'Mecklenburg-Vorpommern'), ('NI', 'Niedersachsen'), ('NW', 'Nordrhein-Westfalen'), ('RP', 'Rheinland-Pfalz'), ('SL', 'Saarland'), ('SN', 'Sachsen'), ('ST', 'Sachsen-Anhalt'), ('SH', 'Schleswig-Holstein'), ('TH', 'Thüringen')], max_length=2)), + ('city', models.CharField(max_length=100)), + ('address', models.TextField(blank=True)), + ('website', models.URLField(blank=True)), + ], + options={ + 'verbose_name_plural': 'Hospitals', + }, + ), + migrations.CreateModel( + name='DepartmentChief', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('title', models.CharField(help_text='e.g. Chief of Medicine, Head Nurse', max_length=100)), + ('department', models.CharField(choices=[('AN', 'Anesthesia'), ('NU', 'Nursing'), ('IC', 'Intensive Care'), ('SU', 'Surgery'), ('IM', 'Internal Medicine'), ('PE', 'Pediatrics'), ('GY', 'Gynecology'), ('OT', 'Other')], max_length=2)), + ('email', models.EmailField(max_length=254)), + ('hospital', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chiefs', to='core.hospital')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..597177c Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..1a527e6 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,54 @@ from django.db import models -# Create your models here. +class Hospital(models.Model): + STATES_CHOICES = [ + ('BW', 'Baden-Württemberg'), + ('BY', 'Bayern'), + ('BE', 'Berlin'), + ('BB', 'Brandenburg'), + ('HB', 'Bremen'), + ('HH', 'Hamburg'), + ('HE', 'Hessen'), + ('MV', 'Mecklenburg-Vorpommern'), + ('NI', 'Niedersachsen'), + ('NW', 'Nordrhein-Westfalen'), + ('RP', 'Rheinland-Pfalz'), + ('SL', 'Saarland'), + ('SN', 'Sachsen'), + ('ST', 'Sachsen-Anhalt'), + ('SH', 'Schleswig-Holstein'), + ('TH', 'Thüringen'), + ] + + name = models.CharField(max_length=255) + state = models.CharField(max_length=2, choices=STATES_CHOICES) + city = models.CharField(max_length=100) + address = models.TextField(blank=True) + website = models.URLField(blank=True) + + def __str__(self): + return f"{self.name} ({self.get_state_display()})" + + class Meta: + verbose_name_plural = "Hospitals" + +class DepartmentChief(models.Model): + DEPARTMENT_CHOICES = [ + ('AN', 'Anesthesia'), + ('NU', 'Nursing'), + ('IC', 'Intensive Care'), + ('SU', 'Surgery'), + ('IM', 'Internal Medicine'), + ('PE', 'Pediatrics'), + ('GY', 'Gynecology'), + ('OT', 'Other'), + ] + + hospital = models.ForeignKey(Hospital, on_delete=models.CASCADE, related_name='chiefs') + name = models.CharField(max_length=255) + title = models.CharField(max_length=100, help_text="e.g. Chief of Medicine, Head Nurse") + department = models.CharField(max_length=2, choices=DEPARTMENT_CHOICES) + email = models.EmailField() + + def __str__(self): + return f"{self.name} - {self.get_department_display()} at {self.hospital.name}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..cfb4490 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -3,23 +3,96 @@ - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} + + {% block title %}MedConnect | Medical Recruitment CRM{% endblock %} + + + + + + + + + {% load static %} + + {% if project_description %} + + {% endif %} + + + {% block head %}{% endblock %} + + {% block content %}{% endblock %} + + + + - + \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..666e703 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,148 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} +{% block content %} + +
+
+
+
+

Reach the Right Department Chiefs.

+

Connect with hospital leadership across Germany. Manage your medical recruitment outreach in one streamlined dashboard.

+
+ Browse Directory + +
+
+
+
+
+
+ Active Campaigns +

12

+
+
+ Response Rate +

24%

+
+
+
+
+
+ Outreach goal for January +
+
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+

{{ chiefs.count }} Contacts Found

+
+ + +
+
+ +
+ {% for chief in chiefs %} +
+
+
+
+ {{ chief.get_department_display }} +
+ +
+
+
{{ chief.name }}
+

{{ chief.title }}

+
+
+ + + + + {{ chief.hospital.name }} +
+
+ + + + + {{ chief.hospital.city }}, {{ chief.hospital.get_state_display }} +
+
+ +
+
+ {% empty %} +
+
+ + + +
+

No contacts found

+

Try adjusting your filters or search terms.

+ Clear All Filters +
+ {% endfor %} +
+
+
-{% block head %} - - - {% endblock %} - -{% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… -
-

AppWizzy AI is collecting your requirements and applying the first changes.

-

This page will refresh automatically as the plan is implemented.

-

- Runtime: Django {{ django_version }} · Python {{ python_version }} - — UTC {{ current_time|date:"Y-m-d H:i:s" }} -

-
-
- -{% endblock %} \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..114fa9a 100644 --- a/core/views.py +++ b/core/views.py @@ -4,22 +4,32 @@ import platform from django import get_version as django_version from django.shortcuts import render from django.utils import timezone - +from .models import Hospital, DepartmentChief def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() + """Render the landing screen with hospital directory.""" + query = request.GET.get('q', '') + state_filter = request.GET.get('state', '') + dept_filter = request.GET.get('dept', '') + + chiefs = DepartmentChief.objects.select_related('hospital').all() + + if query: + chiefs = chiefs.filter(name__icontains=query) | chiefs.filter(hospital__name__icontains=query) + + if state_filter: + chiefs = chiefs.filter(hospital__state=state_filter) + + if dept_filter: + chiefs = chiefs.filter(department=dept_filter) context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), + "project_name": "MedConnect Outreach", + "chiefs": chiefs, + "states": Hospital.STATES_CHOICES, + "departments": DepartmentChief.DEPARTMENT_CHOICES, + "query": query, + "selected_state": state_filter, + "selected_dept": dept_filter, } - return render(request, "core/index.html", context) + return render(request, "core/index.html", context) \ No newline at end of file