Haml clean up for notifications

This commit is contained in:
Brenda Wallace
2017-02-07 07:40:10 +13:00
committed by Shiny
parent fba2306a4d
commit 23f8c24ef4
5 changed files with 16 additions and 14 deletions

View File

@@ -1,22 +1,24 @@
= form_for @notification do |f|
- if @notification.errors.any?
#error_explanation
%h2= "#{pluralize(@post.errors.size, "error")} prohibited this message from being sent:"
%h2
= pluralize(@post.errors.size, "error")
prohibited this message from being sent:
%ul
- @notification.errors.full_messages.each do |msg|
%li= msg
.field
= f.hidden_field :recipient_id, :value => @recipient.id
= f.hidden_field :recipient_id, value: @recipient.id
%p
To:
= link_to @recipient, @recipient
= label_tag :notification, "Subject:"
= f.text_field :subject, :value => @subject, :class => 'form-control', :maxlength => 255
= f.text_field :subject, value: @subject, class: 'form-control', maxlength: 255
= label_tag :body, "Type your message here:"
= f.text_area :body, :rows => 12, :class => 'form-control'
= f.text_area :body, rows: 12, class: 'form-control'
%span.help-block
= render :partial => "shared/markdown_help"
= render partial: "shared/markdown_help"
= f.submit "Send", :class => 'btn btn-primary'
= f.submit "Send", class: 'btn btn-primary'

View File

@@ -1,6 +1,8 @@
- content_for :title, "Inbox"
- if @notifications.size > 0
- if @notifications.empty?
You have no messages.
- else
= paginate @notifications, theme: 'twitter-bootstrap-3'
%table.table.table-striped
%tr
@@ -28,7 +30,5 @@
- else
%strong= n.created_at
%td
= link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default btn-xs'
= link_to 'Delete', n, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default btn-xs'
= paginate @notifications, theme: 'twitter-bootstrap-3'
- else
You have no messages.

View File

@@ -1,4 +1,4 @@
= content_for :title, "Send a message to #{@recipient}"
=render 'form'
= render 'form'

View File

@@ -2,5 +2,5 @@
= render @sender_notification
=render 'form'
= render 'form'

View File

@@ -3,5 +3,5 @@
= render @notification
%p
=link_to 'Delete', @notification, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-default'
=link_to 'Reply', @reply_link, :class => 'btn btn-primary'
= link_to 'Delete', @notification, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-default'
= link_to 'Reply', @reply_link, class: 'btn btn-primary'