WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#from seshat.apps.crisisdb.instability_events_dic_list import ultimate_dics_list
#from seshat.apps.crisisdb.instability_events_dic_list_2 import ultimate_dics_list
from seshat.apps.crisisdb.instability_events_dic_list_batch_3_2 import ultimate_dics_list
from seshat.apps.crisisdb.instability_events_dic_list_batch_3_3 import ultimate_dics_list

from django.db import transaction

Expand Down
83 changes: 56 additions & 27 deletions seshat/apps/core/templates/core/form_base_llm.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
.select2-container .select2-selection__arrow {
height: 36px;
margin-top: 4px; /* Adjust the margin-top as needed */
width:100%;

}

Expand Down Expand Up @@ -389,45 +390,28 @@
</style>
<!-- form-row and form-group etc are removed in Bootstrap 5 -->
<div class="container mt-1">
<div class="row d-flex mt-3">
<div class="row d-flex mt-2">
<div class="row" style="--bs-gutter-x: 0.0rem;">
<div class="col-sm-5">
{% if db_section_mapper %}

<div class="h4 p-1" 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}}
{% if var_section %}
<span class="p-2 m-0 fw-normal">&nbsp;&nbsp; {{var_section}} </span>
{% endif %}
<div class="h4 p-1">
<h5 class="mb-1"><small class="text-secondary text-end">Variable:</small> <span>{{myvar}}</span> <span class="h6 text-secondary">

</span></h5>

</div>
{% endif %}

</div>
<div class="col-sm-4">
</div>

<div class="col-sm-3">
<div class="accordion-header rounded " id="flush-headingOne" style="width:100%; display:inline-block;">

<button class="accordion-button collapsed rounded p-2 highlighted-value-title" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne" style="background-color:#fefae6;">
<span class="fs-5 text-teal fw-bold py-0"><i class="fa-solid fa-comments"></i> &nbsp;Private Comments
<span class="badge bg-success-light fw-bold">
{{ form.instance.private_comment.inner_private_comments_related.all|length }}
</span>


<span type="button" tabindex="0" data-bs-toggle="popover" title="General Description" data-bs-html="true" data-bs-trigger="focus">

</span></span>
</button>
</div>
<div class="col-sm-2">
</div>

<div class="col-sm-5 pe-2">
<small class="float-end text-secondary">Private comments? See the popup button at the bottom-right of the page.</small>

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

{% include "core/partials/_private_comment_inline_accordion.html" %}
</div>

</div>


Expand Down Expand Up @@ -699,6 +683,45 @@
</div>

</div>
<!-- Floating Chat Button -->
<div id="chat-toggle" style="
position: fixed;
bottom: 20px;
right: 20px;
z-index: 1050;
">


{% if form.instance.private_comment.inner_private_comments_related.all|length != 0 %}
<button class="btn btn-success rounded-circle p-3 shadow highlighted-value-title text-dark" onclick="toggleChat()" title="Private Comments">
<i class="fa-solid fa-comments fa-lg"></i>
</button>
{% else %}
<button class="btn btn-secondary rounded-circle p-3 shadow highlighted-value-title text-dark" onclick="toggleChat()" title="Private Comments">
<i class="fa-solid fa-comment fa-lg"></i>
</button>
{% endif %}

</div>

<!-- Chat Box (Initially hidden) -->
<div id="chat-box" class="card shadow" style="
position: fixed;
bottom: 80px;
right: 20px;
width: 40%;
display: none;
z-index: 1050;
">
<div class="card-header highlighted-value-title text-dark d-flex justify-content-between align-items-center">
<span><i class="fa-solid fa-comments"></i> Private Comments</span>
<button type="button" class="btn-close btn-close-darl btn-sm" onclick="toggleChat()"></button>
</div>
{% include "core/partials/_private_comment_inline_absolute.html" %}


</div>


<script>

Expand Down Expand Up @@ -837,5 +860,11 @@
return true;
}

</script>

function toggleChat() {
const chatBox = document.getElementById("chat-box");
chatBox.style.display = chatBox.style.display === "none" ? "block" : "none";
}
</script>

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

