modifications sur le template default
[mw_sourceml] / app / out / default / views / sources / piste / view.php
index f168843..c72fff5 100644 (file)
@@ -1,39 +1,63 @@
-<h2>
-<?php $ariane_params = array("piste" => $this->out["piste"]["id"]); ?>
-<?php if(isset($this->out["album"]) && $this->out["album"]) : $ariane_params["album"] = $this->out["album"]["id"]; ?>
-<a href="<?php echo $this->url("sources/album/view", $ariane_params) ?>">
-<?php echo $this->out["album"]["titre"] ?>
-</a>
-&raquo;
-<?php endif; ?>
-
-<?php if(isset($this->out["morceau"]) && $this->out["morceau"]) : $ariane_params["morceau"] = $this->out["morceau"]["id"]; ?>
-<a href="<?php echo $this->url("sources/morceau/view", $ariane_params) ?>">
-<?php echo $this->out["morceau"]["reference"] ? $this->out["morceau"]["reference"]["titre"] : $this->out["morceau"]["titre"] ?>
-</a>
-&raquo;
-<?php endif; ?>
-
+<article class="piste">
+  <ul class="ariane">
+    <?php $ariane_params = array("piste" => $this->out["piste"]["id"]); ?>
+    <?php if(isset($this->out["album"]) && $this->out["album"]) : $ariane_params["album"] = $this->out["album"]["id"]; ?>
+    <li><a href="<?php echo $this->url("sources/album/view", $ariane_params) ?>">
+    <?php echo $this->out["album"]["titre"] ?>
+    </a></li>
+    <?php endif; ?>
 
-<?php if($this->out["piste"]["reference"]) : ?>
-<span>r&eacute;f&eacute;rence </span>&raquo; <a href="<?php echo $this->out["piste"]["reference"]["from"] ?>"><strong><?php echo $this->out["piste"]["reference"]["titre"] ?> (<?php echo $this->out["piste"]["reference"]["auteur"] ?>)</strong></a>
-<?php else : ?>
-<a href="<?php echo $this->url("sources/piste/view", $ariane_params) ?>"><?php echo $this->out["piste"]["titre"] ?></a>
+    <?php if(isset($this->out["morceau"]) && $this->out["morceau"]) : $ariane_params["morceau"] = $this->out["morceau"]["id"]; ?>
+    <li><a href="<?php echo $this->url("sources/morceau/view", $ariane_params) ?>">
+    <?php echo $this->out["morceau"]["reference"] ? $this->out["morceau"]["reference"]["titre"] : $this->out["morceau"]["titre"] ?>
+    </a></li>
+    <?php endif; ?>
+    
+    <?php if($this->out["piste"]["reference"]) : ?>
+    <li><span>r&eacute;f&eacute;rence &raquo;</span> <a href="<?php echo $this->out["piste"]["reference"]["from"] ?>"><?php echo $this->out["piste"]["reference"]["titre"] ?> (<?php echo $this->out["piste"]["reference"]["auteur"] ?>)</a></li>
+    <?php else : ?>
+    <li><a href="<?php echo $this->url("sources/piste/view", $ariane_params) ?>"><?php echo $this->out["piste"]["titre"] ?></a></li>
+    <?php endif; ?>
+  </ul>
+  <div class="clear"><!-- --></div>
+  <header>
+    <h1>
+      <?php if($this->out["piste"]["reference"]) : ?>
+      <span>r&eacute;f&eacute;rence &raquo;</span><?php echo $this->out["piste"]["reference"]["titre"] ?> (<?php echo $this->out["piste"]["reference"]["auteur"] ?>)
+      <?php else : ?>
+      <?php echo $this->out["piste"]["titre"] ?>
+      <?php endif; ?>
+    </h1>
+    <?php if($this->out["piste"]["derivations"]) : ?>
+    <span class="derivation">
+      <span>d&eacute;rive de &raquo;</span>
+      <?php $n = 0; foreach($this->out["piste"]["derivations"] as $derivation) : ?>
+      <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><?php echo $derivation["titre"] ?> (<?php echo $derivation["auteur"] ?>)</a>
+      <?php $n++; endforeach; ?>
+    </span>
+    <?php endif; ?>
+  </header>
 
-<?php if($this->out["piste"]["derivations"]) : ?>
-      <br />
-      <span class="small">
-        d&eacute;rive de &raquo;
-<?php $n = 0; foreach($this->out["piste"]["derivations"] as $derivation) : ?>
-        <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><?php echo $derivation["titre"] ?> (<?php echo $derivation["auteur"] ?>)</a>
-<?php $n++; endforeach; ?>
-      </span>
-<?php endif; ?>
+<?php
 
+  if
+  (    $this->out["piste"]["image_uri"]
+    && file_exists($this->out["piste"]["image_uri"])
+    && ($img_size = $data->img_size($this->out["piste"]["image_uri"], 450, 450)) !== false
+  ) :
+//  $margin_top = floor((450 - $img_size["height"]) / 2);
+  $margin_top = 10;
+  $piste_image_uri = $this->path("web").$this->out["piste"]["image_uri"];
+?>
+<p class="logo_source">
+  <img src="<?php echo $piste_image_uri ?>"
+       width="<?php echo $img_size["width"] ?>"
+       height="<?php echo $img_size["height"] ?>"
+       style="margin-top:<?php echo $margin_top ?>px"
+       alt="" />
+</p>
 <?php endif; ?>
 
-</h2>
-
 <div class="source_arbo">
 
 <?php
@@ -54,7 +78,7 @@
 ?>
 </ul>
 
-<?php if(!$display_name) : ?>
+<?php if(isset($piste["description"]) && !$display_name) : ?>
 <div class="description">
   <?php echo $piste["description"] ?>
 </div>
@@ -62,3 +86,4 @@
 <div class="clear"><!-- --></div>
 
 </div>
+</article>
\ No newline at end of file