Permalink
Browse files

Channel comparison: Improve view for empty comparison

  • Loading branch information...
flodolo committed Feb 15, 2016
1 parent ce5beec commit 832aa5d3e814e914b588d32cade6cd80ebc14333
Showing with 25 additions and 20 deletions.
  1. +21 −16 app/views/channelcomparison.php
  2. +4 −4 web/style/transvision.css
@@ -30,21 +30,26 @@
<?php
-echo "\n<table class='collapsable'>" .
- " <tr>\n" .
- " <th colspan='3'>Locale: {$locale}</th>\n" .
- " </tr>\n" .
- " <tr>\n" .
- " <th>Key</th>\n" .
- " <th>{$chan1}</th>\n" .
- " <th>{$chan2}</th>\n" .
- " </tr>\n";
+if (empty($common_strings)) {
+ echo "<h3>Comparison is empty</h3>\n" .
+ "<p class='subtitle'>There are no string differences for this locale between the {$repos_nice_names[$chan1]} and {$repos_nice_names[$chan2]} channels.</p>\n";
+} else {
+ echo "\n<table class='collapsable'>" .
+ " <tr>\n" .
+ " <th colspan='3'>Locale: {$locale}</th>\n" .
+ " </tr>\n" .
+ " <tr>\n" .
+ " <th>Key</th>\n" .
+ " <th>{$chan1}</th>\n" .
+ " <th>{$chan2}</th>\n" .
+ " </tr>\n";
-foreach ($common_strings as $key => $value) {
- echo " <tr>"
- . " <td><span class='celltitle'>Key</span><div class='string'>" . ShowResults::formatEntity($key) . "</div></td>\n"
- . " <td><span class='celltitle'>{$chan1}</span><div class='string'>" . ShowResults::highlight($value, $locale) . "</div></td>\n"
- . " <td><span class='celltitle'>{$chan2}</span><div class='string'>" . ShowResults::highlight($strings[$chan2][$key], $locale) . "</div></td>\n"
- . " </tr>\n";
+ foreach ($common_strings as $key => $value) {
+ echo " <tr>"
+ . " <td><span class='celltitle'>Key</span><div class='string'>" . ShowResults::formatEntity($key) . "</div></td>\n"
+ . " <td><span class='celltitle'>{$chan1}</span><div class='string'>" . ShowResults::highlight($value, $locale) . "</div></td>\n"
+ . " <td><span class='celltitle'>{$chan2}</span><div class='string'>" . ShowResults::highlight($strings[$chan2][$key], $locale) . "</div></td>\n"
+ . " </tr>\n";
+ }
+ echo "</table>\n";
}
-echo "</table>\n";
@@ -148,6 +148,10 @@ h3 {
margin: 0 auto;
}
+.subtitle {
+ text-align: center;
+}
+
#page_title {
border-bottom: none;
font-size: 1.8em;
@@ -740,10 +744,6 @@ fieldset {
margin-top: 30px;
}
-.subtitle {
- text-align: center;
-}
-
/* Glossary view */
#glossary_matches {
width: 80%;

0 comments on commit 832aa5d

Please sign in to comment.