Through to the end

This commit is contained in:
Anna Sidwell 2018-11-25 13:48:52 +00:00
parent d87604c6bd
commit 9384b6c9cb
4 changed files with 246 additions and 224 deletions

View File

@ -176,39 +176,6 @@ class LongCaseStudyForm(BaseCaseStudyForm):
initial=4326,
)
POSITIVE_CASE_TYPE_HELP = {
'CREP': _("We are using the World Wind Energy Association's Community Power definition, \
which is that a community project is one where at least \
two of the following three criteria are met:<br> \
1. Local stakeholders own the majority or all of a project,<br> \
2. Voting control rests with the community-based organization,<br> \
3. The majority of social and economic benefits are distributed locally."),
'EACP': _(""),
'PSEP': _(""),
'CORS': _("The extraction of non-renewable resources, such as iron, copper, \
rare-earth elements or other minerals and metals used in \
renewable technologies, directly from the Earth is by definition \
an unsustainable practice. Despite this, the extraction of such elements \
this way for use in the renewable energy transition is, to an extent, \
a necessary evil in the immediate term. Bearing this in mind, \
a case involving extraction may be considered 'positive' if it helps \
to reduce, overall, the need for more extraction; if it drastically \
reduces ecological harms often caused by mining and does not infringe \
on areas of high biodiversity; and if it meets outstanding social \
and human rights standards that are enjoyed and affirmed by \
host communities and other stakeholders. Such social standards include: \
ensuring communities, and especially indigenous peoples, \
enjoy their right to Free Prior and Informed Consent, \
which includes the right to reject projects; abiding by \
the UN's guiding principles on Business and Human Rights; \
full collaboration with the Extractive Industries Transparency Initiative, \
assuring excellence in the transparency of project financing, \
tax affairs and other transactions; the highest labour standards; \
equitable distribution of any benefits accruing from mining; \
respect for the rule of law and the constitutional rights of citizens \
in host countries."),
}
SECTOR_HELP = {
'RN': _("including electricity, heat or combined heat and power generation"),
'PG': '',
@ -238,10 +205,7 @@ class LongCaseStudyForm(BaseCaseStudyForm):
self.fields['positive_case_type'] = forms.ChoiceField(
widget=forms.RadioSelect(),
choices=self.add_explanatory_text(
CaseStudy.POSITIVE_CASE_TYPE_CHOICES,
self.POSITIVE_CASE_TYPE_HELP,
),
choices=CaseStudy.POSITIVE_CASE_TYPE_CHOICES,
required=False
)
@ -266,6 +230,40 @@ class LongCaseStudyForm(BaseCaseStudyForm):
self.fields['project_owners'].required = True
self.fields['shareholders'].required = True
self.fields['socioeconomic_benefits'].label = \
'<span class="organising organising-vs">' + \
_('Socio-environmental impacts (negative and potentially positive)') + \
'</span>' + \
'<span class="organising organising-pro">' + \
_('Socio-environmental impacts (positive and potentially negative)') + \
'</span>' + \
'<span class="organising organising-none organising-idk">' + \
_('Socio-environmental impacts (positive and negative)') + \
'</span>'
self.fields['socioeconomic_benefits'].help_text = \
'<span class="organising organising-none organising-idk">' + \
_('Please expand on your response given in the full description on page one. \
We would expect benefits to go beyond emissions savings, paying rent for land, \
or complying with environmental or social legislation. Please include other \
reasons, noting that we aim to focus on projects with substantive impacts on \
vulnerable groups.') + \
'</span>' + \
'<span class="organising organising-vs">' + \
_('Please expand on your response given in the description. Note that we aim to \
focus on violation of land rights / human rights / collective rights, substantive \
negative impacts on vulnerable groups, aggression / threats / violence, \
severe environmental and/or cultural impacts, abusive labor practices, and \
corruption / governance issues, but feel free to cover any additional aspect \
that you consider relevant. Please also describe and analyze socio-environmental \
impacts that could be presented or considered as positive.') + \
'</span>' + \
'<span class="organising organising-pro">' + \
_('Please expand on your response given in the description. Please also describe \
and analyze socio-environmental impacts that could be considered as negative.') + \
'</span>'
self.helper.form_action = reverse('long-form')
self.helper.layout = Layout(
TabHolder(
@ -273,14 +271,17 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'entry_name',
'location',
'country',
'shapefiles',
'shapefiles_files',
'coordinate_reference_system',
'name_of_territory_or_area',
'area_of_land',
'land_ownership',
'land_ownership_details',
'location_context',
'type_of_ecosystem',
'describe_ecosystem',
'people_affected_indigenous',
'people_affected_other',
'affected_communities',
'project_status',
'synopsis',
'full_description',
@ -321,7 +322,7 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'generation_technology_other',
'total_generation_capacity',
'generation_equipment_supplier',
'total_investment',
PrependedText('total_investment', 'USD$'),
'technical_or_economic_details',
css_id="power_generation_questions"
),
@ -332,7 +333,7 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'energy_storage_capacity',
'energy_transmission_capacity',
'contractor_or_supplier_of_technology',
'approximate_total_investment',
PrependedText('approximate_total_investment', 'USD$'),
'additional_technical_details',
css_id="power_grids_energy_storage_questions"
),
@ -366,31 +367,25 @@ class LongCaseStudyForm(BaseCaseStudyForm):
),
Tab(
_("Socio-environmental analysis"),
HTML("<p>" + _("In the following, we expect the analysis to reflect the perspective of the organization(s) or person(s) describing the case.") + "</p>"),
'positive_or_negative',
Fieldset(
_("Positive Case Questions"),
HTML("<b>What kind of case is this entry about?</b>"),
'positive_case_type',
'socioeconomic_benefits',
'project_status_detail',
'obstacles_and_hindrances',
'identified_partnerships',
css_id="positive_case_questions"
),
Fieldset(
_("Negative Case Questions"),
'negative_case_reasons',
'negative_case_reasons_other',
'negative_socioenvironmental_impacts',
'socioeconomic_benefits',
'isolated_or_widespread',
'key_actors_involved',
'project_status_detail',
'obstacles_and_hindrances',
'negative_socioenvironmental_impacts',
'when_did_organising_start',
'who_has_been_involved',
'participation_mechanisms',
'identified_partnerships',
'potential_partnerships',
'wants_conversation_with_ojuso',
css_id="negative_case_questions"
),
Div(
'key_actors_involved',
css_id="common_questions"
),
FormActions(
@ -417,10 +412,6 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'official_project_documents_files',
'other_documents',
'other_documents_files',
'shapefiles',
'shapefiles_files',
'coordinate_reference_system',
'name_of_territory_or_area',
'shown_on_other_platforms',
'shown_on_other_platforms_detail',
FormActions(

View File

@ -107,7 +107,7 @@ class CaseStudy(models.Model):
('UCONST', _('Under construction')),
('EXSTNG', _('In operation')),
('DECOMM', _('Undergoing decommissioning')),
('END', _('Decommissioned]')),
('END', _('Decommissioned')),
)
FINANCIAL_INSTITUTIONS = (
@ -271,10 +271,11 @@ class CaseStudy(models.Model):
)
POSITIVE_CASE_TYPE_CHOICES = (
('CREP', _('Community renewable energy project')),
('EACP', _('Energy as a commons project')),
('PSEP', _('Public/state (federal, state, municipal) energy project')),
('CORS', _('A case of responsible sourcing/supply chain/lifecycle management')),
('CREP', _('Community project (co-)owned by individuals')),
('EACP', _('Community project owned by not-for-profit organizations and/or serving the public interest')),
('PSEP', _('Public/state (federal, state, municipal) project')),
('CORS', _('Reuse / Recycling / Circular economy project')),
('OTHR', _('Other(s)'))
)
NEGATIVE_CASE_REASONS_OTHER_TEXT = _('Other reasons')
@ -324,6 +325,45 @@ class CaseStudy(models.Model):
# Slug derived from entry_name, used in urls for SEO
slug = AutoSlugField(populate_from=['entry_name'], editable=False)
##
# Territory info
##
location = models.PointField(
verbose_name=_("Project location")
)
shapefiles = models.ManyToManyField(
'files.File',
related_name='shapefile_for',
verbose_name=_("Geographic data"),
help_text=_("If you have territory that you would like to show in relation to this project \
- e.g. Bienes Comunales de Ixtepec etc. This is a set of 3 or more (often 5-6) \
files with file extensions like .cpg, .dbf, .prj, .qpj, .shp, .shx. \
\
Hold down Control, or Command on a Mac, to select more than one. \
Let us know (database@ojuso.org) if you have other file types or need help and we \
can work out how to import it. You may have data as GeoPackage (gpkg), GeoJSON, \
KML, GML, etc. or have data in PostGIS or another spatial database management \
system already."),
blank=True
)
coordinate_reference_system = models.ForeignKey(
SpatialRefSys,
null=True,
blank=True,
default=4326,
on_delete=models.PROTECT
)
name_of_territory_or_area = models.CharField(
verbose_name=_("Name of territory or area"),
max_length=512,
blank=True
)
##
# First Screen - Basic information
##
@ -338,11 +378,6 @@ class CaseStudy(models.Model):
max_length=128
)
# N/A - Not explicitly listed in spec
location = models.PointField(
verbose_name=_("Project location")
)
# 1.2
sector_of_economy = models.CharField(
verbose_name=_("Sector of economy"),
@ -350,14 +385,6 @@ class CaseStudy(models.Model):
choices=SECTOR_CHOICES
)
# 1.3
positive_or_negative = models.CharField(
verbose_name=_("What is the relationship of local community organization(s) to this project?"),
help_text=_("Please reflect the perspective of the organization(s) or person(s) describing the case."),
max_length=1,
choices=POSITIVE_NEGATIVE_CHOICES
)
# 1.4
country = CountryField(
verbose_name=_("Country"),
@ -852,102 +879,81 @@ class CaseStudy(models.Model):
##
# Third Screen - Socio-economic analysis
# Socio-economic analysis
##
# 3.1.1
positive_or_negative = models.CharField(
verbose_name=_("What is the relationship of local community organization(s) to this project?"),
max_length=1,
choices=POSITIVE_NEGATIVE_CHOICES
)
positive_case_type = models.CharField(
verbose_name=_('What kind of positive case is this entry about?'),
verbose_name=_('What kind of case is this entry about?'),
help_text=_('Select the most relevant type of positive case'),
choices=POSITIVE_CASE_TYPE_CHOICES,
max_length=4,
blank=True,
)
# 3.1.2
socioeconomic_benefits = models.TextField(
verbose_name=_('Socio-economic benefits'),
help_text=_('Please expand on your response given in the full description on page one. We would expect \
benefits to go beyond emissions savings, paying rent for land, or complying with environmental or social \
legislation'),
negative_case_reasons = MultiSelectField(
verbose_name=("What kind of case is this entry about?"),
choices=NEGATIVE_CASE_REASONS_CHOICES,
blank=True
)
socioeconomic_benefits = models.TextField(
verbose_name=_('Socio-economic impacts'),
blank=True
)
negative_socioenvironmental_impacts = models.TextField(
verbose_name=_("Describe the socio-environmental impacts (positive and negative):"),
help_text=_("Provide a detailed description of the socio-environmental impacts \
(please provide all relevant details, such as type of ecosystem and \
presence of any existing reserve in the area, land to have increased \
biodiversity as a result of the project, new protection of lands/waters, \
specific communities affected by the project, total geographic footprint \
of the project, and tenure system affected in the case of land grabs, \
kind of permits that were irregularly issued if this is the case."),
blank=True
)
isolated_or_widespread = models.TextField(
verbose_name=_("Is the project part of developments which are causing a cumulative effect?"),
help_text=_("Is this an isolated project or are there similar projects in the same \
geographic area? If so, can you describe them? Is there an analysis of \
cumulative or synergetic effects?"),
blank=True
)
# 3.1.3 + 3.2.5
key_actors_involved = models.TextField(
verbose_name=_('Key actors involved (individual/organisational)'),
blank=True
)
# 3.1.4
project_status_detail = models.TextField(
verbose_name=_('Current status of the project'),
help_text=_("Describe the current status of the project, expanding beyond 'existing', 'under construction' etc"),
verbose_name=_('Current status of the case'),
help_text=_("Describe the current situation and likely future scenarios."),
blank=True
)
# 3.1.5
obstacles_and_hindrances = models.CharField(
verbose_name=_('Obstacles and hindrances'),
help_text=_('List any obstacles or hindrances experienced in the course of the project'),
obstacles_and_hindrances = models.TextField(
verbose_name=_('Current status of the organizing process around this case'),
help_text=_('Please describe the status of the organizing process, including the obstacles and hindrances faced.'),
max_length=512,
blank=True
)
# 3.1.6
identified_partnerships = models.CharField(
verbose_name=_('Identified partnerships'),
help_text=_('Are you looking for partnerships or have any clearly identified need? If so, please describe it \
here.'),
help_text=_('Are you, or the organizing process that you represent, looking for partnerships, \
or have any clearly identified need? If so, please describe and we will try \
to connect you to appropriate partners.'),
max_length=256,
blank=True
)
# 3.1.7.1 + 3.2.8.1
contact_email = models.EmailField(
verbose_name=_('Email address'),
blank=True
)
# 3.1.7.2 + 3.2.8.1
contact_phone = PhoneNumberField(
verbose_name=_('Phone number'),
help_text=_('Please include the international prefix, beginning with "+".'),
blank=True
)
# 3.1.7.3 + 3.2.8.1
contact_website = models.URLField(
verbose_name=_('Website'),
blank=True
)
# 3.1.7.4 + 3.2.8.1
contact_twitter = models.CharField(
verbose_name=_('Twitter username'),
max_length=50,
blank=True
)
# 3.1.7.5 + 3.2.8.1
contact_facebook = models.URLField(
verbose_name=_('Facebook page'),
blank=True
)
# 3.1.7.6 + 3.2.8.1
contact_other = models.TextField(
verbose_name=_('Other contact details'),
blank=True
)
# 3.2.1
negative_case_reasons = MultiSelectField(
verbose_name=("Reasons this is a negative case study"),
choices=NEGATIVE_CASE_REASONS_CHOICES,
blank=True
)
# 3.2.1.9
negative_case_reasons_other = models.CharField(
verbose_name=_("Other reason for negative case"),
@ -957,30 +963,11 @@ class CaseStudy(models.Model):
blank=True
)
# 3.2.2
negative_socioenvironmental_impacts = models.TextField(
verbose_name=_("Describe the negative socio-environmental impacts"),
help_text=_("Provide a detailed description of the negative socio-environmental impacts (please provide all \
relevant details, such as type of ecosystem and presence of any existing reserve in the area, \
, specific communities affected by the project, total geographic footprint of the project, and \
tenure system affected in the case of land grabs, kind of permits that were irregularly issued if \
this is the case."),
blank=True
)
# 3.2.3
isolated_or_widespread = models.TextField(
verbose_name=_("Describe if the project is isolated or commonplace."),
help_text=_("Is this an isolated project or are there similar projects in the same geographic area? If there \
are more, can you describe them? Are there any significant cumulative synergistic effects?"),
blank=True
)
# 3.2.4.1
when_did_organising_start = models.CharField(
verbose_name=_("When did local organising efforts begin?"),
help_text=_("Before the project started? During project implementation? After project implementation? \
Describe in your own words."),
help_text=_("Before the project started? During project implementation? \
After project implementation? Describe in your own words."),
max_length=512,
blank=True
)
@ -998,15 +985,6 @@ class CaseStudy(models.Model):
blank=True
)
# 3.2.6
potential_partnerships = models.CharField(
verbose_name=_("Describe potential partnerships"),
help_text=_("Are you looking for partnerships or do you have any clearly identified need? If so, please \
describe it here."),
max_length=512,
blank=True
)
# 3.2.7
wants_conversation_with_ojuso = models.BooleanField(
verbose_name=_("Would you like to have a conversation with the ojuso team?"),
@ -1015,8 +993,46 @@ class CaseStudy(models.Model):
default=True
)
##
# Fourth Screen - Uploads
# Contact details
##
contact_email = models.EmailField(
verbose_name=_('Email address'),
blank=True
)
contact_phone = PhoneNumberField(
verbose_name=_('Phone number'),
help_text=_('Please include the international prefix, beginning with "+".'),
blank=True
)
contact_website = models.URLField(
verbose_name=_('Website'),
blank=True
)
contact_twitter = models.CharField(
verbose_name=_('Twitter username'),
max_length=50,
blank=True
)
contact_facebook = models.URLField(
verbose_name=_('Facebook page'),
blank=True
)
contact_other = models.TextField(
verbose_name=_('Other contact details'),
blank=True
)
##
# Uploads
##
# 4.1
@ -1024,7 +1040,8 @@ class CaseStudy(models.Model):
'files.File',
related_name='official_project_document_for',
verbose_name=_("Official project documents"),
help_text=_("Attach any legal or official documents that relate to the project."),
help_text=_("Attach any legal or official documents that relate to the project. \
Hold down Control, or Command on a Mac, to select more than one."),
blank=True,
)
@ -1033,37 +1050,11 @@ class CaseStudy(models.Model):
'files.File',
related_name='other_document_for',
verbose_name=_("Other documents"),
help_text=_("Attach any other documents that relate to the project."),
help_text=_("Attach any other documents that relate to the project. \
Hold down Control, or Command on a Mac, to select more than one."),
blank=True,
)
# 4.3.1
shapefiles = models.ManyToManyField(
'files.File',
related_name='shapefile_for',
verbose_name=_("Shapefiles"),
help_text=_("If you have territory that you would like to show in relation to this project - e.g. Bienes \
Comunales de Ixtepec etc. This is a set of 3 or more (often 5-6) files with file extensions like \
.cpg, .dbf, .prj, .qpj, .shp, .shx"),
blank=True
)
# 4.3.2
coordinate_reference_system = models.ForeignKey(
SpatialRefSys,
null=True,
blank=True,
default=4326,
on_delete=models.PROTECT
)
# 4.3.3
name_of_territory_or_area = models.CharField(
verbose_name=_("Name of territory or area"),
max_length=512,
blank=True
)
# 4.4
shown_on_other_platforms = models.BooleanField(
verbose_name=_("Is this case study shown on other platforms?"),

View File

@ -40,8 +40,8 @@
<!-- Conditional logic for hiding and un-hiding fields. -->
<script>
function showIf(thingToShow, whetherToShowIt) {
if (whetherToShowIt) {
function showIf(thingToShow, shouldShow) {
if (shouldShow) {
$(thingToShow).show()
} else {
$(thingToShow).hide()
@ -76,15 +76,10 @@
"showHide": ["#mineral_commodity_questions"],
"condition": ["SM"]
},
{ // 3.1
"field": "#id_positive_or_negative",
"showHide": ["#positive_case_questions"],
"condition": ["P"]
},
{ // 3.2
"field": "#id_positive_or_negative",
"showHide": ["#negative_case_questions"],
"condition": ["N"]
"showHide": ["#div_id_obstacles_and_hindrances"],
"condition": ["P", "N"]
}];
// Here we define the checkboxes that we need to use to
@ -109,7 +104,7 @@
}
];
var conditionalRadioGroups = [
var conditionalControls = [
{
name: "power_technology",
redraw: function() {
@ -153,7 +148,46 @@
showIf(section, input.checked)
}
}
},
{
name: "sector_of_economy",
redraw: function() {
const sector = document.forms['case-study-form'].sector_of_economy
const input = document.querySelector(`[name=positive_case_type][value=CORS]`)
// If sector of economy is transmission, mining, or processing
// Then enable this input. Otherwise, disable.
input.disabled = ['PG', 'SM', 'MA'].includes(sector.value) ? false : true
}
},
{
name: "positive_or_negative",
redraw: function() {
const setting = document.forms['case-study-form'].positive_or_negative
const relatedElements = [
{ value: 'P', elements: '.organising-pro' },
{ value: 'N', elements: '.organising-vs' },
{ value: 'X', elements: '.organising-none' },
{ value: 'U', elements: '.organising-idk' },
{ value: '', elements: '.organising-idk' },
]
let show = null
for (const { value, elements } of relatedElements) {
if (value === setting.value) {
show = elements
}
$(elements).css("display", "")
}
$(show).css("display", "inline")
}
},
]
// Define a function that hides the field and then creates a listener to toggle the field.
@ -230,8 +264,8 @@
$(item.checkbox).change();
});
conditionalRadioGroups.forEach(function (group) {
$(`input[name=${group.name}]`).on('change', group.redraw)
conditionalControls.forEach(function (group) {
$(`[name=${group.name}]`).on('change', group.redraw)
group.redraw();
});
});

View File

@ -146,6 +146,12 @@
}
/* socio-environmental analysis tab styles */
.organising {
display: none;
}
/*
* HOME PAGE
*/