Also apply better approach to generic detail pages

This commit is contained in:
2020-10-08 23:15:55 +01:00
parent 3903481b3d
commit 5d56f4f7b0
11 changed files with 71 additions and 34 deletions

View File

@@ -7,7 +7,7 @@
xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
lang="{% firstof LANGUAGE_CODE 'en' %}">
<head>
<title>{{page_title}}{% block title %}{% endblock %} | Rig Information Gathering System</title>
<title>{% block title %}{{page_title}}{% endblock %} | Rig Information Gathering System</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@@ -70,7 +70,7 @@
{% endfor %}
{% endif %}
{% endblock %}
{% if page_title %}<h2>{{page_title}}</h2>{% endif %}
{% if page_title and not request.is_ajax %}<h2>{{page_title}}</h2>{% endif %}
{% block content %}{% endblock %}
</div>

View File

@@ -1,7 +1,7 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{% block title %}{% endblock %}</h4>
<h4 class="modal-title">{{page_title}}{% block title %}{% endblock %}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>

View File

@@ -1,15 +1,9 @@
{% extends request.is_ajax|yesno:"base_ajax.html,base_rigs.html" %}
{% extends override|default:"base_rigs.html" %}
{% load widget_tweaks %}
{% block title %}{{ type }} | {{ object.name }}{% endblock %}
{% load button from filters %}
{% block content %}
<div class="row">
{% if not request.is_ajax %}
<div class="col-sm-12">
<h1>{{ type }} | {{ object.name }}</h1>
</div>
{% endif %}
<div class="col">
<div class="card border-info">
<div class="card-header">{{ type }} Details</div>
@@ -52,11 +46,10 @@
{% endif %}
{% if not request.is_ajax %}
<div class="row">
<div class="row py-2">
<div class="col-sm-12 text-right">
<div class="btn-group">
<a href="{% url update_link object.pk %}" class="btn btn-warning"><span
class="fas fa-edit"></span> Edit</a>
{% button 'edit' update_link object.pk %}
</div>
{% include 'partials/last_edited.html' with target=history_link %}
</div>
@@ -65,13 +58,12 @@
{% endblock %}
{% if request.is_ajax %}
{% block footer %}
<div class="row">
<div class="row py-2">
<div class="col-sm-12 text-right">
<div class="btn-group btn-page">
<a href="{% url detail_link object.pk %}" class="btn btn-primary"><span
class="fas fa-eye"></span> Open Page</a>
<a href="{% url update_link object.pk %}" class="btn btn-warning"><span
class="fas fa-edit"></span> Edit</a>
{% button 'edit' update_link object.pk %}
</div>
{% include 'partials/last_edited.html' with target=history_link %}
</div>

View File

@@ -7,8 +7,8 @@
{% block content %}
<div class="row">
<div class="col text-right">
<form class="form-inline">
<div class="col">
<form class="form-inline justify-content-end">
{% csrf_token %}
<div class="input-group">
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"