Skip to content

Commit

Permalink
Merge pull request #12 from FroMage/bugfix/fix_hearts_not_loading
Browse files Browse the repository at this point in the history
Bugfix/fix hearts not loading
  • Loading branch information
FroMage authored Jul 2, 2024
2 parents 0da754f + 26656d8 commit b854153
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/main/java/model/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ public static boolean ticketingTrainingIsOpen() {
return config != null && config.value.equals("true");
}

/**
* Retourne l'Url de la page de Openfeedback du talk.
*/
public static String getFeedbackUrl(Long id) {
Configuration config = Configuration.find("key", ConfigurationKey.FEEDBACK_URL).firstResult();
return config != null ? config.value + "/" + id : null;
}

/**
* Return true if Call For Paper is opened, false otherwise
*/
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/model/ConfigurationKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public enum ConfigurationKey {
TICKETING_TRAINING_URL,
/* [true, false] Si true, permet d'accéder à la page de l'organisme de formation */
TICKETING_TRAINING_OPEN,
/* Feedback Url */
FEEDBACK_URL,
/* URL de la plaquette de sponsoring */
SPONSORING_LEAFLET_URL,
/* [true, false] true if the Call For Paper is opened, false otherwise */
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/rest/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static native TemplateInstance speakers(List<Speaker> speakers, List<Spea
public static native TemplateInstance sponsor(Sponsor sponsor);
public static native TemplateInstance sponsorBanner(Sponsor sponsor);

public static native TemplateInstance talk(Talk talk, boolean displayFullSchedule);
public static native TemplateInstance talk(Talk talk, boolean displayFullSchedule, String feedbackUrl);

public static native TemplateInstance organisers(List<Organiser> orgas);

Expand Down Expand Up @@ -346,10 +346,11 @@ public TemplateInstance sponsor(@RestPath Long id) {

@Path("/session")
public TemplateInstance talk(@RestPath Long id) {
String feedbackUrl = Configuration.getFeedbackUrl(id);
Talk talk = Talk.findById(id);
notFoundIfNull(talk);
boolean displayFullSchedule = Configuration.displayFullSchedule();
return Templates.talk(talk, displayFullSchedule);
return Templates.talk(talk, displayFullSchedule, feedbackUrl);
}

@Path("/sponsors")
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/db/migration/V3.0.0__add-config.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table Configuration drop constraint if exists Configuration_key_check;
alter table Configuration add constraint Configuration_key_check check (key in ('GOOGLE_MAP_API_KEY','EVENT_START_DATE','EVENT_END_DATE','DISPLAY_FULL_SCHEDULE','DISPLAY_NEW_SPEAKERS','DISPLAY_TALKS','PROMOTED_PAGE','PROMOTED_PAGE_2','TICKETING_URL','TICKETING_OPEN','TICKETING_TRAINING_URL','TICKETING_TRAINING_OPEN','SPONSORING_LEAFLET_URL','CFP_OPEN','CFP_URL','CANCELLED_URL', 'FEEDBACK_URL'));
1 change: 1 addition & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ views.application.speakers.title=Speakers
views.application.speakers.subtitle=Discover all our amazing speakers !
views.application.speakers.unavailable=The speaker list is not available yet.
views.application.speakers.subscribe=Subscribe to the newsletter to be notified when the speaker list is published.
views.application.speakers.feedback-button=Give your feedback!

views.application.speaker.title=Speaker
views.application.speaker.linkTitle= Tweet about it !
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ views.application.coc.chapter.3.content.4=Pour toute question, merci de contacte
views.application.speakers.title=Orateurs
views.application.speakers.subtitle=Découvrez tous nos super orateurs !
views.application.index.speakers.link=Découvrez tous les orateurs

views.application.speakers.unavailable=La liste des orateurs n'est pas encore disponible.
views.application.speakers.feedback-button=Donner votre avis !

views.application.speakers.subscribe=Abonnez-vous à la newsletter pour être prévenu dès que les orateurs sont connus.

views.application.speaker.title=Orateur
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/Application/talk.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ <h1 class="page__mainTitle">{m:views.application.talk.title}</h1>
</div>

<div class="page__container notFullWidth">
{#talk talk=talk/}
{#talk talk=talk feedbackUrl=feedbackUrl /}
</div>
{/include}
2 changes: 1 addition & 1 deletion src/main/resources/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ <h2 class="footer__title footer__contactTitle">
window.onload = function() {
// Animate loader off screen
$('.loading').fadeOut('slow');
window.onload = initLikedTalks;
initLikedTalks();
window.initBurgerMenu();
};

Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/templates/tags/talk.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,16 @@
</div>
{/if}
</div>
{#if feedbackUrl}
<div class="talkDetails__footer">
<div class="talkDetails__feedback">
<a class="button button--white"
href="{feedbackUrl}"
target="_blank"
>
{m:views.application.speakers.feedback-button}
</a>
</div>
</div>
{/if}
</div>
1 change: 1 addition & 0 deletions src/main/resources/web/app/stylesheets/partials/_talk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
width: 70%;
}

&__footer,
&__header {
border-radius: $borderRadius $borderRadius 0 0;
color: $color-white;
Expand Down

0 comments on commit b854153

Please sign in to comment.