[TASK] EM: extension info within "Get Extensions" 09/19609/2
authorFelix Kopp <felix-source@phorax.com>
Fri, 5 Apr 2013 17:05:28 +0000 (19:05 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 5 Apr 2013 17:40:31 +0000 (19:40 +0200)
Improves the single view / showAllVersions with further details.
Brings detail view as a base for further improvements.

Change-Id: Ia774a064508d6e98438f6480d929e39cbe7e5534
Fixes: #39919
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/19609
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Extension.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/ExtensionRepository.php
typo3/sysext/extensionmanager/Configuration/TCA/Extension.php
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf
typo3/sysext/extensionmanager/Resources/Private/Scss/page/_base.scss
typo3/sysext/extensionmanager/Resources/Private/Scss/page/_get.scss
typo3/sysext/extensionmanager/Resources/Private/Templates/List/ShowAllVersions.html
typo3/sysext/extensionmanager/Resources/Public/Css/main.css

index c6cda03..fa7dbdd 100644 (file)
@@ -119,8 +119,16 @@ class ListController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCont
         * @param string $extensionKey
         */
        public function showAllVersionsAction($extensionKey) {
+               $currentVersion = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extensionKey);
                $extensions = $this->extensionRepository->findByExtensionKeyOrderedByVersion($extensionKey);
-               $this->view->assign('extensions', $extensions)->assign('extensionKey', $extensionKey);
+
+               $this->view->assignMultiple(
+                       array(
+                               'extensionKey' => $extensionKey,
+                               'currentVersion' => $currentVersion,
+                               'extensions' => $extensions
+                       )
+               );
        }
 }
 ?>
\ No newline at end of file
index f83a370..ecfd0f2 100644 (file)
@@ -142,6 +142,11 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $reviewState;
 
        /**
+        * @var integer
+        */
+       protected $alldownloadcounter;
+
+       /**
         * @var string
         */
        protected $serializedDependencies = '';
