Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
17 changes: 16 additions & 1 deletion app/assets/stylesheets/events.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,23 @@ table.eventslist .ticless {
}

#event-comments form textarea {
max-width: 100%;
width: 100%;
height: 5em;
height: 3.5em;
box-sizing: border-box;
resize: vertical;
}

#event-comments fieldset {
border: 2px solid crimson;

p {
margin: 5px 0;
}

.comment-member {
font-weight: bold;
}
}

#event-comments form input[type=submit] {
Expand Down
47 changes: 24 additions & 23 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,30 @@
<% end %>
</ul>
</div>

<div id="event-comments" class="event-box">
<h4>Comments</h4>

<% @event.comments.each do |comment| %>
<fieldset>
<legend>
<%= comment.created_at.strftime("%m/%d/%y, %I:%M%p") %> -
<span class="comment-member"><%= comment.member %></span>
<% if can? :destroy, comment %>
(<%= link_to "delete", comment_url(comment), :method => :delete, data: {confirm: "Are you sure you would like to delete this comment?"} %>)
<% end %>
</legend>
<%= auto_link simple_format comment.content %>
</fieldset>
<% end %>

<%= form_for @event.comments.build do |f| %>
<%= f.hidden_field :event_id %>
<%= f.text_area :content %>
<br />
<%= f.submit "New Comment" %>
<% end %>
</div>

<% if can? :create, Invoice.new(event: @event) or not @event.invoices.accessible_by(current_ability).empty? %>
<div id="event-invoices">
Expand Down Expand Up @@ -166,29 +190,6 @@
</div>
<% end %>
</div>

<div id="event-comments" class="event-box">
<h4>Comments</h4>

<% @event.comments.each do |comment| %>
<fieldset>
<legend>
<%= comment.member %> said on <%= comment.created_at.strftime("%m/%d/%y at %I:%M%p") %>
<% if can? :destroy, comment %>
(<%= link_to "delete", comment_url(comment), :method => :delete, data: {confirm: "Are you sure you would like to delete this comment?"} %>)
<% end %>
</legend>
<%= auto_link simple_format comment.content %>
</fieldset>
<% end %>

<%= form_for @event.comments.build do |f| %>
<%= f.hidden_field :event_id %>
<%= f.text_area :content %>
<br />
<%= f.submit "New Comment" %>
<% end %>
</div>
</div>

<% if can? :update, @event or can? :destroy, @event or can? :read, Timecard or not @event.emails.empty? %>
Expand Down