-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Render metrics for areas which don't have any indicators
- Loading branch information
1 parent
d6f8535
commit be852f4
Showing
3 changed files
with
46 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<% indicators.each do |indicator| %> | ||
<div class="country-assessment__indicator-block"> | ||
<div class="country-assessment__indicator"> | ||
<div class="country-assessment__indicator__title country-assessment__icon country-assessment__icon--<%= ascor_icon_for(indicator, @assessment) %>"> | ||
<%= "#{indicator.code.split('.').last}. #{indicator.text}" %> | ||
</div> | ||
<% if ascor_assessment_result_for(indicator, @assessment).source.present? %> | ||
<div class="country-assessment__indicator__source"> | ||
<%= link_to 'Source', ascor_assessment_result_for(indicator, @assessment).source %> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<%= render 'tpi/ascor/assessment_metrics', metrics: ascor_sub_indicators_for(indicator, metrics) %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<% metrics.each do |metric| %> | ||
<% next if metric.code == 'EP.1.a.ii' # skipped because EP.1.a.i and EP.1.a.ii are rendered via same React component %> | ||
|
||
<div class="country-assessment__metric-block"> | ||
<% if metric.code == 'EP.1.a.i' %> | ||
<%= render 'tpi/ascor/metrics_ep1a', recent_emissions: @recent_emissions %> | ||
<% else %> | ||
<div class="country-assessment__metric"> | ||
<div class="country-assessment__metric__title"> | ||
<%= "#{metric.code.split('.').last}. #{metric.text}" %> | ||
</div> | ||
<% if ascor_assessment_result_for(metric, @assessment).source.present? %> | ||
<div class="country-assessment__metric__source"> | ||
<%= link_to "Source (#{ascor_assessment_result_for(metric, @assessment).year})", ascor_assessment_result_for(metric, @assessment).source %> | ||
</div> | ||
<% end %> | ||
<% if ascor_assessment_result_for(metric, @assessment).answer.present? %> | ||
<div class="country-assessment__break"></div> | ||
<div class="country-assessment__metric__text"> | ||
<%= ascor_assessment_result_for(metric, @assessment).answer %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |