slimで改修せねばいけなくて、
滅茶苦茶テンパって焦ったので備忘を兼ねて書きます
下の様に書いて動かない、なんでじゃ…と慌ててましたが
- client_invitations.each do |invitation|
- invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
tr
td= invitation.id
td= invitation.client_contract_entry_id
td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
- if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
- else
td= '非公開'
td= l invitation.approved_at
td= l invitation.first_published_at
td= l invitation.payment_flag ? '支払済' : '未払い'
td=
= link_to '支払済', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-danger form-control'
.button-margin
= link_to '未払い', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-info form-control'
invitation.payment_flag ?のlいらなかったし、
最後のtd =が多かったでそら動きませんわー!
tbody
- client_invitations.each do |invitation|
- invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
tr
td= invitation.id
td= invitation.client_contract_entry_id
td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
- if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
- else
td= '非公開'
td= l invitation.approved_at
td= l invitation.first_published_at
td= invitation.payment_flag ? '支払済' : '未払い'
td=
= link_to '支払済', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-danger form-control'
.button-margin
= link_to '未払い', backend_reach_invitation_path(invitation), method: :put, params: {payment_flag: false}, class: 'btn btn-info form-control'
tbody
- client_invitations.each do |invitation|
- invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
tr
td= invitation.id
td= invitation.client_contract_entry_id
td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
- if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
- else
td= '非公開'
td= l invitation.approved_at
td= l invitation.first_published_at
td= invitation.payment_flag ? '支払済' : '未払い'
td
= link_to '支払済', backend_reach_invitation_path(invitation, payment_flag: true), method: :put, class: 'btn btn-danger form-control'
.button-margin
= link_to '未払い', backend_reach_invitation_path(invitation, payment_flag: false), method: :put, class: 'btn btn-info form-control'
最後にconfirmつけておしまいっ!
slimが来てもテンパらないようにします
tbody
- client_invitations.each do |invitation|
- invitee_client = ::Reach::Client.find_by(id: invitation.invitee_client.try(:id))
tr
td= invitation.id
td= invitation.client_contract_entry_id
td= "#{invitation.inviter_client.name}: #{invitation.inviter_client.id}"
td= "#{invitation.invitee_client.try(:name)}: #{invitation.invitee_client.try(:id)}"
- if invitee_client.try(:client_page_layout).present? && invitee_client.client_page_layout.page_publish_status.publication?
td.link= link_to 'URL', show_user_frontend_reach_client_url(invitee_client.client_page_layout.url_name), target: 'blank'
- else
td= '非公開'
td= l invitation.approved_at
td= l invitation.first_published_at
td= invitation.payment_flag ? '支払済' : '未払い'
td
= link_to '支払済', backend_reach_invitation_path(invitation, payment_flag: true), method: :put,
class: 'btn btn-danger form-control', 'data-confirm' => '本当に支払済にしますか?'
.button-margin
= link_to '未払い', backend_reach_invitation_path(invitation, payment_flag: false), method: :put,
class: 'btn btn-info form-control', 'data-confirm' => '本当に未払いにしますか?'