mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
Contact CRUD in admin section
This commit is contained in:
parent
d6543f2148
commit
c644a297e1
6 changed files with 149 additions and 7 deletions
|
@ -1 +1,77 @@
|
|||
to be done
|
||||
= form_for([:admin, @contact]) do |f|
|
||||
- if @contact.errors.any?
|
||||
- @contact.errors.each do |attr, err|
|
||||
= err
|
||||
%br
|
||||
- if @contact.errors.any?
|
||||
%hr
|
||||
|
||||
.row
|
||||
.col-md-6.text-left
|
||||
.form-group
|
||||
= f.label :email
|
||||
= f.text_field(:email, class: 'form-control')
|
||||
= f.label :phone
|
||||
= f.text_field(:phone, class: 'form-control')
|
||||
= f.label :fax
|
||||
= f.text_field(:fax, class: 'form-control')
|
||||
|
||||
.col-md-6.text-left
|
||||
.form-group
|
||||
= f.label :ident_type
|
||||
= f.select :ident_type, options_for_select(Contact::IDENT_TYPES, @contact.ident_type), {}, {class: 'form-control'}
|
||||
= f.label :ident
|
||||
= f.text_field(:ident, class: 'form-control')
|
||||
= f.label :auth_info
|
||||
= f.text_field(:auth_info, class: 'form-control')
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-6.text-left
|
||||
%h3
|
||||
International Address
|
||||
.form-group
|
||||
= f.fields_for :international_address do |ia|
|
||||
= ia.label :name
|
||||
= ia.text_field(:name, class: 'form-control')
|
||||
= ia.label :org_name
|
||||
= ia.text_field(:org_name, class: 'form-control')
|
||||
|
||||
= ia.label :country_id, t(:country)
|
||||
= ia.collection_select :country_id, Country.all, :id, :name,{}, { class: 'form-control' }
|
||||
|
||||
= ia.label :city
|
||||
= ia.text_field(:city, class: 'form-control')
|
||||
= ia.label :street
|
||||
= ia.text_field(:street, class: 'form-control')
|
||||
= ia.label :street2
|
||||
= ia.text_field(:street2, class: 'form-control')
|
||||
= ia.label :street3
|
||||
= ia.text_field(:street2, class: 'form-control')
|
||||
|
||||
|
||||
.col-md-6.text-left
|
||||
%h3
|
||||
Local Address
|
||||
= f.fields_for :local_address do |ia|
|
||||
= ia.label :name
|
||||
= ia.text_field(:name, class: 'form-control')
|
||||
|
||||
= ia.label :country_id, t(:country)
|
||||
= ia.collection_select :country_id, Country.all, :id, :name,{}, { class: 'form-control' }
|
||||
|
||||
= ia.label :org_name
|
||||
= ia.text_field(:org_name, class: 'form-control')
|
||||
|
||||
= ia.label :city
|
||||
= ia.text_field(:city, class: 'form-control')
|
||||
= ia.label :street
|
||||
= ia.text_field(:street, class: 'form-control')
|
||||
= ia.label :street2
|
||||
= ia.text_field(:street2, class: 'form-control')
|
||||
= ia.label :street3
|
||||
= ia.text_field(:street2, class: 'form-control')
|
||||
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
= button_tag(t('shared.save'), class: 'btn btn-primary')
|
||||
|
|
9
app/views/admin/contacts/edit.haml
Normal file
9
app/views/admin/contacts/edit.haml
Normal file
|
@ -0,0 +1,9 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs
|
||||
= "#{t('shared.edit_contact')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.back_to_contact'), [:admin, @contact], class: 'btn btn-default')
|
||||
%hr
|
||||
= render 'form'
|
Loading…
Add table
Add a link
Reference in a new issue