fix a lot of small layout bugs and make the apps page overall prettier plus add ratings finally

This commit is contained in:
Frank Karlitschek 2012-10-08 15:49:48 +02:00
parent 3affeb5bd7
commit c701bed2e3
16 changed files with 25 additions and 22 deletions

BIN
core/img/rating/s1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

BIN
core/img/rating/s10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

BIN
core/img/rating/s11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

BIN
core/img/rating/s2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

BIN
core/img/rating/s3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

BIN
core/img/rating/s4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

BIN
core/img/rating/s5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

BIN
core/img/rating/s6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

BIN
core/img/rating/s7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

BIN
core/img/rating/s8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

BIN
core/img/rating/s9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

View file

@ -578,50 +578,45 @@ class OC_App{
* @return array, multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
*/
public static function getAppstoreApps( $filter = 'approved' ) {
$catagoryNames = OC_OCSClient::getCategories();
if ( is_array( $catagoryNames ) ) {
// Check that categories of apps were retrieved correctly
if ( ! $categories = array_keys( $catagoryNames ) ) {
return false;
}
$page = 0;
$remoteApps = OC_OCSClient::getApplications( $categories, $page, $filter );
$app1 = array();
$i = 0;
foreach ( $remoteApps as $app ) {
$app1[$i] = $app;
$app1[$i]['author'] = $app['personid'];
$app1[$i]['ocs_id'] = $app['id'];
$app1[$i]['internal'] = $app1[$i]['active'] = 0;
// rating img
if($app['score']>=0 and $app['score']<5) $img=OC_Helper::imagePath( "core", "rating/s1.png" );
elseif($app['score']>=5 and $app['score']<15) $img=OC_Helper::imagePath( "core", "rating/s2.png" );
elseif($app['score']>=15 and $app['score']<25) $img=OC_Helper::imagePath( "core", "rating/s3.png" );
elseif($app['score']>=25 and $app['score']<35) $img=OC_Helper::imagePath( "core", "rating/s4.png" );
elseif($app['score']>=35 and $app['score']<45) $img=OC_Helper::imagePath( "core", "rating/s5.png" );
elseif($app['score']>=45 and $app['score']<55) $img=OC_Helper::imagePath( "core", "rating/s6.png" );
elseif($app['score']>=55 and $app['score']<65) $img=OC_Helper::imagePath( "core", "rating/s7.png" );
elseif($app['score']>=65 and $app['score']<75) $img=OC_Helper::imagePath( "core", "rating/s8.png" );
elseif($app['score']>=75 and $app['score']<85) $img=OC_Helper::imagePath( "core", "rating/s9.png" );
elseif($app['score']>=85 and $app['score']<95) $img=OC_Helper::imagePath( "core", "rating/s10.png" );
elseif($app['score']>=95 and $app['score']<100) $img=OC_Helper::imagePath( "core", "rating/s11.png" );
$app1[$i]['score'] = '<img src="'.$img.'"> Score: '.$app['score'].'%';
$i++;
}
}
if ( empty( $app1 ) ) {
return false;
} else {
return $app1;
}
}

View file

@ -140,6 +140,7 @@ class OC_OCSClient{
$app['preview']=(string)$tmp[$i]->smallpreviewpic1;
$app['changed']=strtotime($tmp[$i]->changed);
$app['description']=(string)$tmp[$i]->description;
$app['score']=(string)$tmp[$i]->score;
$apps[]=$app;
}
@ -188,6 +189,7 @@ class OC_OCSClient{
$app['changed']=strtotime($tmp->changed);
$app['description']=$tmp->description;
$app['detailpage']=$tmp->detailpage;
$app['score']=$tmp->score;
return $app;
}

View file

@ -50,7 +50,7 @@ li { color:#888; }
li.active { color:#000; }
small.externalapp { color:#FFF; background-color:#BBB; font-weight:bold; font-size: 0.6em; margin: 0; padding: 0.1em 0.2em; border-radius: 4px;}
small.externalapp.list { float: right; }
span.version { margin-left:3em; margin-right:3em; color:#555; }
span.version { margin-left:1em; margin-right:1em; color:#555; }
.app { position: relative; display: inline-block; padding: 0.2em 0 0.2em 0 !important; text-overflow: hidden; overflow: hidden; white-space: nowrap; /*transition: .2s max-width linear; -o-transition: .2s max-width linear; -moz-transition: .2s max-width linear; -webkit-transition: .2s max-width linear; -ms-transition: .2s max-width linear;*/ }
.app.externalapp { max-width: 12.5em; z-index: 100; }
@ -58,6 +58,7 @@ span.version { margin-left:3em; margin-right:3em; color:#555; }
.app:hover, .app:active { max-width: inherit; }
.appslink { text-decoration: underline; }
.score { color:#666; font-weight:bold; font-size:0.8em; }
/* LOG */
#log { white-space:normal; }

View file

@ -17,6 +17,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
} else {
page.find('span.version').text('');
}
page.find('span.score').html(app.score);
page.find('p.description').html(app.description);
page.find('img.preview').attr('src', app.preview);
page.find('small.externalapp').attr('style', 'visibility:visible');
@ -28,11 +29,13 @@ OC.Settings.Apps = OC.Settings.Apps || {
page.find('input.enable').data('appid', app.id);
page.find('input.enable').data('active', app.active);
if (app.internal == false) {
page.find('span.score').show();
page.find('p.appslink').show();
page.find('a').attr('href', 'http://apps.owncloud.com/content/show.php?content=' + app.id);
page.find('small.externalapp').hide();
} else {
page.find('p.appslink').hide();
page.find('span.score').hide();
}
},
enableApp:function(appid, active, element) {

View file

@ -8,6 +8,7 @@
</script>
<div id="controls">
<a class="button" target="_blank" href="http://owncloud.org/dev/apps/getting-started/"><?php echo $l->t('Add your App');?></a>
<a class="button" target="_blank" href="http://apps.owncloud.com"><?php echo $l->t('More Apps');?></a>
</div>
<ul id="leftcontent" class="applist">
<?php foreach($_['apps'] as $app):?>
@ -24,6 +25,7 @@
<div id="rightcontent">
<div class="appinfo">
<h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span class="version"></span><small class="externalapp" style="visibility:hidden;"></small></h3>
<span class="score"></span>
<p class="description"></p>
<img src="" class="preview" />
<p class="appslink hidden"><a href="#" target="_blank"><?php echo $l->t('See application page at apps.owncloud.com');?></a></p>