diff --git a/app/models.py b/app/models.py index 0b3ed5e..80fdff7 100644 --- a/app/models.py +++ b/app/models.py @@ -64,11 +64,15 @@ class FHIRApp(db.Model): launch_url = db.Column(db.String(200), nullable=False) website = db.Column(db.String(200)) designed_for_id = db.Column(db.Integer, db.ForeignKey('designed_for.id')) + designed_for = db.relationship('DesignedFor', backref='fhir_apps') fhir_compatibility_id = db.Column(db.Integer, db.ForeignKey('fhir_support.id')) + fhir_compatibility = db.relationship('FHIRSupport', backref='fhir_apps') categories = db.Column(db.Text) # Comma-separated Category IDs licensing_pricing_id = db.Column(db.Integer, db.ForeignKey('pricing_license.id')) + licensing_pricing = db.relationship('PricingLicense', backref='fhir_apps') os_support = db.Column(db.Text) # Comma-separated OSSupport IDs app_images = db.Column(db.Text) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) + user = db.relationship('User', backref='fhir_apps') # Added relationship registration_date = db.Column(db.DateTime, default=datetime.utcnow) last_updated = db.Column(db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) \ No newline at end of file diff --git a/app/templates/admin_apps.html b/app/templates/admin_apps.html index fde3efa..cae1b4d 100644 --- a/app/templates/admin_apps.html +++ b/app/templates/admin_apps.html @@ -18,7 +18,7 @@ {{ app.name }} {{ app.developer }} - {{ app.user.username }} + {{ app.user.username if app.user else 'Unknown' }} View Edit diff --git a/app/templates/app_detail.html b/app/templates/app_detail.html index add62bd..e66fe2d 100644 --- a/app/templates/app_detail.html +++ b/app/templates/app_detail.html @@ -5,9 +5,9 @@
{% if app.logo_url %} - {{ app.name }} logo + {{ app.name }} logo {% else %} - No Logo + No Logo {% endif %}

{{ app.name }}

@@ -31,7 +31,7 @@ @@ -45,7 +45,7 @@
{% else %} - No Image + No Image {% endif %}
Description
@@ -88,7 +88,7 @@
Designed For

- {% if app.designed_for %} + {% if app.designed_for_id and app.designed_for %} {{ app.designed_for.name }} {% else %} Not specified. @@ -97,9 +97,9 @@

FHIR Compatibility
- <.ttf class="small-hr"> +

- {% if app.fhir_compatibility %} + {% if app.fhir_compatibility_id and app.fhir_compatibility %} {{ app.fhir_compatibility.name }} {% else %} Not specified. @@ -138,7 +138,7 @@

Licensing & Pricing

- {% if app.licensing_pricing %} + {% if app.licensing_pricing_id and app.licensing_pricing %} {{ app.licensing_pricing.name }} {% else %} Not specified. @@ -158,7 +158,7 @@

- + Report Listing
@@ -206,7 +206,6 @@ border-color: #4dabf7; } .btn-outline-primary:hover { - THESE BUTTONS ARE CURRENTLY DISABLED ON THE DETAIL PAGE background-color: #007bff; color: white; }