1
0

Added Highscore to programs/view

This commit is contained in:
Mike Schwörer 2014-07-20 16:37:49 +02:00
parent e4a08ce32d
commit d7e056a4ee
5 changed files with 38 additions and 9 deletions

View File

@ -637,6 +637,10 @@ ul.nav li.dropdown-append:hover > ul.dropdown-menu {
border-radius: 6px 6px 0px 0px; border-radius: 6px 6px 0px 0px;
} }
.progview_donwloadbtns > .btn-primary {
font-weight: 900;
}
/* blog/view /* blog/view
-------------------------------------------------- */ -------------------------------------------------- */

View File

@ -115,4 +115,15 @@ class HighscoreGames extends CActiveRecord
{ {
return '/Highscores/list?gameid=' . $this->ID; return '/Highscores/list?gameid=' . $this->ID;
} }
/**
* @return HighscoreEntries
*/
public function getMaximumScore()
{
if (count($this->ENTRIES) > 0)
return $this->ENTRIES[0];
else
return null;
}
} }

View File

@ -204,6 +204,9 @@ class Program extends CActiveRecord
return new DateTime($this->add_date); return new DateTime($this->add_date);
} }
/**
* @return string
*/
public function getStarHTML() public function getStarHTML()
{ {
$out = ''; $out = '';
@ -261,7 +264,16 @@ class Program extends CActiveRecord
return $result; return $result;
} }
public function deleteDescriptions() { public function deleteDescriptions()
{
MsHelper::deleteDir("data/programs/desc/" . $this->Name . "/"); MsHelper::deleteDir("data/programs/desc/" . $this->Name . "/");
} }
/**
* @return HighscoreGames
*/
public function getHighscoreGame()
{
return HighscoreGames::model()->findByPk($this->highscore_gid);
}
} }

View File

@ -26,9 +26,9 @@
border-spacing: 0px; border-spacing: 0px;
} }
table td { table td { padding: 2px 0px; }
padding: 2px 0px; table td { width: 25%; }
} table td:last-child { width: 50%; }
caption { caption {
font-weight: bolder; font-weight: bolder;

View File

@ -39,6 +39,12 @@ if (!$model->visible && Yii::app()->user->name != 'admin') {
<td>Downloads:</td> <td>Downloads:</td>
<td><?php echo TbHtml::badge($model->Downloads, array('color' => TbHtml::BADGE_COLOR_SUCCESS)); ?></td> <td><?php echo TbHtml::badge($model->Downloads, array('color' => TbHtml::BADGE_COLOR_SUCCESS)); ?></td>
</tr> </tr>
<?php if ($model->highscore_gid >= 0): ?>
<tr>
<td>Highscore:</td>
<td><?php echo TbHtml::badge($model->getHighscoreGame()->getMaximumScore()->POINTS, array('color' => TbHtml::BADGE_COLOR_SUCCESS)); ?></td>
</tr>
<?php endif ?>
<tr> <tr>
<td>Languages:</td> <td>Languages:</td>
<td><?php foreach ($model->getLanguageList() as $lang) echo TbHtml::badge($lang, array('color' => TbHtml::BADGE_COLOR_INFO)); ?></td> <td><?php foreach ($model->getLanguageList() as $lang) echo TbHtml::badge($lang, array('color' => TbHtml::BADGE_COLOR_INFO)); ?></td>
@ -53,10 +59,6 @@ if (!$model->visible && Yii::app()->user->name != 'admin') {
<td><?php echo TbHtml::badge($model->version->Version, array('color' => TbHtml::BADGE_COLOR_INFO)); ?></td> <td><?php echo TbHtml::badge($model->version->Version, array('color' => TbHtml::BADGE_COLOR_INFO)); ?></td>
</tr> </tr>
<?php endif ?> <?php endif ?>
<?php
// TODO-MS Add Highscore Tables to MVC
// TODO-MS Show highest score when highscore_gid is set
?>
</table> </table>
</div> </div>
@ -138,7 +140,7 @@ if (!$model->visible && Yii::app()->user->name != 'admin') {
'block' => true, 'block' => true,
'color' => TbHtml::BUTTON_COLOR_SUCCESS, 'color' => TbHtml::BUTTON_COLOR_SUCCESS,
'size' => TbHtml::BUTTON_SIZE_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_DEFAULT,
'url' => '#', //TODO-MS Add Highscore link 'url' => '/Highscores/list?gameid=' . $model->highscore_gid, //TODO-MS Add Highscore link
]); ]);
?> ?>
</div> </div>