Skip to content

Commit

Permalink
Channel comparison: Improve view for empty comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo committed Feb 22, 2016
1 parent ce5beec commit 832aa5d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
37 changes: 21 additions & 16 deletions app/views/channelcomparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
8 changes: 4 additions & 4 deletions web/style/transvision.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ h3 {
margin: 0 auto;
}

.subtitle {
text-align: center;
}

#page_title {
border-bottom: none;
font-size: 1.8em;
Expand Down Expand Up @@ -740,10 +744,6 @@ fieldset {
margin-top: 30px;
}

.subtitle {
text-align: center;
}

/* Glossary view */
#glossary_matches {
width: 80%;
Expand Down

0 comments on commit 832aa5d

Please sign in to comment.