This commit is contained in:
Joshua Hare 2025-05-13 09:48:24 +10:00
parent 2925676feb
commit aed672bd81
3 changed files with 14 additions and 11 deletions

View File

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

View File

@ -18,7 +18,7 @@
<tr>
<td>{{ app.name }}</td>
<td>{{ app.developer }}</td>
<td>{{ app.user.username }}</td>
<td>{{ app.user.username if app.user else 'Unknown' }}</td>
<td>
<a href="{{ url_for('gallery.app_detail', app_id=app.id) }}" class="btn btn-primary btn-sm">View</a>
<a href="{{ url_for('gallery.edit_app', app_id=app.id) }}" class="btn btn-warning btn-sm">Edit</a>

View File

@ -5,9 +5,9 @@
<div class="card shadow-sm mx-auto" style="max-width: 900px; border: none; border-radius: 10px; animation: fadeIn 0.5s;">
<div class="card-body p-4">
{% if app.logo_url %}
<img src="{{ app.logo_url }}" alt="{{ app.name }} logo" class="d-block mx-auto mb-3" style="width: 100px; height: 100px; object-fit: contain;" onerror="this.src='https://via.placeholder.com/100?text=No+Logo';">
<img src="{{ app.logo_url }}" alt="{{ app.name }} logo" class="d-block mx-auto mb-3" style="width: 100px; height: 100px; object-fit: contain;" onerror="this.src='{{ url_for('static', filename='no-logo.png') }}';">
{% else %}
<img src="https://via.placeholder.com/100?text=No+Logo" alt="No Logo" class="d-block mx-auto mb-3" style="width: 100px; height: 100px; object-fit: contain;">
<img src="{{ url_for('static', filename='no-logo.png') }}" alt="No Logo" class="d-block mx-auto mb-3" style="width: 100px; height: 100px; object-fit: contain;">
{% endif %}
<h1 class="text-center mb-2">{{ app.name }}</h1>
<h5 class="text-center text-muted mb-3">
@ -31,7 +31,7 @@
<div class="carousel-inner">
{% for img_url in app.app_images.split(',') %}
<div class="carousel-item {% if loop.first %}active{% endif %}">
<img src="{{ img_url }}" class="d-block w-100" alt="App Screenshot {{ loop.index }}" style="max-height: 300px; object-fit: contain;" onerror="this.src='https://via.placeholder.com/300?text=No+Image';">
<img src="{{ img_url }}" class="d-block w-100" alt="App Screenshot {{ loop.index }}" style="max-height: 300px; object-fit: contain;" onerror="this.src='{{ url_for('static', filename='no-logo.png') }}';">
</div>
{% endfor %}
</div>
@ -45,7 +45,7 @@
</button>
</div>
{% else %}
<img src="https://via.placeholder.com/300?text=No+Image" class="d-block w-100 mb-4" alt="No Image" style="max-height: 300px; object-fit: contain;">
<img src="{{ url_for('static', filename='no-logo.png') }}" class="d-block w-100 mb-4" alt="No Image" style="max-height: 300px; object-fit: contain;">
{% endif %}
<section class="mb-3">
<h5>Description</h5>
@ -88,7 +88,7 @@
<h5>Designed For</h5>
<hr class="small-hr">
<p>
{% if app.designed_for %}
{% if app.designed_for_id and app.designed_for %}
<a href="{{ url_for('gallery.gallery', designed_for=app.designed_for_id) }}" class="text-decoration-none">{{ app.designed_for.name }}</a>
{% else %}
Not specified.
@ -97,9 +97,9 @@
</div>
<div class="col-6">
<h5>FHIR Compatibility</h5>
<.ttf class="small-hr">
<hr class="small-hr">
<p>
{% if app.fhir_compatibility %}
{% if app.fhir_compatibility_id and app.fhir_compatibility %}
<a href="{{ url_for('gallery.gallery', fhir_support=app.fhir_compatibility_id) }}" class="text-decoration-none">{{ app.fhir_compatibility.name }}</a>
{% else %}
Not specified.
@ -138,7 +138,7 @@
<h5>Licensing & Pricing</h5>
<hr class="small-hr">
<p>
{% if app.licensing_pricing %}
{% if app.licensing_pricing_id and app.licensing_pricing %}
<a href="{{ url_for('gallery.gallery', pricing_license=app.licensing_pricing_id) }}" class="text-decoration-none">{{ app.licensing_pricing.name }}</a>
{% else %}
Not specified.
@ -158,7 +158,7 @@
</div>
</div>
<div class="mt-3 d-flex justify-content-center">
<a href="mailto:support@fhirpad.com?subject=Report Listing: {{ app.name }}" class="text-danger text-decoration-none" aria-label="Report issue with {{ app.name }} listing">
<a href="mailto:support@fhirpad.com?subject=Report Listing: {{ app.name }}" class="text-decoration-none text-danger" aria-label="Report issue with {{ app.name }} listing">
<i class="fas fa-exclamation-circle me-1"></i> Report Listing
</a>
</div>
@ -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;
}