Compare commits
No commits in common. "7766bf4b33f3e94a24c7023e82155a61c8b873c0" and "10bf7b95d0826787c06e7ac824fd6150aacd0d26" have entirely different histories.
7766bf4b33
...
10bf7b95d0
@ -1,108 +0,0 @@
|
|||||||
# -*- encoding : utf-8 -*-
|
|
||||||
|
|
||||||
class Admin::AbonnementsController < ApplicationController
|
|
||||||
before_filter :auth_admin
|
|
||||||
|
|
||||||
layout "admin"
|
|
||||||
|
|
||||||
|
|
||||||
before_filter :find_abonnements
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def new
|
|
||||||
@abonnement = Abonnement.new()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def edit
|
|
||||||
@abonnement = Abonnement.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
|
||||||
@abonnement = Abonnement.find(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def create
|
|
||||||
@abonnement = Abonnement.new(params.require(:abonnement).permit!)
|
|
||||||
|
|
||||||
|
|
||||||
if @abonnement.save
|
|
||||||
|
|
||||||
find_abonnements
|
|
||||||
flash[:notice] = "La catégorie à été ajouté avec succès."
|
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
render :action => "new"
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def update
|
|
||||||
@abonnement = Abonnement.find(params[:id])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
if @abonnement.update_attributes(params.require(:abonnement).permit!)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
flash[:notice] = "Le menu à été modifié avec succès."
|
|
||||||
|
|
||||||
if @reorder
|
|
||||||
format.js {
|
|
||||||
|
|
||||||
render :action => "update" }
|
|
||||||
else
|
|
||||||
format.js {
|
|
||||||
@abonnement = Abonnement.find(@abonnement.id)
|
|
||||||
render :action => "update_row" }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
@abonnement = Abonnement.find(params[:id])
|
|
||||||
@abonnement.destroy
|
|
||||||
find_abonnements
|
|
||||||
|
|
||||||
flash[:notice] = "La catégorie à bien été supprimée."
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def find_abonnements
|
|
||||||
|
|
||||||
@abonnements = Abonnement.order("created_at DESC").all
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@ -10,11 +10,7 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
|
|
||||||
def get_reseaux
|
def get_reseaux
|
||||||
if params[:reseaux_id] and current_customer and !params[:no_reseaux]
|
if session[:reseaux_id] and current_customer and !params[:no_reseaux]
|
||||||
@reseaux = current_customer.reseauxes.find(params[:reseaux_id])
|
|
||||||
@reseaux_layout = true
|
|
||||||
session[:reseaux_id] = @reseaux.id
|
|
||||||
elsif session[:reseaux_id] and current_customer and !params[:no_reseaux]
|
|
||||||
@reseaux = current_customer.reseauxes.find(session[:reseaux_id])
|
@reseaux = current_customer.reseauxes.find(session[:reseaux_id])
|
||||||
@reseaux_layout = true
|
@reseaux_layout = true
|
||||||
elsif !params[:no_reseaux]
|
elsif !params[:no_reseaux]
|
||||||
@ -76,8 +72,6 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def require_negos_abo
|
def require_negos_abo
|
||||||
get_reseaux
|
|
||||||
|
|
||||||
if !current_abo and (!session[:reseaux_id] or (@reseaux and @reseaux.abo_needed))
|
if !current_abo and (!session[:reseaux_id] or (@reseaux and @reseaux.abo_needed))
|
||||||
redirect_to new_public_abonnement_path
|
redirect_to new_public_abonnement_path
|
||||||
end
|
end
|
||||||
|
@ -68,13 +68,9 @@ class Public::CustomersController < ApplicationController
|
|||||||
params[:step] = "login"
|
params[:step] = "login"
|
||||||
@no_search = true
|
@no_search = true
|
||||||
@customer = Customer.new(params.require(:customer).permit!)
|
@customer = Customer.new(params.require(:customer).permit!)
|
||||||
@customer.account_validated = true
|
|
||||||
|
|
||||||
if @customer.save
|
if @customer.save
|
||||||
@customer.reseauxes << Reseaux.find(16)
|
|
||||||
@customer.reseauxes << Reseaux.find(2)
|
|
||||||
@customer.domains << Domain.find(1)
|
|
||||||
|
|
||||||
CustomerMailer.confirm(@customer).deliver
|
CustomerMailer.confirm(@customer).deliver
|
||||||
CustomerMailer.notify_ins(@customer).deliver
|
CustomerMailer.notify_ins(@customer).deliver
|
||||||
|
|
||||||
@ -84,14 +80,12 @@ class Public::CustomersController < ApplicationController
|
|||||||
cookies[:customer_auth_token] = @customer.token
|
cookies[:customer_auth_token] = @customer.token
|
||||||
|
|
||||||
|
|
||||||
#if session[:for_annonce]
|
if session[:for_annonce]
|
||||||
# redirect_to new_public_annonce_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
redirect_to new_public_annonce_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||||
#else
|
else
|
||||||
# redirect_to public_my_account_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
redirect_to public_my_account_path(:ins => "ins_finish"), notice: "Vous êtes désormais inscrit."
|
||||||
#end
|
end
|
||||||
redirect_to public_my_reseauxes_path(), notice: "Vous êtes désormais inscrit."
|
|
||||||
|
|
||||||
|
|
||||||
if cookies[:video_read] == "true"
|
if cookies[:video_read] == "true"
|
||||||
flash[:read_video] = false
|
flash[:read_video] = false
|
||||||
else
|
else
|
||||||
|
@ -3,22 +3,13 @@ class Public::NeedsController < ApplicationController
|
|||||||
layout "public"
|
layout "public"
|
||||||
before_filter :require_negos_abo
|
before_filter :require_negos_abo
|
||||||
before_filter :auth_customer
|
before_filter :auth_customer
|
||||||
#before_filter :check_enabled
|
before_filter :check_enabled
|
||||||
|
|
||||||
|
|
||||||
before_filter :build_category_tree, only:[:index,:new,:create,:edit,:update]
|
before_filter :build_category_tree, only:[:index,:new,:create,:edit,:update]
|
||||||
before_filter :check_owner, only: [:destroy,:edit,:update]
|
before_filter :check_owner, only: [:destroy,:edit,:update]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
#dsffsd = sdfd
|
|
||||||
|
|
||||||
if params[:reseaux_id]
|
|
||||||
@reseaux = Reseaux.find(params[:reseaux_id])
|
|
||||||
session[:reseaux_id] = @reseaux.id
|
|
||||||
elsif session[:reseaux_id]
|
|
||||||
@reseaux = Reseaux.find(session[:reseaux_id])
|
|
||||||
end
|
|
||||||
|
|
||||||
params[:type] = params[:type] || 1
|
params[:type] = params[:type] || 1
|
||||||
|
|
||||||
params[:type] = params[:type].to_i
|
params[:type] = params[:type].to_i
|
||||||
@ -34,7 +25,6 @@ class Public::NeedsController < ApplicationController
|
|||||||
else
|
else
|
||||||
@needs = @needs.where(:reseaux_id => nil)
|
@needs = @needs.where(:reseaux_id => nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
@needs = @needs.domain_in(current_customer.domain_ids)
|
@needs = @needs.domain_in(current_customer.domain_ids)
|
||||||
|
|
||||||
# filters default value
|
# filters default value
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
class Public::ProductsController < ApplicationController
|
class Public::ProductsController < ApplicationController
|
||||||
|
|
||||||
before_filter :auth_customer
|
before_filter :auth_customer
|
||||||
before_filter :require_negos_abo
|
|
||||||
layout "public"
|
layout "public"
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
class Abonnement < ActiveRecord::Base
|
class Abonnement < ActiveRecord::Base
|
||||||
belongs_to :reseaux
|
belongs_to :reseaux
|
||||||
belongs_to :customer
|
|
||||||
has_many :payments, :as => :element
|
has_many :payments, :as => :element
|
||||||
|
|
||||||
def after_paid
|
def after_paid
|
||||||
|
@ -86,7 +86,7 @@ class Customer < ActiveRecord::Base
|
|||||||
validates :cp, :presence => true, :if => :step2
|
validates :cp, :presence => true, :if => :step2
|
||||||
validates :city, :presence => true, :if => :step2
|
validates :city, :presence => true, :if => :step2
|
||||||
|
|
||||||
#validates :need_1 , :presence => true, :if => :step3
|
validates :need_1 , :presence => true, :if => :step3
|
||||||
|
|
||||||
|
|
||||||
# Geocoder
|
# Geocoder
|
||||||
@ -288,10 +288,6 @@ class Customer < ActiveRecord::Base
|
|||||||
"#{firstname.capitalize} #{name.upcase}"
|
"#{firstname.capitalize} #{name.upcase}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def name_for_label
|
|
||||||
"#{self.organisation} #{self.name.upcase} #{self.firstname.capitalize} - #{self.email}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def pseudo
|
def pseudo
|
||||||
if self.pro
|
if self.pro
|
||||||
self.organisation
|
self.organisation
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
|
|
||||||
%tr#abonnement.abonnement{:id => abonnement.id}
|
|
||||||
|
|
||||||
%td=abonnement.id
|
|
||||||
%td
|
|
||||||
-if abonnement.reseaux
|
|
||||||
=abonnement.reseaux.name
|
|
||||||
%td
|
|
||||||
-if abonnement.customer
|
|
||||||
=abonnement.customer.organisation
|
|
||||||
=abonnement.customer.name
|
|
||||||
=abonnement.customer.firstname
|
|
||||||
|
|
||||||
%td=abonnement.slug
|
|
||||||
%td=l abonnement.start_at
|
|
||||||
%td=l abonnement.end_at
|
|
||||||
%td=number_to_currency abonnement.price
|
|
||||||
%td=ic :check if abonnement.paid
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td.actions
|
|
||||||
=# link_to i(:"trash-o"), [:admin, abonnement], :data =>{:remote => true, :confirm => 'Voulez-vous vraiment supprimer cette taille ? Elle sera supprimée de tous les produits qui la contenait'}, :method => :delete
|
|
||||||
|
|
||||||
= link_to i(:pencil), edit_admin_abonnement_path(abonnement), :data => {:remote => true}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
= semantic_form_for [:admin,@abonnement], :remote => true do |form|
|
|
||||||
|
|
||||||
.content
|
|
||||||
= form.input :reseaux_id, :label => "Réseau :", :collection => Reseaux.where(:parent_id => nil).all, :as => :select, :include_blank => true
|
|
||||||
=form.input :customer_id, :label => "Client :", :collection => Customer.order(:organisation, :name).all, :as => :select, :include_blank => true, :member_label => :name_for_label
|
|
||||||
|
|
||||||
= form.input :start_at, :label => "Début", :as => :date
|
|
||||||
= form.input :end_at, :label => "Fin", :as => :date
|
|
||||||
|
|
||||||
= form.input :price, :label => "Prix :"
|
|
||||||
= form.input :paid, :label => "Payé ?"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.actions
|
|
||||||
= form.submit "Sauvegarder"
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
close_pane_hover();
|
|
||||||
|
|
||||||
$('#abonnements').html("<%= escape_javascript(render(@abonnements)) %>");
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
|
|
||||||
$('#abonnement_<%= @abonnement.id %>').remove();
|
|
||||||
|
|
||||||
|
|
||||||
<%= flash_js %>
|
|
@ -1 +0,0 @@
|
|||||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",550,600);
|
|
@ -1,27 +0,0 @@
|
|||||||
.qi_header
|
|
||||||
.right= link_to 'Ajouter un abonnement manuellement', new_admin_abonnement_path, :class => "btn btn-primary", :remote => true
|
|
||||||
%h1
|
|
||||||
|
|
||||||
Boutique
|
|
||||||
%span
|
|
||||||
Liste des documents
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.qi_row
|
|
||||||
.qi_pannel.qi_plain.padding
|
|
||||||
%table.table
|
|
||||||
|
|
||||||
%tr
|
|
||||||
%th ID
|
|
||||||
%th Réseaux
|
|
||||||
%th Client
|
|
||||||
%th Slug
|
|
||||||
%th Début
|
|
||||||
%th Fin
|
|
||||||
%th Prix
|
|
||||||
%th Payé ?
|
|
||||||
|
|
||||||
%th
|
|
||||||
|
|
||||||
%tbody#abonnements=render @abonnements
|
|
@ -1 +0,0 @@
|
|||||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",550,600);
|
|
@ -1,2 +0,0 @@
|
|||||||
close_pane_hover();
|
|
||||||
$('#abonnement_<%= @abonnement.id %>').replaceWith("<%= escape_javascript(render(@abonnement))%>");
|
|
@ -72,7 +72,6 @@
|
|||||||
%li= link_to "Type de documents", admin_product_order_document_types_path
|
%li= link_to "Type de documents", admin_product_order_document_types_path
|
||||||
%li=# link_to "Codes de reduction", admin_vourcher_codes_path
|
%li=# link_to "Codes de reduction", admin_vourcher_codes_path
|
||||||
%li=link_to "Pages statiques", admin_menu_items_path(:menu_id => 1)
|
%li=link_to "Pages statiques", admin_menu_items_path(:menu_id => 1)
|
||||||
%li=link_to "Abos", admin_abonnements_path()
|
|
||||||
|
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%ul.nav.navbar-nav.navbar-right
|
||||||
%li.dropdown
|
%li.dropdown
|
||||||
|
@ -336,14 +336,6 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :abonnements do
|
|
||||||
|
|
||||||
member do
|
|
||||||
get :force
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
resources :fournisseurs
|
resources :fournisseurs
|
||||||
resources :product_order_documents
|
resources :product_order_documents
|
||||||
resources :product_order_document_types
|
resources :product_order_document_types
|
||||||
|
Loading…
x
Reference in New Issue
Block a user