This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 7504b49e authored by Eduard Frankford's avatar Eduard Frankford
Browse files

added help window for like button

parents 632b8f10 a145d436
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
...@@ -158,6 +158,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter { ...@@ -158,6 +158,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.antMatchers("/api/pluginIF/**").permitAll() // plugins calls are always allowed, security by tokens .antMatchers("/api/pluginIF/**").permitAll() // plugins calls are always allowed, security by tokens
.antMatchers("/api/applicationInfo/**").permitAll() // everybody may retrieve deployment infos .antMatchers("/api/applicationInfo/**").permitAll() // everybody may retrieve deployment infos
.antMatchers("/api/authenticate").permitAll() .antMatchers("/api/authenticate").permitAll()
.antMatchers("/api/exerciseFile/**").permitAll()
.antMatchers("/api/exercise/**").permitAll() .antMatchers("/api/exercise/**").permitAll()
.antMatchers("/api/refreshToken").permitAll() .antMatchers("/api/refreshToken").permitAll()
.antMatchers("/api/register").denyAll() .antMatchers("/api/register").denyAll()
......
...@@ -43,12 +43,19 @@ ...@@ -43,12 +43,19 @@
style="float: left; width: 100%; margin-bottom: 5px; padding-top: 15px;"> style="float: left; width: 100%; margin-bottom: 5px; padding-top: 15px;">
<div style="float: left;"> <div style="float: left;">
<div> <div>
<button style="padding: 0%; font-size: 1.2;" *ngIf="!exercise.userHasLiked" <button [ngbTooltip]="helpForLike" style="padding: 0%; font-size: 1.2;"
type="button" class="btn" (click)="likeAction()" *ngIf="isAuthenticated()" type="button" class="btn"
[disabled]="!isAuthenticated()"> (click)="likeAction()" [disabled]="!isAuthenticated()">
<!-- <fa-icon icon="heart"></fa-icon> --> <!-- <fa-icon icon="heart"></fa-icon> -->
<fa-icon [icon]="['far', 'heart']"></fa-icon> <fa-icon [icon]="['far', 'heart']"></fa-icon>
</button> </button>
<span [ngbTooltip]="helpForLikeNotLoggedIn">
<button style="padding: 0%; font-size: 1.2;" *ngIf="!isAuthenticated()"
type="button" class="btn" (click)="likeAction()" [disabled]="true">
<!-- <fa-icon icon="heart"></fa-icon> -->
<fa-icon [icon]="['far', 'heart']"></fa-icon>
</button>
</span>
</div> </div>
<!-- <div class="onhoverIconDisplay"><p class="card-text" jhiTranslate="exercise.details.views"></p></div> --> <!-- <div class="onhoverIconDisplay"><p class="card-text" jhiTranslate="exercise.details.views"></p></div> -->
...@@ -58,15 +65,19 @@ ...@@ -58,15 +65,19 @@
{{exercise.numberOfLikes}} {{exercise.numberOfLikes}}
</span> </span>
</div> </div>
<ng-template #helpForLike> {{ 'exercise.details.like' | translate}}</ng-template>
<ng-template #helpForLikeNotLoggedIn> {{ 'exercise.details.likeLogin' | translate}}
</ng-template>
</div> <!-- modal views end--> </div> <!-- modal views end-->
<div *ngIf="exercise.userHasLiked" <div *ngIf="exercise.userHasLiked"
style="float: left; width: 100%; margin-bottom: 5px; padding-top: 15px;"> style="float: left; width: 100%; margin-bottom: 5px; padding-top: 15px;">
<div style="float: left;"> <div style="float: left;">
<div> <div>
<button style="padding: 0%; font-size: 1.2;" *ngIf="exercise.userHasLiked" <button [ngbTooltip]="helpForUnLike" style="padding: 0%; font-size: 1.2;"
type="button" class="btn" (click)="unlikeAction()" *ngIf="exercise.userHasLiked" type="button" class="btn"
[disabled]="!isAuthenticated()"> (click)="unlikeAction()" [disabled]="!isAuthenticated()">
<!-- <fa-icon icon="heart"></fa-icon> --> <!-- <fa-icon icon="heart"></fa-icon> -->
<fa-icon class="rediconcolor" icon='heart'></fa-icon> <fa-icon class="rediconcolor" icon='heart'></fa-icon>
</button> </button>
...@@ -78,6 +89,9 @@ ...@@ -78,6 +89,9 @@
{{exercise.numberOfLikes}} {{exercise.numberOfLikes}}
</span> </span>
</div> </div>
<ng-template #helpForUnLike> {{ 'exercise.details.unlike' | translate}}
</ng-template>
</div> </div>
<div *ngIf="exercise.rating" <div *ngIf="exercise.rating"
...@@ -124,17 +138,6 @@ ...@@ -124,17 +138,6 @@
</div> </div>
</div> <!-- modal bookmark end--> </div> <!-- modal bookmark end-->
<!-- <button type="button" class="btn btn-outline-secondary"
style="display: block; margin-bottom: 5px;"
jhiTranslate="exercise.details.hitDetails">
</button> -->
<div [ngbTooltip]="helpComingSoon" placement="bottom">
<button *ngIf="exercise.type == exerciseType.COLLECTION" type="button"
class="btn btn-outline-secondary" style="display: block; margin-bottom: 5px;"
jhiTranslate="exercise.details.allExercises" disabled>
>
</button>
</div>
<div *ngIf="exercise.originalResult.file.parentId" <div *ngIf="exercise.originalResult.file.parentId"
style="float: left; width: 100%; padding-top: 15px; margin-bottom: 25px;"> style="float: left; width: 100%; padding-top: 15px; margin-bottom: 25px;">
<ng-template #helpToParent data-container="body"> {{ 'exercise.help.toParent' | <ng-template #helpToParent data-container="body"> {{ 'exercise.help.toParent' |
......
...@@ -11,10 +11,13 @@ ...@@ -11,10 +11,13 @@
"views": "Anzahl der Aufrufe", "views": "Anzahl der Aufrufe",
"downloads": "Anzahl der Downloads", "downloads": "Anzahl der Downloads",
"readmeNotFound": "# Keine README.md Datei (oder Alternative) gefunden!", "readmeNotFound": "# Keine README.md Datei (oder Alternative) gefunden!",
"toParent": "zum übergeordneten Objekt" "toParent": "zum übergeordneten Objekt",
"like": "Wenn Ihnen diese Aufgabe gefällt, dann klicken Sie auf das Herz!",
"unlike": "Wenn Ihnen diese Aufgabe nicht mehr gefällt, dann klicken Sie auf das Herz!",
"likeLogin": "Melden Sie sich an, um dieser Aufgabe ein like zu geben"
}, },
"help": { "help": {
"toParent": "Diese Aufgabe ist Teil einer Sammlung. Klicken Sie hier, um die Sammlung anzusehen." "toParent": "Diese Aufgabe ist Teil einer Sammlung. Klicken Sie hier, um die Sammlung anzusehen."
}, },
"metadata": { "metadata": {
"metadata": "Metadaten", "metadata": "Metadaten",
......
...@@ -11,10 +11,12 @@ ...@@ -11,10 +11,12 @@
"views": "Number of views", "views": "Number of views",
"downloads": "Number of downloads", "downloads": "Number of downloads",
"readmeNotFound": "# No README.md (or alternatives) found!", "readmeNotFound": "# No README.md (or alternatives) found!",
"toParent": "to parent object" "toParent": "to parent object",
"like": "If you like this exercise, you can click here!",
"unlike": "If you don't like this exercise anymore, you can click here!"
}, },
"help": { "help": {
"toParent": "This exercise is contained in a collection. Click here to see the collection item" "toParent": "This exercise is contained in a collection. Click here to see the collection item"
}, },
"metadata": { "metadata": {
"metadata": "Meta data", "metadata": "Meta data",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment