This commit is contained in:
Nicolas Bally 2020-03-03 13:51:47 +01:00
parent 31cfbbe637
commit 39feacb7dc
64 changed files with 992 additions and 6 deletions

View File

@ -0,0 +1,74 @@
# -*- encoding : utf-8 -*-
class Admin::FileTunelDownloadsController < ApplicationController
layout "admin"
before_action :auth_admin
before_action :admin_space
def admin_space
@admin_space = "tournees"
end
def index
@file_tunel_downloads = FileTunelDownload.all
@file_tunel_downloads = sort_by_sorting(@file_tunel_downloads, "created_at DESC")
params[:search][:per_page] = params[:search][:per_page] || 50
per_page = params[:search][:per_page]
page = (params[:page] and params[:page] != "") ? params[:page] : 1
@file_tunel_downloads = @file_tunel_downloads.page(page).per(per_page)
end
def show
@file_tunel_download = FileTunelDownload.find(params[:id])
end
def new
@file_tunel_download = FileTunelDownload.new
end
def edit
@file_tunel_download = FileTunelDownload.find(params[:id])
end
def create
@file_tunel_download = FileTunelDownload.new(params.require(:file_tunel_download).permit!)
if @file_tunel_download.save
else
render action: "new"
end
end
def update
@file_tunel_download = FileTunelDownload.find(params[:id])
if @file_tunel_download.update_attributes(params.require(:file_tunel_download).permit!)
else
render action: "edit"
end
end
def destroy
@file_tunel_download = FileTunelDownload.find(params[:id])
@file_tunel_download.destroy
end
end

View File

@ -0,0 +1,74 @@
# -*- encoding : utf-8 -*-
class Admin::FileTunelFilesController < ApplicationController
layout "admin"
before_action :auth_admin
before_action :admin_space
def admin_space
@admin_space = "tournees"
end
def index
@file_tunel_files = FileTunelFile.all
@file_tunel_files = sort_by_sorting(@file_tunel_files, "created_at DESC")
params[:search][:per_page] = params[:search][:per_page] || 50
per_page = params[:search][:per_page]
page = (params[:page] and params[:page] != "") ? params[:page] : 1
@file_tunel_files = @file_tunel_files.page(page).per(per_page)
end
def show
@file_tunel_file = FileTunelFile.find(params[:id])
end
def new
@file_tunel_file = FileTunelFile.new
end
def edit
@file_tunel_file = FileTunelFile.find(params[:id])
end
def create
@file_tunel_file = FileTunelFile.new(params.require(:file_tunel_file).permit!)
if @file_tunel_file.save
else
render action: "new"
end
end
def update
@file_tunel_file = FileTunelFile.find(params[:id])
if @file_tunel_file.update_attributes(params.require(:file_tunel_file).permit!)
else
render action: "edit"
end
end
def destroy
@file_tunel_file = FileTunelFile.find(params[:id])
@file_tunel_file.destroy
end
end

View File

@ -0,0 +1,74 @@
# -*- encoding : utf-8 -*-
class Admin::FileTunelSendsController < ApplicationController
layout "admin"
before_action :auth_admin
before_action :admin_space
def admin_space
@admin_space = "tournees"
end
def index
@file_tunel_sends = FileTunelSend.all
@file_tunel_sends = sort_by_sorting(@file_tunel_sends, "created_at DESC")
params[:search][:per_page] = params[:search][:per_page] || 50
per_page = params[:search][:per_page]
page = (params[:page] and params[:page] != "") ? params[:page] : 1
@file_tunel_sends = @file_tunel_sends.page(page).per(per_page)
end
def show
@file_tunel_send = FileTunelSend.find(params[:id])
end
def new
@file_tunel_send = FileTunelSend.new
end
def edit
@file_tunel_send = FileTunelSend.find(params[:id])
end
def create
@file_tunel_send = FileTunelSend.new(params.require(:file_tunel_send).permit!)
if @file_tunel_send.save
else
render action: "new"
end
end
def update
@file_tunel_send = FileTunelSend.find(params[:id])
if @file_tunel_send.update_attributes(params.require(:file_tunel_send).permit!)
else
render action: "edit"
end
end
def destroy
@file_tunel_send = FileTunelSend.find(params[:id])
@file_tunel_send.destroy
end
end

