This commit is contained in:
Marlburrow 2015-12-11 00:17:43 +01:00
parent 2e0c9a793f
commit 7f29387a16
5 changed files with 60 additions and 57 deletions

View File

@ -262,6 +262,3 @@ DEPENDENCIES
wicked_pdf wicked_pdf
wkhtmltopdf-binary wkhtmltopdf-binary
workflow (~> 1.2.0) workflow (~> 1.2.0)
BUNDLED WITH
1.10.6

6
app/views/admin/need_categories/index.html.haml Normal file → Executable file
View File

@ -1,5 +1,7 @@
%h1 Gestion des catégories %h1 Gestion des catégories
-if @tree.length < 1
Aucune catégorie
-else
%table.table.admin_table.table-hover.table-striped %table.table.admin_table.table-hover.table-striped
%thead.rows_header %thead.rows_header
@ -10,7 +12,7 @@
&nbsp; &nbsp;
%tbody.rows %tbody.rows
=render @tree =render @tree
%br
= link_to "Créer une nouvelle catégorie", new_admin_need_category_path, class:"btn btn-primary" = link_to "Créer une nouvelle catégorie", new_admin_need_category_path, class:"btn btn-primary"

14
app/views/admin/needs/index.html.haml Normal file → Executable file
View File

@ -1,8 +1,10 @@
%h1 Gestion des besoins %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 %div.alert.alert-info
Avant qu'un besoin soit visible par l'ensemble des clients, vous devez le valider en cliquant sur le bouton <i class="fa fa-check"></i> Avant qu'un besoin soit visible par l'ensemble des clients, vous devez le valider en cliquant sur le bouton <i class="fa fa-check"></i>
%br %br
@ -28,9 +30,10 @@
=render collection: @needs_to_validate, partial: 'need_to_validate', as: :need =render collection: @needs_to_validate, partial: 'need_to_validate', as: :need
%br %br
%h2 Liste des besoins %h2 Liste des besoins
-if @needs.length < 1
Aucun besoin
-else
.row .row
.col-md-2 .col-md-2
= semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f| = semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f|
@ -46,7 +49,6 @@
= f.inputs do = 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 ? ('&nbsp;&nbsp;&nbsp;' * (c.level - 1)) + "|- ": "").html_safe + c.name, c.id]} = 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 ? ('&nbsp;&nbsp;&nbsp;' * (c.level - 1)) + "|- ": "").html_safe + c.name, c.id]}
.clear .clear
= link_to "Créer un besoin", new_admin_need_path, class:"btn btn-primary"
.col-md-10 .col-md-10
%table.table.admin_table.table-hover.table-striped %table.table.admin_table.table-hover.table-striped
@ -73,6 +75,8 @@
=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"

2
app/views/public/my_account/index.html.haml Normal file → Executable file
View File

@ -68,5 +68,5 @@
=render "public/needs/index", needs: @needs =render "public/needs/index", needs: @needs
-else -else
%p %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" =link_to "Proposer un besoin", new_public_need_path, :class => "btn btn-primary"

View File

@ -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", ["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", ["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", ["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| create_table "newsgroups", force: :cascade do |t|
t.string "name", limit: 255 t.string "name", limit: 255