Skip to content
Snippets Groups Projects
Commit 6ab58406 authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Fix layouts for single language systems

* FAQ Articles
* FAQ Categories
* Access templates
parent 81b8d9d1
No related branches found
No related tags found
No related merge requests found
......@@ -60,16 +60,19 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
<div style="margin-top:20px"></div>
<ul class="tabs" style="margin-top:9px;">
<ul class="tabs clean" style="margin-top:9px;">
<li class="active"><a href="#info"><?php echo __('Category Information'); ?></a></li>
<li><a href="#notes"><?php echo __('Internal Notes'); ?></a></li>
</ul>
<div class="tab_content" id="info">
<table width="100%"><tr>
<?php
$langs = Internationalization::getConfiguredSystemLanguages();
if (count($langs) > 1) { ?>
<ul class="vertical tabs left" style="margin-top:10px;">
<td valign="top">
<ul class="vertical tabs left" id="trans" style="margin-top:10px;">
<li class="empty"><i class="icon-globe" title="This content is translatable"></i></li>
<?php foreach ($langs as $tag=>$i) {
list($lang, $locale) = explode('_', $tag);
......@@ -81,11 +84,12 @@ if (count($langs) > 1) { ?>
</a></li>
<?php } ?>
</ul>
</td>
<?php
} ?>
<td id="trans_container">
<?php foreach ($langs as $tag=>$i) {
$code = $i['code'];
$cname = 'name';
......@@ -100,12 +104,12 @@ if (count($langs) > 1) { ?>
$cname = "trans[$code][$cname]";
$dname = "trans[$code][$dname]";
} ?>
<div class="tab_content" style="margin:0 48px;<?php
if ($code != $cfg->getPrimaryLanguage()) echo "display:none;";
<div class="tab_content left <?php
if ($code != $cfg->getPrimaryLanguage()) echo "hidden";
?>" id="lang-<?php echo $tag; ?>"
<?php if ($i['direction'] == 'rtl') echo 'dir="rtl" class="rtl"'; ?>
>
<div style="padding:8px 0;">
<div style="padding-bottom:8px;">
<b><?php echo __('Category Name');?></b>:
<span class="error">*</span>
<div class="faded"><?php echo __('Short descriptive name.');?></div>
......@@ -125,6 +129,7 @@ if (count($langs) > 1) { ?>
echo $desc; ?></textarea>
</div>
<?php } ?>
</td></tr></table>
</div>
......
......@@ -116,7 +116,7 @@ if ($topics = Topic::getAllHelpTopics()) {
<div style="margin-top:20px"></div>
<ul class="tabs" style="margin-top:9px;">
<ul class="tabs clean" style="margin-top:9px;">
<li class="active"><a href="#article"><?php echo __('Article Content'); ?></a></li>
<li><a href="#attachments"><?php echo __('Attachments') . sprintf(' (%d)',
$faq ? count($faq->attachments->getSeparates('')) : 0); ?></a></li>
......@@ -128,10 +128,12 @@ if ($topics = Topic::getAllHelpTopics()) {
<?php echo __('Here you can manage the question and answer for the article. Multiple languages are available if enabled in the admin panel.'); ?>
<div class="clear"></div>
<table width="100%"><tr>
<?php
$langs = Internationalization::getConfiguredSystemLanguages();
if ($faq) { ?>
<ul class="vertical tabs left" style="margin-top:10px;">
if ($faq && count($langs) > 1) { ?>
<td valign="top">
<ul class="vertical tabs left" id="trans" style="margin-top:10px;">
<li class="empty"><i class="icon-globe" title="This content is translatable"></i></li>
<?php foreach ($langs as $tag=>$i) {
list($lang, $locale) = explode('_', $tag);
......@@ -143,9 +145,11 @@ if ($faq) { ?>
</a></li>
<?php } ?>
</ul>
</td>
<?php
} ?>
<td id="trans_container">
<?php foreach ($langs as $tag=>$i) {
$code = $i['code'];
if ($tag == $cfg->getPrimaryLanguage()) {
......@@ -163,8 +167,8 @@ if ($faq) { ?>
$aname = 'trans['.$code.'][answer]';
}
?>
<div class="tab_content" style="margin:0 45px;<?php
if ($code != $cfg->getPrimaryLanguage()) echo "display:none;";
<div class="tab_content <?php
if ($code != $cfg->getPrimaryLanguage()) echo "hidden";
?>" id="lang-<?php echo $tag; ?>"
<?php if ($i['direction'] == 'rtl') echo 'dir="rtl" class="rtl"'; ?>
>
......@@ -184,6 +188,7 @@ if ($faq) { ?>
</div>
<div>
<textarea name="<?php echo $aname; ?>" cols="21" rows="12"
data-width="670px"
class="richtext draft" <?php
list($draft, $attrs) = Draft::getDraftAndDataAttrs('faq', $namespace, $answer);
echo $attrs; ?>><?php echo $draft ?: $answer;
......@@ -192,6 +197,7 @@ echo $attrs; ?>><?php echo $draft ?: $answer;
</div>
</div>
<?php } ?>
</td></tr></table>
</div>
<div class="tab_content" id="attachments" style="display:none">
......@@ -226,7 +232,7 @@ echo $attrs; ?>><?php echo $draft ?: $answer;
</ul>
<?php foreach ($langs as $lang=>$i) {
$code = $i['code']; ?>
<div class="tab_content" style="margin-left:45px" id="attachments-<?php echo $i['code']; ?>" <?php if ($i['code'] != $cfg->getPrimaryLanguage()) echo 'style="display:none;"'; ?>>
<div class="tab_content" id="attachments-<?php echo $i['code']; ?>" <?php if ($i['code'] != $cfg->getPrimaryLanguage()) echo 'style="display:none;"'; ?>>
<div style="padding:0 0 9px">
<strong><?php echo sprintf(__(
/* %s is the name of a language */ 'Attachments for %s'),
......@@ -260,5 +266,3 @@ echo $attrs; ?>><?php echo $draft ?: $answer;
<input type="button" name="cancel" value="<?php echo __('Cancel'); ?>" onclick='window.location.href="faq.php?<?php echo $qstr; ?>"'>
</p>
</form>
<link rel="stylesheet" type="text/css" href="<?php echo ROOT_PATH; ?>css/jquery.multiselect.css" />
......@@ -9,10 +9,14 @@
<?php } ?>
<form method="post" action="#content/<?php echo $content->getId(); ?>"
style="clear:none">
<table>
<tr>
<?php
if (count($langs) > 1) { ?>
<ul class="vertical left tabs">
<li class="empty"><i class="icon-globe" title="This content is translatable"></i></li>
<td valign="top">
<ul class="vertical left tabs" id="content-trans">
<li class="empty"><i class="icon-globe" title="<?php echo __('This content is translatable'); ?>"></i></li>
<?php foreach ($langs as $tag=>$nfo) { ?>
<li class="<?php if ($tag == $cfg->getPrimaryLanguage()) echo "active";
?>"><a href="#translation-<?php echo $tag; ?>" title="<?php
......@@ -21,10 +25,13 @@ if (count($langs) > 1) { ?>
</a></li>
<?php } ?>
</ul>
</td>
<?php
} ?>
<td id="content-trans_container">
<div id="translation-<?php echo $cfg->getPrimaryLanguage(); ?>"
class="tab_content left-tabs" style="padding:0" lang="<?php echo $cfg->getPrimaryLanguage(); ?>">
class="tab_content" style="padding:0" lang="<?php echo $cfg->getPrimaryLanguage(); ?>">
<div class="error"><?php echo $errors['name']; ?></div>
<input type="text" style="width: 100%; font-size: 14pt" name="name" value="<?php
echo Format::htmlchars($info['title']); ?>" spellcheck="true"
......@@ -42,7 +49,7 @@ if (count($langs) > 1) { ?>
if ($tag == $cfg->getPrimaryLanguage())
continue;
$trans = $info['trans'][$tag]; ?>
<div id="translation-<?php echo $tag; ?>" class="tab_content left-tabs"
<div id="translation-<?php echo $tag; ?>" class="tab_content"
style="display:none;padding:0" dir="<?php echo $nfo['direction']; ?>" lang="<?php echo $tag; ?>">
<input type="text" style="width: 100%; font-size: 14pt"
name="trans[<?php echo $tag; ?>][title]" value="<?php
......@@ -60,9 +67,13 @@ if (count($langs) > 1) { ?>
</div>
<?php } ?>
<div class="info-banner left-tabs" style="margin-top:7px"><?php
<div class="info-banner" style="margin-top:7px"><?php
echo $content->getNotes(); ?></div>
</td>
</tr>
</table>
<hr class="clear"/>
<p class="full-width">
<span class="buttons pull-left">
......
......@@ -1011,7 +1011,7 @@ ul.tabs.vertical {
}
ul.tabs.vertical.left {
float: left;
margin-right: 19px;
margin-right: 9px;
}
ul.tabs.vertical li {
......@@ -2003,6 +2003,8 @@ tr.disabled th {
.tab_content {
position: relative;
}
.tab_content:not(.left) {
padding: 12px 0;
}
.left-tabs {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment