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

fix #187 #221

Merged
merged 2 commits into from
Mar 14, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.comments.size().pluralize()}</a>
Copy link

Choose a reason for hiding this comment

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

talk.comments.size().pluralize() -> talk.publicComments.size().pluralize()

#{/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