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 @@
/**
* Index action, displays all authors
* List action, displays all authors
*
* @return void
*/
public function indexAction() {
public function listAction() {
$this->view->assign('authors', $this->authorRepository->findAll());
}
......@@ -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
*
......@@ -114,18 +89,5 @@
$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 @@
/**
* Index action, displays all categories
* List action, displays all categories
*
* @return void
*/
public function indexAction() {
public function listAction() {
$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
*
......
......@@ -118,6 +118,8 @@
/**
* List action, displays all extensions
*
* Note: Required for RSS / JSON output
*
* @return void
*/
public function listAction() {
......@@ -128,6 +130,8 @@
/**
* List latest action, displays new and updated extensions
*
* Note: Required for RSS / JSON output
*
* @return void
*/
public function listLatestAction() {
......@@ -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
*
* @param Tx_TerFe2_Domain_Model_Extension $extension The extension to display
* @param string $extensionKey Extension key
* @return void
* @dontvalidate $extension
* @dontvalidate $extensionKey
*/
public function showAction(Tx_TerFe2_Domain_Model_Extension $extension) {
$this->view->assign('extension', $extension);
}
/**
* Action that displays a single extension by extension key
*
* @param string $extensionKey The extension key
* @return void
*/
public function showByExtensionKey($extensionKey) {
if (empty($extensionKey) || !is_string($extensionKey)) {
public function showAction(Tx_TerFe2_Domain_Model_Extension $extension = NULL, $extensionKey = NULL) {
if (!empty($extensionKey)) {
if (!is_string($extensionKey)) {
throw new Exception('No valid extension key given');
}
$extension = $this->extensionRepository->findOneByExtKey($extensionKey);
$this->showAction($extension);
}
if ($extension === NULL || !$extension instanceof Tx_TerFe2_Domain_Model_Extension) {
throw new Exception('Extension object is not valid');
}
$this->view->assign('extension', $extension);
}
......
......@@ -51,15 +51,26 @@
/**
* Index action, displays all tags
* List action, displays all tags
*
* @return void
*/
public function indexAction() {
public function listAction() {
$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
*
......
......@@ -13,7 +13,7 @@ plugin.tx_terfe2 {
randomAuthorCount = 10
# 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
dateFormat = F j, Y
......
......@@ -135,6 +135,7 @@
<label index="single_author">Show single Author</label>
<label index="author">Author</label>
<label index="relations">Relations</label>
<label index="reverse_relations">Relation of</label>
<label index="category">Category</label>
<label index="download">Download</label>
<label index="details">Details</label>
......@@ -145,6 +146,8 @@
<label index="version_history">Version history</label>
<label index="tags">Tags</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_detail">Back to details</label>
......@@ -153,7 +156,6 @@
<label index="delete">Delete</label>
<label index="download_t3x">Download [t3x]</label>
<label index="download_zip">Download [zip]</label>
<label index="read_manual">Manual</label>
<label index="downloads_by_version">Downloads by Version</label>
</languageKey>
</data>
......
......@@ -4,6 +4,8 @@
<f:then>
<f:for each="{extensions}" as="extension">
<div class="extension-row">
<!-- Headline -->
<div class="extension-head">
<h4>
<span class="extension-icon"><terfe2:extensionIcon version="{extension.lastVersion}" alt="{extension.lastVersion.title}" /></span>
......@@ -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>
</h4>
</div>
<!-- Content area -->
<div class="extension-regular">
<!-- Description -->
<div class="extension-description">
<p><terfe2:crop length="{settings.descriptionLength}">{extension.lastVersion.description}</terfe2:crop></p>
</div>
<div class="extension-info">
<!-- General information -->
<div class="extension-info">
<table>
<tr>
<td class="extension-label"><f:translate key="extension"/>:</td>
......@@ -26,7 +31,7 @@
</tr>
<tr>
<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>
<td class="extension-label"><f:translate key="category"/>:</td>
......@@ -38,8 +43,11 @@
</tr>
</table>
</div>
</div>
<div class="extension-additional" style="display:none;">
<!-- Additional description -->
<div class="extension-description">
<!-- Images -->
<div class="extension-images">
......@@ -66,15 +74,30 @@
<p>TODO: Changelog from file</p>
</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 class="extension-info">
</div>
</div>
<!-- Additional information -->
<div class="extension-info">
<table>
<tr>
<td class="extension-label"><f:translate key="relations"/>:</td>
<td><f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.filteredSoftwareRelations}"/></td>
</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>
<td class="extension-label"><f:translate key="tags"/>:</td>
<td><f:render partial="InlineTagList" arguments="{tags: extension.tags}"/></td>
......@@ -84,8 +107,11 @@
</tr>
</table>
</div>
</div>
<br class="tx_terfe2-clear" />
<!-- Buttons -->
<div class="extension-buttons">
<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>
......@@ -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>
</f:if>
</div>
</div>
</f:for>
</f:then>
......
<f:if condition="{categories}">
<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:if>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<f:if condition="{relations}">
<f:for each="{relations}" as="relation" iteration="relationIteration">
<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 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>
......
<f:if condition="{tags}">
<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:if>
\ No newline at end of file
<f:layout name="Default" />
<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>
\ No newline at end of file
<f:layout name="Default" />
<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>
\ No newline at end of file
<f:layout name="Default" />
<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>
\ 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">
<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>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
<!-- TODO -->
</f:section>
\ No newline at end of file
<f:layout name="Default" />
<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>
\ 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">
</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">
<h2><f:translate key="new_extension"/></h2>
<f:form method="post" action="create" name="newExtension" object="{newExtension}">
<label for="extKey"><f:translate key="tx_terfe2_domain_model_extension.ext_key" /></label><br />
<f:form.textbox property="extKey" /><br />
<label for="forgeLink"><f:translate key="tx_terfe2_domain_model_extension.forge_link" /></label><br />
<f:form.textbox property="forgeLink" /><br />
<label for="hudsonLink"><f:translate key="tx_terfe2_domain_model_extension.hudson_link" /></label><br />
<f:form.textbox property="hudsonLink" /><br />
<label for="categories"><f:translate key="tx_terfe2_domain_model_extension.categories" /></label><br />
<f:form.select property="categories" options="{categories}" optionValueField="uid" optionLabelField="title"></f:form.select><br />
<label for="tags"><f:translate key="tx_terfe2_domain_model_extension.tags" /></label><br />
<f:form.select property="tags" options="{tags}" optionValueField="uid" optionLabelField="title" multiple="1" size="5"></f:form.select><br /><br />
<f:form.submit value="{f:translate(key:'create')}" />
</f:form>
<f:link.action action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:layout name="Default" />
<f:section name="main">
<h2><f:translate key="single_extension"/></h2>
<!-- Extension details -->
<div class="extension">
<!-- TODO -->
<f:link.action controller="Extension" action="edit" arguments="{extension : extension}"><f:translate key="edit"/></f:link.action>
</div>
</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">
<h2><f:translate key="edit_tag"/></h2>
<f:form method="post" action="update" name="tag" object="{tag}">
<label for="title"><f:translate key="tx_terfe2_domain_model_tag.title" /></label><br />
<f:form.textbox property="title" /><br /><br />
<f:form.submit value="{f:translate(key:'edit')}" />
</f:form>
<f:link.action controller="Tag" action="index"><f:translate key="back_to_list"/></f:link.action>
</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">
<h2><f:translate key="new_tag"/> {extension.extKey}</h2>
<f:form method="post" action="create" name="newTag" arguments="{extension : extension}" object="{newTag}">
<label for="title"><f:translate key="tx_terfe2_domain_model_tag.title" /></label><br />
<f:form.textbox property="title" /><br /><br />
<f:form.submit value="{f:translate(key:'create')}" />
</f:form>
<f:link.action controller="Tag" action="index"><f:translate key="back_to_list"/></f:link.action>
</f:section>
\ No newline at end of file
<f:layout name="Default" />
<f:section name="main">
<!-- TODO -->
</f:section>
\ No newline at end of file
jQuery(document).ready(function($) {
/**
* Default chart options
/**
* Returns default chart options
*
* @return object Chart options
*/
var defaultChartOptions = {
function getDefaultChartOptions() {
return {
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
......@@ -12,7 +13,7 @@ jQuery(document).ready(function($) {
grid: {
drawGridLines: true,
gridLineColor: '#cccccc',
background: '#fffdf6',
background: '#ffffff',
borderColor: '#4D4D4D',
borderWidth: 1.0,
shadow: false
......@@ -28,16 +29,19 @@ jQuery(document).ready(function($) {
show: false
}
};
}
(function($) {
/**
* Render chart
*
* @param string containerId ID of the chart container
* @param boolean renderShy Render shy charts
* @return void
*/
function renderChart(containerId, renderShy) {
$.fn.renderChart = function(renderShy) {
var containerId = $(this).attr('id');
if (!containerId || typeof(charts) === 'undefined' || typeof(charts[containerId]) === 'undefined') {
return;
}
......@@ -47,7 +51,7 @@ jQuery(document).ready(function($) {
return;
}
var options = defaultChartOptions;
var options = getDefaultChartOptions();
options.title = chart.options.title;
options.series = chart.options.series;
......@@ -62,8 +66,8 @@ jQuery(document).ready(function($) {
* @param mixed element Object or selector
* @return void
*/
function toggleExtensionDetails(element) {