Field added

This commit is contained in:
Nicolas VARROT 2016-03-17 19:29:22 +01:00
parent 6431ec9e64
commit 1b11e9028b
10 changed files with 36 additions and 12 deletions

View File

@ -19,8 +19,21 @@
#main{
position:relative;
.body-container{
background-color: #ededed;
padding-top:50px;
padding-bottom:30px;
}
.footer{
height:500px;
background-color: #777777;
}
}
.top{
//margin-bottom:10px;

View File

@ -136,7 +136,7 @@
p.description{
font-size:12px;
color:rgb(163, 159, 159);
max-height: 105px;
max-height: 55px;
word-wrap: break-word;
text-overflow: ellipsis;
overflow: hidden;
@ -187,7 +187,7 @@
.top-left-info{
background-color: #ede8e8;
background-color: #d3d3d3;
position:absolute;
padding:4px;
padding-left:8px;
@ -203,8 +203,9 @@
margin-bottom:30px;
h4{
margin-top:0px;
margin-bottom:0px;
margin-top:20px;
font-size:20px;
margin-bottom:20px;
}
.btn{

View File

@ -4,5 +4,6 @@
.need-container{
margin-top:250px;
}

View File

@ -158,7 +158,7 @@ class Public::NeedsController < ApplicationController
end
def need_params
params.require(:need).permit(:title, :devis, :description, :category_id)
params.require(:need).permit(:title, :note, :devis, :description, :category_id)
end
def check_owner

View File

@ -11,6 +11,7 @@
=f.input :description, :label => "Description : ", :rows => 5, :input_html => {:style => "height:100px;"}
=f.input :image_file_id, :label => "Image", :as => :qi_image_select
=f.input :author, :label => "Auteur", include_blank: "Administrateur"
= f.input :note, :label => "Informations supplémentaires pour Négos", :rows => 5, :input_html => {:style => "height:100px;"}
.actions
-if @need.devis?

View File

@ -41,18 +41,16 @@
.clear
-if @biglogo
=link_to image_tag("/logo.png", :id => "big-logo"), "/"
-else
=link_to image_tag("/logo.png", :id => "logo"), "/"
#main
=yield
%br
%br
%br
.body-container
=yield
.footer
.clear
=#render :partial => "public/shared/bottom"

View File

@ -6,5 +6,7 @@
= link_to ic(:download) + " Télécharger le devis actuel", public_need_download_devis_path(@need), class: "btn btn-primary"
= f.input :category, :as => :select, include_blank: "Toute catégorie", :collection => @tree.map{|c| [(c.level > 0 ? ('&nbsp;&nbsp;&nbsp;' * (c.level - 1)) + "|- ": "").html_safe + c.name, c.id]}, label: "Catégorie de besoin"
= f.input :description, :label => "Description", :rows => 5, :input_html => {:style => "height:100px;"}
= f.input :note, :label => "Informations supplémentaires (visibles uniquement par les administrateurs Négos)", :rows => 5, :input_html => {:style => "height:100px;"}
%br
=f.submit "Sauvegarder", :class => "btn btn-primary"

View File

@ -1,5 +1,6 @@
.center.row.need-container
.row.col-md-9.gutter
=render collection: @needs, partial: 'need_item', as: :need
@ -28,6 +29,7 @@
= f.inputs do
= f.input :s, as: :state, selected: params[:s], input_html: {:name => 's' }, label: 'Filter par état', :include_blank => "Tous les états" , :as => :select, :collection => [["En sondage","verified"],["En négociation","negociating"],["Négocié","negociated"],["Négociation échouée","failed"]]
.clear
:javascript
$('#search_o').change(function(){$('#search_form').submit()})
$('#search_r').change(function(){$('#search_form').submit()})

View File

@ -0,0 +1,5 @@
class AddNoteFieldToNeed < ActiveRecord::Migration
def change
add_column :needs, :note, :text
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: 20160317130441) do
ActiveRecord::Schema.define(version: 20160317170901) do
create_table "accepted_offers", force: :cascade do |t|
t.datetime "created_at", null: false
@ -448,6 +448,7 @@ ActiveRecord::Schema.define(version: 20160317130441) do
t.integer "category_id", limit: 4
t.string "devis", limit: 255
t.integer "image_file_id", limit: 4
t.text "note", limit: 65535
end
add_index "needs", ["author_id"], name: "index_needs_on_author_id", using: :btree