Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting display according to kind of screen computer or smartphonetablet #17

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM php:7.4-apache
COPY . /var/www/html/

RUN sed -i 's/80/1912/' /etc/apache2/ports.conf
RUN sed -i 's/80/1912/' /etc/apache2/sites-enabled/000-default.conf
RUN sed -i 's/80/1912/' /etc/apache2/ports.conf && sed -i 's/80/1912/' /etc/apache2/sites-enabled/000-default.conf

# Add test token
RUN touch private/tokens/20350515-testtoken.txt

# Add test dirs
RUN mkdir -p private/docs/A001/ && mkdir -p private/docs/G057/cors
RUN touch private/docs/G057/clarinette1.pdf
RUN touch private/docs/G057/cors/cor1.pdf && touch private/docs/G057/cors/cor2.pdf
66 changes: 26 additions & 40 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
<html>
<head>
<title>Arvin2 : archiviste virtuel</title>
<meta charset="utf-8"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php
$theme->getCSS();
Expand Down Expand Up @@ -145,6 +146,13 @@
color: black;
}

.score {
margin: 0.5em;
padding-left:0.5em;
width:19rem;
border-left:2px grey solid;
}

@media print {
body { font-size:8pt; }
h1 { font-size:10pt; }
Expand Down Expand Up @@ -224,19 +232,19 @@
<?php
if($token_ok)
{
echo '<input type="hidden" name="token" value="'.$token.'" />';
echo '<input type="hidden" name="token" value="'.$token.'">';
}
?>
<input name="s" value="<?php echo $sv ?>" />
<input type="submit" value="Cherche !"/>
<input name="s" value="<?php echo $sv ?>">
<input type="submit" value="Cherche !">
Tri par <select name="t">
<option value="0" <?php if($tv==0) echo 'selected' ?>>Titre</option>
<option value="1" <?php if($tv==1) echo 'selected' ?>>Auteur</option>
<option value="2" <?php if($tv==2) echo 'selected' ?>>Référence</option>
<option value="3" <?php if($tv==3) echo 'selected' ?>>Complétion</option>
</select>
<!--
<input type="checkbox" id="l" name="l" <?php if($lv) echo 'checked' ?>/><label for="l">avec instruments</label>
<input type="checkbox" id="l" name="l" <?php if($lv) echo 'checked' ?>><label for="l">avec instruments</label>
-->
</form>

Expand Down Expand Up @@ -311,28 +319,7 @@ function tri_par_completion($a, $b) {return tri_ligne($a, $b, 'completion');}
}
//print_r($pgm);

echo '<table>';
echo '<tr>';
$i = 0;
foreach($entete as $c)
{
echo '<th>'.ucfirst(strtolower($c)).'</th>';
$i++;
//if(!$lv)
{
if($i>=4) break;
}
}
//echo '<th>Complétion<br/>Base / HMAP</th>'; // Désactivation complétion
if($token_ok)
{
echo '<th>Téléchargement</th>';
}
else
{
echo '<th></th>';
}
echo '</tr>';
echo '<div id="partlist" style="display:inline-flex;flex-wrap:wrap">';

foreach($data as $l)
{
Expand All @@ -350,18 +337,20 @@ function tri_par_completion($a, $b) {return tri_ligne($a, $b, 'completion');}
continue;
}

echo '<tr>';
echo "\n".'<div class="score">';
for($i = 0; $i < sizeof($l); $i++)
{
$c = $l[$i];
echo '<td>';
echo $c;
echo "\n".'<div>';
if($i==0)
{
echo '<h2>'.$c.'</h2>';
echo ' [<a href="http://www.youtube.com/results?search_query='.urlencode($c.', '.$l[$i+1].', '.$l[$i+2]).'">youtube</a>]';
echo ' [<a href="http://musicainfo.net/quiksrch.php?vol='.urlencode($c).'">musicainfo</a>]';
}
echo '</td>';
else
echo $c;
echo '</div>';
//if(!$lv)
{
if($i>=3) break;
Expand All @@ -385,17 +374,13 @@ function tri_par_completion($a, $b) {return tri_ligne($a, $b, 'completion');}
*/
if($token_ok && is_dir($arv_config['docs_dir'].'/'.$l[3]))
{
echo '<td><a href="list.php?ref='.$l[3].'&token='.$_GET['token'].'">Documents</a></td>';
}
else
{
echo '<td></td>';
echo '<div><a href="list.php?ref='.$l[3].'&token='.$_GET['token'].'" style="font-size:150%;font-weight:bolder;text-decoration:underline">Télécharger</a></div>';
}
echo '</tr>';
echo "</div>\n";

if($lv)
{
echo '</table>';
echo '</div>';
//var_dump($l);
echo '<ul>';
$oblig_compt = 0;
Expand All @@ -420,15 +405,16 @@ function tri_par_completion($a, $b) {return tri_ligne($a, $b, 'completion');}
}
echo '</ul>';

echo '<table>';
echo '<div>';
}

}
echo '</table>';
echo '</div>';

//echo '</p>';


?>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions list.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
?>

<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="page">
Expand Down
12 changes: 6 additions & 6 deletions themes/hmap/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ class ThemeHMAP implements Itheme
{
public function getCSS()
{
echo '<link href="//www.hmap.fr/wp-content/themes/twentyeleven-hmap/style.css" media="all" type="text/css" rel="stylesheet"></link>';
echo "
<style type=\"text/css\">
echo '<link href="//www.hmap.fr/wp-content/themes/twentyeleven-hmap/style.css" media="all" type="text/css" rel="stylesheet">';
echo "
<style>
@font-face {
font-family: 'PoppeaRegular';
src: url('themes/hmap/poppea-webfont.woff') format('woff');
Expand All @@ -15,8 +15,8 @@ public function getCSS()
}
</style>
";
echo '
<style type="text/css">
echo '
<style>
h1, h2, h3
{
font-family: PoppeaRegular, serif;
Expand All @@ -28,7 +28,7 @@ public function getCSS()

public function getBanner()
{
echo '<a href="//hmap.fr/arvin2/"><img width="" height="100" alt="" style="" src="//www.hmap.fr/wp-content/uploads/2017/12/logo-droite-2lignes-1024x257.png" /></a>';
echo '<a href="//hmap.fr/arvin2/"><img height="100" alt="" style="" src="//www.hmap.fr/wp-content/uploads/2017/12/logo-droite-2lignes-1024x257.png"></a>';
}
}

Expand Down