# HG changeset patch
# User clebeaupin
# Date 1269437273 -3600
# Node ID be2cac1028d8136f7df01763734a7d37e82f22b5
# Parent 96ecedbe89de633aa4b51e2eec241195595c9795
Fix template bugs
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/config/app.yml
--- a/web/thdProject/apps/frontend/config/app.yml Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/config/app.yml Wed Mar 24 14:27:53 2010 +0100
@@ -5,7 +5,7 @@
uploads: "/Users/ymh/dev/workspace/mosatags/web/thdProject/web/uploads"
format: ".csv"
- player:
- videoPath: "videos/"
+ video:
+ root_uri: "http://atalante.ucthd/web/thdProject/web/videos"
#dev:
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/config/factories.yml
--- a/web/thdProject/apps/frontend/config/factories.yml Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/config/factories.yml Wed Mar 24 14:27:53 2010 +0100
@@ -31,6 +31,14 @@
generate_shortest_url: true
extra_parameters_as_query_string: true
+ request:
+ class: sfWebRequest
+ param:
+ logging: %SF_LOGGING_ENABLED%
+ path_info_array: SERVER
+ path_info_key: PATH_INFO
+ relative_url_root: /web/thdProject/web
+
#all:
# controller:
# class: sfFrontWebController
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/config/settings.yml
--- a/web/thdProject/apps/frontend/config/settings.yml Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/config/settings.yml Wed Mar 24 14:27:53 2010 +0100
@@ -27,6 +27,7 @@
# Output escaping settings
escaping_strategy: false # Determines how variables are made available to templates. Accepted values: on, off.
escaping_method: ESC_SPECIALCHARS # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES, and ESC_SPECIALCHARS.
+ standard_helpers: [Partial, Cache, Form, ThdHtml]
#all:
# .actions:
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/config/view.yml
--- a/web/thdProject/apps/frontend/config/view.yml Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/config/view.yml Wed Mar 24 14:27:53 2010 +0100
@@ -11,7 +11,7 @@
stylesheets: [frontend.css, /css/player.css]
- javascripts: [jquery1.3.1.js, uc.utils.js, uc.input.js, uc.player.js,]
+ javascripts: [jquery1.3.1.js, uc.utils.js]
has_layout: on
layout: layout
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/editor/actions/components.class.php
--- a/web/thdProject/apps/frontend/modules/editor/actions/components.class.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/editor/actions/components.class.php Wed Mar 24 14:27:53 2010 +0100
@@ -1,4 +1,4 @@
-getRequestParameter('ref');
- $film_slug = $this->getRequestParameter('film_slug');
-
+ $film_slug = $this->getRequestParameter('film_slug');
+
// retrieve infos in database
$query = Doctrine_Query::create()
->from('ThdFilm F')
@@ -16,14 +16,16 @@
->leftJoin('F.videos V')
->where("F.ref='{$ref}'");
$this->film = $query->execute()->getFirst();
-
- // retrieve video infos
- $this->videos = $this->film->getVideos();
-
+ if (!$this->film) return sfView::NONE;
+
+ // retrieve video infos
+ $videos = $this->film->getVideos();
+ $this->filmVideo = ($videos) ? $videos[0] : null;
+
return sfView::SUCCESS;
}
-
+
public function executeSegmentList() {
- }
+ }
}
\ No newline at end of file
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/editor/templates/_player.php
--- a/web/thdProject/apps/frontend/modules/editor/templates/_player.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/editor/templates/_player.php Wed Mar 24 14:27:53 2010 +0100
@@ -1,41 +1,29 @@
-getRef();
- $slug = $film->getSlugUrl();
-
- //video file
- $video_file = $videos[0]['file'];
-
- // directors list
- $json = $film->getDirectors();
- $directors = json_decode($json, true);
- $directorsList = $directors['name'];
-?>
-
getTitle();
// original title if exist
@@ -108,13 +96,10 @@
echo " {".$film->getOriginalTitle()."} ";
}
?>
- De
-
+
De
+ getDirectors(), 'name'); ?>
-
+
Marquer le début
@@ -126,7 +111,7 @@
Lire la séquence
-
-
+
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/homepage/actions/components.class.php
--- a/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php Wed Mar 24 14:27:53 2010 +0100
@@ -19,19 +19,23 @@
}
public function executeLastTaggedList() {
- $query = Doctrine_Query::create()
- ->from('ThdFilm F')
- ->leftJoin('F.images I ')
- ->leftJoin('F.videos V')
- //->where("cu.code='{$culture}' AND mo.code='{$module}' AND ms.code='{$section}'")
- ->orderBy('F.id DESC')
- ->limit(0,10);
+ // FIXME: Dummy value
+ $this->tag = Array('score' => 3);
+ $query = Doctrine_Query::create()
+ ->from('ThdFilm F')
+ ->leftJoin('F.images I ')
+ ->leftJoin('F.videos V')
+ //->where("cu.code='{$culture}' AND mo.code='{$module}' AND ms.code='{$section}'")
+ ->orderBy('F.id DESC')
+ ->limit(0,10);
$this->lastTaggedFilms = $query->execute();
$this->videoPath = sfConfig::get('app_player_videoPath');
}
public function executeMostTaggedList() {
- $query = Doctrine_Query::create()
+ // FIXME: Dummy value
+ $this->tag = Array('score' => 3);
+ $query = Doctrine_Query::create()
->from('ThdFilm F')
->leftJoin('F.images I ')
->leftJoin('F.videos V')
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_lastTaggedList.php Wed Mar 24 14:27:53 2010 +0100
@@ -1,27 +1,25 @@
Les derniers films taggés
- getRef();
$slug = $item->getSlugUrl();
$title = $item->getTitle();
-
+
// image file
$image_file = $item->getImages();
// image file
$video_file = $item->getVideos();
- // directors list
- $directors = json_decode($item->getDirectors(), true);
?>
-
+
') no-repeat;" href="">
-
De
+
De getDirectors(), 'name'); ?>
-
-
+
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_mostTaggedList.php Wed Mar 24 14:27:53 2010 +0100
@@ -1,27 +1,26 @@
Les films les plus taggés
- getRef();
$slug = $item->getSlugUrl();
$title = $item->getTitle();
-
+
// image file
$image_file = $item->getImages();
// image file
$video_file = $item->getVideos();
- // directors list
- $directors = json_decode($item->getDirectors(), true);
+
?>
-
+
') no-repeat;" href=""">
-
De
+
De getDirectors(), 'name'); ?>
-
+
+
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/apps/frontend/modules/partials/templates/_header.php
--- a/web/thdProject/apps/frontend/modules/partials/templates/_header.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/apps/frontend/modules/partials/templates/_header.php Wed Mar 24 14:27:53 2010 +0100
@@ -1,5 +1,5 @@
le site du cinéma indépendant
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/lib/helper/ThdHtmlHelper.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/thdProject/lib/helper/ThdHtmlHelper.php Wed Mar 24 14:27:53 2010 +0100
@@ -0,0 +1,54 @@
+$item) {
+ $itemName = '';
+ $itemUri = '';
+ $itemHtml = '';
+ $itemClasses = '';
+
+ if (is_array($item)) {
+ $itemName = $item[$nameAccessor];
+ $itemUri = $uriAccessor ? $item[$uriAccessor]: '';
+ } else {
+ $itemName = $item->$nameAccessor();
+ $itemUri = $uriAccessor ? $item->$uriAccessor() : '';
+ }
+
+ if ($itemClass) {
+ $itemClasses = ' class="'.$itemClass.'"';
+ }
+
+ if ($itemUri) {
+ $itemHtml = strtr(
+ '%name% ',
+ Array('%name%' => $itemName, '%uri%' => $itemUri, '%classes%' => $itemClasses));
+ } else {
+ $itemHtml = strtr(
+ '%name% ',
+ Array('%name%' => $itemName, '%classes%' => $itemClasses));
+ }
+
+ $itemsHtml[] = $itemHtml;
+ }
+
+ return implode($glue, $itemsHtml);
+}
+
+function flash_path($source, $absolute = false) {
+ return _compute_public_path($source, 'flashes', 'swf', $absolute);
+}
+
+function video_path($source) {
+ return sfConfig::get('app_video_root_uri').'/'.$source;
+}
\ No newline at end of file
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/lib/model/doctrine/ThdFilm.class.php
--- a/web/thdProject/lib/model/doctrine/ThdFilm.class.php Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/lib/model/doctrine/ThdFilm.class.php Wed Mar 24 14:27:53 2010 +0100
@@ -8,7 +8,7 @@
public function getSolrDocumentFields()
{
- // keys of this array are fields' name of solr's schema.xml
+ // keys of this array are fields' name of solr's schema.xml
$type = "ThdFilm";
$fields = array('type' => $type,
'id' => $this->getId(),
@@ -27,5 +27,22 @@
{
$this->uniqueid = UUID::generate(UUID::UUID_TIME, UUID::FMT_STRING, "mosatags");
}
-
+
+ protected function decodeJsonData($attr) {
+ $data = $this->getData();
+ return json_decode($data[$attr], true);
+ }
+
+ public function getDirectors() {
+ return $this->decodeJsonData('directors');
+ }
+
+ public function getActors() {
+ return $this->decodeJsonData('actors');
+ }
+
+ public function getProductionCountries() {
+ return $this->decodeJsonData('production_countries');
+ }
+
}
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/web/css/flashplayer.css
--- a/web/thdProject/web/css/flashplayer.css Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/web/css/flashplayer.css Wed Mar 24 14:27:53 2010 +0100
@@ -13,7 +13,7 @@
.player-ba .infos {
position: relative;
height:40px;
- background:#000 url(../images/global/gradient/h80.png) repeat-x;
+ background:#000;
opacity:0.7;
color:#FFFFFF;
margin: 0;
@@ -29,7 +29,7 @@
position:relative;
top: 130px;
height:70px;
- background:#000 url(../images/global/gradient/h80.png) repeat-x;
+ background:#000;
opacity:0.7;
color:#FFFFFF;
margin: 83px 0px 0px 0px;
@@ -95,7 +95,7 @@
position: relative;
top:0px;
height:30px;
- background:#000 url(../images/global/gradient/h80.png) repeat-x;
+ background:#000;
opacity:0.8;
color:#999999;
margin: 0;
@@ -117,7 +117,7 @@
position:relative;
top: 22px;
height:55px;
- background:#000 url(../images/global/gradient/h80.png) repeat-x;
+ background:#000;
opacity:0.8;
color:#FFFFFF;
margin: 33px 0px 0px 0px;
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/web/css/layout.css
--- a/web/thdProject/web/css/layout.css Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/web/css/layout.css Wed Mar 24 14:27:53 2010 +0100
@@ -65,7 +65,7 @@
width: 1280px;
padding: 5px;
top: 10px;
- background:#000000 url(../img/global/gradient/h80.png) repeat-x;
+ background:#000000;
opacity:0.5;
}
#navigation:after {
diff -r 96ecedbe89de -r be2cac1028d8 web/thdProject/web/js/uc.utils.js
--- a/web/thdProject/web/js/uc.utils.js Wed Mar 24 12:39:52 2010 +0100
+++ b/web/thdProject/web/js/uc.utils.js Wed Mar 24 14:27:53 2010 +0100
@@ -1,4 +1,4 @@
-uc = uc || {};
+var uc = uc || {};
uc.utils = uc.utils || {};
uc.utils.centeredContainer = function(html_container) {