diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss index cd0ffb9..2e2125c 100755 --- a/app/assets/stylesheets/public.scss +++ b/app/assets/stylesheets/public.scss @@ -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; diff --git a/app/assets/stylesheets/public/need.scss b/app/assets/stylesheets/public/need.scss index 9c3ab74..18368ec 100755 --- a/app/assets/stylesheets/public/need.scss +++ b/app/assets/stylesheets/public/need.scss @@ -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{ diff --git a/app/assets/stylesheets/public/needs.scss b/app/assets/stylesheets/public/needs.scss index 515ee0b..b963ac2 100755 --- a/app/assets/stylesheets/public/needs.scss +++ b/app/assets/stylesheets/public/needs.scss @@ -4,5 +4,6 @@ .need-container{ margin-top:250px; + } diff --git a/app/controllers/public/needs_controller.rb b/app/controllers/public/needs_controller.rb index 2e6d27c..5ea521f 100755 --- a/app/controllers/public/needs_controller.rb +++ b/app/controllers/public/needs_controller.rb @@ -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 diff --git a/app/views/admin/needs/_form.html.haml b/app/views/admin/needs/_form.html.haml index 843cbe2..54b67f7 100755 --- a/app/views/admin/needs/_form.html.haml +++ b/app/views/admin/needs/_form.html.haml @@ -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? diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 426e90b..18516df 100755 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -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" diff --git a/app/views/public/needs/_form.html.haml b/app/views/public/needs/_form.html.haml index 48b6b5e..b841395 100755 --- a/app/views/public/needs/_form.html.haml +++ b/app/views/public/needs/_form.html.haml @@ -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 ? ('   ' * (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" diff --git a/app/views/public/needs/index.html.haml b/app/views/public/needs/index.html.haml index 0efd787..abe1e7e 100755 --- a/app/views/public/needs/index.html.haml +++ b/app/views/public/needs/index.html.haml @@ -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()}) diff --git a/db/migrate/20160317170901_add_note_field_to_need.rb b/db/migrate/20160317170901_add_note_field_to_need.rb new file mode 100644 index 0000000..4e49434 --- /dev/null +++ b/db/migrate/20160317170901_add_note_field_to_need.rb @@ -0,0 +1,5 @@ +class AddNoteFieldToNeed < ActiveRecord::Migration + def change + add_column :needs, :note, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 47998cc..116608c 100755 --- 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: 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