Skip to content

Commit

Permalink
Merge pull request mixitconf#221 from mpetitdant/fix/187-comment-counter
Browse files Browse the repository at this point in the history
  • Loading branch information
clacote committed Mar 14, 2014
2 parents 5140b0a + a17416a commit 7912039
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 11 additions & 0 deletions app/models/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ public void addComment(SessionComment comment) {
}
}

public List<SessionComment> getPublicComments() {
List<SessionComment> result = new ArrayList<SessionComment>();

for (SessionComment comment : comments) {
if ( !comment.privatelyVisible ) {
result.add(comment);
}
}
return result;
}

public static <T extends Session> List<T> findValidatedLinkedWith(Interest interest) {
return find("valid = true and ? in elements(interests)", interest).fetch();
}
Expand Down
9 changes: 7 additions & 2 deletions app/views/Sessions/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ <h2 itemprop="name"> ${talk.title} [&{'enum.TalkFormat.'+talk.format}#{lang-flag
<p>
${talk.getNbLooks()} consultation${talk.getNbLooks().pluralize()}
#{if talk.comments}
&mdash; <a href="#comments">${talk.comments.size()} commentaire${talk.comments.size().pluralize()}</a>
#{if showPrivateComments}
&mdash; <a href="#comments">${talk.comments.size()} commentaire${talk.comments.size().pluralize()}</a>
#{/if}
#{else}
&mdash; <a href="#comments">${talk.publicComments.size()} commentaire${talk.publicComments.size().pluralize()}</a>
#{/else}
#{/if}
#{if talk.valid}
&mdash; #{socialbar/}
Expand Down Expand Up @@ -218,7 +223,7 @@ <h4>Activité récente</h4>
<div class="col-md-offset-2 col-md-10">
<div class="checkbox">
<label>
<input id="${field.id}" name="${field.name}" type="checkbox" value="true" checked>
<input id="${field.id}" name="${field.name}" type="checkbox" >
&{field.name}
</label>
</div>
Expand Down

0 comments on commit 7912039

Please sign in to comment.