View File

@ -0,0 +1,74 @@
# -*- encoding : utf-8 -*-
class Admin::FileTunelsController < ApplicationController
layout "admin"
before_action :auth_admin
before_action :admin_space
def admin_space
@admin_space = "tournees"
end
def index
@file_tunels = FileTunel.all
@file_tunels = sort_by_sorting(@file_tunels, "created_at DESC")
params[:search][:per_page] = params[:search][:per_page] || 50
per_page = params[:search][:per_page]
page = (params[:page] and params[:page] != "") ? params[:page] : 1
@file_tunels = @file_tunels.page(page).per(per_page)
end
def show
@file_tunel = FileTunel.find(params[:id])
end
def new
@file_tunel = FileTunel.new
end
def edit
@file_tunel = FileTunel.find(params[:id])
end
def create
@file_tunel = FileTunel.new(params.require(:file_tunel).permit!)
if @file_tunel.save
else
render action: "new"
end
end
def update
@file_tunel = FileTunel.find(params[:id])
if @file_tunel.update_attributes(params.require(:file_tunel).permit!)
else
render action: "edit"
end
end
def destroy
@file_tunel = FileTunel.find(params[:id])
@file_tunel.destroy
end
end

59
app/models/file_tunel.rb Normal file
View File

@ -0,0 +1,59 @@
class FileTunel < ApplicationRecord
belongs_to :p_customer
belongs_to :admin
has_many :file_tunel_sends, :dependent => :destroy
accepts_nested_attributes_for :file_tunel_sends, :allow_destroy => true
has_many :file_tunel_files, :dependent => :destroy
accepts_nested_attributes_for :file_tunel_files, :allow_destroy => true
QI_DYNAMICS = %w()
eval(QI_DYNAMICS_CORE)
has_many :m_odr_virements, :dependent => :nullify
def self.qi_table_order
{
:created_at => {:name => "Date", :reorder => true},
:name => {:name => "Nom", :reorder => true},
:slug => {:name => "Permalien", :reorder => true},
:start_at => {:name => "Date de début", :reorder => true},
:end_at => {:name => "Date de fin", :reorder => true},
:actions => "Actions",
}
end
def self.valid_sort
r = []
self.qi_table_order.each do |key, value|
if value.instance_of? Hash
if value[:reorder] and value[:reorder] == true
r << key.to_s if value[:reorder]
end
end
end
return r
end
before_create { generate_token() }
def generate_token()
begin
self[:token] = SecureRandom.urlsafe_base64
end while FileTunel.exists?(:token => self[:token])
end
end

View File

@ -0,0 +1,14 @@
class FileTunelDownload < ApplicationRecord
belongs_to :file_tunel
belongs_to :file_tunel_send_id
before_create { generate_token() }
def generate_token()
begin
self[:token] = SecureRandom.urlsafe_base64
end while FileTunelDownload.exists?(:token => self[:token])
end
end

View File

@ -0,0 +1,15 @@
class FileTunelFile < ApplicationRecord
belongs_to :file_tunel
before_create { generate_token() }
def generate_token()
begin
self[:token] = SecureRandom.urlsafe_base64
end while FileTunelFile.exists?(:token => self[:token])
end
mount_uploader :file, OdrUploader
validates :file, :presence => true
end

View File

@ -0,0 +1,11 @@
class FileTunelSend < ApplicationRecord
belongs_to :file_tunel
before_create { generate_token() }
def generate_token()
begin
self[:token] = SecureRandom.urlsafe_base64
end while FileTunelSend.exists?(:token => self[:token])
end
end

View File

@ -1,3 +1 @@
=#%li= link_to "Tournées", admin_p_ship_tours_path
=#%li= link_to "Camions", admin_p_trucks_path
=#%li= link_to "Chauffeurs", admin_p_drivers_path
%li=link_to "Tunels", admin_file_tunels_path

View File

@ -0,0 +1,13 @@
%tr#file_tunel_download_row{:id => file_tunel_download.id}
-tr = {}
-tr[:actions] = capture do
%td.actions
= link_to i(:"trash-o"), [:admin, file_tunel_download], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_file_tunel_download_path(file_tunel_download), :remote => true
= link_to i(:eye), admin_file_tunel_download_path(file_tunel_download), :remote => true
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => file_tunel_download}

View File

@ -0,0 +1,21 @@
=semantic_form_for [:admin, @file_tunel_download], :remote => true do |f|
.content
=f.inputs do
= f.input :file_tunel, :label => "file_tunel :"
= f.input :file_tunel_send_id, :label => "file_tunel_send_id :"
= f.input :name, :label => "name :"
= f.input :firstname, :label => "firstname :"
= f.input :organisation, :label => "organisation :"
= f.input :civilite, :label => "civilite :"
= f.input :token, :label => "token :"
= f.input :email, :label => "email :"
= f.input :download_times, :label => "download_times :"
= f.input :last_download_at, :label => "last_download_at :"
.actions=f.submit "sauvegarder", :class => "btn btn-primary"

View File

@ -0,0 +1,2 @@
$('#file_tunel_downloads_rows').prepend("<%= escape_javascript(render(@file_tunel_download))%>");
close_pane_hover();

View File

@ -0,0 +1 @@
$('#file_tunel_download_<%= @file_tunel_download.id %>').remove();

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,20 @@
.qi_header
.right= link_to 'Ajouter ', new_admin_file_tunel_download_path(), :class => "btn btn-primary", :remote => true
%h1
%span
.qi_search_row
=form_tag "", :method => "get", :onsubmit => "" do
-params[:search] =params[:search] || {}
%table
%tr
%td
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @file_tunel_downloads}
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @file_tunel_downloads}

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,10 @@
.qi_header
%h1
%span
.qi_row
.qi_pannel.qi_plain.padding
=debug @file_tunel_download

View File

@ -0,0 +1,2 @@
$('#file_tunel_download_row_<%= @file_tunel_download.id %>').replaceWith("<%= escape_javascript(render(@file_tunel_download))%>");
close_pane_hover();

View File

@ -0,0 +1,13 @@
%tr#file_tunel_file_row{:id => file_tunel_file.id}
-tr = {}
-tr[:actions] = capture do
%td.actions
= link_to i(:"trash-o"), [:admin, file_tunel_file], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_file_tunel_file_path(file_tunel_file), :remote => true
= link_to i(:eye), admin_file_tunel_file_path(file_tunel_file), :remote => true
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => file_tunel_file}

View File

@ -0,0 +1,8 @@
.file_tunel_file_form.field
=form.input :name, :label => "Nom :"
=form.input :file, :label => "Fichier :"
=form.input :position
=link_to_remove_fields ic(:"trash-o"), form

View File

@ -0,0 +1,2 @@
$('#file_tunel_files_rows').prepend("<%= escape_javascript(render(@file_tunel_file))%>");
close_pane_hover();

View File

@ -0,0 +1 @@
$('#file_tunel_file_<%= @file_tunel_file.id %>').remove();

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,20 @@
.qi_header
.right= link_to 'Ajouter ', new_admin_file_tunel_file_path(), :class => "btn btn-primary", :remote => true
%h1
%span
.qi_search_row
=form_tag "", :method => "get", :onsubmit => "" do
-params[:search] =params[:search] || {}
%table
%tr
%td
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @file_tunel_files}
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @file_tunel_files}

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,10 @@
.qi_header
%h1
%span
.qi_row
.qi_pannel.qi_plain.padding
=debug @file_tunel_file

View File

@ -0,0 +1,2 @@
$('#file_tunel_file_row_<%= @file_tunel_file.id %>').replaceWith("<%= escape_javascript(render(@file_tunel_file))%>");
close_pane_hover();

View File

@ -0,0 +1,13 @@
%tr#file_tunel_send_row{:id => file_tunel_send.id}
-tr = {}
-tr[:actions] = capture do
%td.actions
= link_to i(:"trash-o"), [:admin, file_tunel_send], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_file_tunel_send_path(file_tunel_send), :remote => true
= link_to i(:eye), admin_file_tunel_send_path(file_tunel_send), :remote => true
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => file_tunel_send}

View File

@ -0,0 +1,6 @@
.file_tunel_send_form.field
=form.input :email, :label => "Email :"
=link_to_remove_fields ic(:"trash-o"), form

View File

@ -0,0 +1,2 @@
$('#file_tunel_sends_rows').prepend("<%= escape_javascript(render(@file_tunel_send))%>");
close_pane_hover();

View File

@ -0,0 +1 @@
$('#file_tunel_send_<%= @file_tunel_send.id %>').remove();

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,20 @@
.qi_header
.right= link_to 'Ajouter ', new_admin_file_tunel_send_path(), :class => "btn btn-primary", :remote => true
%h1
%span
.qi_search_row
=form_tag "", :method => "get", :onsubmit => "" do
-params[:search] =params[:search] || {}
%table
%tr
%td
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @file_tunel_sends}
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @file_tunel_sends}

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,10 @@
.qi_header
%h1
%span
.qi_row
.qi_pannel.qi_plain.padding
=debug @file_tunel_send

View File

@ -0,0 +1,2 @@
$('#file_tunel_send_row_<%= @file_tunel_send.id %>').replaceWith("<%= escape_javascript(render(@file_tunel_send))%>");
close_pane_hover();

View File

@ -0,0 +1,13 @@
%tr#file_tunel_row{:id => file_tunel.id}
-tr = {}
-tr[:actions] = capture do
%td.actions
= link_to i(:"trash-o"), [:admin, file_tunel], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_file_tunel_path(file_tunel), :remote => true
= link_to i(:eye), admin_file_tunel_path(file_tunel), :remote => true
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => file_tunel}

View File

@ -0,0 +1,41 @@
=semantic_form_for [:admin, @file_tunel], html: { multipart: true }, :remote => true do |f|
.content
=f.inputs do
= f.input :p_customer, :label => "Client :"
= f.input :name, :label => "Nom :"
= f.input :description, :label => "Description :"
= f.input :slug, :label => "Permalien :"
= f.input :start_at, :label => "Date de début :", :as => :date
= f.input :end_at, :label => "Date de fin :" , :as => :date
= f.input :fili_text, :label => "Texte filigrame :"
.qi_row
.qi_pannel.qi_plain.padding
Fichiers :
%hr
.file_tunel_files_form
=f.semantic_fields_for :file_tunel_files do |form|
=render :partial => "admin/file_tunel_files/form", :locals => {:form => form}
%p= link_to_add_fields ic(:plus)+" Ajouter un fichier demandé", f, :file_tunel_files
.qi_row
.qi_pannel.qi_plain.padding
Fichiers demandés :
%hr
.file_tunel_sends_form
=f.semantic_fields_for :file_tunel_sends do |form|
=render :partial => "admin/file_tunel_sends/form", :locals => {:form => form}
%p= link_to_add_fields ic(:plus)+" Ajouter un fichier demandé", f, :file_tunel_sends
.actions=f.submit "sauvegarder", :class => "btn btn-primary"

View File

@ -0,0 +1,2 @@
$('#file_tunels_rows').prepend("<%= escape_javascript(render(@file_tunel))%>");
close_pane_hover();

View File

@ -0,0 +1 @@
$('#file_tunel_<%= @file_tunel.id %>').remove();

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,20 @@
.qi_header
.right= link_to 'Ajouter ', new_admin_file_tunel_path(), :class => "btn btn-primary", :remote => true
%h1
%span
.qi_search_row
=form_tag "", :method => "get", :onsubmit => "" do
-params[:search] =params[:search] || {}
%table
%tr
%td
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @file_tunels}
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @file_tunels}

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);

View File

@ -0,0 +1,10 @@
.qi_header
%h1
%span
.qi_row
.qi_pannel.qi_plain.padding
=debug @file_tunel

View File

