Skip to content

Commit

Permalink
Merge pull request #441 from Simounet/feature/mobile-marigolds
Browse files Browse the repository at this point in the history
- Améliorations graphiques du thème marigolds (mobile + labels d'états)
- Fix fonction truncate
  • Loading branch information
Simounet authored Jan 24, 2017
2 parents bd6894a + b60d048 commit 88d8447
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 57 deletions.
14 changes: 7 additions & 7 deletions Functions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ public static function getIP(){
* @return<String> chaine tronquée
*/
public static function truncate($msg,$limit){
if(mb_strlen($msg)>$limit){
$fin='' ;
$nb=$limit-mb_strlen($fin) ;
}else{
$nb=mb_strlen($msg);
$fin='';
$str = html_entity_decode($msg, ENT_QUOTES, 'UTF-8');
$count = preg_match_all('/\X/u', $str);
if($count<=$limit){
return $msg;
}
return mb_substr($msg, 0, $nb).$fin;
$fin='' ;
$nb=$limit-1;
return mb_substr($str, 0, $nb, 'UTF-8').$fin;
}


Expand Down
16 changes: 8 additions & 8 deletions Plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static function install($url) {
$tempZipName = $pluginBaseFolder.md5(microtime());
file_put_contents($tempZipName,file_get_contents(urldecode($url)), false, self::getContext());
if(file_exists($tempZipName)){
$logger->appendLogs('Plugin téléchargé <span class="label label-success">OK</span>');
$logger->appendLogs('Plugin téléchargé <span class="button notice">OK</span>');
$logger->appendLogs('Extraction du plugin...');
$zip = new ZipArchive;
$res = $zip->open($tempZipName);
Expand All @@ -143,7 +143,7 @@ public static function install($url) {
$pluginFolder = $tempZipFolder;
$zip->extractTo($tempZipFolder);
$zip->close();
$logger->appendLogs('Plugin extrait <span class="readUnreadButton">OK</span>');
$logger->appendLogs('Plugin extrait <span class="button notice">OK</span>');
$fi = new FilesystemIterator($tempZipFolder, FilesystemIterator::SKIP_DOTS);
if(iterator_count($fi) === 1) {
foreach($fi as $file){
Expand All @@ -159,24 +159,24 @@ public static function install($url) {
if(!file_exists($pluginBaseFolder.$pluginName)){
$logger->appendLogs('Renommage...');
if(rename($pluginFolder,$pluginBaseFolder.$pluginName)){
$logger->appendLogs('Plugin installé, rechargez la page pour voir le plugin <span class="readUnreadButton">pensez à l\'activer</span>');
$logger->appendLogs('Plugin installé, rechargez la page pour voir le plugin <span class="button notice">pensez à l\'activer</span>');
}else{
Functions::rmFullDir($pluginFolder);
$logger->appendLogs('Impossible de renommer le plugin <span class="readUnreadButton">Erreur</span>');
$logger->appendLogs('Impossible de renommer le plugin <span class="button error">Erreur</span>');
}
}else{
$logger->appendLogs('Plugin déjà installé <span class="readUnreadButton">OK</span>');
$logger->appendLogs('Plugin déjà installé <span class="button warning">OK</span>');
}
}else{
$logger->appendLogs('Plugin invalide, fichier principal manquant <span class="readUnreadButton">Erreur</span>');
$logger->appendLogs('Plugin invalide, fichier principal manquant <span class="button error">Erreur</span>');
}

} else {
$logger->appendLogs('Echec de l\'extraction <span class="readUnreadButton">Erreur</span>');
$logger->appendLogs('Echec de l\'extraction <span class="button error">Erreur</span>');
}
unlink($tempZipName);
}else{
$logger->appendLogs('Echec du téléchargement <span class="readUnreadButton">Erreur</span>');
$logger->appendLogs('Echec du téléchargement <span class="button error">Erreur</span>');
}
}
if(Functions::isAjaxCall()){
Expand Down
136 changes: 106 additions & 30 deletions templates/marigolds/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: b
sup { top: -0.5em; }
sub { bottom: -0.25em; }

ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
ul, ol { margin: 1em 0; padding: 0; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }

Expand Down Expand Up @@ -72,6 +72,21 @@ td { vertical-align: top; }

.chromeframe { margin: 0.2em 0; background: #ccc; color: black; padding: 0.2em 0; }

.notice,
.button.notice {
background-color: #4caf50;
}

.warning,
.button.warning {
background-color: #ff9800;
}

.error,
.button.error {
background-color: #d32f2f;
}


/* ===== Initializr Styles =====================================================
Author: Jonathan Verrecchia - verekia.com/initializr/responsive-template
Expand Down Expand Up @@ -214,10 +229,6 @@ html, body { position: relative; height: 100%; }
background:#222222;
}

#main aside{

}

#title{ color:#ffffff; }

::-moz-selection { background: #f16529; color: #fff; text-shadow: none; }
Expand Down Expand Up @@ -298,17 +309,18 @@ header a,header a:hover,header a:visited{
text-decoration: none;
}

#main button, .loginBloc button,.button,.readUnreadButton{
#main button, .loginButton, .button,.readUnreadButton{
background-color:#f16529;
border:0px;
color:#ffffff;
text-decoration:none;
padding:3px 8px 3px 8px;
padding: 0.4em 0.8em;
font-size:10px;
font-weight:bold;

min-width: 35px;
text-align: center;
vertical-align: middle;
}

.readUnreadButton{
Expand All @@ -322,6 +334,11 @@ header a,header a:hover,header a:visited{
cursor:pointer;
}

.unreadForFolder,
.readFolder {
padding: 0px 3px 0px 3px;
}

#main aside a.unreadForFolder,#main aside a.readFolder{

background-color:#F16529;
Expand All @@ -330,7 +347,6 @@ header a,header a:hover,header a:visited{
margin:3px 3px 3px 0px;
font-size:10px;
font-weight:bold;
padding:0px 3px 0px 3px;
line-height: 20px;

min-width:55px;
Expand Down Expand Up @@ -360,6 +376,10 @@ header a,header a:hover,header a:visited{
font-weight: normal;
}

.unreadForFeed {
margin: 5px 0 0 10px;
}

#menuBar aside h3{
margin:5px;
}
Expand Down Expand Up @@ -533,16 +553,12 @@ header a,header a:hover,header a:visited{
.loginBloc{
background-color: #222222;

float: none;
margin: 10px 0px 10px;
padding: 5px;
width: auto;
}
.loginBloc input{
.miniInput {
width:100px;
border:none;
margin-right:1%;

}
.wrongLogin input{
background-color: #fdd;
Expand Down Expand Up @@ -606,10 +622,6 @@ header a,header a:hover,header a:visited{
width:70%;
}

.addBloc{
margin-left: 40px;
}

#main.settings aside a {
font-size: 16px;
}
Expand Down Expand Up @@ -641,26 +653,30 @@ header a,header a:hover,header a:visited{
vertical-align: top;
}

#main.settings .feedAction {
.feedAction,
.feedButtons {
display: inline-block;
vertical-align: top;
}

.settings .feedAction {
width: 25%;
float: right;
}

#main.settings .feedFolder {
.settings .feedFolder {
width: 72%;
}

#main.settings .feedVerbose {
.settings .feedVerbose {
min-width: 1em;
float:left;
}

.settings .feedButtons {
float: right;
width: 28%;
}
#main.settings .feedRename,
#main.settings .feedDelete {
.settings .feedRename,
.settings .feedDelete {
min-width: 7em;
width: 48%;
}
Expand All @@ -679,6 +695,15 @@ footer a,#main aside a{
font-size:12px;
}

#main aside a {
max-width: 70%;
overflow: hidden;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
}

#main aside a span{
font-weight:bold;
font-size:14px;
Expand Down Expand Up @@ -823,17 +848,31 @@ footer a,#main aside a{
========================================================================== */

@media only screen and (max-width: 480px) {

.logo{
.logo{
display:none;
}

.loginBloc {
margin:0px;

.loginBloc {
text-align: center;
}

.loginButton {
padding: 1em 2em;
}

.miniInput {
display: block;
margin-bottom: 2%;
padding: 0.6em 1em;
width: 100%;
box-sizing: border-box;
vertical-align: middle;
}

nav a {
margin-bottom: 3px;
padding-top: 0.4em;
padding-bottom: 0.4em;
}
.wrapper {
margin: 0;
Expand All @@ -842,16 +881,53 @@ footer a,#main aside a{
.versionBloc{
display:none;
}

#main aside a {
display: inline-block;
padding-top: 0.6em;
padding-bottom: 0.6em;
}

#main button {
padding-top: 0.8em;
padding-bottom: 0.8em;
}

.pluginBloc .pluginMenu li {
float: none;
display: block;
margin-right: 0;
margin-bottom: 3px;
}

.settings .feedTitle,
.settings .feedAction,
.settings .feedButtons {
display: block;
margin-bottom: 3%;
width: 100%;
}

.settings .feedTitle > input,
.settings .feedFolder {
width: 100%;
box-sizing: border-box;
}

#main.settings .feedRename,
#main.settings .feedDelete {
width: 49%;
}
}

@media only screen and (min-width: 480px) {

ul,
ol,
.addBloc {
margin-left: 40px;
}

/* ====================
INTERMEDIATE: Menu
==================== */
Expand Down Expand Up @@ -886,7 +962,7 @@ footer a,#main aside a{
@media only screen and (min-width: 768px) {
.loginBloc{
float: left;
width: 40%;
width: 50%;
margin: 15px 20px 0;
}

Expand Down
10 changes: 5 additions & 5 deletions templates/marigolds/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ <h1 class="logo" id="title"><a href="./index.php">L<i>eed</i></a><div class="ver
{$wrongLoginClass=''}
{/if}
<form action="action.php?action=login" method="POST" class="{$wrongLoginClass}">
<input id="inputlogin" type="text" class="miniInput left" name="login" placeholder="{function="_t('LOGIN')"}"/>
<input type="password" class="miniInput left" name="password" placeholder="{function="_t('PASSWORD')"}"/>
<input id="inputlogin" type="text" class="miniInput" name="login" placeholder="{function="_t('LOGIN')"}"/>
<input type="password" class="miniInput" name="password" placeholder="{function="_t('PASSWORD')"}"/>
{if="$otpEnabled"}
<input type="text" name="otp" class="miniInput left" autocomplete="off" placeholder="{function="_t('OTP_CODE')"}"/>
<input type="text" name="otp" class="miniInput" autocomplete="off" placeholder="{function="_t('OTP_CODE')"}"/>
{/if}
<button class="left">GO!!</button>
<button class="loginButton">GO!!</button>
<span id="rememberMe">
<input type="checkbox" name="rememberMe">
<span>{function="_t('REMEMBER_ME')"}</span>
</span>
<div class="clear"></div>
</form>
{else}
<span>{function="_t('IDENTIFIED_WITH',array('<span>'.$myUser->getLogin().'</span>'))"} </span><button onclick="window.location='action.php?action=logout'">{function="_t('DISCONNECT')"}</button>
<span>{function="_t('IDENTIFIED_WITH',array('<span>'.$myUser->getLogin().'</span>'))"} </span><a href="action.php?action=logout" class="loginButton">{function="_t('DISCONNECT')"}</a>
{/if}
<div class="clear"></div>
</div>
Expand Down
Loading

0 comments on commit 88d8447

Please sign in to comment.