Skip to content

Commit 832aa5d

Browse files
committed
Channel comparison: Improve view for empty comparison
1 parent ce5beec commit 832aa5d

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

app/views/channelcomparison.php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,26 @@
3030

3131
<?php
3232

33-
echo "\n<table class='collapsable'>" .
34-
" <tr>\n" .
35-
" <th colspan='3'>Locale: {$locale}</th>\n" .
36-
" </tr>\n" .
37-
" <tr>\n" .
38-
" <th>Key</th>\n" .
39-
" <th>{$chan1}</th>\n" .
40-
" <th>{$chan2}</th>\n" .
41-
" </tr>\n";
33+
if (empty($common_strings)) {
34+
echo "<h3>Comparison is empty</h3>\n" .
35+
"<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";
36+
} else {
37+
echo "\n<table class='collapsable'>" .
38+
" <tr>\n" .
39+
" <th colspan='3'>Locale: {$locale}</th>\n" .
40+
" </tr>\n" .
41+
" <tr>\n" .
42+
" <th>Key</th>\n" .
43+
" <th>{$chan1}</th>\n" .
44+
" <th>{$chan2}</th>\n" .
45+
" </tr>\n";
4246

43-
foreach ($common_strings as $key => $value) {
44-
echo " <tr>"
45-
. " <td><span class='celltitle'>Key</span><div class='string'>" . ShowResults::formatEntity($key) . "</div></td>\n"
46-
. " <td><span class='celltitle'>{$chan1}</span><div class='string'>" . ShowResults::highlight($value, $locale) . "</div></td>\n"
47-
. " <td><span class='celltitle'>{$chan2}</span><div class='string'>" . ShowResults::highlight($strings[$chan2][$key], $locale) . "</div></td>\n"
48-
. " </tr>\n";
47+
foreach ($common_strings as $key => $value) {
48+
echo " <tr>"
49+
. " <td><span class='celltitle'>Key</span><div class='string'>" . ShowResults::formatEntity($key) . "</div></td>\n"
50+
. " <td><span class='celltitle'>{$chan1}</span><div class='string'>" . ShowResults::highlight($value, $locale) . "</div></td>\n"
51+
. " <td><span class='celltitle'>{$chan2}</span><div class='string'>" . ShowResults::highlight($strings[$chan2][$key], $locale) . "</div></td>\n"
52+
. " </tr>\n";
53+
}
54+
echo "</table>\n";
4955
}
50-
echo "</table>\n";

web/style/transvision.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ h3 {
148148
margin: 0 auto;
149149
}
150150

151+
.subtitle {
152+
text-align: center;
153+
}
154+
151155
#page_title {
152156
border-bottom: none;
153157
font-size: 1.8em;
@@ -740,10 +744,6 @@ fieldset {
740744
margin-top: 30px;
741745
}
742746

743-
.subtitle {
744-
text-align: center;
745-
}
746-
747747
/* Glossary view */
748748
#glossary_matches {
749749
width: 80%;

0 commit comments

Comments
 (0)