Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shop Engine initialization #949

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ruby File.open('.ruby-version').readline.chomp
#=== CORE =====================================================================
gem 'acts-as-taggable-on', git: 'https://github.com/Fodoj/acts-as-taggable-on', ref: 'rails-5.2'
gem 'carrierwave', '~> 1.2'
gem "mini_magick"
gem 'rmagick'
gem 'devise', '~> 4.7.1'
gem 'friendly_id', '~> 5.1'
gem 'kaminari'
Expand All @@ -23,6 +25,7 @@ gem 'sidekiq-scheduler', '~> 2.1.4'
gem 'simple_form'

gem 'courses', path: 'components/courses'
gem 'shop', path: 'components/shop'
gem 'ez-settings'

#=== CONFIG ===================================================================
Expand All @@ -38,8 +41,8 @@ gem 'autoprefixer-rails', '~> 7.1.6'
gem 'coffee-rails', '~> 4.2.1'
gem 'jquery-rails', '~> 4.2.2'
gem 'premailer-rails' # email inline styling
gem 'rails-assets-semantic-ui-calendar', source: 'https://rails-assets.org'
gem 'rails-assets-svgxuse', source: 'https://rails-assets.org'
gem 'rails-assets-semantic-ui-calendar', source: 'http://insecure.rails-assets.org'
gem 'rails-assets-svgxuse', source: 'http://insecure.rails-assets.org'
gem 'sass-rails', '~> 5.0'
gem 'semantic-ui-sass', '~> 2.2'
gem 'slim-rails'
Expand Down
20 changes: 18 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ PATH
courses (0.1.0)
friendly_id
kaminari
rails
rails (~> 5.2.2, >= 5.2.2.1)
simple_form
slim-rails

PATH
remote: components/shop
specs:
shop (0.1.0)
carrierwave (~> 1.2)
friendly_id
kaminari
rails (~> 5.2.2, >= 5.2.2.1)
simple_form
slim-rails

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
remote: http://insecure.rails-assets.org/
specs:
Ascii85 (1.0.3)
actioncable (5.2.5)
Expand Down Expand Up @@ -302,6 +313,7 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mini_magick (4.11.0)
mini_mime (1.1.0)
mini_portile2 (2.5.1)
minitest (5.14.4)
Expand Down Expand Up @@ -449,6 +461,7 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.4)
rmagick (4.2.2)
rollbar (2.19.4)
multi_json
rqrcode (1.1.2)
Expand Down Expand Up @@ -651,6 +664,7 @@ DEPENDENCIES
letter_opener
listen
meta_request
mini_magick
newrelic_rpm (~> 5.4)
oj (~> 3.7.11)
omniauth-facebook (~> 5.0)
Expand All @@ -673,6 +687,7 @@ DEPENDENCIES
recaptcha
redcarpet (~> 3.4.0)
redis (~> 3.2)
rmagick
rollbar (~> 2.19.3)
rspec
rspec-activemodel-mocks
Expand All @@ -684,6 +699,7 @@ DEPENDENCIES
rubocop-rspec
sass-rails (~> 5.0)
semantic-ui-sass (~> 2.2)
shop!
shoulda-matchers
sidekiq
sidekiq-scheduler (~> 2.1.4)
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/app/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
@import "pages/courses/form";
@import "pages/courses/seasons";

@import "pages/shop/items";

@import "pages/donate/form";

@import "pages/agenda/agenda";
Expand Down
89 changes: 89 additions & 0 deletions app/assets/stylesheets/app/pages/shop/_items.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.main{
max-width: 1200px;
margin: 0 auto;
}

h1 {
font-size: 24px;
font-weight: 400;
text-align: center;
}

img {
height: auto;
max-width: 100%;
vertical-align: middle;
}

.btn {
color: #ffffff;
padding: 0.8rem;
font-size: 14px;
text-transform: uppercase;
border-radius: 4px;
font-weight: 400;
display: block;
width: 100%;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, 0.2);
background: transparent;
}

.btn:hover {
background-color: rgba(255, 255, 255, 0.12);
}

.cards {
display: flex;
flex-wrap: wrap;
list-style: none;
margin: 0;
}

.cards_item {
display: flex;
padding: 1rem;
}

@media (min-width: 40rem) {
.cards_item {
width: 50%;
}
}

@media (min-width: 56rem) {
.cards_item {
width: 33.3333%;
}
}

.card {
background-color: white;
border-radius: 0.25rem;
box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.25);
display: flex;
flex-direction: column;
overflow: hidden;
}

.card_content {
padding: 1rem;
background: linear-gradient(to bottom left, #ce5739 40%, #FFC39E 100%);
}

.card_title {
color: #ffffff;
font-size: 1.1rem;
font-weight: 700;
letter-spacing: 1px;
text-transform: capitalize;
margin: 0px;
}

.card_text {
color: #ffffff;
font-size: 0.875rem;
line-height: 1.5;
margin-bottom: 1.25rem;
font-weight: 400;
}
4 changes: 4 additions & 0 deletions app/helpers/admin/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def admin_pages_link
link_to t('pages.plural'), admin_pages_path, class: class_for(:pages)
end

def admin_shop_link
link_to t('shop.singular'), admin_shop_items_path, class: class_for(:shop)
end

private

def class_for(item)
Expand Down
14 changes: 13 additions & 1 deletion app/uploaders/default_image_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
class DefaultImageUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
include CarrierWave::MiniMagick

version :small do
process resize_to_fill: [60, 60]
end

version :middle do
process resize_to_fill: [295, 295]
end

version :large do
process resize_to_fill: [1200, 1200]
end

# Choose what kind of storage to use for this uploader:
storage :file
Expand Down
4 changes: 4 additions & 0 deletions app/uploaders/item_image_uploader.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class ItemImageUploader < DefaultImageUploader
end
2 changes: 1 addition & 1 deletion app/views/layouts/admin/_navigation.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
= admin_email_templates_link
= admin_friends_link
= admin_pages_link

= admin_shop_link

// TOOD @VS: Move all menu items to registry. Or not ?
- Ez::Registry.data(:admin_primary_navigation).each do |menu_item|
Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/app/_header.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ header.pk-header class="#{header_classlist.compact.join(' ')}"
.pk-header__dropdown-list-wr
nav
ul.pk-list.pk-header__dropdown-list.js-dropdown-list
li.pk-list__unit.pk-header__li-list-wr
= link_to "shop", '/shop/items'
li.pk-list__unit.pk-header__li-list-wr
a = "info"
ul.pk-header__li-list
Expand Down
50 changes: 26 additions & 24 deletions components/courses/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PATH
courses (0.1.0)
friendly_id
kaminari
rails
rails (~> 5.2.2, >= 5.2.2.1)
simple_form
slim-rails

Expand Down Expand Up @@ -79,7 +79,7 @@ GEM
i18n (>= 0.7)
ffi (1.10.0)
formatador (0.2.5)
friendly_id (5.2.5)
friendly_id (5.4.2)
activerecord (>= 4.0.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
Expand All @@ -100,18 +100,18 @@ GEM
i18n (1.6.0)
concurrent-ruby (~> 1.0)
json (2.2.0)
kaminari (1.1.1)
kaminari (1.2.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
kaminari-actionview (= 1.2.1)
kaminari-activerecord (= 1.2.1)
kaminari-core (= 1.2.1)
kaminari-actionview (1.2.1)
actionview
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
kaminari-core (= 1.2.1)
kaminari-activerecord (1.2.1)
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
launchy (2.4.3)
addressable (~> 2.3)
listen (3.1.5)
Expand All @@ -127,12 +127,14 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
mimemagic (0.3.3)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
nenv (0.3.0)
nio4r (2.3.1)
nio4r (2.5.7)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
notiffany (0.1.1)
Expand Down Expand Up @@ -199,38 +201,38 @@ GEM
rspec-support (3.8.0)
ruby_dep (1.5.0)
shellany (0.0.1)
simple_form (4.1.0)
actionpack (>= 5.0)
activemodel (>= 5.0)
simple_form (5.1.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slim (4.0.1)
slim (4.1.0)
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
slim-rails (3.2.0)
actionpack (>= 3.1)
railties (>= 3.1)
slim (>= 3.0, < 5.0)
sprockets (3.7.2)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
temple (0.8.1)
temple (0.8.2)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
tilt (2.0.10)
tzinfo (1.2.5)
thread_safe (~> 0.1)
websocket-driver (0.7.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

Expand All @@ -250,4 +252,4 @@ DEPENDENCIES
sqlite3 (~> 1.3.6)

BUNDLED WITH
1.16.1
1.17.2
2 changes: 1 addition & 1 deletion components/courses/courses.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|

s.add_dependency 'friendly_id'
s.add_dependency 'kaminari'
s.add_dependency 'rails'
s.add_dependency 'rails', '~> 5.2.2', '>= 5.2.2.1'
s.add_dependency 'simple_form'
s.add_dependency 'slim-rails'

Expand Down
10 changes: 10 additions & 0 deletions components/shop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.bundle/
log/*.log
pkg/
spec/dummy/db/*.sqlite3
spec/dummy/db/*.sqlite3-journal
spec/dummy/log/*.log
spec/dummy/node_modules/
spec/dummy/yarn-error.log
spec/dummy/storage/
spec/dummy/tmp/
Loading