Skip to content

Commit

Permalink
Merge branch 'feature/rtl-support'
Browse files Browse the repository at this point in the history
albertoleoncio committed May 7, 2024
1 parent 86968c8 commit 25442b9
Showing 12 changed files with 112 additions and 51 deletions.
2 changes: 1 addition & 1 deletion bin/backtrack.php
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@
<button
type='submit'
onclick="return confirm('<?=§('backtrack-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-section w3-green'
class='w3-bar-item w3-<?=$right?> w3-button w3-section w3-green'
><?=§('backtrack-accept')?></button>
</form>
</li>
1 change: 1 addition & 0 deletions bin/diff.css
Original file line number Diff line number Diff line change
@@ -265,6 +265,7 @@ table.diff.diff-contentalign-left.diff-editfont-monospace {

.details i {
margin-right: 5px;
margin-left: 5px;
width: 15px;
text-align: center;
}
2 changes: 1 addition & 1 deletion bin/edits.php
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@
<div class="w3-threequarter"><?=§('edits-about')?></div>
<form method="post" target="_blank" class="w3-quarter">
<input type="hidden" name="csv" value="csv">
<button class="w3-button w3-right w3-green" type="submit">
<button class="w3-button w3-<?=$right?> w3-green" type="submit">
<i class="fa-solid fa-file-csv"></i> <?=§('edits-csv')?>
</button>
</form>
28 changes: 14 additions & 14 deletions bin/evaluators.php
Original file line number Diff line number Diff line change
@@ -175,13 +175,13 @@
<div class="w3-container">
<ul class="w3-ul">
<li class="w3-bar">
<i class="w3-bar-item w3-padding-16 fa-regular fa-circle-user" style="font-size: 3em; padding: 20px;"></i>
<i class="w3-bar-item w3-padding-16 fa-regular fa-circle-user w3-<?=$left?>" style="font-size: 3em; padding: 20px;"></i>
<form method="post">
<input type="email" placeholder="<?=§('login-email')?>" name="email"
class="w3-input w3-border w3-bar-item w3-section"
class="w3-input w3-border w3-bar-item w3-section w3-<?=$left?>"
>
<button type='submit'
class='w3-bar-item w3-right w3-button w3-section w3-<?=$contest['theme'];?>'
class='w3-bar-item w3-<?=$right?> w3-button w3-section w3-<?=$contest['theme'];?>'
>
<?=§('evaluators-register')?>
</button>
@@ -199,8 +199,8 @@ class='w3-bar-item w3-right w3-button w3-section w3-<?=$contest['theme'];?>'
<ul class="w3-ul">
<?php foreach ($output["evaluators"]["G"] ?? array() as $user => $data): ?>
<li class="w3-bar">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user" style="font-size: 3em;"></i>
<div class="w3-bar-item">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user w3-<?=$left?>" style="font-size: 3em;"></i>
<div class="w3-bar-item w3-<?=$left?>">
<span class='w3-large'><?=$user?></span><br>
<span><?=$data['email']?></span><br>
<span><?=§('evaluators-stats',$data['evaluated'])?></span>
@@ -212,7 +212,7 @@ class='w3-bar-item w3-right w3-button w3-section w3-<?=$contest['theme'];?>'
<button
type='submit'
onclick="return confirm('<?=§('evaluators-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-margin w3-red'
class='w3-bar-item w3-<?=$right?> w3-button w3-margin w3-red'
><?=§('counter-redefine')?></button>
</form>
<?php endif; ?>
@@ -229,8 +229,8 @@ class='w3-bar-item w3-right w3-button w3-margin w3-red'
<ul class="w3-ul">
<?php foreach ($output["evaluators"]["A"] ?? array() as $user => $data): ?>
<li class="w3-bar">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user" style="font-size: 3em;"></i>
<div class="w3-bar-item">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user w3-<?=$left?>" style="font-size: 3em;"></i>
<div class="w3-bar-item w3-<?=$left?>">
<span class='w3-large'><?=$user?></span><br>
<span><?=$data['email']?></span><br>
<span><?=§('evaluators-stats',$data['evaluated'])?></span>
@@ -242,7 +242,7 @@ class='w3-bar-item w3-right w3-button w3-margin w3-red'
<button
type='submit'
onclick="return confirm('<?=§('evaluators-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-section w3-orange'
class='w3-bar-item w3-<?=$right?> w3-button w3-section w3-orange'
><?=§('evaluators-disable')?></button>
</form>
<form method="post">
@@ -251,7 +251,7 @@ class='w3-bar-item w3-right w3-button w3-section w3-orange'
<button
type='submit'
onclick="return confirm('<?=§('evaluators-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-margin w3-red'
class='w3-bar-item w3-<?=$right?> w3-button w3-margin w3-red'
><?=§('counter-redefine')?></button>
</form>
<?php endif; ?>
@@ -268,8 +268,8 @@ class='w3-bar-item w3-right w3-button w3-margin w3-red'
<ul class="w3-ul">
<?php foreach ($output["evaluators"]["P"] ?? array() as $user => $data): ?>
<li class="w3-bar">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user" style="font-size: 3em;"></i>
<div class="w3-bar-item">
<i class="w3-bar-item w3-padding-24 fa-solid fa-circle-user w3-<?=$left?>" style="font-size: 3em;"></i>
<div class="w3-bar-item w3-<?=$left?>">
<span class='w3-large'><?=$user?></span><br>
<span><?=$data['email']?></span><br>
<span><?=§('evaluators-stats',$data['evaluated'])?></span>
@@ -281,7 +281,7 @@ class='w3-bar-item w3-right w3-button w3-margin w3-red'
<button
type='submit'
onclick="return confirm('<?=§('evaluators-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-section w3-green'
class='w3-bar-item w3-<?=$right?> w3-button w3-section w3-green'
><?=§('evaluators-enable')?></button>
</form>
<form method="post">
@@ -290,7 +290,7 @@ class='w3-bar-item w3-right w3-button w3-section w3-green'
<button
type='submit'
onclick="return confirm('<?=§('evaluators-areyousure')?>')"
class='w3-bar-item w3-right w3-button w3-margin w3-red'
class='w3-bar-item w3-<?=$right?> w3-button w3-margin w3-red'
><?=§('counter-redefine')?></button>
</form>
<?php endif; ?>
10 changes: 10 additions & 0 deletions bin/languages.php
Original file line number Diff line number Diff line change
@@ -76,4 +76,14 @@ function §($item, ...$args) {
}

return $translatedString;
}

