diff --git a/app/models/i_website.rb b/app/models/i_website.rb index 2109c89..4c2d8ab 100644 --- a/app/models/i_website.rb +++ b/app/models/i_website.rb @@ -1,5 +1,6 @@ class IWebsite < ActiveRecord::Base belongs_to :p_customer + belongs_to :admin has_many :i_tasks diff --git a/app/views/admin/i_websites/_form.html.haml b/app/views/admin/i_websites/_form.html.haml index c05a9b9..f65af79 100755 --- a/app/views/admin/i_websites/_form.html.haml +++ b/app/views/admin/i_websites/_form.html.haml @@ -2,6 +2,7 @@ .content =f.inputs do + = f.input :admin_id, :label => "Chef projet :", :collection => Admin.all, :as => :select, :include_blank => true, :member_label => :show_name = f.input :p_customer_id, :label => "Clients :", :collection => PCustomer.all, :as => :select, :include_blank => false, :member_label => :show_name = f.input :name, :label => "Nom :" = f.input :url, :label => "Url :" diff --git a/app/views/admin/i_websites/_i_website.html.haml b/app/views/admin/i_websites/_i_website.html.haml index dff9733..b7b7395 100644 --- a/app/views/admin/i_websites/_i_website.html.haml +++ b/app/views/admin/i_websites/_i_website.html.haml @@ -1,5 +1,7 @@ %tr#i_website{:id => i_website.id} + %td= i_website.admin.show_name if i_website.admin + %td= i_website.p_customer.show_name if i_website.p_customer %td= i_website.name %td=link_to i_website.url.to_s, i_website.url.to_s, :target => "_blank" diff --git a/app/views/admin/i_websites/index.html.haml b/app/views/admin/i_websites/index.html.haml index f80f5c2..7dffa0d 100644 --- a/app/views/admin/i_websites/index.html.haml +++ b/app/views/admin/i_websites/index.html.haml @@ -8,6 +8,7 @@ .qi_pannel.qi_plain.padding %table.table %tr + %th Chef projet %th Client diff --git a/app/views/admin/i_websites/update.js.erb b/app/views/admin/i_websites/update.js.erb index c95a552..62930aa 100644 --- a/app/views/admin/i_websites/update.js.erb +++ b/app/views/admin/i_websites/update.js.erb @@ -1,2 +1,2 @@ -$('#i_websites_rows').html("<%= escape_javascript(render(@i_websites))%>"); +$('#i_website_<%= @i_website.id %>').replaceWith("<%= escape_javascript(render(@i_website))%>"); close_pane_hover(); \ No newline at end of file diff --git a/db/migrate/20190722161039_add_admin_to_i_website.rb b/db/migrate/20190722161039_add_admin_to_i_website.rb new file mode 100644 index 0000000..35bd1dc --- /dev/null +++ b/db/migrate/20190722161039_add_admin_to_i_website.rb @@ -0,0 +1,6 @@ +class AddAdminToIWebsite < ActiveRecord::Migration + def change + add_column :i_websites, :admin_id, :integer + add_column :i_websites, :state, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 03638ad..aa3a5c6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190722151424) do +ActiveRecord::Schema.define(version: 20190722161039) do create_table "admin_admin_roles", force: :cascade do |t| t.integer "admin_id", limit: 4 @@ -462,6 +462,8 @@ ActiveRecord::Schema.define(version: 20190722151424) do t.integer "p_customer_id", limit: 4 t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "admin_id", limit: 4 + t.string "state", limit: 255 end create_table "image_contents", force: :cascade do |t|