@ -0,0 +1,2 @@
$('#file_tunel_row_<%= @file_tunel.id %>').replaceWith("<%= escape_javascript(render(@file_tunel))%>");
close_pane_hover();

View File

@ -42,6 +42,8 @@
.cat#big_cat_stocks
=ic :"cubes"
Opérations ODR
-if false
.element
@ -62,7 +64,14 @@
.cat#big_cat_payments
=ic :"eur"
Virements
.element
=link_to admin_file_tunels_path do
.cat#big_cat_tournees
=ic :"lock"
Tunels fichier sécurisés
-if false
.element
=link_to admin_p_stats_path do

View File

@ -119,7 +119,7 @@
=image_tag @m_odr.logo_image_file.file.url, :class => "odr_logo", :style => (@m_odr.logo_image_file_width? ? "max-width:#{@m_odr.logo_image_file_width}px;margin:auto;": "")
-if @m_odr.logo_image_file
-if @m_odr.banner_image_file
=image_tag @m_odr.banner_image_file.file.url, :class => "odr_banner", :style => (@m_odr.banner_image_file_width? ? "max-width:#{@m_odr.banner_image_file_width}px;margin:auto;margin-bottom:40px;": "")
-background = (@m_odr.background_image_file ? @m_odr.background_image_file.file.url : "")

View File

@ -1,5 +1,49 @@
Rails.application.routes.draw do
namespace :admin do
resources :file_tunel_files do
member do
end
collection do
end
end
end
namespace :admin do
resources :file_tunel_downloads do
member do
end
collection do
end
end
end
namespace :admin do
resources :file_tunel_sends do
member do
end
collection do
end
end
end
namespace :admin do
resources :file_tunels do
member do
end
collection do
end
end
end
namespace :admin do
resources :mail_hists do
member do

View File

@ -0,0 +1,23 @@
class CreateFileTunels < ActiveRecord::Migration[6.0]
def change
create_table :file_tunels do |t|
t.string :name
t.text :description
t.string :slug
t.string :token
t.string :from_email
t.string :from_name
t.boolean :enabled, :default => true
t.datetime :start_at
t.datetime :end_at
t.string :fili_text
t.integer :download_times, :default => 0
t.boolean :init_mail, :default => true
t.boolean :send_mail, :default => true
t.references :p_customer, foreign_key: true
t.references :admin, foreign_key: true
t.timestamps
end
end
end

View File

@ -0,0 +1,16 @@
class CreateFileTunelSends < ActiveRecord::Migration[6.0]
def change
create_table :file_tunel_sends do |t|
t.references :file_tunel, foreign_key: true
t.string :token
t.string :email
t.integer :download_times, :default => 0
t.boolean :enabled, :default => true
t.datetime :send_at
t.boolean :read, :default => false
t.string :mj_token
t.timestamps
end
end
end

View File

@ -0,0 +1,18 @@
class CreateFileTunelDownloads < ActiveRecord::Migration[6.0]
def change
create_table :file_tunel_downloads do |t|
t.references :file_tunel, foreign_key: true
t.references :file_tunel_send, foreign_key: true
t.string :name
t.string :firstname
t.string :organisation
t.string :civilite
t.string :token
t.string :email
t.integer :download_times, :default => 0
t.datetime :last_download_at
t.timestamps
end
end
end

View File

@ -0,0 +1,15 @@
class CreateFileTunelFiles < ActiveRecord::Migration[6.0]
def change
create_table :file_tunel_files do |t|
t.string :file
t.string :token
t.boolean :enabled, :default => true
t.integer :position
t.text :description
t.string :name
t.references :file_tunel, foreign_key: true
t.timestamps
end
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_01_125633) do
ActiveRecord::Schema.define(version: 2020_03_03_104720) do
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
@ -321,6 +321,70 @@ ActiveRecord::Schema.define(version: 2020_03_01_125633) do
t.datetime "updated_at", precision: 6, null: false
end
create_table "file_tunel_downloads", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "file_tunel_id"
t.bigint "file_tunel_send_id"
t.string "name"
t.string "firstname"
t.string "organisation"
t.string "civilite"
t.string "token"
t.string "email"
t.integer "download_times", default: 0
t.datetime "last_download_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["file_tunel_id"], name: "index_file_tunel_downloads_on_file_tunel_id"
t.index ["file_tunel_send_id"], name: "index_file_tunel_downloads_on_file_tunel_send_id"
end
create_table "file_tunel_files", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "file"
t.string "token"
t.boolean "enabled", default: true
t.integer "position"
t.text "description"
t.string "name"
t.bigint "file_tunel_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "file_tunel_sends", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.bigint "file_tunel_id"
t.string "token"
t.string "email"
t.integer "download_times", default: 0
t.boolean "enabled", default: true
t.datetime "send_at"
t.boolean "read", default: false
t.string "mj_token"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "file_tunels", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
t.text "description"
t.string "slug"
t.string "token"
t.string "from_email"
t.string "from_name"
t.boolean "enabled", default: true
t.datetime "start_at"
t.datetime "end_at"
t.string "fili_text"
t.integer "download_times", default: 0
t.boolean "init_mail", default: true
t.boolean "send_mail", default: true
t.bigint "p_customer_id"
t.bigint "admin_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["admin_id"], name: "index_file_tunels_on_admin_id"
t.index ["p_customer_id"], name: "index_file_tunels_on_p_customer_id"
end
create_table "gallery_contents", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
t.text "description"
@ -2464,6 +2528,10 @@ ActiveRecord::Schema.define(version: 2020_03_01_125633) do
end
add_foreign_key "admin_preferences", "admins"
add_foreign_key "file_tunel_downloads", "file_tunel_sends"
add_foreign_key "file_tunel_downloads", "file_tunels"
add_foreign_key "file_tunels", "admins"
add_foreign_key "file_tunels", "p_customers"
add_foreign_key "i_task_projects", "admins"
add_foreign_key "i_tasks", "admins"
add_foreign_key "i_tasks", "i_task_projects"

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

25
test/fixtures/file_tunel_downloads.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
file_tunel: one
file_tunel_send_id: one
name: MyString
firstname: MyString
organisation: MyString
civilite: MyString
token: MyString
email: MyString
download_times: 1
last_download_at: 2020-03-03 11:46:19
two:
file_tunel: two
file_tunel_send_id: two
name: MyString
firstname: MyString
organisation: MyString
civilite: MyString
token: MyString
email: MyString
download_times: 1
last_download_at: 2020-03-03 11:46:19

19
test/fixtures/file_tunel_files.yml vendored Normal file
View File

@ -0,0 +1,19 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
file: MyString
token: MyString
enabled: false
position: 1
description: MyText
name: MyString
file_tunel: one
two:
file: MyString
token: MyString
enabled: false
position: 1
description: MyText
name: MyString
file_tunel: two

21
test/fixtures/file_tunel_sends.yml vendored Normal file
View File

@ -0,0 +1,21 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
file_tunel: one
token: MyString
email: MyString
download_times: 1
enabled: false
send_at: 2020-03-03 11:44:51
read: false
mj_token: MyString
two:
file_tunel: two
token: MyString
email: MyString
download_times: 1
enabled: false
send_at: 2020-03-03 11:44:51
read: false
mj_token: MyString

31
test/fixtures/file_tunels.yml vendored Normal file
View File

@ -0,0 +1,31 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name:
description: MyText
slug: MyString
token: MyString
enabled: false
start_at: 2020-03-03 11:43:26
end_at: 2020-03-03 11:43:26
fili_text: MyString
download_times: 1
init_mail: false
send_mail: false
p_customer: one
admin: one
two:
name:
description: MyText
slug: MyString
token: MyString
enabled: false
start_at: 2020-03-03 11:43:26
end_at: 2020-03-03 11:43:26
fili_text: MyString
download_times: 1
init_mail: false
send_mail: false
p_customer: two
admin: two

View File

@ -0,0 +1,7 @@
require 'test_helper'
class FileTunelDownloadTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class FileTunelFileTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class FileTunelSendTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class FileTunelTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end