//RTL conversion
$rtl = ['he', 'skr-arab'];
$right = 'right';
$left = 'left';
if (in_array($lang, $rtl)) {
echo '<link rel="stylesheet" href="bin/rtl.css">';
$right = 'left';
$left = 'right';
}
4 changes: 2 additions & 2 deletions bin/login.php
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@
class="w3-button w3-bar-item" ><?=§('login-graph')?></button>
<button onclick="document.getElementById('id01').style.display='block'"
class="w3-button w3-bar-item" ><?=§('login')?></button>
<span class="w3-bar-item w3-right w3-hide-small"><?=$contest['name'];?></span>
<span class="w3-bar-item w3-<?=$right?> w3-hide-small"><?=$contest['name'];?></span>
</div>
<div class="w3-block w3-card w3-margin w3-hide-medium w3-hide-small" style="width: inherit;">
<div class="w3-center">
@@ -216,7 +216,7 @@ class="w3-button w3-margin-top w3-padding">
<div class="w3-modal-content w3-card-4 w3-animate-zoom" style="max-width:600px">
<div class="w3-center">
<br>
<button onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-xlarge w3-hover-red w3-display-topright" title="Close Modal">&times;</button>
<button onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-xlarge w3-hover-red w3-display-top<?=$right?>" title="Close Modal">&times;</button>
<svg width="240" height="240" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 18V17C7 14.2386 9.23858 12 12 12V12C14.7614 12 17 14.2386 17 17V18" stroke="currentColor" stroke-linecap="round" />
<path d="M12 12C13.6569 12 15 10.6569 15 9C15 7.34315 13.6569 6 12 6C10.3431 6 9 7.34315 9 9C9 10.6569 10.3431 12 12 12Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" />
30 changes: 15 additions & 15 deletions bin/manage_contests.php
Original file line number Diff line number Diff line change
@@ -552,7 +552,7 @@ class="w3-input w3-border w3-margin-bottom"
<?=($contest_info['name']==null)?'required':'disabled'?>>

<div class="w3-row">
<div class="w3-threequarter" style="padding-right: 8px;">
<div class="w3-threequarter" style="padding-<?=$right?>: 8px;">

<label for="internalcode">
<strong><?=§('manage-internalcode')?></strong>
@@ -569,7 +569,7 @@ class="w3-input w3-border w3-margin-bottom"
<?=($contest_info['name']==null)?'required':'disabled'?>>

</div>
<div class="w3-quarter" style="padding-right: 8px;">
<div class="w3-quarter" style="padding-<?=$right?>: 8px;">

<label for="group">
<strong><?=§('manage-group')?></strong>
@@ -637,7 +637,7 @@ class="w3-input w3-border w3-margin-bottom"
<?=($contest_info['name']==null)?'required':'disabled'?>>

<div class="w3-row">
<div class="w3-half" style="padding-right: 8px;">
<div class="w3-half" style="padding-<?=$right?>: 8px;">