@@ -196,7 +201,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * @param int $category
+        * @param integer $category
         * @return void
         */
        public function setCategory($category) {
@@ -518,7 +523,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * @param int $integerVersion
+        * @param integer $integerVersion
         * @return void
         */
        public function setIntegerVersion($integerVersion) {
@@ -526,14 +531,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * @return int
+        * @return integer
         */
        public function getIntegerVersion() {
                return $this->integerVersion;
        }
 
        /**
-        * @param int $reviewState
+        * @param integer $reviewState
         * @return void
         */
        public function setReviewState($reviewState) {
@@ -541,14 +546,14 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * @return int
+        * @return integer
         */
        public function getReviewState() {
                return $this->reviewState;
        }
 
        /**
-        * @param int $position
+        * @param integer $position
         * @return void
         */
        public function setPosition($position) {
@@ -556,13 +561,26 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
-        * @return int
+        * @return integer
         */
        public function getPosition() {
                return $this->position;
        }
 
-}
+       /**
+        * @param integer $alldownloadcounter
+        */
+       public function setAlldownloadcounter($alldownloadcounter) {
+               $this->alldownloadcounter = $alldownloadcounter;
+       }
+
+       /**
+        * @return integer
+        */
+       public function getAlldownloadcounter() {
+               return $this->alldownloadcounter;
+       }
 
+}
 
 ?>
\ No newline at end of file
index 18ac89f..4bc6a88 100644 (file)
@@ -99,6 +99,25 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
        }
 
        /**
+        * Find the current version by extension key
+        *
+        * @param string $extensionKey
+        * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
+        */
+       public function findOneByCurrentVersionByExtensionKey($extensionKey) {
+               $query = $this->createQuery();
+               $query->matching(
+                       $query->logicalAnd(
+                               $query->equals('extensionKey', $extensionKey),
+                               $query->greaterThanOrEqual('reviewState', 0),
+                               $query->equals('currentVersion', 1)
+                       )
+               );
+               $query->setLimit(1);
+               return $query->execute()->getFirst();
+       }
+
+       /**
         * Find one extension by extension key and version
         *
         * @param string $extensionKey
index 0716c29..f49b77a 100644 (file)
@@ -24,6 +24,11 @@ $TCA['tx_extensionmanager_domain_model_extension'] = array(
                                'size' => '30'
                        )
                ),
+               'alldownloadcounter' => array(
+                       'config' => array(
+                               'type' => 'passthrough'
+                       )
+               ),
                'integer_version' => array(
                        'exclude' => 0,
                        'label' => 'LLL:EXT:extensionmanager/Resources/Private/locallang_db.xml:tx_extensionmanager_domain_model_extension.integerversion',
index 346b109..3037cc7 100644 (file)
                        <trans-unit id="extensionList.showAllVersions.label" xml:space="preserve">
                                <source>Show all versions</source>
                        </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.extensionKey" xml:space="preserve">
+                               <source>Extension key</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.version" xml:space="preserve">
+                               <source>Version</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.lastUploaded" xml:space="preserve">
+                               <source>Last uploaded</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.downloads" xml:space="preserve">
+                               <source>Downloads</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.category" xml:space="preserve">
+                               <source>Category</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.manual" xml:space="preserve">
+                               <source>Manual</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.author" xml:space="preserve">
+                               <source>Author</source>
+                       </trans-unit>
+                       <trans-unit id="extensionList.showAllVersions.readOnline" xml:space="preserve">
+                               <source>Read online</source>
+                       </trans-unit>
+
                        <trans-unit id="extensionList.updateFromTer.label" xml:space="preserve">
                                <source>Retrieving Extension-List from TYPO3 Extension Repository (TER)</source>
                        </trans-unit>
index 9fa36fd..d4757e6 100644 (file)
        text-indent: -200px;
        overflow: hidden;
 }
+
+.currentVersionInfo {
+       padding: 0 0 20px 0;
+
+       td { padding: 4px 0; }
+       th { font-weight: normal; color: #8c8c8c; padding: 4px 20px 4px 0; }
+}
+
+.currentVersionInfo a {
+       text-decoration: underline;
+}
+
+span.ter-ext-state {
+       padding: 0 0 0 5px;
+       font-weight: bold;
+       text-transform: capitalize;
+}
+
+span.ter-ext-state-obsolete {
+       color: #8c8c8c;
+       font-weight: normal;
+}
+
+span.ter-ext-state-stable {
+       color: #3db900;
+}
+
+span.ter-ext-state-beta {
+       color: #f4bd00;
+}
+
+span.ter-ext-state-alpha {
+       color: #f14400;
+}
index 87474be..b2517af 100644 (file)
 </f:section>
 
 <f:section name="Content">
+       <f:if condition="{currentVersion}">
+               <p>{currentVersion.description}</p>
+
+               <table cellpadding="0" cellspacing="0" class="currentVersionInfo">
+                       <tr class="ter-ext-single-info-key">
+                               <th><f:translate key="extensionList.showAllVersions.extensionKey" /></th>
+                               <td><strong>{currentVersion.extensionKey}</strong></td>
+                       </tr>
+                       <tr>
+                               <th><f:translate key="extensionList.showAllVersions.version" /></th>
+                               <td>
+                                       {currentVersion.version}
+                                       <span class="ter-ext-state ter-ext-state-{currentVersion.stateString}">{currentVersion.stateString}</span>
+                               </td>
+                       </tr>
+                       <tr>
+                               <th><f:translate key="extensionList.showAllVersions.lastUploaded" /></th>
+                               <td>
+                                       <f:format.date>{currentVersion.lastUpdated}</f:format.date></td>
+                       </tr>
+                       <tr>
+                               <th><f:translate key="extensionList.showAllVersions.downloads" /></th>
+                               <td>
+                                       <f:format.number decimals="0">
+                                               {currentVersion.alldownloadcounter}
+                                       </f:format.number>
+                               </td>
+                       </tr>
+                       <tr>
+                               <th><f:translate key="extensionList.showAllVersions.category" /></th>
+                               <td>{currentVersion.categoryString}</td>
+                       </tr>
+                       <tr class="ter-ext-single-info-manual">
+                               <th><f:translate key="extensionList.showAllVersions.manual" /></th>
+                               <td>
+                                       <a href="http://typo3.org/extension-manuals/{currentVersion.extensionKey}/current/" target="_top">
+                                               <f:translate key="readOnline" />
+                                       </a>
+                               </td>
+                       </tr>
+                       <tr>
+                               <th><f:translate key="extensionList.showAllVersions.author" /></th>
+                               <td>{currentVersion.authorName}</td>
+                       </tr>
+               </table>
+       </f:if>
+
        <f:be.widget.paginate objects="{extensions}" as="paginatedExtensions" configuration="{itemsPerPage: 15, maximumNumberOfLinks: 2}">
                <table id="terVersionTable" class="typo3-extension-list">
                        <f:render partial="List/TerShowVersionsTable" arguments="{paginatedExtensions:paginatedExtensions}" />
index 6722393..817d172 100644 (file)
   color: #222222; }
 
 .ui-widget-header {
-  border: 1px solid #aaaaaa;
+  border: 1px solid #aaa;
   background: #cccccc url(../Images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
   color: #222222;
   font-weight: bold; }
 /* Interaction states
 ----------------------------------*/
 .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
-  border: 1px solid lightgrey;
+  border: 1px solid #d3d3d3;
   background: #e6e6e6 url(../Images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
   font-weight: normal;
   color: #555555; }
 .ui-accordion .ui-accordion-header a {
   display: block;
   font-size: 1em;
-  padding: 0.5em 0.5em 0.5em 0.7em; }
+  padding: .5em .5em .5em .7em; }
 
 .ui-accordion-icons .ui-accordion-header a {
   padding-left: 2.2em; }
 .ui-menu .ui-menu-item a {
   text-decoration: none;
   display: block;
-  padding: 0.2em 0.4em;
+  padding: .2em .4em;
   line-height: 1.5;
   zoom: 1; }
 
