Through row 140

This commit is contained in:
Anna Sidwell 2018-11-24 21:09:35 +00:00
parent 2fb4f8771c
commit d87604c6bd
3 changed files with 126 additions and 56 deletions

View File

@ -211,8 +211,9 @@ class LongCaseStudyForm(BaseCaseStudyForm):
SECTOR_HELP = {
'RN': _("including electricity, heat or combined heat and power generation"),
'PG': "",
'SM': _("including supply of minerals and/or manufacturing/processing of equipment used in the renewable energy economy")
'PG': '',
'SM': _("including supply of minerals"),
'MA': '',
}
POWER_TECHNOLOGY_HELP = {
@ -330,8 +331,6 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'power_technology_other',
'energy_storage_capacity',
'energy_transmission_capacity',
'maximum_power_output',
'discharge_time',
'contractor_or_supplier_of_technology',
'approximate_total_investment',
'additional_technical_details',
@ -350,6 +349,16 @@ class LongCaseStudyForm(BaseCaseStudyForm):
'associated_infrastructure',
css_id="mineral_commodity_questions"
),
Fieldset(
'',
'manufacturing_type',
'manufacturing_description',
'manufacturing_related_tech',
'manufacturing_factors',
'manufacturing_factors_description',
'manufacturing_ownership',
css_id="manufacturing_questions"
),
FormActions(
HTML("<a class='btn btn-primary btnPrevious'>"+_("Previous")+"</a>"),
HTML("<a class='btn btn-primary btnNext pull-right'>"+_("Next")+"</a>")

View File

@ -56,7 +56,8 @@ class CaseStudy(models.Model):
SECTOR_CHOICES = (
('RN', _('Renewable energy generation project')),
('PG', _('Energy networks and energy storage facilities')),
('SM', _('Supply chain and lifecycle management')),
('SM', _('Mining related to the renewable energy economy')),
('MA', _('Manufacturing and/or processing of equipment'))
)
POSITIVE_NEGATIVE_CHOICES = (
@ -226,13 +227,47 @@ class CaseStudy(models.Model):
)
USE_IN_ENERGY_ECONOMY_CHOICES = (
('WTM', _('Wind turbine manufacturing')),
('SPM', _('Solar panel manufacturing')),
('STM', _('Solar thermal system manufacturing')),
('HGM', _('Hydropower generator manufacturing')),
('GGM', _('Geothermal generator manufacturing')),
('ESS', _('Energy storage (inc. battery systems)')),
('OTR', _('Others'))
('CPV', _('Concentrated solar power (CSP)')),
('EPT', _('Electrical power transmission infrastructure')),
('ESS', _('Energy storage')),
('GGM', _('Geothermal')),
('HGM', _('Hydropower')),
('HNT', _('Heat networks')),
('SPM', _('Solar PV')),
('STM', _('Solar thermal systems')),
('WTM', _('Wind power')),
('ESS', _("Don't know")),
('OTR', _('Other'))
)
MANUFACTURING_TYPE_CHOICES = (
('GENERATE', _('Manufacturing of renewable energy generation equipment')),
('TRANSSTORE', _('Manufacturing of energy transmission or storage equipment')),
('RECYCLE', _('Recycling / reusing equipment or raw materials')),
('DISPOSAL', _('Disposal of equipment')),
('OTHER', _('Other')),
)
MANUFACTURING_RELATED_CHOICES = (
('PV', _('Solar PV')),
('CSP', _('CSP')),
('WIND', _('Wind power')),
('HYDRO', _('Hydropower')),
('GEO', _('Geothermal')),
('TRANSMIT', _('Electrical power transmission infrastructure')),
('STORE', _('Energy storage')),
('HEAT', _('Heat networks')),
('OTHER', _('Other')),
('IDK', _('Unknown')),
)
MANUFACTURING_FACTORS_CHOICES = (
('LAND', _('Land use')),
('LABOR', _('Labor rights')),
('ENVIRO', _('Environmental factors')),
('LIFECYCLE', _('Lifecycle management')),
('OWN', _('Ownership')),
('OTHER', _('Other(s)')),
)
POSITIVE_CASE_TYPE_CHOICES = (
@ -311,8 +346,6 @@ class CaseStudy(models.Model):
# 1.2
sector_of_economy = models.CharField(
verbose_name=_("Sector of economy"),
help_text=_("Which sector of the renewable energy economy is most\
relevant?"),
max_length=3,
choices=SECTOR_CHOICES
)
@ -709,40 +742,35 @@ class CaseStudy(models.Model):
blank=True
)
# 2.3.1.1
## Mining
minerals_or_commodities = models.CharField(
verbose_name=_("Mineral commodity/commodities"),
help_text=_("Select the mineral commodity that is primarily mined in this project"),
verbose_name=_("Primary mineral mined"),
help_text=_("What mineral commodity is primarily mined in this project?"),
max_length=3,
choices=MINERAL_COMMODITY_CHOICES,
blank=True
)
# 2.3.1.2
minerals_or_commodities_other = models.CharField(
verbose_name=_("Other mineral commodity"),
help_text=_("Enter the mineral commodity that isn't in the list."),
max_length=64,
minerals_or_commodities_other = models.TextField(
verbose_name=_("Other mineral commodities"),
help_text=_("Enter any mineral commodities not in the list. Separate each with a new line."),
blank=True
)
# 2.3.2
use_in_energy_economy = models.CharField(
use_in_energy_economy = MultiSelectField(
verbose_name=_("Potential use in renewable energy economy"),
help_text=_("Select the potential use of the minerals in the renewable energy economy"),
max_length=3,
max_length=128,
choices=USE_IN_ENERGY_ECONOMY_CHOICES,
blank=True
)
# 2.3.2.9
use_in_energy_economy_other = models.CharField(
verbose_name=_('Other use in energy economy'),
verbose_name=_('Other'),
max_length=128,
blank=True
)
# 2.3.3.1
project_life_span = models.CharField(
verbose_name=_("Project life span"),
help_text=_("e.g. 12 years of production, 15 years overall"),
@ -750,25 +778,21 @@ class CaseStudy(models.Model):
blank=True
)
# 2.3.3.2
size_of_concessions = models.CharField(
verbose_name=_("Size of concessions"),
help_text=_("Describe the size of concession(s) granted to company/companies (e.g. 'one concession encompassing\
2,300 hectares')"),
verbose_name=_("Size of concessions (land/marine area)"),
help_text=_("Describe the size of concession(s) granted to company/companies (e.g. 'one concession of 2,300 hectares')"),
max_length=200,
blank=True
)
# 2.3.3.3
projected_production_of_commodities = models.CharField(
verbose_name=_("Projected production of key commodities"),
help_text=_("Describe the projected production of commodities per annum and overall (e.g. '40 million tonnes of\
iron ore per year, 200 million tonnes over 5 year life of mine'"),
verbose_name=_("Estimated production of key commodities"),
help_text=_('Describe the projected production of commodities per annum and overall.<br>\
For example, "40 million tonnes of iron ore per year", "200 million tonnes over 5 year life of mine"'),
max_length=256,
blank=True
)
# 2.3.4
type_of_extraction = models.CharField(
verbose_name=_("Type of extraction"),
max_length=3,
@ -776,7 +800,6 @@ class CaseStudy(models.Model):
blank=True
)
# 2.3.5
associated_infrastructure = models.CharField(
verbose_name=_("Associated infrastructure in the locality"),
help_text=_("List any associated infrastructure in the locality (e.g. tailings dams/mine waste storage and \
@ -786,6 +809,48 @@ class CaseStudy(models.Model):
blank=True
)
## Manufacturing
manufacturing_type = models.CharField(
verbose_name=_("Which of the following options best describes this case?"),
max_length=16,
choices=MANUFACTURING_TYPE_CHOICES,
blank=True
)
manufacturing_description = models.TextField(
verbose_name=_("Description"),
help_text=_("Briefly describe manufacturing process and components/outputs.\
(less than 500 characters, about 2 tweets)."),
max_length=500,
blank=True
)
manufacturing_related_tech = MultiSelectField(
verbose_name=_("What technology is this case related to?"),
max_length=128,
choices=MANUFACTURING_RELATED_CHOICES,
blank=True
)
manufacturing_factors = MultiSelectField(
verbose_name=_("Choose the factors that make this case remarkable, in a positive or negative way"),
max_length=128,
choices=MANUFACTURING_FACTORS_CHOICES,
blank=True
)
manufacturing_factors_description = models.TextField(
verbose_name=_("Describe these factors"),
blank=True
)
manufacturing_ownership = models.TextField(
verbose_name=_("Describe the ownership structure of the project and its relation with the local community"),
blank=True
)
##
# Third Screen - Socio-economic analysis
##

View File

@ -103,6 +103,10 @@
checkbox: "#id_negative_case_reasons_8",
showHide: "#div_id_negative_case_reasons_other"
},
{
checkbox: "[name=use_in_energy_economy][value=OTR]",
showHide: "#div_id_use_in_energy_economy_other"
}
];
var conditionalRadioGroups = [
@ -135,24 +139,16 @@
{
name: "sector_of_economy",
redraw: function() {
var sections = [
{
"input": "id_id_sector_of_economy_0_1",
"section": "power_generation_questions",
},
{
"input": "id_id_sector_of_economy_0_2",
"section": "power_grids_energy_storage_questions",
},
{
"input": "id_id_sector_of_economy_0_3",
"section": "mineral_commodity_questions",
},
]
const sections = {
RN: "power_generation_questions",
PG: "power_grids_energy_storage_questions",
SM: "mineral_commodity_questions",
MA: "manufacturing_questions",
}
for (const option of sections) {
const input = document.getElementById(option.input)
const section = document.getElementById(option.section)
for (const option of Object.keys(sections)) {
const input = document.querySelector(`[name=sector_of_economy][value=${option}]`)
const section = document.getElementById(sections[option])
showIf(section, input.checked)
}