Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
extensions.typo3.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
services
T
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
78aff044
Commit
78aff044
authored
Mar 05, 2019
by
Tomas Norre Mikkelsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Add list of liked extensions to "My Extensions" view"
parent
149cea23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
27 deletions
+92
-27
extensions/ter_fe2/Classes/Controller/RegisterkeyController.php
...ions/ter_fe2/Classes/Controller/RegisterkeyController.php
+9
-6
extensions/ter_fe2/Resources/Private/Partials/Like.html
extensions/ter_fe2/Resources/Private/Partials/Like.html
+25
-18
extensions/ter_fe2/Resources/Private/Templates/Registerkey/Index.html
...er_fe2/Resources/Private/Templates/Registerkey/Index.html
+56
-1
extensions/ter_fe2/Resources/Public/Javascript/Default.js
extensions/ter_fe2/Resources/Public/Javascript/Default.js
+2
-2
No files found.
extensions/ter_fe2/Classes/Controller/RegisterkeyController.php
View file @
78aff044
...
...
@@ -36,7 +36,7 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
protected
$versionRepository
;
/**
* @var \T
YPO3\CMS\Extbase
\Domain\Repository\FrontendUserRepository
* @var \T
3o\TerFe2
\Domain\Repository\FrontendUserRepository
*/
protected
$userRepository
;
...
...
@@ -63,9 +63,9 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
/**
* inject userRepository
*
* @param \T
YPO3\CMS\Extbase
\Domain\Repository\FrontendUserRepository $userRepository
* @param \T
3o\TerFe2
\Domain\Repository\FrontendUserRepository $userRepository
*/
public
function
injectUserRepository
(
\
T
YPO3\CMS\Extbase
\Domain\Repository\FrontendUserRepository
$userRepository
)
public
function
injectUserRepository
(
\
T
3o\TerFe2
\Domain\Repository\FrontendUserRepository
$userRepository
)
{
$this
->
userRepository
=
$userRepository
;
}
...
...
@@ -79,11 +79,14 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
{
// get extensions by user if a user is logged in
if
(
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'uid'
])
{
$this
->
frontendUser
=
$this
->
userRepository
->
findByUid
(
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'uid'
]);
$extensions
=
$this
->
extensionRepository
->
findByFrontendUser
(
$this
->
frontendUser
->
getUsername
());
$expiringExtensions
=
$this
->
extensionRepository
->
findByFrontendUserAndExpiring
(
$this
->
frontendUser
->
getUsername
());
/** @var \T3o\TerFe2\Domain\Model\FrontendUser $frontendUser */
$frontendUser
=
$this
->
userRepository
->
findByUid
(
$GLOBALS
[
'TSFE'
]
->
fe_user
->
user
[
'uid'
]);
$extensions
=
$this
->
extensionRepository
->
findByFrontendUser
(
$frontendUser
->
getUsername
());
$expiringExtensions
=
$this
->
extensionRepository
->
findByFrontendUserAndExpiring
(
$frontendUser
->
getUsername
());
$likedExtensions
=
$frontendUser
->
getLikedExtensions
();
$this
->
view
->
assign
(
'extensions'
,
$extensions
);
$this
->
view
->
assign
(
'expiringExtensions'
,
$expiringExtensions
);
$this
->
view
->
assign
(
'likedExtensions'
,
$likedExtensions
);
$this
->
view
->
assign
(
'uploaded'
,
$uploaded
);
}
}
...
...
extensions/ter_fe2/Resources/Private/Partials/Like.html
View file @
78aff044
<html
xmlns:f=
"http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid=
"true"
>
<span
class=
"ml-3"
>
<f:security.ifAuthenticated>
<f:then>
<f:if
condition=
"{hasLiked}"
>
<f:if
condition=
"{showOnly}"
>
<f:then>
<f:format.number
decimals=
"0"
thousandsSeparator=
","
>
{extension.likes}
</f:format.number>
</f:then>
<f:else>
<span
class=
"ml-3"
>
<f:security.ifAuthenticated>
<f:then>
<button
class=
"btn btn-primary"
data-rating-type=
"dislike"
data-rating-extension=
"{extension.uid}"
title=
"Click to dislike"
>
<i
class=
"fa fa-heart"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
"."
>
{extension.likes}
</f:format.number>
</button>
<f:if
condition=
"{hasLiked}"
>
<f:then>
<button
class=
"btn btn-primary"
data-rating-type=
"dislike"
data-rating-extension=
"{extension.uid}"
title=
"Click to dislike"
>
<i
class=
"fa fa-heart"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
","
>
{extension.likes}
</f:format.number>
</button>
</f:then>
<f:else>
<button
class=
"btn btn-outline-primary"
data-rating-type=
"like"
data-rating-extension=
"{extension.uid}"
title=
"Click to like"
>
<i
class=
"fa fa-heart-o"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
","
>
{extension.likes}
</f:format.number>
</button>
</f:else>
</f:if>
</f:then>
<f:else>
<button
class=
"btn btn-outline-primary"
data-
rating-type=
"like"
data-rating-extension=
"{extension.uid}"
title=
"Click
to like"
>
<i
class=
"fa fa-heart-o"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
"
.
"
>
{extension.likes}
</f:format.number>
<button
class=
"btn btn-outline-primary"
data-
login=
"1"
title=
"Login
to like"
>
<i
class=
"fa fa-heart-o"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
"
,
"
>
{extension.likes}
</f:format.number>
</button>
</f:else>
</f:if>
</f:then>
<f:else>
<button
class=
"btn btn-outline-primary"
data-login=
"1"
title=
"Login to like"
>
<i
class=
"fa fa-heart-o"
></i>
<f:format.number
decimals=
"0"
thousandsSeparator=
"."
>
{extension.likes}
</f:format.number>
</button>
</f:else>
</f:security.ifAuthenticated>
</span>
</f:security.ifAuthenticated>
</span>
</f:else>
</f:if>
</html>
extensions/ter_fe2/Resources/Private/Templates/Registerkey/Index.html
View file @
78aff044
...
...
@@ -29,6 +29,11 @@
<a
class=
"nav-link"
id=
"expiretab"
data-toggle=
"tab"
href=
"#expiring"
role=
"tab"
>
Expiring extension keys
</a>
</li>
</f:if>
<f:if
condition=
"{likedExtensions -> f:count()}"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#liked"
role=
"tab"
>
My liked extensions
</a>
</li>
</f:if>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
href=
"#register"
role=
"tab"
>
Register extension key
</a>
</li>
...
...
@@ -47,9 +52,15 @@
<table
class=
"table table-striped"
>
<thead>
<tr>
<th
colspan=
"2"
>
<th>
<f:translate
key=
"extensionKey"
/>
</th>
<th>
Likes
</th>
<th
class=
"text-right"
>
Actions
</th>
</tr>
</thead>
<tbody>
...
...
@@ -85,6 +96,9 @@
</f:if>
</small>
</td>
<td>
<f:render
partial=
"Like"
arguments=
"{extension: extension, showOnly: 1}"
/>
</td>
<td
class=
"text-right"
>
<f:if
condition=
"{extension.versionCount} < 1"
>
<f:then>
...
...
@@ -168,6 +182,47 @@
</table>
</div>
</f:if>
<f:if
condition=
"{likedExtensions}"
>
<f:variable
name=
"hasLiked"
value=
"1"
/>
<div
class=
"tab-pane"
id=
"liked"
role=
"tabpanel"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Extension key
</th>
<th>
Download latest version
</th>
<th
class=
"text-right"
>
Likes
</th>
</tr>
</thead>
<tbody>
<f:for
each=
"{likedExtensions}"
as=
"extension"
>
<tr>
<td
class=
"text-middle"
>
<f:link.action
controller=
"Extension"
action=
"show"
arguments=
"{extension: extension}"
>
{extension.extKey}
</f:link.action>
</td>
<td>
<f:if
condition=
"{extension.lastVersion.reviewState} != -1"
>
<f:link.action
class=
"btn btn-primary"
controller=
"Extension"
action=
"download"
arguments=
"{extension : extension, versionString : extension.lastVersion.versionString, format : 'zip'}"
>
<strong>
Download
<span
itemprop=
"softwareVersion"
>
{extension.lastVersion.versionString}
</span></strong>
</f:link.action>
</f:if>
</td>
<td
class=
"text-right"
>
<f:render
partial=
"Like"
arguments=
"{extension: extension,showOnly: 1}"
/>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
</f:if>
<div
class=
"tab-pane"
id=
"register"
role=
"tabpanel"
>
<f:form
action=
"create"
controller=
"Registerkey"
class=
"form-inline mt-3"
method=
"post"
>
...
...
extensions/ter_fe2/Resources/Public/Javascript/Default.js
View file @
78aff044
...
...
@@ -61,7 +61,7 @@ jQuery(document).ready(function ($) {
let
pageType
=
0
;
let
removeClass
=
''
;
let
addClass
=
''
;
let
likes
=
$
(
item
).
text
().
trim
();
let
likes
=
$
(
item
).
text
().
trim
()
.
replace
(
'
,
'
,
''
)
;
let
newRatingType
=
''
;
let
ratingType
=
$
(
item
).
data
(
'
rating-type
'
);
if
(
ratingType
===
'
like
'
)
{
...
...
@@ -87,7 +87,7 @@ jQuery(document).ready(function ($) {
success
:
function
(
returnData
)
{
$
(
item
).
removeClass
(
removeClass
).
addClass
(
addClass
);
$
(
item
).
data
(
'
rating-type
'
,
newRatingType
);
item
.
lastChild
.
nodeValue
=
"
"
+
likes
;
item
.
lastChild
.
nodeValue
=
"
"
+
likes
.
toLocaleString
(
'
en
'
)
;
}
});
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment