Commit 16b98901 by Mykhailo Makohin

some changes with tooltipster

parent 9c366b06
...@@ -33,6 +33,7 @@ gem 'globalize' ...@@ -33,6 +33,7 @@ gem 'globalize'
gem 'globalize-accessors' gem 'globalize-accessors'
gem 'ckeditor', '~> 4.3' gem 'ckeditor', '~> 4.3'
gem 'mini_magick' gem 'mini_magick'
gem 'video_info', '~> 2.7'
group :development, :test do group :development, :test do
gem 'byebug', platform: :mri gem 'byebug', platform: :mri
......
...@@ -52,9 +52,11 @@ GEM ...@@ -52,9 +52,11 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
arbre (1.2.1) arbre (1.2.1)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
arel (7.1.4) arel (7.1.4)
ast (2.4.0)
autoprefixer-rails (9.6.1.1) autoprefixer-rails (9.6.1.1)
execjs execjs
awesome_print (1.8.0) awesome_print (1.8.0)
...@@ -133,6 +135,7 @@ GEM ...@@ -133,6 +135,7 @@ GEM
has_scope (~> 0.6) has_scope (~> 0.6)
railties (>= 5.0, < 6.0) railties (>= 5.0, < 6.0)
responders (~> 2.0) responders (~> 2.0)
iso8601 (0.9.1)
jbuilder (2.9.1) jbuilder (2.9.1)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
jquery-rails (4.3.5) jquery-rails (4.3.5)
...@@ -170,6 +173,7 @@ GEM ...@@ -170,6 +173,7 @@ GEM
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
mysql2 (0.5.2) mysql2 (0.5.2)
net_http_timeout_errors (0.3.5)
nio4r (2.5.1) nio4r (2.5.1)
nokogiri (1.10.4) nokogiri (1.10.4)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
...@@ -179,6 +183,9 @@ GEM ...@@ -179,6 +183,9 @@ GEM
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (>= 1.2, < 3) rack (>= 1.2, < 3)
oga (2.15)
ast
ruby-ll (~> 2.1)
omniauth (1.9.0) omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0) hashie (>= 3.4.6, < 3.7.0)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
...@@ -240,6 +247,9 @@ GEM ...@@ -240,6 +247,9 @@ GEM
responders (2.4.1) responders (2.4.1)
actionpack (>= 4.2.0, < 6.0) actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0)
ruby-ll (2.1.2)
ansi
ast
ruby-vips (2.0.15) ruby-vips (2.0.15)
ffi (~> 1.9) ffi (~> 1.9)
sass (3.7.4) sass (3.7.4)
...@@ -287,6 +297,10 @@ GEM ...@@ -287,6 +297,10 @@ GEM
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.20) uglifier (4.1.20)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
video_info (2.7)
iso8601 (~> 0.9.1)
net_http_timeout_errors (~> 0.3.0)
oga (~> 2.7)
warden (1.2.8) warden (1.2.8)
rack (>= 2.0.6) rack (>= 2.0.6)
web-console (3.7.0) web-console (3.7.0)
...@@ -336,6 +350,7 @@ DEPENDENCIES ...@@ -336,6 +350,7 @@ DEPENDENCIES
turbolinks (~> 5) turbolinks (~> 5)
tzinfo-data tzinfo-data
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
video_info (~> 2.7)
web-console (>= 3.3.0) web-console (>= 3.3.0)
BUNDLED WITH BUNDLED WITH
......
...@@ -22,7 +22,7 @@ jQuery(document).ready(function($){ ...@@ -22,7 +22,7 @@ jQuery(document).ready(function($){
// initTip(); // initTip();
// initMap(); // initMap();
topTip(); topTip();
// toolinitTooltipster(); initTooltipster();
playStopVideoInModal(); playStopVideoInModal();
// initTwentytwenty(); // initTwentytwenty();
scrollToTop(); scrollToTop();
......
class HomeController < ApplicationController class HomeController < ApplicationController
def index def index
@video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
@projects = Project.all
end end
end end
\ No newline at end of file
class ProjectGalery < ApplicationRecord class ProjectGalery < ApplicationRecord
mount_uploader :photo, AvatarUploader mount_uploader :photo, AvatarUploader
translates :name
globalize_accessors :locales => [:en, :uk], :attributes => [:name]
belongs_to :project belongs_to :project
end end
class ProjectPhoto < ApplicationRecord class ProjectPhoto < ApplicationRecord
mount_uploader :photo, AvatarUploader mount_uploader :photo, AvatarUploader
translates :name
globalize_accessors :locales => [:en, :uk], :attributes => [:name]
belongs_to :project belongs_to :project
end end
class ProjectQoute < ApplicationRecord class ProjectQoute < ApplicationRecord
mount_uploader :icon, AvatarUploader mount_uploader :icon, AvatarUploader
translates :text_over_quote, :text_quote, :text_below_quote
globalize_accessors :locales => [:en, :uk], :attributes => [:text_over_quote, :text_quote,
:text_below_quote]
belongs_to :project belongs_to :project
end end
...@@ -6,6 +6,10 @@ class AvatarUploader < CarrierWave::Uploader::Base ...@@ -6,6 +6,10 @@ class AvatarUploader < CarrierWave::Uploader::Base
version :thumb_small do version :thumb_small do
process resize_to_fill: [320,200] process resize_to_fill: [320,200]
end end
version :thumb do
process resize_to_fill: [70,64]
end
storage :file storage :file
......
class VideoUploader < CarrierWave::Uploader::Base class VideoUploader < CarrierWave::Uploader::Base
storage :file
def extension_whitelist storage :file
%w(mp4 wbmv flv avi)
end
def store_dir def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end end
end version :thumb do
process thumbnail: [{format: 'png', quality: 10, size: 192, strip: true, logger: Rails.logger}]
def full_filename for_file
png_name for_file, version_name
end
end
def png_name for_file, version_name
%Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.png}
end
end
\ No newline at end of file
...@@ -2,8 +2,7 @@ class CreateProjectGaleries < ActiveRecord::Migration[5.0] ...@@ -2,8 +2,7 @@ class CreateProjectGaleries < ActiveRecord::Migration[5.0]
def change def change
create_table :project_galeries do |t| create_table :project_galeries do |t|
t.string :photo t.string :photo
t.string :name_uk t.string :name
t.string :name_en
t.references :project t.references :project
t.timestamps t.timestamps
end end
......
class CreateProjectQoutes < ActiveRecord::Migration[5.0] class CreateProjectQoutes < ActiveRecord::Migration[5.0]
def change def change
create_table :project_qoutes do |t| create_table :project_qoutes do |t|
t.text :text_over_quote_uk t.text :text_over_quote
t.text :text_over_quote_en
t.string :background_color_quote_text t.string :background_color_quote_text
t.string :icon t.string :icon
t.text :text_quote_uk
t.text :text_quote t.text :text_quote
t.text :text_below_quote_uk
t.text :text_below_quote t.text :text_below_quote
t.references :project t.references :project
t.timestamps t.timestamps
......
...@@ -2,8 +2,7 @@ class CreateProjectPhotos < ActiveRecord::Migration[5.0] ...@@ -2,8 +2,7 @@ class CreateProjectPhotos < ActiveRecord::Migration[5.0]
def change def change
create_table :project_photos do |t| create_table :project_photos do |t|
t.string :photo t.string :photo
t.string :title_uk t.string :title
t.string :title_en
t.references :project t.references :project
t.timestamps t.timestamps
end end
......
...@@ -2,8 +2,7 @@ class CreateProjectLinks < ActiveRecord::Migration[5.0] ...@@ -2,8 +2,7 @@ class CreateProjectLinks < ActiveRecord::Migration[5.0]
def change def change
create_table :project_links do |t| create_table :project_links do |t|
t.string :site t.string :site
t.string :title_uk t.string :title
t.string :title_en
t.references :project t.references :project
t.timestamps t.timestamps
end end
......
...@@ -3,8 +3,7 @@ class CreateProjectDocuments < ActiveRecord::Migration[5.0] ...@@ -3,8 +3,7 @@ class CreateProjectDocuments < ActiveRecord::Migration[5.0]
create_table :project_documents do |t| create_table :project_documents do |t|
t.string :document_uk t.string :document_uk
t.string :document_en t.string :document_en
t.string :document_name_uk t.string :document_name
t.string :document_name_en
t.references :project t.references :project
t.timestamps t.timestamps
end end
......
class CreateProjectVideos < ActiveRecord::Migration[5.0] class CreateProjectVideos < ActiveRecord::Migration[5.0]
def change def change
create_table :project_videos do |t| create_table :project_videos do |t|
t.string :title_uk t.string :title
t.string :title_en t.string :short
t.string :short_description_uk
t.string :short_description_en
t.string :video_file t.string :video_file
t.string :video_link t.string :video_link
t.string :description_uk t.string :description
t.string :description_en
t.references :project t.references :project
t.timestamps t.timestamps
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment