diff --git a/apps/files/static/files/upload.js b/apps/files/static/files/upload.js index a229548..d0bece8 100644 --- a/apps/files/static/files/upload.js +++ b/apps/files/static/files/upload.js @@ -253,6 +253,16 @@ class MultipleFilesWidget { } $(function() { + // Display OS-specific stuff + function os_class() { + if (navigator.platform.indexOf("Win") != -1) return "os-windows"; + if (navigator.platform.indexOf("Mac") != -1) return "os-mac"; + return "os-other"; + } + + document.querySelector('body').classList.add(os_class()) + + // Get the CSRF token for form submitting let csrf_token = document.querySelector("[name=csrfmiddlewaretoken]").value window.images = new MultipleFilesWidget( diff --git a/apps/map/forms.py b/apps/map/forms.py index 7d11bb1..6a0cfe9 100644 --- a/apps/map/forms.py +++ b/apps/map/forms.py @@ -18,13 +18,14 @@ from .widgets import JSONFileListWidget SECTOR_HELP = { 'RN': _("Including electricity, heat or combined heat and power generation"), 'PG': '', - 'ST': _('Biological, chemical, electrical, electromagnetic, electrochemical, mechanical including gravitational potential, thermal etc.'), + 'ST': _('Biological, chemical, electrical, electromagnetic, electrochemical,' + ' mechanical including gravitational potential, thermal, etc.'), 'SM': _("Including supply of minerals"), 'MA': '', } POWER_TECHNOLOGY_HELP = { - 'PT': _('Lines, transformers, machinery etc.'), + 'PT': _('Lines, transformers, machinery, etc.'), 'HN': _('District heating/cooling, etc.'), 'OT': '', } @@ -58,7 +59,9 @@ class PointOfInterest(forms.models.ModelForm): self.helper.include_media = False self.helper.form_action = reverse('point-of-interest-form') - self.helper.add_input(Submit('submit', _('Submit'), css_class='btn-success center-block')) + self.helper.add_input( + Submit('submit', _('Submit'), css_class='btn-success center-block') + ) class Meta: model = PointOfInterest @@ -192,6 +195,8 @@ class LongCaseStudyForm(BaseCaseStudyForm): ) shapefiles = forms.FileField( + label=CaseStudy.shapefiles_label, + help_text=CaseStudy.shapefiles_help_text, widget=BootstrapClearableFileInput(attrs={ 'url': reverse_lazy('files:upload'), 'field': 'shapefiles_files', @@ -385,10 +390,18 @@ class LongCaseStudyForm(BaseCaseStudyForm): ), Tab( _("Socio-environmental analysis"), - HTML("
" + _("In the following, we expect the analysis to reflect the perspective of the organization(s) or person(s) describing the case.") + "
"), + HTML( + "" + + _("In the following, we expect the analysis to reflect the" + " perspective of the organization(s) or person(s) describing" + " the case.") + "
" + ), 'positive_or_negative', Div( - HTML(""), + HTML( + ""), Div( 'positive_case_type', 'negative_case_reasons', @@ -407,7 +420,6 @@ class LongCaseStudyForm(BaseCaseStudyForm): 'who_has_been_involved', 'participation_mechanisms', 'identified_partnerships', - 'wants_conversation_with_ojuso', Div( css_class="common_questions" ), diff --git a/apps/map/models.py b/apps/map/models.py index 2f20e30..a995b0d 100644 --- a/apps/map/models.py +++ b/apps/map/models.py @@ -76,7 +76,7 @@ class CaseStudy(models.Model): TYPE_OF_ECOSYSTEM_CHOICES = ( ('MARINE', _('Marine (e.g. ocean, sea)')), - ('FRESH', _('Freshwater (e.g. freshwater, lake)')), + ('FRESH', _('Freshwater (e.g. river, lake)')), ('FOREST', _('Forest/jungle')), ('AGRI', _('Agricultural land')), ('GRASS', _('Grassland')), @@ -94,7 +94,7 @@ class CaseStudy(models.Model): ) PROJECT_STATUS_CHOICES = ( - ('INIT', _('Initiation/ideation')), + ('INIT', _('Initial/conceptual')), ('PROJCD', _('In planning and design')), ('FAIL', _('Failed')), ('UCONST', _('Under construction')), @@ -119,7 +119,6 @@ class CaseStudy(models.Model): ('EC', _('European Commission (EC)')), ('EIB', _('European Investment Bank (EIB)')), ('IADB', _('Inter-American Development Bank Group (IDB, IADB)')), - ('IFFIm', _('International Finance Facility for Immunisation (IFFIm)')), ('IFAD', _('International Fund for Agricultural Development (IFAD)')), ('IIB', _('International Investment Bank (IIB)')), ('IsDB', _('Islamic Development Bank (IsDB)')), @@ -141,9 +140,9 @@ class CaseStudy(models.Model): ) GENERATION_TYPE_CHOICES = ( - ('POW', _('Power')), - ('HOT', _('Heat/Cool')), - ('CHP', _('Combined Heat/Cool and Power (CHP)')), + ('POW', _('Electricity')), + ('HOT', _('Heat/Cold')), + ('CHP', _('Combined Heat/Cold and Power (CHP, CCP or CCHP)')), ) GENERATION_TECHNOLOGY_CHOICES = ( @@ -151,7 +150,7 @@ class CaseStudy(models.Model): ('GEOT', _('Geothermal electricity')), (_('Hydro'), ( ('uHYD', _('Micro hydro (<100kW)')), - ('SHYD', _('Small-scale hydro (<1MW)')), + ('SHYD', _('Small-scale hydro (100kW-1MW)')), ('MHYD', _('Medium-scale hydro (1-30MW)')), ('LHYD', _('Large-scale hydro (>30MW - often not considered renewable)')), )), @@ -173,11 +172,11 @@ class CaseStudy(models.Model): ('SSWE', _('Small-scale wind (<500kW)')), ('LSWE', _('Large-scale wind (>500kW)')) )), - ('OTHR', _('Other (tidal, wave, etc.)')) + ('OTHR', _('Other')) ) POWER_TECHNOLOGY_CHOICES = ( - ('PT', _('Electrical power transmission')), + ('PT', _('Electrical power transmission/distribution')), ('HN', _('Heat networks')), ('OT', _('Other')), ) @@ -195,15 +194,18 @@ class CaseStudy(models.Model): ('BER', _('Beryllium')), ('CAD', _('Cadmium')), ('CHR', _('Chromium')), - ('COK', _('Coking')), - ('COA', _('Coal (for steel)')), + ('COK', _('Coking coal (for steel)')), ('COP', _('Copper')), ('GAL', _('Gallium')), ('GER', _('Germanium')), ('GLD', _('Gold')), - ('HRE', _('Heavy rare earth elements (gadolinium, terbium, dysprosium, holmium, erbium, thulium, ytterbium, lutetium, yttrium, scandium)')), + ('HRE', _( + 'Heavy rare earth elements (gadolinium, terbium, dysprosium, holmium,' + ' erbium, thulium, ytterbium, lutetium, yttrium, scandium)')), ('IRN', _('Iron')), - ('LRE', _('Light rare earth elements (lanthanum, cerium, praseodymium, neodymium, promethium, samarium, europium)')), + ('LRE', _( + 'Light rare earth elements (lanthanum, cerium, praseodymium, neodymium,' + ' promethium, samarium, europium)')), ('LED', _('Lead')), ('LIT', _('Lithium')), ('MAN', _('Manganese')), @@ -211,7 +213,9 @@ class CaseStudy(models.Model): ('MOL', _('Molybdenum')), ('NIC', _('Nickel')), ('NIO', _('Niobium')), - ('PGM', _('Platinum group metals (ruthenium, rhodium, palladium, osmium, iridium, and platinum)')), + ('PGM', _( + 'Platinum group metals (ruthenium, rhodium, palladium, osmium,' + ' iridium, and platinum)')), ('RHE', _('Rhenium')), ('SIL', _('Silicon')), ('SIV', _('Silver')), @@ -227,13 +231,13 @@ class CaseStudy(models.Model): ) USE_IN_ENERGY_ECONOMY_CHOICES = ( - ('CPV', _('Concentrated solar power (CSP)')), - ('EPT', _('Electrical power transmission infrastructure')), + ('CPV', _('Concentrated solar power (CSP) tower')), + ('EPT', _('Electrical power transmission/distribution infrastructure')), ('ESS', _('Energy storage')), ('GGM', _('Geothermal')), ('HGM', _('Hydropower')), ('HNT', _('Heat networks')), - ('SPM', _('Solar PV')), + ('SPM', _('Solar photovoltaic')), ('STM', _('Solar thermal systems')), ('WTM', _('Wind power')), ('ESS', _("Don't know")), @@ -243,7 +247,7 @@ class CaseStudy(models.Model): 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')), + ('RECYCLE', _('Recycling/reusing equipment or raw materials')), ('DISPOSAL', _('Disposal of equipment')), ('OTHER', _('Other')), ) @@ -272,23 +276,31 @@ class CaseStudy(models.Model): POSITIVE_CASE_TYPE_CHOICES = ( ('CREP', _('Community project (co-)owned by individuals')), - ('EACP', _('Community project owned by not-for-profit organizations and/or serving the public interest')), + ('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')), + ('CORS', _('Circular economy project / Reuse / Recycling')), ) NEGATIVE_CASE_REASONS_CHOICES = ( ('VOLR', _('Violation of land rights')), - ('VOHR', _('Violation of fundamental human rights, indigenous rights and/or other collective rights')), - ('EIMP', _('Environmental impacts (severe impacts on ecosystems / violation of laws,' - ' plans or programs of environmental conservation or territorial governance systems,' - ' etc.')), - ('NCUL', _('Negative cultural impacts (erosion/destruction of bio-cultural heritage,' - ' impacts on sacred land, etc.)')), - ('AGGR', _('Aggression/threats to community members opposed to the project, collaboration' - ' with organized crime, etc.')), + ('VOHR', _( + 'Violation of fundamental human rights, indigenous rights and/or other' + ' collective rights')), + ('EIMP', _( + 'Environmental impacts (severe impacts on ecosystems / violation of laws' + ' plans or programs of environmental conservation, etc.')), + ('NCUL', _( + 'Negative cultural impacts (erosion/destruction of bio-cultural heritage,' + ' impacts on sacred land, etc.)')), + ('AGGR', _( + 'Aggression/threats to community members opposed to the project,' + ' collaboration with organized crime, etc.')), ('ALAB', _('Abusive labour practices')), - ('CRUP', _('Corruption and/or irregular permitting or contracting, conflicts of interest, etc.')), + ('CRUP', _( + 'Corruption and/or irregular permitting or contracting, conflicts of' + ' interest, etc.')), ) # Dynamically generate a list of choices 40 years prior and after the current year. @@ -329,16 +341,27 @@ class CaseStudy(models.Model): verbose_name=_("Project location") ) + shapefiles_label = _( + "Do you have geographic information files about the territory impacted by" + " this project?" + ) + + shapefiles_help_text = _( + "For example, of the limits of the land within which a project is taking" + " place, or of sites of particular importance. You can upload data in" + " different formats (ESRI Shapefiles with file extensions like .cpg, .dbf," + " .prj, .qpj, .shp, .shx., or GeoPackage gpkg, GeoJSON, KML, GML, etc.)." + " Write to database@ojuso.org if you need help." + ) + 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 i.e. area(s) of land or water affected by the project, or maybe the limits of the land within which a project is taking place or the sites of particular objects of importance. ESRI Shapefiles are a popular file type: they comprise 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. You may have data as GeoPackage (gpkg), GeoJSON, KML, GML, etc. or have data in PostGIS or another spatial database management system already. Let us know (database@ojuso.org) if you have other file types or need help and we can work out how to import it."), + verbose_name=shapefiles_label, + help_text=shapefiles_help_text, blank=True ) - - coordinate_reference_system = models.ForeignKey( SpatialRefSys, null=True, @@ -368,7 +391,7 @@ class CaseStudy(models.Model): # 1.4 country = CountryField( verbose_name=_("Country"), - help_text=_("Select the country of the project") + help_text=_("Please select the country of the project.") ) # 1.5.1 @@ -388,9 +411,9 @@ class CaseStudy(models.Model): # 1.5.3 land_ownership_details = models.TextField( verbose_name=_("Land ownership/tenure details"), - help_text=_("Please specify details about land ownership, including" - " conflicting claims, unrecognized customary rights, conflicts" - " around land lease or purchase contracts, etc." + help_text=_("
Please specify details about land ownership," + " including conflicting claims, unrecognized customary rights, " + " conflicts around land lease or purchase contracts, etc." "" "
We understand this is a difficult question, so" " please try to provide just the information you know.
"), @@ -401,7 +424,8 @@ class CaseStudy(models.Model): # 1.5.4 location_context = models.CharField( verbose_name=_("Location"), - help_text=_("Select the context that is most applicable to this case study."), + help_text=_( + "Please select the context that is most applicable to this case study."), max_length=3, choices=LOCATION_CONTEXT_CHOICES ) @@ -416,7 +440,7 @@ class CaseStudy(models.Model): # 1.5.5.3 describe_ecosystem = models.TextField( - verbose_name=_("Describe the ecosystem"), + verbose_name=_("Please describe the ecosystem."), ) affected_communities = MultiSelectField( @@ -443,9 +467,9 @@ class CaseStudy(models.Model): # 1.7 start_year = models.IntegerField( verbose_name=_("Construction start year"), - help_text=_("Select the year project construction began. If the project is not yet" - " in construction, select the assumed start year as detailed in company" - " information or media."), + help_text=_("Please select the year project construction began." + "If the project is not yet in construction, select the assumed" + " start year as detailed in company information or media."), choices=YEAR_CHOICES, blank=True, null=True @@ -454,9 +478,10 @@ class CaseStudy(models.Model): # 1.8 completion_year = models.IntegerField( verbose_name=_("Operation start year"), - help_text=_("Select the year the project's operation and maintenance (O&M) phase began." - " If the project is not yet in operation, select the year operation is expected" - " to begin as detailed in company information or media."), + help_text=_( + "Please select the year the project's operation and maintenance (O&M) phase" + " began. If the project is not yet in operation, select the year operation " + " is expected to begin as detailed in company information or media."), choices=YEAR_CHOICES, default=None, null=True, @@ -466,45 +491,48 @@ class CaseStudy(models.Model): # 1.9 synopsis = models.TextField( verbose_name=_("Project synopsis"), - help_text=_("Briefly summarise the project. This will be displayed at the top of the case study page. (Maximum 500 chars)") + help_text=_("Please briefly summarise the project. (Maximum 500 characters.)"), + max_length=500 ) # 1.10 full_description = models.TextField( verbose_name=_("Full description"), - help_text=_("Describe the project in full. Separate paragraphs with two" + help_text=_("Please describe the project in full. Separate paragraphs with two" " new lines. Please add as much detail as you feel is necessary" " here.") ) # 1.11 project_owners = models.TextField( - verbose_name=_("Project and facility owners"), - help_text=_("List companies or organisations that own the project and/or facilities." - " Provide company numbers etc. if available. Separate with a new line."), + verbose_name=_("Project owners"), + help_text=_("Please list companies or organisations that own the project." + " Write each name in a new line."), blank=True ) consultants_contractors = models.TextField( verbose_name=_("Consultants and contractors"), - help_text=_("List consultants, planners or organisations that are doing the planning," - " construction, operation or maintenance work relating to the project" - " and/or facilities. Separate each with a new line."), + help_text=_("Please list consultants, planners or organisations that are doing" + " the planning, construction, operation or maintenance work relating" + " to the project and/or facilities. Separate each with a new line."), blank=True ) # 1.12 shareholders = models.TextField( verbose_name=_("Shareholders of the project owners"), - help_text=_("List shareholders of the project owners you've just listed. Separate with a new line."), + help_text=_("List the shareholders of the company/companies that own the" + " project, if you have this information. Separate with a new line."), blank=True ) # 1.13.1 financial_institutions = MultiSelectField( verbose_name=_("Financial institutions"), - help_text=_("Select any financial institutions (public or private) that have," - " or are considering, extending loans or guarantees to the project."), + help_text=_("Please select any financial institutions (public or private) that" + " have, or are considering extending loans or guarantees to the" + " project."), choices=FINANCIAL_INSTITUTIONS, blank=True ) @@ -512,7 +540,8 @@ class CaseStudy(models.Model): # 1.13.2 financial_institutions_other = models.TextField( verbose_name=_("Financial institutions – other"), - help_text=_("List any other financial institutions not listed above. Put each on a new line."), + help_text=_("Please list any other financial institutions not listed above." + " Separate with a new line."), blank=True ) @@ -550,37 +579,42 @@ class CaseStudy(models.Model): # 1.17.1 media_coverage_mainstream = models.TextField( verbose_name=_("Links to media reports"), - help_text=_("Provide any links to mainstream media coverage."), + help_text=_("Please provide any links to mainstream media coverage."), blank=True, ) # 1.17.2 media_coverage_independent = models.TextField( verbose_name=_("Independent grassroots reports"), - help_text=_("Provide any links to grassroots/independent media coverage."), + help_text=_("Please provide any links to grassroots/independent media coverage."), blank=True, ) # 1.18.1 community_voices = models.TextField( verbose_name=_("Community Voices"), - help_text=_("Add any direct quotes from members of the community that relate to this project"), + help_text=_( + "Please add any direct quotes from members of the community that relate" + " to this project."), blank=True, ) # 1.18.2 direct_comms = models.TextField( verbose_name=_("Reports of direct communications"), - help_text=_("Add any reports of direct communication between community members and" - " representatives of developers/companies/investors. If you have files" - " to upload, you can do this in 'other documents' on the 'uploads' tab."), + help_text=_( + "Please add any reports of direct communication between community members" + " and representatives of developers/companies/investors. If you have files" + " to upload, you can do this in 'other documents' on the 'uploads' tab."), blank=True, ) # 1.18.3 social_media_links = models.TextField( verbose_name=_("Social media links"), - help_text=_("Add any links to social media accounts directly relating to the project."), + help_text=_( + "Please add any links to social media accounts directly relating" + " to the project."), max_length=500, blank=True, ) @@ -590,14 +624,14 @@ class CaseStudy(models.Model): ## sector_of_economy = models.CharField( - verbose_name=_("Sector of economy"), + verbose_name=_("Sector of renewable energy economy"), max_length=3, choices=SECTOR_CHOICES ) energy_details = models.CharField( - verbose_name=_("Further details"), - help_text=_("Please give more information about the transmission, network or storage technology."), + verbose_name=_("Technology type"), + help_text=_("Please provide more information about the type of technology this case study focuses on."), max_length=200, blank=True ) @@ -605,7 +639,7 @@ class CaseStudy(models.Model): ## Energy generation project generation_type = models.CharField( - verbose_name=_('What is being generated?'), + verbose_name=_('What kind of energy is generated?'), max_length=4, choices=GENERATION_TYPE_CHOICES, blank=True @@ -613,7 +647,8 @@ class CaseStudy(models.Model): generation_technology = models.CharField( verbose_name=_("Generation technology"), - help_text=_("Select the type of renewable energy generation that most applies to this case study."), + help_text=_("Please select the type of renewable energy generation that most" + " applies to this case study."), max_length=4, choices=GENERATION_TECHNOLOGY_CHOICES, blank=True @@ -623,14 +658,15 @@ class CaseStudy(models.Model): biomass_detail = models.CharField( verbose_name=_("Bio-energy feedstock"), help_text="Please describe the source of the fuel and how it is processed/used. Please consider:
" - "Please describe the source of the fuel and how it is processed/used." + " Please consider:
\n" + "We do not expect users to know this information, but if you do " " it may be useful to give a fuller picture.
" ) + "- ojuso’s aim is to promote best practice in the renewable energy - industry, to encourage divestment from ecologically and socially - destructive projects, and to foster improvements in supply chain and - lifecycle management in the sector. + ojuso’s aims are to promote best practice in the renewable energy industry, to avoid investment in ecologically and socially destructive projects, and to foster improvements in supply chain and lifecycle management in the sector.
- ojuso provides a platform for information exchange and - cooperation between different sectors involved in the renewable energy - economy and is supportive of ethical and ecologically sound practices. - This platform consists of an online map and database of positive and - negative case studies, contributed by communities affected by and - leading the transition, and a series of discussion fora and features, - contributed by a diversity of players. -
+ ojuso provides a platform for information exchange and cooperation between different sectors involved in the renewable energy economy and is supportive of ethical and ecologically sound practices. This platform consists of an online map and database of positive and negative case studies, contributed by communities affected by, or leading, renewable energy projects, and of a series of discussion fora and features, contributed by diverse players.- You are welcome to submit a case study through this map tool. - Following submission, cases will be moderated and, if successful, - placed on the map. If you need any help or have any suggestions, - please post messages on our forum. + You are welcome to submit a case study through this tool. Following submission, cases will be moderated and, if successful, placed on the map. If you need any help or have any suggestions, please post messages on our forum.
{% endblocktrans %}diff --git a/assets/css/ojuso.css b/assets/css/ojuso.css index efe1acc..ecb7073 100644 --- a/assets/css/ojuso.css +++ b/assets/css/ojuso.css @@ -30,6 +30,11 @@ h1 { .mx-1 { margin-left: 10px; } +.only-windows { display: none; } +.os-windows .only-windows { display: initial; } + +.only-mac { display: none; } +.os-mac .only-mac { display: initial; } /* * LAYOUT