Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/fix hearts not loading #12

Merged
merged 6 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1 addition & 1 deletion src/main/resources/db/migration/V1.0.0__website.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

create table Configuration (
id bigint not null,
key varchar(255) 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')),
key varchar(255) 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')),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not good. We need a migration file with an alter table Configuration…

value varchar(255),
primary key (id)
);
Expand Down
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 a feedback !
FroMage marked this conversation as resolved.
Show resolved Hide resolved

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 un feedback !
FroMage marked this conversation as resolved.
Show resolved Hide resolved

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
Loading