diff --git a/app/assets/javascripts/admin.coffee b/app/assets/javascripts/admin.coffee
index db3b98b..02aae8e 100755
--- a/app/assets/javascripts/admin.coffee
+++ b/app/assets/javascripts/admin.coffee
@@ -37,31 +37,32 @@ content_type_to_move =false
@open_collapse3 = ->
$("#collapse3 .panel").show()
$("#collapse3").show()
-
+
@reset_edit_pane = ->
$("#element_form").html()
$("#collapse3").hide()
-
+
@unselect_portlet = ->
$(".portlet.active").removeClass("active")
reset_edit_pane()
-
+
@cancel_move_portlet = ->
$(".move_message").show()
$(".cancel_message").hide()
-
+
$(".move").removeClass("move")
$(".portlet_placeholder").remove()
portlet_to_move = false
-
-$(document).ready ->
-
+
+$(document).ready ->
+
+
$(document).on 'click', 'input.datepicker', ->
$(this).datetimepicker(
language: 'fr'
pickTime: false
).focus();
-
+
$(document).on 'click', 'input.datetimepicker', ->
$(this).datetimepicker(
use24hours: true
@@ -69,8 +70,8 @@ $(document).ready ->
minuteStepping:15
language: 'fr'
).focus();
-
-
+
+
$(document).on 'click', 'input.timepicker', ->
$(this).datetimepicker(
use24hours: true
@@ -79,56 +80,56 @@ $(document).ready ->
pickDate: false
language: 'fr'
).focus();
-
-
-
-
-
+
+
+
+
+
$(document).on "click", ".portlet", (event) ->
if !$(this).hasClass("active") and portlet_to_move == false
-
+
$(".portlet.active").removeClass("active")
$(this).addClass("active")
-
-
+
+
$.ajax({url : $(this).data("edit-link"), type: "GET"});
$("#collapse3 .trash").attr("href", $(this).data("show-link"));
-
+
event.stopPropagation();
-
+
$(document).on "click", ".block_portlets", (event) ->
portlet_to_move = false
content_type_to_move = false
$("#element_form").html("")
-
+
$(".portlet.active").removeClass("active")
-
-
-
-
-
+
+
+
+
+
$(document).on "click", "#content_types .content_type", ->
cancel_move_portlet()
unselect_portlet()
reset_edit_pane()
-
-
+
+
type = $(this).data("type")
content_type_to_move = type
init_portlets_place_holder()
$(this).addClass("move")
false
-
-
-
+
+
+
$(document).on "click", ".portlet_handle", ->
if portlet_to_move == false
-
+
$(".move_message").hide()
$(".cancel_message").show()
-
-
+
+
id = $(this).data("portlet-id")
portlet_to_move = $("#portlet_"+id)
init_portlets_place_holder()
@@ -136,9 +137,9 @@ $(document).ready ->
false
else
cancel_move_portlet()
-
+
false
-
+
$(document).on "click", ".portlet_placeholder", ->
if portlet_to_move != false
$(this).after portlet_to_move
@@ -146,28 +147,28 @@ $(document).ready ->
$(".portlet_placeholder").remove()
update_block_portlet_order(portlet_to_move.closest(".block_portlets").data("block_id"))
cancel_move_portlet()
- else
-
+ else
+
block_id = $(this).closest(".block_portlets").data("block_id")
-
-
+
+
$(this).replaceWith('
');
-
+
$.ajax({
- url:"/portlet/portlets/new.js",
+ url:"/portlet/portlets/new.js",
type: "GET",
- data: {
+ data: {
block_id : block_id,
position : $(this).attr("data_position"),
content_type : content_type_to_move
- }
-
+ }
+
})
content_type_to_move = false
$(".portlet_placeholder").remove()
-
-
-
+
+
+
@init_portlets_place_holder = ->
placeholder = '
'
@@ -178,21 +179,21 @@ $(document).ready ->
$(this).after(placeholder)
-
+
@flash_delay = ->
$("#flashs").find(".alert").each ->
-
+
if !$(this).hasClass("delay")
$(this).addClass("delay")
$(this).delay(3000).fadeOut();
-
-
+
+
@init_menu_items_list = ->
-
+
if $(".prevv_folder").length > 0
-
+
$(".prevv_folder").sortable({
group:"menu_items",
containerSelector :".receptable",
@@ -201,7 +202,7 @@ $(document).ready ->
nested:false,
placeholder:"",
-
+
})
oldContainer = ""
$("#sortable_menu_item").sortable({
@@ -218,101 +219,101 @@ $(document).ready ->
container.el.addClass("active")
oldContainer = container
onDrop: (item, Container, _super) ->
-
-
+
+
if Container
-
+
parent_id = Container.el.data("parent-id")
menu_id = Container.el.data("menu-id")
id = item.data("menu-item-id")
$.ajax({
- url:"/admin/menu_items/"+id+".js",
+ url:"/admin/menu_items/"+id+".js",
type: "PUT",
- data: {
+ data: {
reorder : true,
menu_item : {
parent_id : parent_id,
menu_id : menu_id
- }
+ }
},
success : ->
-
-
+
+
_super(item)
item.remove()
-
+
})
-
-
-
-
-
+
+
+
+
+
else
-
-
+
+
_super(item)
-
+
sortable_data = {parent_id :$("#sortable_menu_item").data("parent-id"), menu_id :$("#sortable_menu_item").data("menu-id") , menu_items_ids : []}
-
+
$("#sortable_menu_item").find(".menu_item_row").each ->
sortable_data.menu_items_ids.push $(this).data("menu-item-id")
-
-
+
+
$.ajax({url : "/admin/menu_items/reorder", data : sortable_data, type: "POST"});
-
+
})
-
+
@update_block_portlet_order = (block_portlet_id) ->
return_order = []
-
+
block_portlet = $("#block_portlet_"+block_portlet_id)
-
+
block_data = {block_id : block_portlet.data('block_id'), block_portlet_ids : []}
block_portlet.children('.portlet').each ->
if $(this).data('portlet_id')
block_data.block_portlet_ids.push($(this).data('portlet_id'))
-
-
+
+
return_order.push(block_data);
$.ajax({url : "/portlet/portlets/reorder", data : {blocks:return_order}, type: "POST"})
-
-
+
+
jQuery ->
-
+
$(".inline-contenteditable").keypress (e) ->
if e.which == 13
false
else
$(this).html($(this).text())
return true
-
-
+
+
$(document).on 'click', ".portlet_title_content .inline-contenteditable", () ->
-
+
$.ajax
- url : "/portlet/title_contents/"+$(this).data("title-id")+"/edit.js",
+ url : "/portlet/title_contents/"+$(this).data("title-id")+"/edit.js",
type: "GET",
-
+
$(document).on 'blur keyup paste', ".portlet_title_content .inline-contenteditable", () ->
$(this).html($(this).text())
$.ajax
- url : "/portlet/title_contents/"+$(this).data("title-id"),
+ url : "/portlet/title_contents/"+$(this).data("title-id"),
type: "PUT",
- data :
- title_content :
+ data :
+ title_content :
content : $(this).html()
-
-
-
-
+
+
+
+
$(".sortable").sortable({
containerSelector :".block",
@@ -320,21 +321,21 @@ jQuery ->
handle: ".handle",
nested:true,
placeholder:""
-
+
})
-
-
-
-
-
+
+
+
+
+
flash_delay();
-
+
item_catched = ""
-
-
+
+
adjustment = ""
-
+
$("#menu_item_inspector_container").sortable({
@@ -347,21 +348,21 @@ jQuery ->
height: $item.height(),
width: $item.width()
})
-
+
$("body").addClass("dragging")
-
+
offset = $item.offset()
pointer = container.rootGroup.pointer
adjustment = {
left: pointer.left - offset.left,
top: pointer.top - offset.top
- }
-
+ }
+
onCancel : ($item, container, _super) ->
$item.css(position)
$item.removeClass("dragged")
$("body").removeClass("dragging")
-
+
onDrag: ($item, position, _super) ->
$item.css({
@@ -372,31 +373,28 @@ jQuery ->
-
+
})
-
-
+
+
$(document).on "scroll", () ->
- if( $(this).scrollTop() <= 52 )
+ if( $(this).scrollTop() <= 52 )
top = 52 - $(this).scrollTop()
else
top = 0
$("#toolbar-text, #menu_item_informations").css
top : top
-
+
$(document).on "click", "#menu_item_informations .save", ->
$(this).closest(".panel").find("form").submit()
return false
-
+
$(document).on "click", "#menu_item_informations h4", ->
$(this).next(".panel").toggle()
return false
-
-
-
diff --git a/app/assets/javascripts/bootstrap.js b/app/assets/javascripts/bootstrap.js
index 3f2bca0..16da285 100755
--- a/app/assets/javascripts/bootstrap.js
+++ b/app/assets/javascripts/bootstrap.js
@@ -2,7 +2,7 @@
//= require bootstrap/alert
//= require bootstrap/button
//= require bootstrap/carousel
-
+//= require bootstrap/collapse
//= require bootstrap/dropdown
//= require bootstrap/tab
//= require bootstrap/transition
diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss
index 81c621f..bd69ca5 100755
--- a/app/assets/stylesheets/public.scss
+++ b/app/assets/stylesheets/public.scss
@@ -691,3 +691,10 @@ height: 100%;
cursor: inherit;
display: block;
}
+
+.mfp-iframe-holder .mfp-content {
+
+ width: 90%;
+ max-width: 100%;
+
+}
diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb
index 9a6eb87..efed9fb 100755
--- a/app/controllers/admin/customers_controller.rb
+++ b/app/controllers/admin/customers_controller.rb
@@ -20,6 +20,16 @@ class Admin::CustomersController < ApplicationController
end
+ def connected_customers
+
+ @customers_5m = Customer.where("last_activity > ?", DateTime.now - 5.minutes)
+ @customers_1h = Customer.where("last_activity > ?", DateTime.now - 1.hour)
+ @customers_24h = Customer.where("last_activity > ?", DateTime.now - 24.hours)
+
+
+ end
+
+
def show
@customer = Customer.find(params[:id])
end
diff --git a/app/controllers/admin/needs_controller.rb b/app/controllers/admin/needs_controller.rb
index c66d072..6393674 100755
--- a/app/controllers/admin/needs_controller.rb
+++ b/app/controllers/admin/needs_controller.rb
@@ -68,7 +68,7 @@ class Admin::NeedsController < ApplicationController
def download_devis
@need = Need.find(params[:need_id])
- send_file @need.devis.file.path, :filename => "devis-need-#{@need.id}.#{@need.devis.file.extension}"
+ send_file @need.devis.file.path, :filename => "proposition-besoin-#{@need.id}.#{@need.devis.file.extension}"
end
def create
@@ -150,7 +150,7 @@ class Admin::NeedsController < ApplicationController
def accept
@need = Need.find(params[:id])
if @need.offers.length < 1
- flash[:error] = "Vous devez créer au moins une proposition avant de passer ce besoin en négocié"
+ flash[:error] = "Vous devez créer au moins une offre avant de passer ce besoin en négocié"
else
if @need.accept!
flash[:notice] = "Le besoin est maintenant négocié"
diff --git a/app/controllers/admin/offers_controller.rb b/app/controllers/admin/offers_controller.rb
index 7f19471..3d2645d 100755
--- a/app/controllers/admin/offers_controller.rb
+++ b/app/controllers/admin/offers_controller.rb
@@ -65,7 +65,7 @@ class Admin::OffersController < ApplicationController
@offer = Offer.new(offer_params)
if @offer.save
@need.offers << @offer
- flash[:notice] = "Proposition créée avec succès."
+ flash[:notice] = "Offre créée avec succès."
@offer.validate!
redirect_to admin_need_offers_path(@need)
else
@@ -83,7 +83,7 @@ class Admin::OffersController < ApplicationController
def update
@offer = Offer.find(params[:id])
if @offer.update_attributes(offer_params)
- flash[:notice] = "Proposition modifiée avec succès."
+ flash[:notice] = "Offre modifiée avec succès."
if params[:need_id]
@need = Need.find(params[:need_id])
redirect_to admin_need_offers_path(@need)
@@ -99,9 +99,9 @@ class Admin::OffersController < ApplicationController
@offer = Offer.find(params[:id])
if(@offer.destroy)
- flash[:notice] = "Proposition supprimée avec succès."
+ flash[:notice] = "Offre supprimée avec succès."
else
- flash[:error] = "Impossible de supprimer cette proposition"
+ flash[:error] = "Impossible de supprimer cette offre"
end
if params[:need_id]
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 876757e..7e37a4d 100755
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -16,6 +16,9 @@ class ApplicationController < ActionController::Base
if !current_customer
session[:before_auth_url] = request.url
redirect_to new_public_customers_auth_path(:p => params[:p], :for_annonce => (true if params[:controller] == "public/annonces"))
+ else
+ @current_customer.last_activity = DateTime.now
+ @current_customer.save
end
end
@@ -43,6 +46,7 @@ class ApplicationController < ActionController::Base
a_c = Customer.find_by_token(cookies[:customer_auth_token])
if !a_c.lock
@current_customer = a_c
+
else
cookies[:customer_auth_token] = nil
nil
diff --git a/app/controllers/public/accepted_offers_controller.rb b/app/controllers/public/accepted_offers_controller.rb
index 0d38d7f..07c49a9 100755
--- a/app/controllers/public/accepted_offers_controller.rb
+++ b/app/controllers/public/accepted_offers_controller.rb
@@ -7,7 +7,7 @@ class Public::AcceptedOffersController < ApplicationController
def download_devis
@accepted_offer = AcceptedOffer.find(params[:id])
if(@accepted_offer.customer.id != current_customer.id)
- flash[:error] = "Vous n'avez pas la permission de télécharger ce devis"
+ flash[:error] = "Vous n'avez pas la permission de télécharger cette offre"
redirect_back_or_default :root
else
@accepted_offer.state = :devis_downloaded
diff --git a/app/controllers/public/needs_controller.rb b/app/controllers/public/needs_controller.rb
index 99d7751..1dd9fe4 100755
--- a/app/controllers/public/needs_controller.rb
+++ b/app/controllers/public/needs_controller.rb
@@ -78,7 +78,7 @@ class Public::NeedsController < ApplicationController
return redirect_to :back
end
- send_file @need.devis.file.path, filename: "devis-need-#{@need.id}.#{@need.devis.file.extension}"
+ send_file @need.devis.file.path, filename: "proposition-need-#{@need.id}.#{@need.devis.file.extension}"
end
@@ -117,8 +117,9 @@ class Public::NeedsController < ApplicationController
def create
@need = Need.new(need_params)
@need.author = current_customer
- if !@need.devis?
- flash[:error] = "Vous devez joindre un devis au format PDF"
+
+ if !@need.devis? && !@need.note?
+ flash[:error] = "Vous devez joindre une proposition au format PDF ou au moins préciser son prix dans le champ d'information"
return render :action => "new"
end
diff --git a/app/controllers/public/offers_controller.rb b/app/controllers/public/offers_controller.rb
index 00de577..69ade48 100755
--- a/app/controllers/public/offers_controller.rb
+++ b/app/controllers/public/offers_controller.rb
@@ -7,7 +7,7 @@ class Public::OffersController < ApplicationController
def accept
if @offer.customers.include?(current_customer)
- flash[:error] = "Vous avez déjà accepter cette proposition"
+ flash[:error] = "Vous avez déjà accepter cette offre"
return redirect_back_or_default :root
end
@accepted_offer = AcceptedOffer.new
@@ -15,7 +15,7 @@ class Public::OffersController < ApplicationController
@accepted_offer.offer = @offer
@document = Document.new
- @document.title = "Proposition"
+ @document.title = "Offre"
@accepted_offer.documents << @document
if @accepted_offer.save
@@ -26,7 +26,7 @@ class Public::OffersController < ApplicationController
CustomerMailer.offer_accepted(current_customer, @accepted_offer).deliver
- flash[:notice] = "Proposition acceptée avec succès !"
+ flash[:notice] = "Offre acceptée avec succès !"
diff --git a/app/controllers/public/wishes_controller.rb b/app/controllers/public/wishes_controller.rb
index 2928a57..e77edcb 100644
--- a/app/controllers/public/wishes_controller.rb
+++ b/app/controllers/public/wishes_controller.rb
@@ -87,7 +87,7 @@ class Public::WishesController < ApplicationController
return redirect_to :back
end
- send_file @wish.devis.file.path, filename: "devis-need-#{@need.id}.#{@wish.devis.file.extension}"
+ send_file @wish.devis.file.path, filename: "proposition-need-#{@need.id}.#{@wish.devis.file.extension}"
end
diff --git a/app/mailers/customer_mailer.rb b/app/mailers/customer_mailer.rb
index e19f3ec..c418fa2 100755
--- a/app/mailers/customer_mailer.rb
+++ b/app/mailers/customer_mailer.rb
@@ -78,21 +78,21 @@ class CustomerMailer < ApplicationMailer
def offer_accepted(customer, accepted_offer)
@accepted_offer = accepted_offer
@customer = customer
- mail to: @customer.email, :subject => "Vous avez accepté une proposition"
+ mail to: @customer.email, :subject => "Vous avez accepté une offre"
end
def document_available(customer, document)
@document = document
@customer = customer
- mail to: @customer.email, :subject => "Document disponible pour la proposition #{@document.accepted_offer.offer.need.title}"
+ mail to: @customer.email, :subject => "Document disponible pour l'offre #{@document.accepted_offer.offer.need.title}"
end
def document_verified(customer, document)
@document = document
@customer = customer
- mail to: @customer.email, :subject => "Document vérifié pour la proposition #{@document.accepted_offer.offer.need.title}"
+ mail to: @customer.email, :subject => "Document vérifié pour l'offre #{@document.accepted_offer.offer.need.title}"
end
diff --git a/app/models/wish.rb b/app/models/wish.rb
index 862cca0..6b3137b 100755
--- a/app/models/wish.rb
+++ b/app/models/wish.rb
@@ -4,7 +4,7 @@ class Wish < ActiveRecord::Base
mount_uploader :devis, WishDevisUploader
- validates :devis, :presence => true
+ validates :note, presence: true, if: "!devis?"
validates :need, :presence => true
validates :customer, :presence => true
end
diff --git a/app/views/admin/customers/_connected_customers.html.haml b/app/views/admin/customers/_connected_customers.html.haml
new file mode 100644
index 0000000..4754303
--- /dev/null
+++ b/app/views/admin/customers/_connected_customers.html.haml
@@ -0,0 +1,23 @@
+
+
+%tr#customer_row
+ %td
+ = link_to "#{customer.firstname} #{customer.name} ",edit_admin_customer_path(customer)
+ %td
+ = link_to customer.organisation, edit_admin_customer_path(customer)
+
+ %td
+ -if customer.phone?
+ = i("phone") + " #{customer.phone}"
+ %td
+ =customer.city
+
+ %td
+ =link_to customer.email, "mailto:#{customer.email}"
+ %td
+ =customer.last_activity
+ ="(Il y a #{time_ago_in_words(customer.last_activity)})"
+
+
+ %td.actions{:style => "width:150px;text-align:right;"}
+ =link_to i(:"comments"), admin_conversation_path(customer)
diff --git a/app/views/admin/customers/_customer.html.haml b/app/views/admin/customers/_customer.html.haml
index 7fb2e30..e425dd9 100755
--- a/app/views/admin/customers/_customer.html.haml
+++ b/app/views/admin/customers/_customer.html.haml
@@ -21,6 +21,7 @@
%td.actions{:style => "width:150px;text-align:right;"}
+ =link_to i(:"comments"), admin_conversation_path(customer)
= link_to i(:"trash-o"), [:admin, customer], :data => {:confirm => 'Voulez-vous vraiment supprimer ce compte utilisateur ?'}, :method => :delete, :remote => true
=# link_to i(:eye), [:admin, customer]
= link_to i(:pencil), edit_admin_customer_path(customer)
diff --git a/app/views/admin/customers/connected_customers.html.haml b/app/views/admin/customers/connected_customers.html.haml
new file mode 100644
index 0000000..c30c0b6
--- /dev/null
+++ b/app/views/admin/customers/connected_customers.html.haml
@@ -0,0 +1,82 @@
+%h1 Moniteur d'activité
+
+%h3 Utilisateurs actifs ces 5 dernières minutes
+
+%table.table.table-hover.table-striped.customer_table
+ %thead#customer_rows_header.rows_header
+
+ %tr
+ %th
+ Prénom/Nom
+ %th
+ Société
+ %th
+ Téléphone
+ %th
+ Ville
+ %th
+ Email
+
+ %th
+ Dernière activité
+ %th
+
+ %tbody#customer_rows.rows
+
+ =render partial: "admin/customers/connected_customers", collection: @customers_5m, as: :customer
+
+
+%h3 Utilisateurs ayant été actifs durant ces 60 dernières minutes
+
+%table.table.table-hover.table-striped.customer_table
+ %thead#customer_rows_header.rows_header
+
+ %tr
+ %th
+ Prénom/Nom
+ %th
+ Société
+ %th
+ Téléphone
+ %th
+ Ville
+ %th
+ Email
+
+ %th
+ Dernière activité
+ %th
+
+ %tbody#customer_rows.rows
+
+ =render partial: "admin/customers/connected_customers", collection: @customers_1h, as: :customer
+
+
+
+
+
+%h3 Utilisateurs ayant été actifs au cours de ces dernières 24 heures
+
+
+%table.table.table-hover.table-striped.customer_table
+ %thead#customer_rows_header.rows_header
+
+ %tr
+ %th
+ Prénom/Nom
+ %th
+ Société
+ %th
+ Téléphone
+ %th
+ Ville
+ %th
+ Email
+
+ %th
+ Dernière activité
+ %th
+
+ %tbody#customer_rows.rows
+
+ =render partial: "admin/customers/connected_customers", collection: @customers_24h, as: :customer
diff --git a/app/views/admin/needs/_form.html.haml b/app/views/admin/needs/_form.html.haml
index 82660b0..b8b4811 100755
--- a/app/views/admin/needs/_form.html.haml
+++ b/app/views/admin/needs/_form.html.haml
@@ -11,7 +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;"}
+ -#= f.input :note, :label => "Informations supplémentaires pour Négos (Si vous n'avez pas attaché de proposition, merci de préciser son prix dans ce champ)", :rows => 5, :input_html => {:style => "height:100px;"}
.actions
= f.submit "Sauvegarder", :class => "btn btn-primary"
diff --git a/app/views/admin/offers/_offer.html.haml b/app/views/admin/offers/_offer.html.haml
index 8b72aca..1334256 100755
--- a/app/views/admin/offers/_offer.html.haml
+++ b/app/views/admin/offers/_offer.html.haml
@@ -15,10 +15,10 @@
%td.actions{:style => "width:150px;text-align:right"}
-if @need
- = link_to i(:"cog"), accepted_admin_offer_path(offer), title: "Gérer les propositions par client"
- = link_to i(:"trash"), [:admin,@need, offer], :data => {:confirm => 'Voulez-vous vraiment supprimer cette proposition ?'}, :method => :delete
+ = link_to i(:"cog"), accepted_admin_offer_path(offer), title: "Gérer les offres par client"
+ = link_to i(:"trash"), [:admin,@need, offer], :data => {:confirm => 'Voulez-vous vraiment supprimer cette offre ?'}, :method => :delete
= link_to i(:pencil), edit_admin_need_offer_path(@need, offer)
-else
- = link_to i(:"cog"), accepted_admin_offer_path(offer), title: "Gérer les propositions par client"
- = link_to i(:"trash"), [:admin, offer], :data => {:confirm => 'Voulez-vous vraiment supprimer cette proposition ?'}, :method => :delete
+ = link_to i(:"cog"), accepted_admin_offer_path(offer), title: "Gérer les offres par client"
+ = link_to i(:"trash"), [:admin, offer], :data => {:confirm => 'Voulez-vous vraiment supprimer cette offre ?'}, :method => :delete
= link_to i(:pencil), edit_admin_offer_path(offer)
diff --git a/app/views/admin/offers/accepted.html.haml b/app/views/admin/offers/accepted.html.haml
index 71cfb28..0086b1c 100755
--- a/app/views/admin/offers/accepted.html.haml
+++ b/app/views/admin/offers/accepted.html.haml
@@ -1,5 +1,5 @@
%h1
- = "Gestion des propositions par client pour le besoin "
+ = "Gestion des offres par client pour le besoin "
= @offer.need.title
@@ -10,7 +10,7 @@
=pluralize(@offer.need.wishes.length, "Personne")
%h4
- = "Propositions acceptées: "
+ = "Offres acceptées: "
=pluralize(@offer.accepted_offers.length, "Personne")
@@ -37,7 +37,7 @@
%th
Email
%th{style:"text-align:center"}
- Propositions acceptée?
+ Offres acceptée?
%th{style:"text-align:center"}
Documents
%th{style:"text-align:center"}
diff --git a/app/views/admin/offers/edit.html.haml b/app/views/admin/offers/edit.html.haml
index f908625..812d77d 100755
--- a/app/views/admin/offers/edit.html.haml
+++ b/app/views/admin/offers/edit.html.haml
@@ -1,4 +1,4 @@
%h1
- Modifier une proposition
+ Modifier une offre
=render :partial => "form"
diff --git a/app/views/admin/offers/index.html.haml b/app/views/admin/offers/index.html.haml
index 6f0d0f2..6af0cdb 100755
--- a/app/views/admin/offers/index.html.haml
+++ b/app/views/admin/offers/index.html.haml
@@ -1,33 +1,33 @@
-if @need
%h1
- Gestion des propositions pour le besoin
+ Gestion des offres pour le besoin
%strong= @need.title
%p.alert.alert-info
- Seul les propositions concernant le besoin
+ Seul les offres concernant le besoin
%strong= @need.title
sont affichées sur cette page.
%br
- Pour voir toutes les propositions, aller dans l'onglet
- %strong Gestion des propositions
+ Pour voir toutes les offres, aller dans l'onglet
+ %strong Gestion des offres
depuis la barre de navigation
-else
%h1
- Gestion des propositions
+ Gestion des offres
%p.alert.alert-info
- Cette page affiche toutes les propositions existantes.
+ Cette page affiche toutes les offres existantes.
%br
- Pour créer une proposition, il faut d'abord choisir un besoin. Pour cela, passer par l'onglet
+ Pour créer une offre, il faut d'abord choisir un besoin. Pour cela, passer par l'onglet
%strong Gestion des besoins
puis cliquer sur le bouton
%strong= ic(:gift)
en face du besoin de votre choix.
-if @offers.length < 1
- Aucune proposition actuellement
+ Aucune offre actuellement
-if @need
%br
%br
- =link_to "Ajouter une proposition", new_admin_need_offer_path(@need),class:"btn btn-primary"
+ =link_to "Ajouter une offre", new_admin_need_offer_path(@need),class:"btn btn-primary"
%br
-else
.row
@@ -38,7 +38,7 @@
%tr
%th
- Besoin concerné par la proposition
+ Besoin concerné par l'offre
%th
Fournisseur
%th
@@ -46,7 +46,7 @@
%th{style:"text-align:center;"}
Clients Intéressés
%th{style:"text-align:center;"}
- Propositions Acceptées
+ Offres Acceptées
%th{:style => "width:100px"}
@@ -57,7 +57,7 @@
.pagination.pull-right= paginate @offers
.col-md-2
-if @need
- =link_to "Ajouter une proposition", new_admin_need_offer_path(@need),class:"btn btn-primary btn-block"
+ =link_to "Ajouter une offre", new_admin_need_offer_path(@need),class:"btn btn-primary btn-block"
%br
= semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f|
= f.inputs do
diff --git a/app/views/admin/offers/new.html.haml b/app/views/admin/offers/new.html.haml
index 26aeaee..d22684c 100755
--- a/app/views/admin/offers/new.html.haml
+++ b/app/views/admin/offers/new.html.haml
@@ -1,4 +1,4 @@
%h1
- Créer une proposition pour le besoin
+ Créer une offre pour le besoin
%strong= @need.title
=render :partial => "form"
diff --git a/app/views/admin/wishes/_wish.html.haml b/app/views/admin/wishes/_wish.html.haml
index d1c3174..52b7367 100755
--- a/app/views/admin/wishes/_wish.html.haml
+++ b/app/views/admin/wishes/_wish.html.haml
@@ -6,9 +6,9 @@
=wish.created_at
%td
-if wish.devis?
- = link_to ic(:download) + " Télécharger devis", download_devis_admin_need_wish_path(wish.need, wish), class:"btn btn-primary btn-sm"
+ = link_to ic(:download) + " Télécharger sa proposition", download_devis_admin_need_wish_path(wish.need, wish), class:"btn btn-primary btn-sm"
-else
- Aucun devis
+ Aucune proposition attachée
%td
-if wish.note?
=wish.note
diff --git a/app/views/admin/wishes/index.html.haml b/app/views/admin/wishes/index.html.haml
index 85aa056..64d3395 100755
--- a/app/views/admin/wishes/index.html.haml
+++ b/app/views/admin/wishes/index.html.haml
@@ -10,7 +10,7 @@
%th
Intéressé le
%th
- Devis
+ Proposition
%th
Informations supplémentaires
%th{:style => "width:100px"}
diff --git a/app/views/admin_mailer/customer_accept_offer.html.haml b/app/views/admin_mailer/customer_accept_offer.html.haml
index b1e89cb..baef58f 100644
--- a/app/views/admin_mailer/customer_accept_offer.html.haml
+++ b/app/views/admin_mailer/customer_accept_offer.html.haml
@@ -3,5 +3,5 @@
%p
Le client
%strong= @accepted_offer.customer.fullname
- vient d'accepter la proposition concernant le besoin
+ vient d'accepter l'offre concernant le besoin
%strong= @accepted_offer.offer.need.title
diff --git a/app/views/customer_mailer/document_available.html.haml b/app/views/customer_mailer/document_available.html.haml
index 4b21ce1..e8a5004 100644
--- a/app/views/customer_mailer/document_available.html.haml
+++ b/app/views/customer_mailer/document_available.html.haml
@@ -1,7 +1,7 @@
%p Bonjour,
%p
- Un document est disponible pour une proposition que vous avez récemment acceptée:
+ Un document est disponible pour une offre que vous avez récemment acceptée:
%strong= @document.accepted_offer.offer.need.title
%p
diff --git a/app/views/customer_mailer/document_verified.html.haml b/app/views/customer_mailer/document_verified.html.haml
index 37e1303..23fb401 100644
--- a/app/views/customer_mailer/document_verified.html.haml
+++ b/app/views/customer_mailer/document_verified.html.haml
@@ -1,12 +1,12 @@
%p Bonjour,
%p
- Un document que vous nous avez récemment retourné pour la proposition
+ Un document que vous nous avez récemment retourné pour l'offre
%strong= @document.accepted_offer.offer.need.title
vient d'être vérifié
%p
Le titre du document concerné est
%strong= @document.title
-
+
%p Merci
diff --git a/app/views/customer_mailer/need_negociated.html.haml b/app/views/customer_mailer/need_negociated.html.haml
index c133d38..a363926 100644
--- a/app/views/customer_mailer/need_negociated.html.haml
+++ b/app/views/customer_mailer/need_negociated.html.haml
@@ -4,7 +4,7 @@
Le besoin
%strong= @need.title
vient d'être négocié !"
-
-%p Rendez-vous sur notre site afin de voir notre proposition
+
+%p Rendez-vous sur notre site afin de voir notre offre
%p Merci
diff --git a/app/views/customer_mailer/offer_accepted.html.haml b/app/views/customer_mailer/offer_accepted.html.haml
index d4db561..8622445 100644
--- a/app/views/customer_mailer/offer_accepted.html.haml
+++ b/app/views/customer_mailer/offer_accepted.html.haml
@@ -1,7 +1,7 @@
%p Bonjour,
%p
- Vous venez d'accepter une proposition pour le besoin
+ Vous venez d'accepter une offre pour le besoin
%strong= @accepted_offer.offer.need.title
%p Merci
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index 84eeea1..99eb157 100755
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -10,8 +10,7 @@
= javascript_include_tag "admin"
= javascript_include_tag "https://maps.google.com/maps/api/js?sensor=false®ion=FR"
-
-
+
@@ -50,12 +49,13 @@
%li= link_to " Besoins", admin_needs_path
%li= link_to " Catégories", admin_need_categories_path
- %li= link_to " Propositions", admin_offers_path
+ %li= link_to " Offres", admin_offers_path
- unread_messages = ContactMessage.where(read_by_admin: false).count
-if unread_messages > 0
%li=link_to content_tag(:span,unread_messages , style:"background-color:#D9534F", class: 'badge') + " Contacts", admin_conversations_path
-else
%li= link_to " Contacts", admin_conversations_path
+ %li= link_to " Moniteur d'activité", admin_connected_customers_path
%ul.nav.navbar-nav.navbar-right
diff --git a/app/views/public/accepted_offers/index.html.haml b/app/views/public/accepted_offers/index.html.haml
index 81062c7..8baf174 100755
--- a/app/views/public/accepted_offers/index.html.haml
+++ b/app/views/public/accepted_offers/index.html.haml
@@ -1,4 +1,4 @@
.center.white.row
.row.gutter
- %h1= i(:"file") + " Documents à retourner pour la proposition #{@accepted_offer.offer.need.title}"
+ %h1= i(:"file") + " Documents à retourner pour l'offre #{@accepted_offer.offer.need.title}"
diff --git a/app/views/public/my_account/index.html.haml b/app/views/public/my_account/index.html.haml
index 8cfe330..d4646b7 100755
--- a/app/views/public/my_account/index.html.haml
+++ b/app/views/public/my_account/index.html.haml
@@ -47,30 +47,31 @@
=link_to "Modifier mes infos", public_edit_infos_path, :class => "btn btn-primary"
.padding.center.white
%h3
- Mes propositions acceptées
+ Mes offres acceptées
%div.alert.alert-info
%p
- Voici la liste de toutes les propositions que vous avez acceptées.
+ Voici la liste de toutes les offres que vous avez acceptées.
C’est ici que vous pouvez accéder aux offres disponibles.
%p
- Une fois téléchargé, vous devez nous renvoyer le mandat signé afin de pour bénéficier de la proposition.
+ Une fois téléchargé, vous devez nous renvoyer le mandat signé afin de pouvoir bénéficier de l'offre.
%p
- N’oubliez pas que c’est l’intérêt de chacun de contribuer à NEGOS, en participant, en communiquant afin d’obtenir la meilleure proposition
+ %strong
+ N’oubliez pas que c’est l’intérêt de chacun de contribuer à NEGOS, en participant, en communiquant afin d’obtenir la meilleure offre
-if @accepted_offers.length > 0
=render "public/needs/accepted_offers_index", accepted_offers: @accepted_offers
.pagination= paginate @accepted_offers, param_name: 'page_offers'
-else
%p
- Vous n'avez pas encore accepté de proposition
+ Vous n'avez pas encore accepté d'offre
.padding.center.white
%h3
- Mes besoins
+ Mes intérêts
%div.alert.alert-info
%p
Signaler votre intérêt, vous permet d’accéder au fil de discussion ainsi qu’au suivi propre à chaque besoin.
%p
- Cela nous permet de vous envoyer des propositions intéressantes si nous décidons de négocier ce besoin.
+ Cela nous permet de vous envoyer des offres intéressantes si nous décidons de négocier ce besoin.
-if @wishes.length > 0
=render "public/wishes/index", wishes: @wishes
.pagination= paginate @wishes , param_name: 'page_wishes'
@@ -79,12 +80,12 @@
Vous n'êtes encore intéressé par aucun besoin
.padding.center.white
%h3
- Mes propositions de besoin
+ Mes besoins
%div.alert.alert-info
%p
Si vous avez un besoin qui ne fait pas encore parti de notre liste, vous pouvez vous-même le proposer à Négos.
%p
- Votre proposition sera alors soumise à une courte validation par l'un de nos modérateurs.
+ Votre proposition de besoin sera alors soumise à une courte validation par l'un de nos modérateurs.
%p
Vous serez informé par courriel de son acceptation.
-if @needs.length > 0
diff --git a/app/views/public/needs/_form.html.haml b/app/views/public/needs/_form.html.haml
index 7b1cd43..b36310b 100755
--- a/app/views/public/needs/_form.html.haml
+++ b/app/views/public/needs/_form.html.haml
@@ -3,7 +3,7 @@
= f.input :title, :label => "Titre de votre besoin"
= 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 :devis, type: :file, :label => "Devis/Offre (Fichier au format PDF)"
+ = f.input :devis, type: :file, :label => "Votre proposition (Fichier au format PDF)"
= f.input :note, :label => "Informations supplémentaires (visibles uniquement par les administrateurs Négos)", :rows => 5, :input_html => {:style => "height:100px;"}
%br
diff --git a/app/views/public/needs/_need_item.html.haml b/app/views/public/needs/_need_item.html.haml
index b04a906..2ad74c2 100755
--- a/app/views/public/needs/_need_item.html.haml
+++ b/app/views/public/needs/_need_item.html.haml
@@ -64,7 +64,7 @@
-elsif(need.negociated?)
-if(need.customers.include?(current_customer))
- =link_to i(:"download") +" Voir les propositions", public_need_path(need), class: "btn btn-success pull-right"
+ =link_to i(:"download") +" Voir les offres", public_need_path(need), class: "btn btn-success pull-right"
-else
=link_to i(:"times-circle") + " Négociation terminée", public_need_path(need) , class: "btn btn-danger pull-right"
diff --git a/app/views/public/needs/index.html.haml b/app/views/public/needs/index.html.haml
index abe1e7e..2b694e1 100755
--- a/app/views/public/needs/index.html.haml
+++ b/app/views/public/needs/index.html.haml
@@ -27,9 +27,9 @@
= 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
= 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"]]
+ = 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"]]
.clear
-
+
:javascript
$('#search_o').change(function(){$('#search_form').submit()})
$('#search_r').change(function(){$('#search_form').submit()})
diff --git a/app/views/public/needs/show.html.haml b/app/views/public/needs/show.html.haml
index 794891f..dc54006 100755
--- a/app/views/public/needs/show.html.haml
+++ b/app/views/public/needs/show.html.haml
@@ -54,7 +54,7 @@
%h3 Vous avez aussi ce besoin ? signalez-le nous !
%p Vous pouvez marquer votre interêt pour ce besoin en cliquant sur le bouton Ça m'intéresse !
%p Si il y a un nombre suffisant de personnes intéressées par ce même besoin, une négociation sera entamée auprès des fournisseurs afin de vous faire une offre intéressante.
- %p Une fois la négociation terminée, vous serez libre d'accepter ou non la proposition.
+ %p Une fois la négociation terminée, vous serez libre d'accepter ou non l'offre.
-elsif @need.negociating?
-if @need.customers.include?(current_customer)
@@ -74,8 +74,8 @@
.alert.alert-success
%h3 Négociation terminée
%p= "Nous avons négocié ce besoin à partir de #{number_to_currency(offers.first.price, locale: :fr)}"
- %p Vous avez maintenant le choix d'accepter ou refuser la proposition.
- %p Une fois la proposition acceptée, vous devrez nous retourner au plus vite le mandat signé
+ %p Vous avez maintenant le choix d'accepter ou refuser l'offre.
+ %p Une fois l'offre acceptée, vous devrez nous retourner au plus vite le mandat signé
-else
.alert.alert-success
%h3 Négociation terminée
@@ -103,7 +103,7 @@
-elsif @need.negociated?
-if @need.offers.length > 0
- %h2= i(:"gift") + " Les propositions négociées"
+ %h2= i(:"gift") + " Les offres négociées"
-@need.offers.each do |offer|
.offer
@@ -113,18 +113,18 @@
-if offer.need.customers.include?(current_customer)
-if !offer.customers.include?(current_customer)
.accept-offer
- =link_to i(:"check") + " Accepter la proposition", accept_public_need_offer_path(@need, offer), data: {confirm: "Voulez-vous vraiment accepter cette proposition ? Attention, cette action vous engage à payer la somme proposée."}, class: "btn btn-lg btn-success "
+ =link_to i(:"check") + " Accepter l'offre", accept_public_need_offer_path(@need, offer), data: {confirm: "Voulez-vous vraiment accepter cette offre ? Attention, cette action vous engage à payer la somme proposée."}, class: "btn btn-lg btn-success "
-else
.offer-accepted
- =i(:"check") + " Proposition Acceptée"
+ =i(:"check") + " Offre Acceptée"
.my-account-link
Vous devez maintenant nous retourner le mandat signé, rendez-vous rubrique
=link_to "Mon compte", public_my_account_path
- pour gérer vos propositions acceptées.
+ pour gérer vos offres acceptées.
-else
.offer-not-aceptable
- Proposition non disponible
+ Offre non disponible
.clear
diff --git a/app/views/public/wishes/_form.html.haml b/app/views/public/wishes/_form.html.haml
index fe52ea4..ff96e39 100644
--- a/app/views/public/wishes/_form.html.haml
+++ b/app/views/public/wishes/_form.html.haml
@@ -2,13 +2,13 @@
=f.inputs do
-if @wish.devis?
- = link_to ic(:download) + " Voir votre devis actuel", download_devis_public_need_wish_path(@need, @wish), class: "btn btn-primary"
+ = link_to ic(:download) + " Télécharger votre proposition", download_devis_public_need_wish_path(@need, @wish), class: "btn btn-primary"
%br
%br
-else
- = f.input :devis, type: :file, :label => "Devis de votre offre actuelle (Fichier au format PDF)"
+ = f.input :devis, type: :file, :label => "Votre proposition (Fichier au format PDF)"
- = f.input :note, :label => "Informations supplémentaires (visibles uniquement par les administrateurs Négos)", :rows => 5, :input_html => {:style => "height:100px;"}
+ = f.input :note, :label => "Informations supplémentaires (Si vous n'avez pas attaché de proposition, merci de préciser son prix dans ce champ)", :rows => 5, :input_html => {:style => "height:100px;"}
%br
diff --git a/app/views/public/wishes/new.html.haml b/app/views/public/wishes/new.html.haml
index 0f3a2cd..61a840a 100644
--- a/app/views/public/wishes/new.html.haml
+++ b/app/views/public/wishes/new.html.haml
@@ -5,8 +5,8 @@
Je signale mon intérêt pour le besoin
=link_to @need.title, public_need_path(@need)
.alert.alert-info
- %h2 Joindre mon devis
- %p Si vous êtes intéressé par ce besoin, faites nous part de votre offre actuelle en nous fournissant un devis.
+ %h2 Joindre ma proposition
+ %p Si vous êtes intéressé par ce besoin, faites nous part de votre proposition actuelle au format PDF.
%p
Une fois ce formulaire validé, vous pourrez si besoin revenir sur cette page depuis l'onglet
%strong Mon Compte
diff --git a/config/routes.rb b/config/routes.rb
index e205cb7..382e634 100755
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -269,6 +269,8 @@ Rails.application.routes.draw do
end
end
+
+
resources :need_categories
resources :needs do
get :download_devis
@@ -324,9 +326,11 @@ Rails.application.routes.draw do
get :accepted
end
end
-
+ get :connected_customers, to: "customers#connected_customers"
resources :customers do
+
member do
+
get :validate
end
end
diff --git a/db/migrate/20160413101451_add_last_activity_to_user.rb b/db/migrate/20160413101451_add_last_activity_to_user.rb
new file mode 100644
index 0000000..d0f810d
--- /dev/null
+++ b/db/migrate/20160413101451_add_last_activity_to_user.rb
@@ -0,0 +1,5 @@
+class AddLastActivityToUser < ActiveRecord::Migration
+ def change
+ add_column :customers, :last_activity, :datetime, default:nil
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6ab1805..9dd27d5 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: 20160318165409) do
+ActiveRecord::Schema.define(version: 20160413101451) do
create_table "accepted_offers", force: :cascade do |t|
t.datetime "created_at", null: false
@@ -223,6 +223,7 @@ ActiveRecord::Schema.define(version: 20160318165409) do
t.datetime "account_validated_at"
t.float "latitude", limit: 24
t.float "longitude", limit: 24
+ t.datetime "last_activity"
end
create_table "data_files", force: :cascade do |t|