diff --git a/seshat/apps/accounts/admin.py b/seshat/apps/accounts/admin.py index 5c3a7fa69..67dd6d074 100644 --- a/seshat/apps/accounts/admin.py +++ b/seshat/apps/accounts/admin.py @@ -17,7 +17,7 @@ class CustomUserAdmin(admin.ModelAdmin): inlines = (ProfileInline, ) list_display = ('username', 'email', 'first_name', - 'last_name', 'is_staff', 'get_location','get_email_confirmed') + 'last_name', 'is_staff', 'date_joined', 'last_login','get_email_confirmed') list_select_related = ('profile', ) def get_location(self, instance): diff --git a/seshat/apps/core/forms.py b/seshat/apps/core/forms.py index b8aa78f62..beb80493e 100644 --- a/seshat/apps/core/forms.py +++ b/seshat/apps/core/forms.py @@ -280,9 +280,12 @@ class Meta: class ReferenceWithPageForm(forms.Form): ref = forms.ModelChoiceField( queryset=Reference.objects.all(), - widget=forms.Select(attrs={'class': 'form-control form-select mb-1 js-example-basic-single', 'text':'ref'}), - label='' + widget=forms.Select(attrs={'class': 'form-control form-select mb-1 js-example-basic-single', 'text':'ref',}), + label='', + empty_label="Please choose a Reference ..." , + ) + # ref = forms.ModelChoiceField( # queryset=Reference.objects.all(), # widget=forms.Select(attrs={'class': 'form-control form-select mb-3 js-states js-example-basic-single'}), @@ -290,7 +293,7 @@ class ReferenceWithPageForm(forms.Form): # ) page_from = forms.IntegerField(label='', required=False) page_to = forms.IntegerField(label='', required=False) - parent_pars = forms.CharField(widget=forms.Textarea(attrs={'style': 'height: 140px;'}), label='Consulted Paragraphs (Private, for NLP project)', required=False) + parent_pars = forms.CharField(widget=forms.Textarea(attrs={'style': 'height: 60px;', 'placeholder': 'Consulted Paragraphs (Private, for NLP project)' }), label='', required=False) #parent_pars = forms.Textarea(attrs={'class': 'form-control mb-3', 'style': 'height: 120px', 'placeholder':'Please copy and paste the paragraphs you consulted into this field for each reference.'}) @@ -309,6 +312,9 @@ def add_fields(self, form, index): super().add_fields(form, index) form.fields['ref'].widget.attrs['class'] = 'form-control form-select mb-1 p-1 js-example-basic-single' form.fields['page_from'].widget.attrs['class'] = 'form-control mb-1 p-1' + form.fields['page_from'].widget.attrs['placeholder'] = 'p_from' + form.fields['page_to'].widget.attrs['placeholder'] = 'p_to' + form.fields['page_to'].widget.attrs['class'] = 'form-control mb-1 p-1' form.fields['parent_pars'].widget.attrs['class'] = 'form-control mb-1 p-1' @@ -318,23 +324,32 @@ def add_fields(self, form, index): ReferenceFormSet5 = forms.formset_factory(ReferenceWithPageForm, formset=BaseReferenceFormSet, extra=5, max_num=5, can_delete=True, can_order=True) + +ReferenceFormSet10 = forms.formset_factory(ReferenceWithPageForm, formset=BaseReferenceFormSet, extra=10, max_num=10, can_delete=True, can_order=True) #ReferenceFormSet = forms.formset_factory(ReferenceWithPageForm, extra=2, can_delete=True,) class SeshatCommentPartForm2(forms.Form): - comment_text = forms.CharField(label='SubComment Text (Public)', widget=forms.Textarea(attrs={'class': 'form-control mb-1 p-0', 'style': 'height: 200px',})) + comment_text = forms.CharField(label='', widget=forms.Textarea(attrs={'class': 'form-control mb-1 p-1', 'style': 'height: 300px', 'placeholder': 'SubDescription Text (Public)'})) formset = ReferenceFormSet2(prefix='refs') comment_order = forms.IntegerField(label='Do NOT Change This Number: ', required=False,) formset.management_form # Include the management form class SeshatCommentPartForm5(forms.Form): - comment_text = forms.CharField(label='Comment Textu', widget=forms.Textarea(attrs={'class': 'form-control mb-1 p-0', 'style': 'height: 200px',})) + comment_text = forms.CharField(label='', widget=forms.Textarea(attrs={'class': 'form-control mb-1 p-0', 'style': 'height: 200px',})) formset = ReferenceFormSet5(prefix='refs') comment_order = forms.IntegerField(label='Do NOT Change This Number: ', required=False,) formset.management_form # Include the management form +class SeshatCommentPartForm10(forms.Form): + comment_text = forms.CharField(label='', widget=forms.Textarea(attrs={'class': 'form-control mb-1 p-0', 'style': 'height: 200px',})) + + formset = ReferenceFormSet10(prefix='refs') + comment_order = forms.IntegerField(label='Do NOT Change This Number: ', required=False,) + formset.management_form # Include the management form + CommentPartFormSet = forms.formset_factory(SeshatCommentPartForm2, extra=2) @@ -431,3 +446,46 @@ class Meta: unique_together = ("variable_name", "section_name", "subsection_name") # VarHierFormSet = formset_factory(VariablehierarchyForm, extra=10) + + +############ + + +class ReferenceWithPageForm_UPGRADE(forms.Form): + ref = forms.ModelChoiceField( + queryset=Reference.objects.all(), + widget=forms.Select(attrs={'class': 'form-control form-select mb-1 js-example-basic-single'}), + label='' + ) + page_from = forms.IntegerField(label='', required=False) + page_to = forms.IntegerField(label='', required=False) + parent_pars = forms.CharField(widget=forms.Textarea(attrs={'style': 'height: 140px;'}), label='Consulted Paragraphs (UPGRADED) (Private, for NLP project)', required=False) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.helper = FormHelper() + self.helper.form_method = 'post' + self.helper.add_input(Submit('submit', 'Submit')) + + + +ReferenceFormSet2_UPGRADE = formset_factory(ReferenceWithPageForm_UPGRADE, extra=1) + +class SeshatCommentPartForm2_UPGRADE(forms.Form): + comment_text = forms.CharField(label='SubComment Text (Public)', widget=forms.Textarea(attrs={'class': 'form-control mb-1', 'style': 'height: 200px'})) + references_formset = ReferenceFormSet2_UPGRADE(prefix='refs') + #formset = ReferenceFormSet2_UPGRADE(prefix='refs') + comment_order = forms.IntegerField(label='Do NOT Change This Number:', required=False) + references_formset.management_form # Include the management form + + + #formset.management_form # Include the management form + +# class SeshatCommentPartWithReferencesForm_UPGRADE(forms.Form): +# comment_part_form = SeshatCommentPartForm2_UPGRADE() +# references_formset = ReferenceFormSet2_UPGRADE() +# references_formset.management_form # Include the management form + + +#formset = ReferenceFormSet2(prefix='refs') +#comment_order = forms.IntegerField(label='Do NOT Change This Number: ', required=False,) diff --git a/seshat/apps/core/templates/core/code_book_1.html b/seshat/apps/core/templates/core/code_book_1.html new file mode 100644 index 000000000..f3642527e --- /dev/null +++ b/seshat/apps/core/templates/core/code_book_1.html @@ -0,0 +1,3437 @@ + + + +
+ + +h2 > h3 > h4 > h5 > h6 [parent freq] | +vars [freq] | +||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[1267]
+ General variables + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[974]
+ General variables + - + Temporal bounds + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1860]
+ General variables + - + Supra-cultural relations + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[15]
+ General variables + - + Supra-cultural relations + Language + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[342]
+ Social Complexity variables + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[862]
+ Social Complexity variables + Social Scale + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1287]
+ Social Complexity variables + Hierarchical Complexity + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[10]
+ Social Complexity variables + Hierarchical Complexity + - + 1. Village + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[2]
+ Social Complexity variables + Hierarchical Complexity + - + Guard units + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[972]
+ Social Complexity variables + Professions + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1249]
+ Social Complexity variables + Bureaucracy characteristics + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1239]
+ Social Complexity variables + Law + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1262]
+ Social Complexity variables + Specialized Buildings: polity owned + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1170]
+ Social Complexity variables + Specialized Buildings: polity owned + Transport infrastructure + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[282]
+ Social Complexity variables + Specialized Buildings: polity owned + Special purpose sites + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1725]
+ Social Complexity variables + Information + Writing System + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[2997]
+ Social Complexity variables + Information + Kinds of Written Documents + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[9]
+ Social Complexity variables + Information + Kinds of Written Documents + Money + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[9]
+ Social Complexity variables + Information + Kinds of Written Documents + Money + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1738]
+ Social Complexity variables + Information + Money + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[855]
+ Social Complexity variables + Information + Postal System + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[11]
+ Social Complexity variables + Information + - + Measurement System + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[350]
+ Warfare variables + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[12]
+ Warfare variables + - + Military use of Metals + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[25]
+ Warfare variables + - + Projectiles + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[16]
+ Warfare variables + - + Handheld weapons + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[12]
+ Warfare variables + - + Animals used in warfare + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[24]
+ Warfare variables + - + Armor + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[5]
+ Warfare variables + - + Naval technology + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[21]
+ Warfare variables + - + Fortifications + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1387]
+ Warfare variables + Military Technologies + Military use of Metals + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[4]
+ Warfare variables + Military Technologies + Military use of Metals + - + Copper (H7) |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[10]
+ Warfare variables + Military Technologies + Military use of Metals + Projectiles + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[21]
+ Warfare variables + Military Technologies + Military use of Metals + Handheld weapons + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[3]
+ Warfare variables + Military Technologies + Military use of Metals + Naval technology + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[11]
+ Warfare variables + Military Technologies + Military use of Metals + Fortifications + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[3493]
+ Warfare variables + Military Technologies + Projectiles + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[6]
+ Warfare variables + Military Technologies + Projectiles + Handheld weapons + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[2132]
+ Warfare variables + Military Technologies + Handheld weapons + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1776]
+ Warfare variables + Military Technologies + Animals used in warfare + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[3443]
+ Warfare variables + Military Technologies + Armor + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[2]
+ Warfare variables + Military Technologies + Armor + Naval technology + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[985]
+ Warfare variables + Military Technologies + Naval technology + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[33]
+ Warfare variables + Military Technologies + Naval technology + Fortifications + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[3784]
+ Warfare variables + Military Technologies + Fortifications + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[4]
+ Warfare variables + Military Technologies + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Warfare variables + Largest scale collective ritual of the official cult + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Warfare variables + Most widespread collective ritual of the official cult + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Warfare variables + Most frequent collective ritual of the official cult + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Warfare variables + Most euphoric collective ritual of the official cult + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Warfare variables + Most dysphoric collective ritual of the official cult + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[319]
+ Social Mobility + Status + - + Elite status + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1]
+ Social Mobility + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[313]
+ Religion and Normative Ideology + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[650]
+ Religion and Normative Ideology + Deification of Rulers + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[1523]
+ Religion and Normative Ideology + Normative Ideological Aspects of Equity and Prosociality + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[3410]
+ Religion and Normative Ideology + Moralizing Supernatural Powers + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[9]
+ Religion and Normative Ideology + Normative ideological Aspects of Equity and Prosociality + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[187]
+ Institutional Variables + - + - + - + - |
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||
[344]
+ Institutional Variables + Limits on Power of the Chief Executive + Power distributed + - + - |
+
+
|
+
Tags | -# | Polity | Year(s) | - {% block myheadings %} - {% endblock myheadings %} - {% include "core/partials/_confidence_disputed_expert.html" %} -Description | Update |
---|---|---|---|---|---|
1 | -+ {% block extracols %} + {% endblock extracols %} + {% include "core/partials/_all_tags_inline_new.html" %} + |
{% if object.polity.long_name %}
{{ object.polity.long_name }}
@@ -73,11 +87,7 @@ {{var_name_display}} |
{% include "core/partials/_years_block_new_object.html" %}
- {% block extracols %}
- {% endblock extracols %}
- {% include "core/partials/_confidence_disputed_expert_object.html" %}
- {% autoescape off %}{{ object.description }}{% endautoescape %} |
{% with object.clean_name|add:"-update" as meat %}
@@ -91,5 +101,81 @@ {{var_name_display}} |
Variable | -Definition | - -
---|---|
Polity | -The Seshat Polity Name | -
Year(s) | -The years for which we have the data. [negative = BCE] | -
Confidence | -Inferred : The value is inferred. - Suspected : The value is suspected (Expert Check Needed). - Evidenced : The value is backed up by sufficient evidence. |
-
Disputed? | -
- No : No disagreement among scholars. Yes : There is disagreement among scholars. - |
-
Expert? | - : Not yet Checked by a Seshat Expert. : Checked and accepted by a Seshat Expert (or RA). |
-
Variable | -Definition | -|||||||||
---|---|---|---|---|---|---|---|---|---|---|
{{ktop}} | - {% if vtop.var_exp %} -{{vtop.var_exp}} | - {% elif "Definition" in potential_cols %} -- {% endif %} - {% if vtop.scale %} - | {{vtop.scale}} | - {% elif "Scale" in potential_cols %} -- {% endif %} - {% if vtop.units %} - | {{vtop.units}} | - {% elif "Units" in potential_cols %} -- {% endif %} - {% if vtop.min %} - | {{vtop.min}} | - {% elif "Min" in potential_cols %} -- {% endif %} - {% if vtop.max %} - | {{vtop.max}} | - {% elif "Max" in potential_cols %} -- {% endif %} - |
# | +# | - Polity - - - | -- - Year(s) + Polity | {% block myheadings_list %} {% endblock myheadings_list %} - {% include "core/partials/_confidence_disputed_expert.html" %} - -Edit | +Tags | ++ + Year(s) + | +Edit | +Desc | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ forloop.counter }} | - {% if obj.polity %} -- {% if obj.polity.long_name %} - - {{ obj.polity.long_name }} - - {% else %} - - {{ obj.polity.name }} - - {% endif %} - - | - {% else %} -- | - {% endif%} - - {% include "core/partials/_years_block_new_obj.html" %} +||||||||||||||
+ {{ forloop.counter }} + {% if obj.comment and obj.comment.id > 1 %} + * + {% endif %} - - {% block extra_vars_list %} - {% endblock extra_vars_list %} - | - {% if obj.tag == "DSP" %} - {{ obj.get_tag_display }} - {% elif obj.tag == "SSP" %} - {{ obj.get_tag_display }} - {% elif obj.tag == "UNK" %} - {{ obj.get_tag_display }} - {% elif obj.tag == "IFR" %} - {{ obj.get_tag_display }} - {% else %} - {{ obj.get_tag_display }} - {% endif %} - | -- {% if obj.is_disputed %} - Yes - {% else %} - No - {% endif %} - | -- {% if obj.expert_reviewed %} - - {% else %} - - {% endif %} - | + - - {% if obj.display_citations %} - - - - {% endif %} - + {% if obj.polity %} ++ {% if obj.polity.long_name %} + + {{ obj.polity.long_name }} + + {% else %} + + {{ obj.polity.name }} + + {% endif %} + + | + {% else %} +- | + {% endif%} + + + {% block extra_vars_list %} + {% endblock extra_vars_list %} + {% include "core/partials/_all_tags_inline_obj.html" %} + + + {% include "core/partials/_years_block_new_obj.html" %} + + + {% block update_button %} + {% endblock update_button %} +- {% block update_button %} - {% endblock update_button %} - + | ||||||||||
+
+
+ {% autoescape off %}
+ {% if obj.description %}
+ {{ obj.description|make_references_look_nicer }}
+
+ + {% else %} + - + {% endif%} + {% if obj.comment and obj.comment.id > 1 %} + {{obj.comment }} + + {% endif %} + {% endautoescape %} + + |