Skip to content

Commit

Permalink
improved seshat description entry and more
Browse files Browse the repository at this point in the history
  • Loading branch information
MajidBenam committed Dec 3, 2024
1 parent 7639e1e commit f8642f2
Show file tree
Hide file tree
Showing 34 changed files with 787 additions and 288 deletions.
2 changes: 0 additions & 2 deletions seshat/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,6 @@ def curators_list(self):
else:
return None



# class Annual_wages(SeshatCommon):
# name = models.CharField(max_length=100, default="Annual_wages")
# annual_wages = models.IntegerField(blank=True, null=True)
Expand Down
26 changes: 17 additions & 9 deletions seshat/apps/core/templates/core/detail_base_for_new_approach.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
transition: background-color 0.3s ease;
}


.tab a {
text-decoration: none;
color: #000;
Expand Down Expand Up @@ -186,7 +187,7 @@ <h4><span class="text-secondary">Variable:</span> <span>{{ var_name_display }}</
{% endif %}
</ul>
{% endif %}
<div style="border: 2px solid rgba(120, 40, 35, 0.311); border-radius: 5px; overflow: hidden;">
<div style="border: 2px solid rgba(120, 40, 35, 0.311); border-radius: 5px; overflow: hidden; box-shadow: 0 6px 6px hsl(0deg 0% 0% / 0.3);">

<table class="table table-borderless align-middle" >
<thead>
Expand Down Expand Up @@ -259,17 +260,24 @@ <h4><span class="text-secondary">Variable:</span> <span>{{ var_name_display }}</
{{ form.comment_text.label_tag }} {{ form.comment_text }}
{{ form.formset.management_form }}
{{ form.management_form }}
<div class="pt-0">
<div class="pt-0" >
<span class="text-secondary pt-0">* Use &lt;br&gt;
for new paragraphs.</span>
</div>
<div class="row">
<div class="col-md-12" style="display: none;">
{{ form.comment_order|as_crispy_field }}
</div>
<div class="col-md-12 pt-2 d-grid gap-2">
<input type="submit" class="btn btn-outline-success btn-block mt-2 fs-5 fw-bold" value="Submit the First Chunk**">
</div>



<div class="col-sm-8 mb-2 d-grido">
<button type="submit" name="action" value="redirect_one" class="btn btn-success my-auto btn-block btn-lg" style="font-family: 'Roboto Mono', monospace;">Submit & Continue Adding Description</button>
</div>
<div class="col-sm-4 mb-2 d-grido">
<button type="submit" name="action" value="redirect_two" class="btn btn-outline-primary my-auto btn-block btn-lg" style="font-family: 'Roboto Mono', monospace;">Submit (Done)</button>
</div>

</div>
<span class="text-secondary pt-0">** Please note that in this step, we insert only the initial portion of the description—specifically, the section from the beginning up to the first set of references (citations). <br>
<br> <span class="text-dark">Example:</span>
Expand All @@ -281,11 +289,11 @@ <h4><span class="text-secondary">Variable:</span> <span>{{ var_name_display }}</

</div>
<div class="col-md-7">
<div id="formset-container">
<div id="formset-container" >
{% autoescape off %}
{% for form1 in form.formset %}

<div class="formset-item d-flex align-items-start pt-4">
<div class="formset-item d-flex align-items-start pt-4" >
<!-- Citation number on the left -->


Expand All @@ -301,7 +309,7 @@ <h4><span class="text-secondary">Variable:</span> <span>{{ var_name_display }}</
id="id_refs-{{ forloop.counter0 }}-ref" data-select2-id="id_refs-{{ forloop.counter0 }}-ref"
tabindex="-1" aria-hidden="true" style="width:100%; white-space:normal;"
data-selected-value="{{ form1.ref.value }}">
<option value="" selected data-select2-id="{{ forloop.counter0 }}">Reference ...</option>
<option value="" selected data-select2-id="{{ forloop.counter0 }}" >Reference ...</option>
</select>
</div>
</div>
Expand All @@ -317,7 +325,7 @@ <h4><span class="text-secondary">Variable:</span> <span>{{ var_name_display }}</
</div>
</div>
</div>
<span class="badge fs-6 citation-badge" style="background: cadetblue;">Citation &nbsp;{{ forloop.counter }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span class="badge fs-6 citation-badge" style="background: cadetblue; box-shadow: 0 6px 6px hsl(0deg 0% 0% / 0.3);">Citation &nbsp;{{ forloop.counter }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<i class="fa-solid fa-trash-can" style="color:rgb(244, 176, 176)"></i>
{{ form1.DELETE }}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@ <h6><span class="text-secondary">Section:</span> {{var_section}} /
&nbsp;-
{% endif %}
</h6>
{% if myvar == 'Polity Preceding Entity' %}
<h4><span >Polity Succession</span></h4>

{% else %}

<h4><span >{{ myvar }}</span></h4>
</div>
{% endif %} </div>
<div class="col-md-8 border-dark">
{% autoescape off %}
<h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: </span> {{my_exp}}</h6>
Expand Down Expand Up @@ -176,11 +181,17 @@ <h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: <
{% endif %}
<div class="row pt-2 ps-2" style="background:rgba(255, 235, 205, 0.664);">
<div class="col-sm-12 row">
{% if myvar == 'Polity Preceding Entity' %}

{% elif myvar != 'Polity Duration' and myvar != 'Polity Peak Years' %}
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
{% if myvar != 'Polity Duration' and myvar != 'Polity Peak Years' %}
{% else %}

<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-sm-3 pb-2">
{{ form.year_from|as_crispy_field }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
color: beige;
}

.goodsubmit{
background-image: linear-gradient(to right, rgb(246, 127, 127, 0.616),rgb(242, 199, 119, 0.616),rgb(151, 230, 151, 0.616));
border:2px solid seagreen;
}

.goodsubmit:hover{
font-weight: bold;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #782823;
Expand Down Expand Up @@ -65,7 +73,13 @@
margin: 0;
padding: 0;
}


.checkboxinput {
width: 20px; /* Increase the width of the checkbox */
height: 20px; /* Increase the height of the checkbox */
cursor: pointer; /* Change the cursor to indicate interactivity */
}

.tab-container {
display: flex;
justify-content: center;
Expand Down Expand Up @@ -132,15 +146,16 @@

.mainform {
background:rgba(255, 235, 205, 0.464);
border: 1px #782923 solid;
border: 1px #78292366 solid;
border-radius: 5px;
box-shadow: 0 6px 6px hsl(0deg 0% 0% / 0.3);
}


</style>
<!-- form-row and form-group etc are removed in Bootstrap 5 -->
<div class="container mt-1">
<div class="tab-container">
<div class="tab-container" style="font-family: 'Roboto Mono', monospace;" >
<div class="tab active" id="step1-tab">
<span ><i class="fa-solid fa-circle"></i> Step 1: Insert the data</span>
</div>
Expand All @@ -164,11 +179,18 @@ <h6><span class="text-secondary">Section:</span> {{var_section}} /
&nbsp;-
{% endif %}
</h6>
{% if myvar == 'Polity Preceding Entity' %}
<h4><span >Polity Succession</span></h4>

{% else %}

<h4><span >{{ myvar }}</span></h4>
{% endif %}

</div>
<div class="col-md-8 border-dark">
{% autoescape off %}
<h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: </span> {{my_exp}}</h6>
<h6 class="lead-2 text-secondary" style="font-family: 'Roboto Mono', monospace;"><span class="text-dark fw-bold">{{ myvar }}: </span> {{my_exp}}</h6>
{% endautoescape %}

</div>
Expand Down Expand Up @@ -205,13 +227,16 @@ <h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: <
<div class="row pt-2 ps-2 mainform">
<div class="col-sm-12 row">
{% if myvar == 'Polity Preceding Entity' %}

{% elif myvar == 'Polity Duration' and myvar == 'Polity Peak Years' %}
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
{% else %}
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
{% endif %}

{% if myvar != 'Polity Duration' and myvar != 'Polity Peak Years' and myvar != 'Polity Preceding Entity' %}
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>

<div class="col-sm-3 pb-2">
{{ form.year_from|as_crispy_field }}
Expand Down Expand Up @@ -257,16 +282,18 @@ <h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: <
</fieldset>
</div>
<div class="col-sm-12 row">
<div class="col-sm-6 mb-2 py-2 d-grid mx-auto">
<span class="fw-bold">* Please note: You will have the opportunity to add descriptions, including references, on the next page.</span>

<div class="col-sm-4 mb-2 pb-4 d-grid mx-auto">
<button type="submit" name="action" value="redirect_one" class="btn btn-outline-secondary my-auto btn-block btn-lg" style="font-family: 'Roboto Mono', monospace;">Submit without Description</button>
</div>
<div class="col-sm-5 mb-2 pb-4 d-grid mx-auto ">
<button type="submit" name="action" value="redirect_two" class="btn my-auto btn-block btn-lg goodsubmit" style="font-family: 'Roboto Mono', monospace;">Submit and Continue to add Description</button>
</div>
<div class="col-sm-3 mb-2 py-2 d-grid mx-auto">
<div class="col-sm-3 mb-2 pb-4 d-grid mx-auto">
{% block delete_button %}
{% endblock delete_button %}
</div>
<div class="col-sm-3 mb-2 py-2 d-grid mx-auto">
<button type="submit" class="btn btn-outline-success my-auto btn-block btn-lg">Submit</button>
</div>

</div>
</div>

Expand All @@ -275,19 +302,19 @@ <h6 class="lead-2 text-secondary"><span class="text-dark fw-bold">{{ myvar }}: <

</div>

<div class="row">
<div>
{% if request.user.is_staff %}
<div class="col-md-12 py-3 ps-4">
<div class="py-3 ps-1">
<div class="mb-2">
<i class="fas fa-user-check"></i>
<b>{{user|capfirst}}</b>, You are a Seshat Expert; you can enter a new record or update an existing one.
<b>{{user|capfirst}}</b>, You have the needed permissions to enter a new record or update an existing one.
</div>
<div class="mb-2" style="display: none;">
{{ form.finalized|as_crispy_field }}
</div>
</div>
{% else %}
<div class="col-md-4 py-3 ps-4">
<div class="py-3 ps-1">
<input type="checkbox" id="seshatexpert" name="vehicle2" value="Car" onclick="return false">
<label for="seshatexpert"> You are not a Seshat Expert.</label>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<div class="col-md-4">
{{ extra_var3|as_crispy_field }}
</div>
<div class="col-sm-4 pb-2">
<div class="col-md-4 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-md-4 pb-4">
<div class="col-md-6 pb-4">
{{ extra_var2|as_crispy_field }}
</div>

{% elif extra_var and extra_var2 %}
<div class="col-md-4">
{{ extra_var|as_crispy_field }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
{% block extra_vars %}

{% if extra_var and extra_var2 and extra_var3 %}

<div class="col-md-4">
{{ extra_var|as_crispy_field }}
</div>
<div class="col-md-4">
{{ extra_var3|as_crispy_field }}
</div>
<div class="col-sm-4 pb-2">
<div class="col-md-4 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-md-4 pb-4">
<div class="col-md-6 pb-4">
{{ extra_var2|as_crispy_field }}
</div>
{% elif extra_var and extra_var2 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
{% block extra_vars %}

{% if extra_var and extra_var2 and extra_var3 %}
<div class="col-md-3">

<div class="col-md-4">
{{ extra_var|as_crispy_field }}
</div>
<div class="col-md-3">
<div class="col-md-4">
{{ extra_var3|as_crispy_field }}
</div>
<div class="col-md-4 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-md-6 pb-4">
{{ extra_var2|as_crispy_field }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ <h6 class="m-auto">DISPUTED</h6>

<!-- Tag tag (Disputed/Suspected etc.) -->
</tr>
<tr class="py-0 mt-0 mb-5">
<tr class="py-0 mt-0 mb-2">
<td class="col-sm-12 py-0 mt-0" scope="row">
{% autoescape off %}

<span class="fs-6 highlighted-value mb-5">
<span class="fs-6 highlighted-value mb-2">
{% if value.description %}
{{ value.description|make_references_look_nicer }}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
<span class="text-dark fw-bold">

{% if value.year_from == None %}
<a type="button" class="btn p-0 m-0" data-bs-toggle="tooltip" data-bs-html="true" title='Year Range of Polity is assumed.'>
<span><i class="fa-solid fa-clock fs-6 text-secondary"></i> </span>
</a>



{% elif value.year_from == value.year_to %}
{% if value.year_from < 0 %}
{{ value.year_from|abs }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
<span class="text-dark">

{% if value.year_from == None %}
<a type="button" class="btn p-0 m-0" data-bs-toggle="tooltip" data-bs-html="true" title='Year Range of Polity is assumed.'>
<span><i class="fa-solid fa-clock fs-6 text-secondary"></i> </span>
</a>



{% elif value.year_from == value.year_to %}
{% if value.year_from < 0 %}
Expand Down
Loading

0 comments on commit f8642f2

Please sign in to comment.