{% block delete_button %}
<!-- Render the delete button for the specified object ID -->
<a href="{% url delete_url object.id %}" type="cancel" class="btn py-2 btn-outline-danger my-auto btn-block" style="font-family: 'Roboto Mono', monospace;">Deleeeeeete</a>
<a href="{% url delete_url object.id %}" type="cancel" class="btn py-2 btn-outline-danger my-auto btn-block" style="font-family: 'Roboto Mono', monospace;">Delete</a>
{% endblock delete_button %}

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ <h6 class="fw-bold"><span class="fw-normal"><i class="fa-solid fa-caret-right"><
<br>
<select name="macro_event" id="macro_event" class="form-select js-example-basic-single " onchange="this.form.submit()">
<option value="">All</option>
{% for macro in macro_events %}
<option value="{{ macro }}" {% if macro == selected_macro %}selected{% endif %}>
{{ macro }}
{% for event, count in macro_events_with_counts %}
<option value="{{ event }}" {% if event == selected_macro %}selected{% endif %}>
{{ event }} (#{{ count }} Events)

</option>
{% endfor %}
</select>
Expand Down
103 changes: 68 additions & 35 deletions seshat/apps/core/templates/core/partials/_llm_data_row_before.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,51 @@
{% load mathfilters %}
{% load custom_filters %}

<tr style="border-width:0; background-image: linear-gradient(to left, rgb(246, 127, 127, 0.056),rgb(242, 199, 119, 0.056),rgb(151, 230, 151, 0.056)); ">
<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">



<style>
.top-level-header {
border-bottom: 4px solid rgba(0, 128, 128, 0.122);
border-radius:3px;
color: gray;
display:block;
margin-bottom: 2px;
font-size:0.85rem;
}
</style>

<tr style="background:#fffdf2; vertical-align:top; border-left: 1px solid rgba(0, 128, 128, 0.356); box-shadow: -2px 2px 2px rgba(0, 128, 128, 0.356);
">
<td class="fw-normal text-dark ps-2" style="text-align: left; width:25%">
<span class="top-level-header">Event</span>

<span> <b>{{ form.instance.llm_name|remove_macro_event}}</b> </span>
<br>
{% if form.instance.llm_year_from == None %}
{% elif form.instance.llm_year_from == form.instance.llm_year_to %}
{% if form.instance.llm_year_from < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs|intcomma }} <small class="text-secondary">BCE</small> </span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small></span>
{% endif %}
{% elif form.instance.llm_year_to == None %}
{% if form.instance.llm_year_from < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small></span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small></span>
{% endif %}
{% elif form.instance.llm_year_to == None and form.instance.llm_year_from == None %}
<span style="text-align: right; border-width: 0;"> <i class="fa-solid fa-minus"></i> </span>
{% else %}
{% if form.instance.llm_year_from < 0 and form.instance.llm_year_to < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to|abs }}&nbsp;<small class="text-secondary">BCE</small></span>
{% elif form.instance.llm_year_from < 0 and form.instance.llm_year_to >= 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to }}&nbsp;<small class="text-secondary">CE</small></span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to }}&nbsp;<small class="text-secondary">CE</small></span>
{% endif %}
{% endif %}

<small style="vertical-align: top;">
{% if form.instance.created_date|date:"Y-m-d" < "2025-03-29" %}
<span class="badge bg-secondary" data-bs-toggle="tooltip" data-bs-html="true" title="Generated in March 2025.">Batch 1</span>
Expand All @@ -15,12 +57,16 @@
{% endif %}
</small>

<span> {{ form.instance.llm_name|remove_macro_event}}</span>
</td>
<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">
{{form.instance.llm_name|extract_macro_event}}


<br>
Macro Event:
{{form.instance.llm_name|extract_macro_event}}

</td>
<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">
<span class="top-level-header">Polity</span>

{% if form.instance.polity.long_name %}
<span class="fw-bold">
<a href="{% url 'polity-detail-main' form.instance.polity.id %}#instability_event_var">{{ form.instance.polity.long_name }}</a>
Expand All @@ -31,41 +77,28 @@
</span>
{% endif %}
</td>
<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">{{ form.instance.get_llm_instability_types }}
<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">
<span class="top-level-header">Types</span>

{{ form.instance.get_llm_instability_types }}
</td>
<td class="fw-normal text-dark" style="border-width: 0; text-align: center;">
{% if form.instance.llm_year_from == None %}
{% elif form.instance.llm_year_from == form.instance.llm_year_to %}
{% if form.instance.llm_year_from < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs|intcomma }} <small class="text-secondary">BCE</small> </span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small></span>
{% endif %}
{% elif form.instance.llm_year_to == None %}
{% if form.instance.llm_year_from < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small></span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small></span>
{% endif %}
{% elif form.instance.llm_year_to == None and form.instance.llm_year_from == None %}
<span style="text-align: right; border-width: 0;"> <i class="fa-solid fa-minus"></i> </span>
{% else %}
{% if form.instance.llm_year_from < 0 and form.instance.llm_year_to < 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to|abs }}&nbsp;<small class="text-secondary">BCE</small></span>
{% elif form.instance.llm_year_from < 0 and form.instance.llm_year_to >= 0 %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from|abs }} <small class="text-secondary">BCE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to }}&nbsp;<small class="text-secondary">CE</small></span>
{% else %}
<span style="text-align: right; border-width: 0;">{{ form.instance.llm_year_from }} <small class="text-secondary">CE</small> <i class="fa-solid fa-arrow-right-long"></i> {{ form.instance.llm_year_to }}&nbsp;<small class="text-secondary">CE</small></span>
{% endif %}
{% endif %}

</td>
<td class="fw-bold text-dark " style="border-width: 0; text-align: center;">
<span class="top-level-header">Intensity</span>

<span> {{ form.instance.llm_inst_intensity}}</span>
</td>
<td class="fw-bold text-dark" style="border-width: 0; text-align: center;">
<td class="fw-bold text-dark" style="border-width: 0; text-align: center; ">
<span class="top-level-header">Extent</span>

<span> {{ form.instance.llm_inst_extent}}</span></td>

<td class="fw-normal text-dark" style="border-width: 0; text-align: left;">{{ form.instance.get_instability_checks}}
<td class="fw-normal text-dark" style="border-width: 0; text-align: left; border-right: 1px solid rgba(0, 128, 128, 0.356);">
<span class="top-level-header">Checks</span>

{{ form.instance.get_instability_checks}}
</td>

</tr>
</tr>
Loading
Loading