Skip to content

Commit

Permalink
Merge pull request mixitconf#220 from mpetitdant/fix/177-speakers-on-…
Browse files Browse the repository at this point in the history
…home

fix mixitconf#177
  • Loading branch information
clacote committed Mar 14, 2014
2 parents 7912039 + 00dafe1 commit 8678200
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 13 deletions.
18 changes: 14 additions & 4 deletions app/controllers/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ public static void index() {
}

// Three recent articles
List<Article> articles = Article.recents(1, 3);
List<Talk> sessions = Talk.recents(ConferenceEvent.CURRENT, 1, 3);
List<Member> members = Member.recents(1, 14);
// Unused
// List<Article> articles = Article.recents(1, 3);
// List<Talk> sessions = Talk.recents(ConferenceEvent.CURRENT, 1, 3);
// List<Member> members = Member.recents(1, 14);

// List<Map> tags = Interest.getCloud();

List<Member> currentGuestSpeakers = Talk.guestSpeakers(ConferenceEvent.CURRENT);

List<Member> guestSpeakersToDisplay = null;
if (currentGuestSpeakers.size() > 5 ) {
Collections.shuffle(currentGuestSpeakers);
guestSpeakersToDisplay = currentGuestSpeakers.subList(0, 6);
}

boolean isHomePage = true;
render(articles, sessions, members, isHomePage);
render(/*articles, sessions, members, */isHomePage, guestSpeakersToDisplay);
}

public static void members() {
Expand Down
11 changes: 11 additions & 0 deletions app/models/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,15 @@ public ConferenceEvent apply(@Nullable Session session) {
public static Function<Session,ConferenceEvent> toEvent() {
return SESSION_TO_EVENT;
}

public static List<Member> guestSpeakers(ConferenceEvent event) {
return find("select distinct speaker " +
"from Session s " +
"inner join s.speakers speaker " +
"inner join s.comments c " +
"where lower(c.content) like '%guest speaker%' " +
"and s.event = ? " +
"and s.valid = true", event).fetch();
}

}
18 changes: 16 additions & 2 deletions app/views/Application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,23 @@ <h1>&{'home.headers.innovation'}</h1>
</div>
<!-- /.row -->

#{if guestSpeakersToDisplay?.size() > 5 }
<div class="row">
<div class="row speakers">
<div class="container">
<h4 id="this-year" class="centeredWithLine"><span>&{'home.speakers.this-year'}</span></h4>
#{list items:guestSpeakersToDisplay, as:'speaker'}
#{speaker-on-home name:speaker.toString(), email:speaker.email, login:speaker.login/}
#{/list}
</div>
</div>
</div>
#{/if}

<div class="row">
<div class="row speakers">
<div class="container">
<h4 id="previously"><span>&{'home.speakers.previously'}</span></h4>

<h4 id="previously" class="centeredWithLine"><span>&{'home.speakers.previously'}</span></h4>
#{speaker-on-home name:'Zach Holman', email:'[email protected]', login:'holman'/}
#{speaker-on-home name:'Pamela Fox', email:'[email protected]', login:'pamelafox'/}
#{speaker-on-home name:'Simon Brown', email:'[email protected]', login:'simonbrown'/}
Expand All @@ -197,6 +209,8 @@ <h4 id="previously"><span>&{'home.speakers.previously'}</span></h4>
#{speaker-on-home name:'JC Grosjean', email:'[email protected]', login:'jcQualitystreet'/}
</div>
</div>
</div>


<!-- START THE FEATURETTES -->

Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/speaker-on-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
- login (for profile link)
}*
<div class="col-lg-2 headers">
<h3>${_name}</h3>
#{a @Profile.show(_login)}
<img class="img-thumbnail" src="#{gravatar.url _email, size:120, default:'mm', rating:'pg', secure:false/}" />
#{/a}
<h3>${_name}</h3>
</div>
1 change: 1 addition & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ home.headers.development.short=Dev
home.headers.agility=Agilité
home.headers.innovation=Innovation
home.speakers.previously=Précédemment, à Mix-IT
home.speakers.this-year=Cette année, à Mix-IT

home.featurette1.title=Développement, Agilité, Innovation, DevOps, Lean Startup.
home.featurette1.subtitle=Des idées pour tout de suite&nbsp;!
Expand Down
1 change: 1 addition & 0 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ home.headers.development.short=Development
home.headers.agility=Agility
home.headers.innovation=Innovation
home.speakers.previously=Previously, at Mix-IT
home.speakers.this-year=This year, at Mix-IT

home.featurette1.title=Development, Agility, Innovation, DevOps, Lean Startup.
home.featurette1.subtitle=Ideas for now!
Expand Down
12 changes: 6 additions & 6 deletions public/stylesheets/linkit.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
color: green;
}

#previously {
.centeredWithLine {
width: 100%;
text-align: center;
border-bottom: 1px solid #eee;
line-height: 0.1em;
margin-bottom: 25px;
}

#previously span {
background: white;
padding: 0 10px;
color: #5A5A5A;
span {
background: white;
padding: 0 10px;
color: #5A5A5A;
}
}

.row.headers {
Expand Down

0 comments on commit 8678200

Please sign in to comment.