Permalink
Browse files

Fixes in health status view + removing repocomparison.php

  • Loading branch information...
TheoChevalier committed Feb 29, 2016
1 parent ec10869 commit a3c97f25f97b74e16d5fa34c99baa2b864130612
Showing with 14 additions and 43 deletions.
  1. +0 −3 app/inc/dispatcher.php
  2. +5 −1 app/models/health_status.php
  3. +5 −11 app/views/health_status.php
  4. +0 −26 app/views/repocomparison.php
  5. +4 −2 app/views/showrepos.php
View
@@ -70,9 +70,6 @@
$page_descr = 'Show productization aspects for this locale.';
$css_include = ['productization.css'];
break;
case 'repocomparison':
$view = 'repocomparison';
break;
case 'rss':
$controller = 'changelog';
$template = false;
@@ -88,6 +88,7 @@
$locale_entities = $filter_pattern($locale);
$english_entities = $filter_pattern($ref_locale);
$english_strings = $locale_strings = [];
// Skip some special cases (mostly optional strings)
$path = [];
@@ -260,7 +261,10 @@ function ($entity) use ($path) {
$stats = Health::getStats($projects);
$translated = $stats['translated'];
$reference = $stats['total'];
$completion = round(($translated / $reference) * 100, 2);
// Making sure we never divide by zero while computing percentage
$completion = $reference == 0 ? 0 : round(($translated / $reference) * 100, 2);
$completion = $completion > 100 ? 100 : $completion;
// Get color from completion value
@@ -1,14 +1,8 @@
<form name="searchform" id="simplesearchform" method="get" action="">
<fieldset id="main_search">
<fieldset>
<label>Locale</label>
<select name="locale" title="Locale">
<?=$target_locales_list?>
</select>
</fieldset>
<input type="submit" value="Go" alt="Go" />
</fieldset>
</form>
<?php
// Include the common simple search form
include __DIR__ . '/simplesearchform.php';
?>
<h3>Health Status for <?=$page_locale?></h3>
<div id="wrapper">

This file was deleted.

Oops, something went wrong.
View
@@ -28,7 +28,7 @@
$string_count = [];
// Referen_ce locale count
// Reference locale count
$count_reference = count($strings['en-US'][$repo]);
foreach ($gaia_locales as $val) {
@@ -57,7 +57,9 @@
foreach ($string_count as $locale => $numbers) {
$completion = $count_reference - $numbers['identical'] - $numbers['missing'];
$completion = number_format($completion / $count_reference * 100);
// Making sure we never divide by zero while computing percentage
$completion = $count_reference == 0 ? 0 : number_format($completion / $count_reference * 100);
if ($completion >= 99) {
$confidence = 'Highest';

0 comments on commit a3c97f2

Please sign in to comment.