suite contacts
This commit is contained in:
parent
01f0c18e98
commit
1ff0fc508b
@ -7,8 +7,8 @@ class Admin::ContactsController < ApplicationController
|
|||||||
|
|
||||||
@contacts = Contact.order("created_at DESC")
|
@contacts = Contact.order("created_at DESC")
|
||||||
|
|
||||||
if params[:archived]
|
if params[:status]
|
||||||
@contacts = @contacts.where(:archived => true)
|
@contacts = @contacts.where(:status => params[:status])
|
||||||
else
|
else
|
||||||
@contacts = @contacts.where("archived IS NULL or archived = 0")
|
@contacts = @contacts.where("archived IS NULL or archived = 0")
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
%tr.vertical_center.contact#contact{:id => contact.id}
|
%tr.vertical_center.contact#contact{:id => contact.id}
|
||||||
%td{:style => "vertical-align:middle;"}
|
%td{:style => "vertical-align:middle;"}
|
||||||
=image_tag "/provenance/#{contact.provenance_id}.png", :style => "width:20px;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,0.5)"
|
=image_tag "/provenance/#{contact.provenance_id}.png", :style => "width:20px;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,0.5)"
|
||||||
|
%td
|
||||||
|
-if contact.urgent
|
||||||
|
%div{:style => "width:10px;height:10px;border-radius:50%;"}
|
||||||
%td{:style => "vertical-align:middle;"}
|
%td{:style => "vertical-align:middle;"}
|
||||||
-if !contact.readed
|
-if !contact.readed
|
||||||
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"}
|
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"}
|
||||||
@ -10,10 +13,11 @@
|
|||||||
%td
|
%td
|
||||||
=contact.name
|
=contact.name
|
||||||
%td
|
%td
|
||||||
=contact.email
|
=contact.cp
|
||||||
%br
|
=contact.city
|
||||||
=contact.tel
|
%td
|
||||||
|
=contact.small_comment
|
||||||
|
|
||||||
%td
|
%td
|
||||||
-if contact.admin
|
-if contact.admin
|
||||||
%span{:style => "background:#{contact.admin.color};padding:5px 10px;color:white"}
|
%span{:style => "background:#{contact.admin.color};padding:5px 10px;color:white"}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
= semantic_form_for [:admin, @contact], :remote => true do |f|
|
= semantic_form_for [:admin, @contact], :remote => true do |f|
|
||||||
.content
|
.content
|
||||||
=f.inputs do
|
=f.inputs do
|
||||||
|
= f.input :contact_status, :label => "Status :", :collection => ["En cours", "Signés","En attente", "Archivé"]
|
||||||
|
= f.input :urgent, :label => "Urgent ?"
|
||||||
= f.input :readed, :label => "Lu ?"
|
= f.input :readed, :label => "Lu ?"
|
||||||
= f.input :admin_id, :label => "Géré par ?", :collection => (Admin.where(:contact_role => true).all.map{|u|[ u.username, u.id]}), :as => :select
|
= f.input :admin_id, :label => "Géré par ?", :collection => (Admin.where(:contact_role => true).all.map{|u|[ u.username, u.id]}), :as => :select
|
||||||
= f.input :archived, :label => "Archivé ?"
|
= f.input :archived, :label => "Archivé ?"
|
||||||
@ -17,6 +19,7 @@
|
|||||||
= f.input :city, :label => "Ville"
|
= f.input :city, :label => "Ville"
|
||||||
= f.input :country, :label => "Pays", :as => :string
|
= f.input :country, :label => "Pays", :as => :string
|
||||||
|
|
||||||
|
= f.input :small_comment, :label => "Commentaire court"
|
||||||
|
|
||||||
= f.input :notes, :label => "Notes"
|
= f.input :notes, :label => "Notes"
|
||||||
|
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
%h1 Liste des contacts
|
%h1 Liste des contacts
|
||||||
|
|
||||||
%p
|
%p
|
||||||
=link_to "Actifs", admin_contacts_path
|
-["En cours", "Signés","En attente", "Archivé"].each do |status|
|
||||||
|
|
||||||
|
=link_to "Actifs", admin_contacts_path(:status => status)
|
||||||
|
|
||||||
|
|
||||||
=link_to "Archivés", admin_contacts_path(:archived => true)
|
|
||||||
|
|
||||||
%table.table.table-hover
|
%table.table.table-hover
|
||||||
%thead#Admin_rows_header.rows_header
|
%thead#Admin_rows_header.rows_header
|
||||||
|
7
db/migrate/20171113205813_add_infos_to_contacts.rb
Normal file
7
db/migrate/20171113205813_add_infos_to_contacts.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class AddInfosToContacts < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :contacts, :small_comment, :text
|
||||||
|
add_column :contacts, :contact_status, :string
|
||||||
|
add_column :contacts, :urgent, :boolean
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user