diff --git a/Gemfile.lock b/Gemfile.lock index 365bd2f..91d7bbd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -262,6 +262,3 @@ DEPENDENCIES wicked_pdf wkhtmltopdf-binary workflow (~> 1.2.0) - -BUNDLED WITH - 1.10.6 diff --git a/app/views/admin/need_categories/index.html.haml b/app/views/admin/need_categories/index.html.haml old mode 100644 new mode 100755 index 91412f7..e1fcae8 --- a/app/views/admin/need_categories/index.html.haml +++ b/app/views/admin/need_categories/index.html.haml @@ -1,16 +1,18 @@ %h1 Gestion des catégories +-if @tree.length < 1 + Aucune catégorie +-else + %table.table.admin_table.table-hover.table-striped + %thead.rows_header -%table.table.admin_table.table-hover.table-striped - %thead.rows_header + %tr + %th + Nom + %th{:style => "width:100px"} +   - %tr - %th - Nom - %th{:style => "width:100px"} -   - - %tbody.rows - - =render @tree + %tbody.rows + =render @tree +%br = link_to "Créer une nouvelle catégorie", new_admin_need_category_path, class:"btn btn-primary" diff --git a/app/views/admin/needs/index.html.haml b/app/views/admin/needs/index.html.haml old mode 100644 new mode 100755 index 9160cb3..23d276f --- a/app/views/admin/needs/index.html.haml +++ b/app/views/admin/needs/index.html.haml @@ -1,8 +1,10 @@ %h1 Gestion des besoins +%h2 Proposition de besoin +-if @needs_to_validate.length < 1 + Aucune proposition de besoin +-else --if @needs_to_validate.length > 0 - %h2 Modération des besoins %div.alert.alert-info Avant qu'un besoin soit visible par l'ensemble des clients, vous devez le valider en cliquant sur le bouton %br @@ -28,51 +30,53 @@ =render collection: @needs_to_validate, partial: 'need_to_validate', as: :need %br - - %h2 Liste des besoins -.row - .col-md-2 - = semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f| - = f.inputs do - =f.input :q, :as => :search, label: "Recherche", input_html: {value: params[:q], :name => 'q' }, placeholder: "Rechercher un besoin" - .clear - = f.inputs do - = f.input :o, as: :order, selected: params[:o], input_html: {:name => 'o' }, label: "Ordre d'affichage", :include_blank => false , :as => :select, :collection => @orders - .clear - = f.inputs do - = f.input :r, as: :result, selected: params[:r], input_html: {:name => 'r' }, label: 'Résultats par page', :include_blank => false , :as => :select, :collection => [10,20,50,100] - .clear - = f.inputs do - = f.input :c, as: :category, selected: params[:c], input_html: {:name => 'c' }, label: 'Filtrer par catégorie', :include_blank => "Toute catégorie" , :as => :select, :collection => @tree.map{|c| [(c.level > 0 ? ('   ' * (c.level - 1)) + "|- ": "").html_safe + c.name, c.id]} - .clear - = link_to "Créer un besoin", new_admin_need_path, class:"btn btn-primary" +-if @needs.length < 1 + Aucun besoin +-else + .row + .col-md-2 + = semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f| + = f.inputs do + =f.input :q, :as => :search, label: "Recherche", input_html: {value: params[:q], :name => 'q' }, placeholder: "Rechercher un besoin" + .clear + = f.inputs do + = f.input :o, as: :order, selected: params[:o], input_html: {:name => 'o' }, label: "Ordre d'affichage", :include_blank => false , :as => :select, :collection => @orders + .clear + = f.inputs do + = f.input :r, as: :result, selected: params[:r], input_html: {:name => 'r' }, label: 'Résultats par page', :include_blank => false , :as => :select, :collection => [10,20,50,100] + .clear + = f.inputs do + = f.input :c, as: :category, selected: params[:c], input_html: {:name => 'c' }, label: 'Filtrer par catégorie', :include_blank => "Toute catégorie" , :as => :select, :collection => @tree.map{|c| [(c.level > 0 ? ('   ' * (c.level - 1)) + "|- ": "").html_safe + c.name, c.id]} + .clear - .col-md-10 - %table.table.admin_table.table-hover.table-striped - %thead.rows_header + .col-md-10 + %table.table.admin_table.table-hover.table-striped + %thead.rows_header - %tr - %th - Titre - %th - Catégorie - %th - Émetteur - %th{style: 'text-align:center' } - Commentaires/Intérêts - %th{style: 'text-align:center' } - Offres - %th - Statut - %th{:style => "width:100px"} -   + %tr + %th + Titre + %th + Catégorie + %th + Émetteur + %th{style: 'text-align:center' } + Commentaires/Intérêts + %th{style: 'text-align:center' } + Offres + %th + Statut + %th{:style => "width:100px"} +   - %tbody.rows + %tbody.rows - =render @needs + =render @needs - .pagination.pull-right= paginate @needs + .pagination.pull-right= paginate @needs +%br += link_to "Créer un besoin", new_admin_need_path, class:"btn btn-primary" diff --git a/app/views/public/my_account/index.html.haml b/app/views/public/my_account/index.html.haml old mode 100644 new mode 100755 index c3e0e4c..df28c20 --- a/app/views/public/my_account/index.html.haml +++ b/app/views/public/my_account/index.html.haml @@ -68,5 +68,5 @@ =render "public/needs/index", needs: @needs -else %p - Vous n'avez pas encore proposer de besoin + Vous n'avez pas encore proposé de besoin =link_to "Proposer un besoin", new_public_need_path, :class => "btn btn-primary" diff --git a/db/schema.rb b/db/schema.rb index 6052ebc..8084b77 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -415,7 +415,7 @@ ActiveRecord::Schema.define(version: 20151209125427) do add_index "needs", ["author_id"], name: "index_needs_on_author_id", using: :btree add_index "needs", ["category_id"], name: "index_needs_on_category_id", using: :btree add_index "needs", ["deleted_at"], name: "index_needs_on_deleted_at", using: :btree - add_index "needs", ["title"], name: "index_needs_on_title", using: :btree + add_index "needs", ["title"], name: "index_needs_on_title", length: {"title"=>191}, using: :btree create_table "newsgroups", force: :cascade do |t| t.string "name", limit: 255