This commit is contained in:
Nicolas Bally 2019-07-22 18:19:04 +02:00
parent e5d4400fc9
commit 9019a90384
7 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,6 @@
class IWebsite < ActiveRecord::Base
belongs_to :p_customer
belongs_to :admin
has_many :i_tasks

View File

@ -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 :"

View File

@ -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"

View File

@ -8,6 +8,7 @@
.qi_pannel.qi_plain.padding
%table.table
%tr
%th Chef projet
%th Client

View File

@ -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();

View File

@ -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

View File

@ -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|