Skip to content

Commit

Permalink
Merge pull request #217 from Seshat-Global-History-Databank/seshat-ex…
Browse files Browse the repository at this point in the history
…perts-updates

download links fixed for variables
  • Loading branch information
MajidBenam authored Jan 8, 2025
2 parents 957e0cd + 8ebfafa commit bb34cb2
Show file tree
Hide file tree
Showing 25 changed files with 878 additions and 400 deletions.
7 changes: 7 additions & 0 deletions seshat/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,13 @@ def curators_list(self):
return ", ".join(my_list)
else:
return None

def curators_list_ids(self):
my_list = [curator.id for curator in self.curator.all()]
if my_list:
return my_list
else:
return None

# class Annual_wages(SeshatCommon):
# name = models.CharField(max_length=100, default="Annual_wages")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@
padding: 0;
}

.checkboxinput {
width: 18px; /* Increase the width of the checkbox */
height: 18px; /* 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 @@ -194,25 +200,36 @@

<div class="row d-flex mt-3">
<div class="col-md-3">
<h5><span class="text-secondary">Section:</span> {{var_section}} </h5>
{% if db_section_mapper %}

<h5 class="p-2 m-0" style="border-top-left-radius:5px; border-top-right-radius:5px; background:#84eab3; border-bottom:3px solid #27a567; font-family: 'Roboto Mono', monospace;"> {{db_section_mapper}}
</h5>
{% endif %}

{% if var_section %}
<h5 class="p-2 m-0 fw-normal" style="background:#aaf0c9;">{{var_section}} </h5>
{% endif %}

{% if var_subsection %}

<h6>
<span class="text-secondary">Subsection:</span> {{var_subsection}}
<h6 class="p-2 m-0" style="background:#cbf5dd">
{{var_subsection}}

</h6>
{% endif %}

{% if myvar == 'Polity Preceding Entity' %}
<h4><span >Polity Succession</span></h4>

{% else %}

<h4><span >{{ myvar }}</span></h4>
{% endif %}
<h4 class="fw-bold pt-2"><span >{{ myvar }}</span></h4>
{% endif %}

{% autoescape off %}
<h6 class="lead-2 text-secondary">{{my_exp}}</h6>
<small class="text-dark" style="text-align: justify;">{{my_exp}}</small>
{% endautoescape %}

</div>
<div class="col-md-9 border-dark mainform mb-4">
<form id="regForm" action="" method="post" >
Expand Down Expand Up @@ -247,10 +264,10 @@ <h6 class="lead-2 text-secondary">{{my_exp}}</h6>
{% if myvar == 'Polity Preceding Entity' %}

{% elif myvar == 'Polity Duration' or myvar == 'Polity Peak Years' %}
<div class="col-sm-6 pb-0">
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-sm-6 pb-0">
<div class="col-sm-6 pb-2">
</div>
{% elif myvar == 'Power Transition' %}
<div class="col-sm-8 pb-0">
Expand All @@ -273,6 +290,33 @@ <h6 class="lead-2 text-secondary">{{my_exp}}</h6>
</div>
{% endif %}

<div class="col-sm-12">

{% if form.instance.pk %}
{% if form.instance.curator.exists %}
<div class="p-2 mb-3" style="background: #daf1de; border-radius:10px;">
<div class="fs-6" style="font-family: Roboto Mono; color:#163832;"> <i class="fa-regular fa-square-check fa-lg"></i> This record has been <b>Expert Reviewed</b> by:
{% for curator in form.instance.curator.all %}
<span class="fw-bold">{{ curator }}</span>{% if not forloop.last %},{% else %}.{% endif %}

{% endfor %}
</div>

</div>


{% else %}
<div class="p-2 mb-3" style="background: #ffdddd; border-radius:10px;">
<div class="fs-6" style="font-family: Roboto Mono; color:#800000;">
<i class="fa-regular fa-circle-xmark fa-lg"></i> This record has <b><u> not</u> been Expert Reviewed yet</b>.
</div>
</div>

{% endif %}
{% endif %}

</div>

{% block extra_vars %}
{% endblock extra_vars %}

Expand All @@ -281,7 +325,7 @@ <h6 class="lead-2 text-secondary">{{my_exp}}</h6>
{{ form.description }}
</div>

<div class="col-sm-2 pb-0 pt-4">
<div class="col-sm-2 pb-0 pt-4" style="align-items: end;">
{{ form.is_disputed|as_crispy_field }}
{{ form.is_uncertain|as_crispy_field }}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@

.mainform {
background:rgba(255, 235, 205, 0.464);
border: 1px #78292366 solid;
border-left: 3px #ddd solid;
border-top: 1px gray solid;
border-radius: 5px;
box-shadow: 0 6px 6px hsl(0deg 0% 0% / 0.3);
}
Expand Down Expand Up @@ -225,11 +226,20 @@

<div class="row d-flex">
<div class="col-md-3">
<h5><span class="text-secondary">Section:</span> {{var_section}} </h5>
{% if db_section_mapper %}

<h5 class="p-2 m-0" style="border-top-left-radius:5px; border-top-right-radius:5px; background:#84eab3; border-bottom:3px solid #27a567; font-family: 'Roboto Mono', monospace;"> {{db_section_mapper}}
</h5>
{% endif %}

{% if var_section %}
<h5 class="p-2 m-0 fw-normal" style="background:#aaf0c9;">{{var_section}} </h5>
{% endif %}

{% if var_subsection %}

<h6>
<span class="text-secondary">Subsection:</span> {{var_subsection}}
<h6 class="p-2 m-0" style="background:#cbf5dd">
{{var_subsection}}

</h6>
{% endif %}
Expand All @@ -239,15 +249,15 @@ <h4><span >Polity Succession</span></h4>

{% else %}

<h4><span >{{ myvar }}</span></h4>
<h4 class="fw-bold pt-2"><span >{{ myvar }}</span></h4>
{% endif %}

{% autoescape off %}
<h6 class="text-dark" style="text-align: justify;">- {{my_exp}}</h6>
<small class="text-dark" style="text-align: justify;">{{my_exp}}</small>
{% endautoescape %}

</div>
<div class="col-md-9 border-dark mainform mb-4">
<div class="col-md-9 mainform mb-4">
<form id="regForm" action="" method="post" >
{% csrf_token %}
<legend>
Expand Down Expand Up @@ -280,10 +290,10 @@ <h6 class="text-dark" style="text-align: justify;">- {{my_exp}}</h6>
{% if myvar == 'Polity Preceding Entity' %}

{% elif myvar == 'Polity Duration' or myvar == 'Polity Peak Years' %}
<div class="col-sm-6 pb-0">
<div class="col-sm-6 pb-2">
{{ form.polity|as_crispy_field }}
</div>
<div class="col-sm-6 pb-0">
<div class="col-sm-6 pb-2">
</div>
{% elif myvar == 'Power Transition' %}
<div class="col-sm-8 pb-0">
Expand All @@ -306,6 +316,32 @@ <h6 class="text-dark" style="text-align: justify;">- {{my_exp}}</h6>
</div>
{% endif %}

<div class="col-sm-12">

{% if form.instance.pk %}
{% if form.instance.curator.exists %}
<div class="p-2 mb-3" style="background: #daf1de; border-radius:10px;">
<div class="fs-6" style="font-family: Roboto Mono; color:#163832;"> <i class="fa-regular fa-square-check fa-lg"></i> This record has been <b>Expert Reviewed</b> by:
{% for curator in form.instance.curator.all %}
<span class="fw-bold">{{ curator }}</span>
{% endfor %}
</div>

</div>


{% else %}
<div class="p-2 mb-3" style="background: #ffdddd; border-radius:10px;">
<div class="fs-6" style="font-family: Roboto Mono; color:#800000;">
<i class="fa-regular fa-circle-xmark fa-lg"></i> This record has <b><u> not</u> been Expert Reviewed yet</b>.
</div>
</div>

{% endif %}
{% endif %}

</div>

{% block extra_vars %}
{% endblock extra_vars %}

Expand Down Expand Up @@ -356,6 +392,8 @@ <h6 class="text-dark" style="text-align: justify;">- {{my_exp}}</h6>


</div>


<div class="col-sm-12 pe-0">

{% if object.comment %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@


</style>
<hr class="bg-secondary" style="height:1px !important;">

{% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions and 'core.add_seshatprivatecommentpart' in request.user.get_all_permissions %}
{% if extra_var and extra_var2 and extra_var3 and extra_var4 and extra_var5 and extra_var6 and extra_var7 and extra_var8 and extra_var9 and extra_var10 and extra_var11 and extra_var12 and extra_var13 and extra_var14 and extra_var4.name == 'contested' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{% load custom_filters %}

{% block extra_vars %}
<hr class="bg-secondary" style="height:1px !important;">

{% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions and 'core.add_seshatprivatecommentpart' in request.user.get_all_permissions %}
{% if extra_var and extra_var2 and extra_var3 and extra_var4 and extra_var5 and extra_var6 and extra_var7 and extra_var8 and extra_var9 and extra_var10 and extra_var11 and extra_var12 and extra_var13 and extra_var14 and extra_var4.name == 'contested' %}
Expand Down Expand Up @@ -60,15 +59,15 @@
<div class="col-md-6 pb-3">
{{ extra_var2|as_crispy_field }}
</div>
{% elif extra_var and extra_var2 and extra_var3 and extra_var.name == 'widespread_religion' %}
{% elif extra_var and extra_var2 and extra_var3 and extra_var2.name == 'widespread_religion' %}
<div class="col-md-4 pb-3">
{{ extra_var|as_crispy_field }}
</div>
<div class="col-md-4 pb-3">
{{ extra_var3|as_crispy_field }}
{{ extra_var2|as_crispy_field }}
</div>
<div class="col-md-4 pb-3">
{{ extra_var2|as_crispy_field }}
{{ extra_var3|as_crispy_field }}
</div>
{% elif extra_var and extra_var2 %}
<div class="col-md-6 pb-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{% load custom_filters %}

{% block extra_vars %}
<hr class="bg-secondary" style="height:1px !important;">

{% if request.user.is_authenticated and 'core.add_capital' in request.user.get_all_permissions and 'core.add_seshatprivatecommentpart' in request.user.get_all_permissions %}
{% if extra_var and extra_var2 and extra_var3 and extra_var4 and extra_var5 and extra_var6 and extra_var7 and extra_var8 and extra_var9 and extra_var10 and extra_var11 and extra_var12 and extra_var13 and extra_var14 and extra_var4.name == 'contested' %}
Expand Down Expand Up @@ -60,22 +59,26 @@
<div class="col-md-6 pb-3">
{{ extra_var2|as_crispy_field }}
</div>
{% elif extra_var and extra_var2 and extra_var3 and extra_var.name == 'widespread_religion' %}
{% elif extra_var and extra_var2 and extra_var3 and extra_var2.name == 'widespread_religion' %}
<div class="col-md-4 pb-3">
{{ extra_var|as_crispy_field }}
</div>
<div class="col-md-4 pb-3">
{{ extra_var3|as_crispy_field }}
{{ extra_var2|as_crispy_field }}
</div>
<div class="col-md-4 pb-3">
{{ extra_var2|as_crispy_field }}
{{ extra_var3|as_crispy_field }}
</div>

{% elif extra_var and extra_var2 %}
<div class="col-md-3">
<div class="col-md-6 pb-3">
{{ extra_var|as_crispy_field }}
{% if extra_var.name == 'polity_cap' %}
<span class="text-secondary">
Do not see your desired capital? Add it <a class="fw-bold text-decoration-underline" href="{% url 'capital-create' %}" >here</a> first.
</span>
{% endif %}
</div>
<div class="col-md-3">
<div class="col-md-6 pb-3">
{{ extra_var2|as_crispy_field }}
</div>
{% else %}
Expand Down
Loading

0 comments on commit bb34cb2

Please sign in to comment.