-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from fsek/FixPostdescriptionElection
Fixing post expand for Election
- Loading branch information
Showing
8 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
<div id="<%=dom_id(post)%>" class="collapsed"> | ||
<div id="<%= dom_id(post) %>" class="collapsed"> | ||
<div class="funny-boxes funny-boxes-left-orange left-text-align"> | ||
<%=link_to("Dölj",%(##{dom_id(post)}),class: "btn btn-u pull-right margin-left-20", data: {toggle: "collapse"})%> | ||
<%= link_to("Dölj", collapse_posts_path, remote: true, class: "btn btn-u pull-right margin-left-20") %> | ||
<% if @election && @election.can_candidate?(post) %> | ||
<%=link_to("Kandidera",new_election_candidate_path(post: post.id.to_s),class: "btn btn-u pull-right margin-left-20")%> | ||
<%=link_to("Nominera",new_election_nominations_path(post: post.id.to_s),class: "btn btn-u pull-right")%> | ||
<%end%> | ||
<h2><%=post.title%></h2> | ||
<%if post.description%><p><%=simple_format(post.description)%></p><%end%> | ||
<%= link_to("Kandidera", new_election_candidate_path(post: post.id.to_s), class: "btn btn-u pull-right margin-left-20") %> | ||
<%= link_to("Nominera", new_election_nominations_path(post: post.id.to_s), class: "btn btn-u pull-right") %> | ||
<% end %> | ||
<h2><%= post.title %></h2> | ||
<% if post.description %><p><%= simple_format(post.description) %></p> | ||
<% end %> | ||
<ul class="list-unstyled"> | ||
<%if (post.limit) || (post.styrelse)%><li><i class="fa fa-briefcase"></i><%if post.limit%>Antal: <%=post.printLimit%> <%end%><%if post.styrelse%>, styrelsepost<%end%></li><%end%> | ||
<%if post.council%><li><i class="fa fa-users"></i>Utskott: <%=link_to(post.council.title,post.council)%></li><%end%> | ||
<%if post.elected_by%><li><i class="fa fa-cog"></i>Väljs av: <%=post.elected_by%></li><%end%> | ||
<%if (current_user) && (current_user.moderator?(:poster))%><li><%=link_to("Redigera",edit_council_post_path(post.council,post))%></li> <%end%> | ||
<% if (post.limit) || (post.styrelse) %> | ||
<li><i class="fa fa-briefcase"></i> | ||
<% if post.limit %>Antal: <%= post.printLimit %> | ||
<% end %> | ||
<% if post.styrelse %>, styrelsepost | ||
<% end %></li> | ||
<% end %> | ||
<% if post.council %> | ||
<li><i class="fa fa-users"></i>Utskott: <%= link_to(post.council.title, post.council) %></li> | ||
<% end %> | ||
<% if post.elected_by %> | ||
<li><i class="fa fa-cog"></i>Väljs av: <%= post.elected_by %></li> | ||
<% end %> | ||
<% if (current_user) && (current_user.moderator?(:poster)) %> | ||
<li><%= link_to("Redigera", edit_council_post_path(post.council, post)) %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$('.display-post').hide(); | ||
$('.display-post').html(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<% if @post.present? %> | ||
$('.display-post').hide(); | ||
$('.display-post').html("<%= escape_javascript( render @post)%>").show(); | ||
$('html, body').animate({ | ||
scrollTop: $('.display-post').offset().top | ||
}, 1000); | ||
<%end%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters