Commit 35b3367d authored by speedprogs_de's avatar speedprogs_de

edited templates, removed old, added new

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/terfe/branches/ter_fe2@51989 735d13b6-9817-0410-8766-e36946ffe9aa
parent 30bd5b93
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
/** /**
* Index action, displays all authors * List action, displays all authors
* *
* @return void * @return void
*/ */
public function indexAction() { public function listAction() {
$this->view->assign('authors', $this->authorRepository->findAll()); $this->view->assign('authors', $this->authorRepository->findAll());
} }
...@@ -65,31 +65,6 @@ ...@@ -65,31 +65,6 @@
} }
/**
* Displays a form for creating a new author
*
* @param Tx_TerFe2_Domain_Model_Author $newAuthor New author object
* @return void
* @dontvalidate $newAuthor
*/
public function newAction(Tx_TerFe2_Domain_Model_Author $newAuthor = NULL) {
$this->view->assign('newAuthor', $newAuthor);
}
/**
* Creates a new author
*
* @param Tx_TerFe2_Domain_Model_Author $newAuthor New author object
* @return void
*/
public function createAction(Tx_TerFe2_Domain_Model_Author $newAuthor) {
$this->authorRepository->add($newAuthor);
$this->flashMessageContainer->add($this->translate('msg.author_created'));
$this->redirect('index');
}
/** /**
* Displays a form to edit an existing author * Displays a form to edit an existing author
* *
...@@ -114,18 +89,5 @@ ...@@ -114,18 +89,5 @@
$this->redirect('index'); $this->redirect('index');
} }
/**
* Deletes an existing author
*
* @param Tx_TerFe2_Domain_Model_Author $author The author to delete
* @return void
*/
public function deleteAction(Tx_TerFe2_Domain_Model_Author $author) {
$this->authorRepository->remove($author);
$this->flashMessageContainer->add($this->translate('msg.author_deleted'));
$this->redirect('index');
}
} }
?> ?>
\ No newline at end of file
...@@ -45,15 +45,26 @@ ...@@ -45,15 +45,26 @@
/** /**
* Index action, displays all categories * List action, displays all categories
* *
* @return void * @return void
*/ */
public function indexAction() { public function listAction() {
$this->view->assign('categories', $this->categoryRepository->findAll()); $this->view->assign('categories', $this->categoryRepository->findAll());
} }
/**
* Action that displays a single category
*
* @param Tx_TerFe2_Domain_Model_Category $category The category to display
* @return void
*/
public function showAction(Tx_TerFe2_Domain_Model_Category $category) {
$this->view->assign('category', $category);
}
/** /**
* Displays a form for creating a new category * Displays a form for creating a new category
* *
......
...@@ -117,6 +117,8 @@ ...@@ -117,6 +117,8 @@
/** /**
* List action, displays all extensions * List action, displays all extensions
*
* Note: Required for RSS / JSON output
* *
* @return void * @return void
*/ */
...@@ -127,6 +129,8 @@ ...@@ -127,6 +129,8 @@
/** /**
* List latest action, displays new and updated extensions * List latest action, displays new and updated extensions
*
* Note: Required for RSS / JSON output
* *
* @return void * @return void
*/ */
...@@ -137,51 +141,28 @@ ...@@ -137,51 +141,28 @@
} }
/**
* List by category action, displays all extensions in a category
*
* @param Tx_TerFe2_Domain_Model_Category $category The category to search in
* @return void
*/
public function listByCategoryAction(Tx_TerFe2_Domain_Model_Category $category) {
$this->view->assign('extensions', $this->extensionRepository->findByCategory($category));
}
/**
* List by tag action, displays all extensions with a tag
*
* @param Tx_TerFe2_Domain_Model_Tag $tag The tag to search for
* @return void
*/
public function listByTagAction(Tx_TerFe2_Domain_Model_Tag $tag) {
$this->view->assign('extensions', $this->extensionRepository->findByTag($tag));
}
/** /**
* Action that displays a single extension * Action that displays a single extension
* *
* @param Tx_TerFe2_Domain_Model_Extension $extension The extension to display * @param Tx_TerFe2_Domain_Model_Extension $extension The extension to display
* @param string $extensionKey Extension key
* @return void * @return void
* @dontvalidate $extension
* @dontvalidate $extensionKey
*/ */
public function showAction(Tx_TerFe2_Domain_Model_Extension $extension) { public function showAction(Tx_TerFe2_Domain_Model_Extension $extension = NULL, $extensionKey = NULL) {
$this->view->assign('extension', $extension); if (!empty($extensionKey)) {
} if (!is_string($extensionKey)) {
throw new Exception('No valid extension key given');
}
$extension = $this->extensionRepository->findOneByExtKey($extensionKey);
}
/** if ($extension === NULL || !$extension instanceof Tx_TerFe2_Domain_Model_Extension) {
* Action that displays a single extension by extension key throw new Exception('Extension object is not valid');
*
* @param string $extensionKey The extension key
* @return void
*/
public function showByExtensionKey($extensionKey) {
if (empty($extensionKey) || !is_string($extensionKey)) {
throw new Exception('No valid extension key given');
} }
$extension = $this->extensionRepository->findOneByExtKey($extensionKey);
$this->showAction($extension); $this->view->assign('extension', $extension);
} }
......
...@@ -51,15 +51,26 @@ ...@@ -51,15 +51,26 @@
/** /**
* Index action, displays all tags * List action, displays all tags
* *
* @return void * @return void
*/ */
public function indexAction() { public function listAction() {
$this->view->assign('tags', $this->tagRepository->findAll()); $this->view->assign('tags', $this->tagRepository->findAll());
} }
/**
* Action that displays a single tag
*
* @param Tx_TerFe2_Domain_Model_Category $tag The tag to display
* @return void
*/
public function showAction(Tx_TerFe2_Domain_Model_Tag $tag) {
$this->view->assign('tag', $tag);
}
/** /**
* Displays a form for creating a new tag * Displays a form for creating a new tag
* *
......
...@@ -13,7 +13,7 @@ plugin.tx_terfe2 { ...@@ -13,7 +13,7 @@ plugin.tx_terfe2 {
randomAuthorCount = 10 randomAuthorCount = 10
# cat=TER Frontend/settings/130; type=int+; label=Crop description at this count of signs # cat=TER Frontend/settings/130; type=int+; label=Crop description at this count of signs
descriptionLength = 200 descriptionLength = 350
# cat=TER Frontend/settings/130; type=string; label=Date format # cat=TER Frontend/settings/130; type=string; label=Date format
dateFormat = F j, Y dateFormat = F j, Y
......
...@@ -135,6 +135,7 @@ ...@@ -135,6 +135,7 @@
<label index="single_author">Show single Author</label> <label index="single_author">Show single Author</label>
<label index="author">Author</label> <label index="author">Author</label>
<label index="relations">Relations</label> <label index="relations">Relations</label>
<label index="reverse_relations">Relation of</label>
<label index="category">Category</label> <label index="category">Category</label>
<label index="download">Download</label> <label index="download">Download</label>
<label index="details">Details</label> <label index="details">Details</label>
...@@ -145,6 +146,8 @@ ...@@ -145,6 +146,8 @@
<label index="version_history">Version history</label> <label index="version_history">Version history</label>
<label index="tags">Tags</label> <label index="tags">Tags</label>
<label index="changelog">Changelog</label> <label index="changelog">Changelog</label>
<label index="files">Files</label>
<label index="manual">Manual</label>
<label index="back_to_list">Back to list</label> <label index="back_to_list">Back to list</label>
<label index="back_to_detail">Back to details</label> <label index="back_to_detail">Back to details</label>
...@@ -153,7 +156,6 @@ ...@@ -153,7 +156,6 @@
<label index="delete">Delete</label> <label index="delete">Delete</label>
<label index="download_t3x">Download [t3x]</label> <label index="download_t3x">Download [t3x]</label>
<label index="download_zip">Download [zip]</label> <label index="download_zip">Download [zip]</label>
<label index="read_manual">Manual</label>
<label index="downloads_by_version">Downloads by Version</label> <label index="downloads_by_version">Downloads by Version</label>
</languageKey> </languageKey>
</data> </data>
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<f:then> <f:then>
<f:for each="{extensions}" as="extension"> <f:for each="{extensions}" as="extension">
<div class="extension-row"> <div class="extension-row">
<!-- Headline -->
<div class="extension-head"> <div class="extension-head">
<h4> <h4>
<span class="extension-icon"><terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" /></span> <span class="extension-icon"><terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" /></span>
...@@ -11,14 +13,17 @@ ...@@ -11,14 +13,17 @@
<span class="extension-date"><f:translate key="version"/> {extension.lastVersion.versionString} - <terfe2:dateTime format="{settings.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime> | <strong><terfe2:format content="{extension.lastVersion.state}" function="ucfirst" /></strong></span> <span class="extension-date"><f:translate key="version"/> {extension.lastVersion.versionString} - <terfe2:dateTime format="{settings.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime> | <strong><terfe2:format content="{extension.lastVersion.state}" function="ucfirst" /></strong></span>
</h4> </h4>
</div> </div>
<!-- Content area -->
<div class="extension-regular"> <div class="extension-regular">
<!-- Description --> <!-- Description -->
<div class="extension-description"> <div class="extension-description">
<p><terfe2:crop length="{settings.descriptionLength}">{extension.lastVersion.description}</terfe2:crop></p> <p><terfe2:crop length="{settings.descriptionLength}">{extension.lastVersion.description}</terfe2:crop></p>
</div> </div>
<!-- General information -->
<div class="extension-info"> <div class="extension-info">
<!-- General information -->
<table> <table>
<tr> <tr>
<td class="extension-label"><f:translate key="extension"/>:</td> <td class="extension-label"><f:translate key="extension"/>:</td>
...@@ -26,7 +31,7 @@ ...@@ -26,7 +31,7 @@
</tr> </tr>
<tr> <tr>
<td class="extension-label"><f:translate key="author"/>:</td> <td class="extension-label"><f:translate key="author"/>:</td>
<td><f:link.action controller="Extension" action="listByAuthor" arguments="{author : extension.lastVersion.author}">{extension.lastVersion.author.name}</f:link.action></td> <td><f:link.action controller="Author" action="show" arguments="{author : extension.lastVersion.author}">{extension.lastVersion.author.name}</f:link.action></td>
</tr> </tr>
<tr> <tr>
<td class="extension-label"><f:translate key="category"/>:</td> <td class="extension-label"><f:translate key="category"/>:</td>
...@@ -38,8 +43,11 @@ ...@@ -38,8 +43,11 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<div class="extension-additional" style="display:none;"> <div class="extension-additional" style="display:none;">
<!-- Additional description -->
<div class="extension-description"> <div class="extension-description">
<!-- Images --> <!-- Images -->
<div class="extension-images"> <div class="extension-images">
...@@ -66,15 +74,30 @@ ...@@ -66,15 +74,30 @@
<p>TODO: Changelog from file</p> <p>TODO: Changelog from file</p>
</div> </div>
</div> </div>
<h5 class="a-h closed"><span><f:translate key="files"/></span></h5>
<div class="a-body">
<div class="a-content">
<p>TODO: File links (scrollable div), will be displayed in new window (target)</p>
</div>
</div>
</div> </div>
</div> </div>
<!-- Additional information -->
<div class="extension-info"> <div class="extension-info">
<!-- Additional information -->
<table> <table>
<tr> <tr>
<td class="extension-label"><f:translate key="relations"/>:</td> <td class="extension-label"><f:translate key="relations"/>:</td>
<td><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.filteredSoftwareRelations}"/></td> <td><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.filteredSoftwareRelations}"/></td>
</tr> </tr>
<!-- <tr>
<td class="extension-label"><f:translate key="reverse_relations"/>:</td>
<td>TODO: Related to this</td>
</tr> -->
<tr>
<td class="extension-label"><f:translate key="manual"/>:</td>
<td>TODO: Manual link</td>
</tr>
<tr> <tr>
<td class="extension-label"><f:translate key="tags"/>:</td> <td class="extension-label"><f:translate key="tags"/>:</td>
<td><f:render partial="InlineTagList" arguments="{tags: extension.tags}"/></td> <td><f:render partial="InlineTagList" arguments="{tags: extension.tags}"/></td>
...@@ -84,8 +107,11 @@ ...@@ -84,8 +107,11 @@
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<br class="tx_terfe2-clear" /> <br class="tx_terfe2-clear" />
<!-- Buttons -->
<div class="extension-buttons"> <div class="extension-buttons">
<span class="extension-button extension-row-toggle"><f:translate key="details"/></span> <span class="extension-button extension-row-toggle"><f:translate key="details"/></span>
<span class="extension-button extension-button-right"><f:link.action controller="Extension" action="download" arguments="{version : extension.lastVersion}"><f:translate key="download_t3x"/></f:link.action></span> <span class="extension-button extension-button-right"><f:link.action controller="Extension" action="download" arguments="{version : extension.lastVersion}"><f:translate key="download_t3x"/></f:link.action></span>
...@@ -93,6 +119,7 @@ ...@@ -93,6 +119,7 @@
<span class="extension-button extension-button-right"><f:link.action controller="Extension" action="download" arguments="{version : extension.lastVersion, format : 'zip'}"><f:translate key="download_zip"/></f:link.action></span> <span class="extension-button extension-button-right"><f:link.action controller="Extension" action="download" arguments="{version : extension.lastVersion, format : 'zip'}"><f:translate key="download_zip"/></f:link.action></span>
</f:if> </f:if>
</div> </div>
</div> </div>
</f:for> </f:for>
</f:then> </f:then>
......
<f:if condition="{categories}"> <f:if condition="{categories}">
<f:for each="{categories}" as="category" iteration="categoryIteration"> <f:for each="{categories}" as="category" iteration="categoryIteration">
<f:link.action controller="Extension" action="listByCategory" arguments="{category : category}">{category.title}</f:link.action><f:if condition="{categoryIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if> <f:link.action controller="Category" action="show" arguments="{category : category}">{category.title}</f:link.action><f:if condition="{categoryIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if>
</f:for> </f:for>
</f:if> </f:if>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<f:if condition="{relations}"> <f:if condition="{relations}">
<f:for each="{relations}" as="relation" iteration="relationIteration"> <f:for each="{relations}" as="relation" iteration="relationIteration">
<f:if condition="{relation.isExtension}"> <f:if condition="{relation.isExtension}">
<f:link.action controller="Extension" action="showByExtensionKey" arguments="{extensionKey : relation.relationKey}">{relation.relationKey}</f:link.action><f:if condition="{relation.versionString}"> ({relation.versionString})</f:if><f:if condition="{relationIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if> <f:link.action controller="Extension" action="show" arguments="{extensionKey : relation.relationKey}">{relation.relationKey}</f:link.action><f:if condition="{relation.versionString}"> ({relation.versionString})</f:if><f:if condition="{relationIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if>
</f:if> </f:if>
<f:if condition="{relation.isSystem}"> <f:if condition="{relation.isSystem}">
<terfe2:format function="strtoupper">{relation.relationKey}</terfe2:format><f:if condition="{relation.versionString}"> ({relation.versionString})</f:if><f:if condition="{relationIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if> <terfe2:format function="strtoupper">{relation.relationKey}</terfe2:format><f:if condition="{relation.versionString}"> ({relation.versionString})</f:if><f:if condition="{relationIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if>
......
<f:if condition="{tags}"> <f:if condition="{tags}">
<f:for each="{tags}" as="tag" iteration="tagIteration"> <f:for each="{tags}" as="tag" iteration="tagIteration">
<f:link.action controller="Extension" action="listByTag" arguments="{tag : tag}">{tag.title}</f:link.action><f:if condition="{tagIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if> <f:link.action controller="Tag" action="show" arguments="{tag : tag}">{tag.title}</f:link.action><f:if condition="{tagIteration.isLast}"><f:then></f:then><f:else>, </f:else></f:if>
</f:for> </f:for>
</f:if> </f:if>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<h2><f:translate key="edit_author"/></h2>
<f:form method="post" action="update" name="author" object="{author}">
<label for="name"><f:translate key="tx_terfe2_domain_model_author.name" /></label><br />
<f:form.textbox property="name" /><br />
<label for="email"><f:translate key="tx_terfe2_domain_model_author.email" /></label><br />
<f:form.textbox property="email" /><br />
<label for="company"><f:translate key="tx_terfe2_domain_model_author.company" /></label><br />
<f:form.textbox property="company" /><br />
<label for="forge_link"><f:translate key="tx_terfe2_domain_model_author.forge_link" /></label><br />
<f:form.textbox property="forgeLink" /><br /><br />
<f:form.submit value="{f:translate(key:'edit')}" />
</f:form>
<f:link.action controller="Author" action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<h2><f:translate key="single_author"/></h2>
<table cellpadding="4" style="border:1px solid black;">
<tr>
<td><f:translate key="tx_terfe2_domain_model_author.name" />:</td>
<td>{author.name}</td>
</tr>
<tr>
<td><f:translate key="tx_terfe2_domain_model_author.email" />:</td>
<td>{author.email}</td>
</tr>
<tr>
<td><f:translate key="tx_terfe2_domain_model_author.company" />:</td>
<td>{author.company}</td>
</tr>
<tr>
<td><f:translate key="tx_terfe2_domain_model_author.forge_link" />:</td>
<td>{author.forgeLink}</td>
</tr>
</table>
<br />
<f:link.action controller="Author" action="edit" arguments="{author : author}"><f:translate key="edit"/></f:link.action>
<f:link.action controller="Author" action="delete" arguments="{author : author}"><f:translate key="delete"/></f:link.action>
<f:link.action controller="Author" action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<h2><f:translate key="edit_category"/></h2>
<f:form method="post" action="update" name="category" object="{category}">
<label for="title"><f:translate key="tx_terfe2_domain_model_category.title" /></label><br />
<f:form.textbox property="title" /><br />
<label for="description"><f:translate key="tx_terfe2_domain_model_category.description" /></label><br />
<f:form.textbox property="description" /><br /><br />
<f:form.submit value="{f:translate(key:'edit')}" />
</f:form>
<f:link.action controller="Category" action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
</f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<f:render partial="CategoryList" arguments="{categories: categories}"/> <f:render partial="CategoryList" arguments="{categories: categories}"/>
<br /> <br />
<f:link.action controller="Category" action="new"><f:translate key="create_category"/></f:link.action> <f:link.action controller="Category" action="new"><f:translate key="create_category"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<h2><f:translate key="new_category"/></h2>
<f:form method="post" action="create" name="newCategory" object="{newCategory}">
<label for="title"><f:translate key="tx_terfe2_domain_model_category.title" /></label><br />
<f:form.textbox property="title" /><br />
<label for="description"><f:translate key="tx_terfe2_domain_model_category.description" /></label><br />
<f:form.textbox property="description" /><br /><br />
<f:form.submit value="{f:translate(key:'create')}" />
</f:form>
<f:link.action controller="Category" action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<!-- TODO -->
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" /> <f:layout name="Default" />
<f:section name="main"> <f:section name="main">
<h2><f:translate key="edit_extension"/></h2>
<f:form method="post" action="update" controller="Extension" name="extension" object="{extension}">
<label for="title"><f:translate key="tx_terfe2_domain_model_version.title" /></label><br />
<f:form.textbox size="40" property="lastVersion.title" /><br /><br />
<label for="description"><f:translate key="tx_terfe2_domain_model_version.description" /></label><br />
<f:form.textarea rows="5" cols="40" property="lastVersion.description" /><br /><br />
<label for="forgeLink"><f:translate key="tx_terfe2_domain_model_extension.forge_link" /></label><br />
<f:form.textbox size="40" property="forgeLink" /><br />
<label for="hudsonLink"><f:translate key="tx_terfe2_domain_model_extension.hudson_link" /></label><br />
<f:form.textbox size="40" property="hudsonLink" /><br /><br />
<f:form.submit value="{f:translate(key:'edit')}" />
</f:form>
<f:link.action controller="Extension" action="show" arguments="{extension : extension}"><f:translate key="back_to_detail"/></f:link.action>
</f:section> </f:section>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
</f:section>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
</f:section>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">