@@ -1027,17 +1027,17 @@ button.ui-button-icons-only {
   line-height: 1.4; }
 
 .ui-button-text-only .ui-button-text {
-  padding: 0.4em 1em; }
+  padding: .4em 1em; }
 
 .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
   padding: .4em;
   text-indent: -9999999px; }
 
 .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text {
-  padding: 0.4em 1em 0.4em 2.1em; }
+  padding: .4em 1em .4em 2.1em; }
 
 .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text {
-  padding: 0.4em 2.1em 0.4em 1em; }
+  padding: .4em 2.1em .4em 1em; }
 
 .ui-button-text-icons .ui-button-text {
   padding-left: 2.1em;
@@ -1045,7 +1045,7 @@ button.ui-button-icons-only {
 
 /* no icon support for input elements, provide padding by default */
 input.ui-button {
-  padding: 0.4em 1em; }
+  padding: .4em 1em; }
 
 /*button icon element(s) */
 .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
@@ -1072,7 +1072,7 @@ input.ui-button {
 
 .ui-buttonset .ui-button {
   margin-left: 0;
-  margin-right: -.3em; }
+  margin-right: -0.3em; }
 
 /* workarounds */
 button.ui-button::-moz-focus-inner {
@@ -1096,12 +1096,12 @@ button.ui-button::-moz-focus-inner {
   overflow: hidden; }
 
 .ui-dialog .ui-dialog-titlebar {
-  padding: 0.4em 1em;
+  padding: .4em 1em;
   position: relative; }
 
 .ui-dialog .ui-dialog-title {
   float: left;
-  margin: 0.1em 16px 0.1em 0; }
+  margin: .1em 16px .1em 0; }
 
 .ui-dialog .ui-dialog-titlebar-close {
   position: absolute;
@@ -1122,7 +1122,7 @@ button.ui-button::-moz-focus-inner {
 .ui-dialog .ui-dialog-content {
   position: relative;
   border: 0;
-  padding: 0.5em 1em;
+  padding: .5em 1em;
   background: none;
   overflow: auto;
   zoom: 1; }
@@ -1131,14 +1131,14 @@ button.ui-button::-moz-focus-inner {
   text-align: left;
   border-width: 1px 0 0 0;
   background-image: none;
-  margin: 0.5em 0 0 0;
-  padding: 0.3em 1em 0.5em 0.4em; }
+  margin: .5em 0 0 0;
+  padding: .3em 1em .5em .4em; }
 
 .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
   float: right; }
 
 .ui-dialog .ui-dialog-buttonpane button {
-  margin: 0.5em 0.4em 0.5em 0;
+  margin: .5em .4em .5em 0;
   cursor: pointer; }
 
 .ui-dialog .ui-resizable-se {
@@ -1182,8 +1182,8 @@ button.ui-button::-moz-focus-inner {
   height: .8em; }
 
 .ui-slider-horizontal .ui-slider-handle {
-  top: -.3em;
-  margin-left: -.6em; }
+  top: -0.3em;
+  margin-left: -0.6em; }
 
 .ui-slider-horizontal .ui-slider-range {
   top: 0;
@@ -1200,9 +1200,9 @@ button.ui-button::-moz-focus-inner {
   height: 100px; }
 
 .ui-slider-vertical .ui-slider-handle {
-  left: -.3em;
+  left: -0.3em;
   margin-left: 0;
-  margin-bottom: -.6em; }
+  margin-bottom: -0.6em; }
 
 .ui-slider-vertical .ui-slider-range {
   left: 0;
@@ -1231,21 +1231,21 @@ button.ui-button::-moz-focus-inner {
 /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
 .ui-tabs .ui-tabs-nav {
   margin: 0;
-  padding: 0.2em 0.2em 0; }
+  padding: .2em .2em 0; }
 
 .ui-tabs .ui-tabs-nav li {
   list-style: none;
   float: left;
   position: relative;
   top: 1px;
-  margin: 0 0.2em 1px 0;
+  margin: 0 .2em 1px 0;
   border-bottom: 0 !important;
   padding: 0;
   white-space: nowrap; }
 
 .ui-tabs .ui-tabs-nav li a {
   float: left;
-  padding: 0.5em 1em;
+  padding: .5em 1em;
   text-decoration: none; }
 
 .ui-tabs .ui-tabs-nav li.ui-tabs-selected {
@@ -1279,12 +1279,12 @@ button.ui-button::-moz-focus-inner {
  */
 .ui-datepicker {
   width: 17em;
-  padding: 0.2em 0.2em 0;
+  padding: .2em .2em 0;
   display: none; }
 
 .ui-datepicker .ui-datepicker-header {
   position: relative;
-  padding: 0.2em 0; }
+  padding: .2em 0; }
 
 .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
   position: absolute;
@@ -1335,10 +1335,10 @@ button.ui-button::-moz-focus-inner {
   width: 100%;
   font-size: .9em;
   border-collapse: collapse;
-  margin: 0 0 0.4em; }
+  margin: 0 0 .4em; }
 
 .ui-datepicker th {
-  padding: 0.7em 0.3em;
+  padding: .7em .3em;
   text-align: center;
   font-weight: bold;
   border: 0; }
@@ -1355,17 +1355,17 @@ button.ui-button::-moz-focus-inner {
 
 .ui-datepicker .ui-datepicker-buttonpane {
   background-image: none;
-  margin: 0.7em 0 0 0;
-  padding: 0 0.2em;
+  margin: .7em 0 0 0;
+  padding: 0 .2em;
   border-left: 0;
   border-right: 0;
   border-bottom: 0; }
 
 .ui-datepicker .ui-datepicker-buttonpane button {
   float: right;
-  margin: 0.5em 0.2em 0.4em;
+  margin: .5em .2em .4em;
   cursor: pointer;
-  padding: 0.2em 0.6em 0.3em 0.6em;
+  padding: .2em .6em .3em .6em;
   width: auto;
   overflow: visible; }
 
@@ -1381,7 +1381,7 @@ button.ui-button::-moz-focus-inner {
 
 .ui-datepicker-multi .ui-datepicker-group table {
   width: 95%;
-  margin: 0 auto 0.4em; }
+  margin: 0 auto .4em; }
 
 .ui-datepicker-multi-2 .ui-datepicker-group {
   width: 50%; }
@@ -1538,7 +1538,7 @@ button.ui-button::-moz-focus-inner {
   padding: 2px 6px;
   margin: 0;
   cursor: pointer;
-  color: #333333 !important; }
+  color: #333 !important; }
 
 .dataTables_paginate .ui-button {
   margin-right: -0.1em !important; }
@@ -1641,7 +1641,7 @@ button.ui-button::-moz-focus-inner {
   display: none;
   width: 400px;
   background-color: #ffa;
-  border: 1px solid #cccc99;
+  border: 1px solid #cc9;
   padding: 3px;
   font-size: 13px;
   z-index: 1000; }
@@ -1649,6 +1649,9 @@ button.ui-button::-moz-focus-inner {
 .headerTooltip {
   width: 150px; }
 
+p {
+  padding-bottom: 20px; }
+
 .typo3-extensionmanager-headerRowLeft {
   display: inline-block; }
   .typo3-extensionmanager-headerRowLeft .typo3-extensionmanager-searchTerFieldWrapper {
@@ -1742,7 +1745,7 @@ button.ui-button::-moz-focus-inner {
     background: none;
     padding: 8px 10px;
     vertical-align: middle;
-    border-bottom: 1px solid white; }
+    border-bottom: 1px solid #fff; }
     .typo3-extension-list tr td.stable {
       background-color: #87b374;
       background-image: -webkit-gradient(linear, left top, left bottom, from(#87b374 0%), to(#5f8d4b 100%));
@@ -1817,3 +1820,33 @@ button.ui-button::-moz-focus-inner {
   width: 20px;
   text-indent: -200px;
   overflow: hidden; }
+
+.currentVersionInfo {
+  padding: 0 0 20px 0; }
+  .currentVersionInfo td {
+    padding: 4px 0; }
+  .currentVersionInfo th {
+    font-weight: normal;
+    color: #8c8c8c;
+    padding: 4px 20px 4px 0; }
+
+.currentVersionInfo a {
+  text-decoration: underline; }
+
+span.ter-ext-state {
+  padding: 0 0 0 5px;
+  font-weight: bold;
+  text-transform: capitalize; }
+
+span.ter-ext-state-obsolete {
+  color: #8c8c8c;
+  font-weight: normal; }
+
+span.ter-ext-state-stable {
+  color: #3db900; }
+
+span.ter-ext-state-beta {
+  color: #f4bd00; }
+
+span.ter-ext-state-alpha {
+  color: #f14400; }