diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-10-08 15:49:48 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-10-08 15:49:48 +0200 |
commit | c701bed2e3572b3b5d5d192cbe3f801d016c881d (patch) | |
tree | b5b5530ee9ced384a768f36a79663d6230445cf2 | |
parent | 3affeb5bd77715c84c70230d744de8d0f577a378 (diff) | |
download | nextcloud-server-c701bed2e3572b3b5d5d192cbe3f801d016c881d.tar.gz nextcloud-server-c701bed2e3572b3b5d5d192cbe3f801d016c881d.zip |
fix a lot of small layout bugs and make the apps page overall prettier plus add ratings finally
-rw-r--r-- | core/img/rating/s1.png | bin | 0 -> 454 bytes | |||
-rw-r--r-- | core/img/rating/s10.png | bin | 0 -> 848 bytes | |||
-rw-r--r-- | core/img/rating/s11.png | bin | 0 -> 724 bytes | |||
-rw-r--r-- | core/img/rating/s2.png | bin | 0 -> 731 bytes | |||
-rw-r--r-- | core/img/rating/s3.png | bin | 0 -> 918 bytes | |||
-rw-r--r-- | core/img/rating/s4.png | bin | 0 -> 989 bytes | |||
-rw-r--r-- | core/img/rating/s5.png | bin | 0 -> 939 bytes | |||
-rw-r--r-- | core/img/rating/s6.png | bin | 0 -> 992 bytes | |||
-rw-r--r-- | core/img/rating/s7.png | bin | 0 -> 939 bytes | |||
-rw-r--r-- | core/img/rating/s8.png | bin | 0 -> 987 bytes | |||
-rw-r--r-- | core/img/rating/s9.png | bin | 0 -> 908 bytes | |||
-rwxr-xr-x | lib/app.php | 37 | ||||
-rw-r--r-- | lib/ocsclient.php | 2 | ||||
-rw-r--r-- | settings/css/settings.css | 3 | ||||
-rw-r--r-- | settings/js/apps.js | 3 | ||||
-rw-r--r-- | settings/templates/apps.php | 2 |
16 files changed, 25 insertions, 22 deletions
diff --git a/core/img/rating/s1.png b/core/img/rating/s1.png Binary files differnew file mode 100644 index 00000000000..445d965ffeb --- /dev/null +++ b/core/img/rating/s1.png diff --git a/core/img/rating/s10.png b/core/img/rating/s10.png Binary files differnew file mode 100644 index 00000000000..b8d66c2a4c4 --- /dev/null +++ b/core/img/rating/s10.png diff --git a/core/img/rating/s11.png b/core/img/rating/s11.png Binary files differnew file mode 100644 index 00000000000..aee9f921560 --- /dev/null +++ b/core/img/rating/s11.png diff --git a/core/img/rating/s2.png b/core/img/rating/s2.png Binary files differnew file mode 100644 index 00000000000..4f860e74ca1 --- /dev/null +++ b/core/img/rating/s2.png diff --git a/core/img/rating/s3.png b/core/img/rating/s3.png Binary files differnew file mode 100644 index 00000000000..26c9baff55f --- /dev/null +++ b/core/img/rating/s3.png diff --git a/core/img/rating/s4.png b/core/img/rating/s4.png Binary files differnew file mode 100644 index 00000000000..47f1f694bf7 --- /dev/null +++ b/core/img/rating/s4.png diff --git a/core/img/rating/s5.png b/core/img/rating/s5.png Binary files differnew file mode 100644 index 00000000000..aa225b6a9a9 --- /dev/null +++ b/core/img/rating/s5.png diff --git a/core/img/rating/s6.png b/core/img/rating/s6.png Binary files differnew file mode 100644 index 00000000000..fd4f42e22c6 --- /dev/null +++ b/core/img/rating/s6.png diff --git a/core/img/rating/s7.png b/core/img/rating/s7.png Binary files differnew file mode 100644 index 00000000000..0d18a1dc025 --- /dev/null +++ b/core/img/rating/s7.png diff --git a/core/img/rating/s8.png b/core/img/rating/s8.png Binary files differnew file mode 100644 index 00000000000..951c3fd3be4 --- /dev/null +++ b/core/img/rating/s8.png diff --git a/core/img/rating/s9.png b/core/img/rating/s9.png Binary files differnew file mode 100644 index 00000000000..b1a654c85d2 --- /dev/null +++ b/core/img/rating/s9.png diff --git a/lib/app.php b/lib/app.php index 90b5c58a448..395230156f6 100755 --- a/lib/app.php +++ b/lib/app.php @@ -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; - } } diff --git a/lib/ocsclient.php b/lib/ocsclient.php index fc2095f5c15..c5c4357313b 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -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; } diff --git a/settings/css/settings.css b/settings/css/settings.css index d5e826b33ce..60a42784661 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -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; } diff --git a/settings/js/apps.js b/settings/js/apps.js index 6ef33706f65..8de95100c4c 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -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) { diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 0662148ebf2..1e9598de1e3 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -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> |