<label for="reverttime">
<strong><?=§('manage-reverttime')?></strong>
@@ -672,7 +672,7 @@ class="w3-select w3-border w3-margin-bottom"
</select>

</div>
<div class="w3-half" style="padding-left: 8px;">
<div class="w3-half" style="padding-<?=$left?>: 8px;">

<label for="listid">
<strong><?=§('manage-listid')?></strong>
@@ -715,7 +715,7 @@ class="w3-input w3-border w3-margin-bottom"
<?=($contest_info['name']==null)?'required':'disabled'?>>

<div class="w3-row">
<div class="w3-half" style="padding-right: 8px;">
<div class="w3-half" style="padding-<?=$right?>: 8px;">

<label for="bpp">
<strong><?=§('manage-bpp')?></strong>
@@ -759,7 +759,7 @@ class="w3-input w3-border w3-margin-bottom"
<?=($contest_info['name']==null)?'required':'disabled'?>>

</div>
<div class="w3-half" style="padding-left: 8px;">
<div class="w3-half" style="padding-<?=$left?>: 8px;">

<label for="ipp">
<strong><?=§('manage-ipp')?></strong>
@@ -805,7 +805,7 @@ class="w3-select w3-border w3-margin-bottom"
</div>

<div class="w3-row">
<div class="w3-half" style="padding-right: 8px;">
<div class="w3-half" style="padding-<?=$right?>: 8px;">
<label for="theme">
<strong><?=§('manage-palette')?></strong>
</label>
@@ -848,7 +848,7 @@ class="w3-select w3-border w3-margin-bottom"
<option value="color" class="w3-transparent" <?=($contest_info['theme']!='color')?:'selected'?>><?=§('manage-custom')?></option>
</select>
</div>
<div class="w3-half" style="padding-left: 8px;">
<div class="w3-half" style="padding-<?=$left?>: 8px;">
<label for="hex">
<strong><?=§('manage-hexcolor')?></strong>
</label>
@@ -887,14 +887,14 @@ class="w3-button w3-block w3-deep-green w3-section w3-padding"
<div class="w3-row w3-section">
<div class="w3-half">
<button
class="w3-button w3-blue w3-block w3-rightbar w3-border-white"
class="w3-button w3-blue w3-block w3-<?=$right?>bar w3-border-white"
style="display: block;"
type="button"
id="editor"
onclick="editChange('<?=$contest_info['name_id']?>')"
><?=§('modify')?></button>
<button
class="w3-button w3-green w3-block w3-rightbar w3-border-white"
class="w3-button w3-green w3-block w3-<?=$right?>bar w3-border-white"
style="display: none;"
name="do_edit"
id="saver"
@@ -903,7 +903,7 @@ class="w3-button w3-green w3-block w3-rightbar w3-border-white"
</div>
<div class="w3-half">
<button
class="w3-button w3-black w3-block w3-leftbar w3-border-white"
class="w3-button w3-black w3-block w3-<?=$left?>bar w3-border-white"
name="do_manager"
onclick="managerChange('<?=$contest_info['name_id']??''?>', true)"
type="button"><?=§('manage-newmanager')?></button>
@@ -912,14 +912,14 @@ class="w3-button w3-black w3-block w3-leftbar w3-border-white"
<div class="w3-row w3-section">
<div class="w3-half">
<button
class="w3-button w3-orange w3-block w3-rightbar w3-border-white"
class="w3-button w3-orange w3-block w3-<?=$right?>bar w3-border-white"
name="do_restart"
onclick="editChange('<?=$contest_info['name_id']?>'); return confirm('<?=§('manage-confirmrestart')?>')"
type="submit"><?=§('manage-restart')?></button>
</div>
<div class="w3-half">
<button
class="w3-button w3-red w3-block w3-leftbar w3-border-white"
class="w3-button w3-red w3-block w3-<?=$left?>bar w3-border-white"
name="do_delete"
onclick="editChange('<?=$contest_info['name_id']?>'); return confirm('<?=§('manage-confirmdelete')?>')"
type="submit"><?=§('manage-delete')?></button>
@@ -945,13 +945,13 @@ class="w3-input w3-border w3-margin-bottom"
<div class="w3-row">
<div class="w3-half">
<button
class="w3-button w3-orange w3-block w3-rightbar w3-border-white"
class="w3-button w3-orange w3-block w3-<?=$right?>bar w3-border-white"
name="do_manager"
type="submit"><?=§('manage-newmanager')?></button>
</div>
<div class="w3-half">
<button
class="w3-button w3-red w3-block w3-leftbar w3-border-white"
class="w3-button w3-red w3-block w3-<?=$left?>bar w3-border-white"
type="button"
onclick="managerChange('<?=$contest_info['name_id']??''?>', false)"><?=§('login-cancel')?></button>
</div>
Loading

0 comments on commit 25442b9

Please sign in to comment.