summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2017-09-02 22:46:07 +0000
committermo <mo.khan@gmail.com>2017-09-02 22:46:07 +0000
commit4d6fd17c8f1d7ee0ecb46e8323b61e4006bf39a4 (patch)
treee9d098503da331c6b50c339166d1dd8f4a7c3c5f
parent85b4e006052f51dfb7fb02ee1fe7d6914cb6b17c (diff)
parent6a6daa8c8d9223d6f3b29897bc23df386f28428b (diff)
Merge branch 'bootstrap' into 'master'
Bootstrap Closes #10 See merge request !2
-rw-r--r--.env.example4
-rw-r--r--Gemfile7
-rw-r--r--Gemfile.lock32
-rw-r--r--app/assets/javascripts/application.js18
-rw-r--r--app/assets/javascripts/backbone/templates/cakes/delete_modal.jst.ejs24
-rw-r--r--app/assets/javascripts/backbone/templates/cakes/edit.jst.ejs56
-rw-r--r--app/assets/javascripts/backbone/templates/cakes/new.jst.ejs26
-rw-r--r--app/assets/javascripts/backbone/templates/cakes/show.jst.ejs50
-rw-r--r--app/assets/javascripts/backbone/templates/cakes/thumbnail.jst.ejs11
-rw-r--r--app/assets/javascripts/backbone/templates/photos/new-modal.jst.ejs18
-rw-r--r--app/assets/javascripts/backbone/templates/profiles/show.jst.ejs59
-rw-r--r--app/assets/javascripts/backbone/templates/tutorials/new.jst.ejs33
-rw-r--r--app/assets/javascripts/backbone/views/cakes/index_view.js.coffee8
-rw-r--r--app/assets/javascripts/backbone/views/cakes/no_cakes_view.js.coffee5
-rw-r--r--app/assets/javascripts/backbone/views/cakes/thumbnail_view.js.coffee13
-rw-r--r--app/assets/javascripts/backbone/views/tutorials/index_view.js.coffee9
-rw-r--r--app/assets/javascripts/backbone/views/tutorials/no_tutorials_view.js.coffee5
-rw-r--r--app/assets/javascripts/backbone/views/tutorials/show_view.js.coffee7
-rw-r--r--app/assets/javascripts/backbone/views/tutorials/tutorial_view.js.coffee10
-rw-r--r--app/assets/javascripts/cakeside.js.coffee (renamed from app/assets/javascripts/backbone/cakeside.js.coffee)14
-rw-r--r--app/assets/javascripts/controllers/my/cakes_controller.js.coffee (renamed from app/assets/javascripts/backbone/controllers/cakes_controller.js.coffee)8
-rw-r--r--app/assets/javascripts/controllers/my/dashboard_controller.js.coffee (renamed from app/assets/javascripts/backbone/controllers/dashboard_controller.js.coffee)2
-rw-r--r--app/assets/javascripts/controllers/my/profile_controller.js.coffee (renamed from app/assets/javascripts/backbone/controllers/profile_controller.js.coffee)8
-rw-r--r--app/assets/javascripts/controllers/my/tutorials_controller.js.coffee (renamed from app/assets/javascripts/backbone/controllers/tutorials_controller.js.coffee)8
-rw-r--r--app/assets/javascripts/infrastructure/auto_view.js.coffee23
-rw-r--r--app/assets/javascripts/infrastructure/auto_view_setup.js.coffee8
-rw-r--r--app/assets/javascripts/infrastructure/behaviour.js.coffee12
-rw-r--r--app/assets/javascripts/infrastructure/infinite_scroll.js.coffee11
-rw-r--r--app/assets/javascripts/models/.gitkeep (renamed from app/assets/javascripts/backbone/models/.gitkeep)0
-rw-r--r--app/assets/javascripts/models/cake.js.coffee (renamed from app/assets/javascripts/backbone/models/cake.js.coffee)0
-rw-r--r--app/assets/javascripts/models/category.js.coffee (renamed from app/assets/javascripts/backbone/models/category.js.coffee)0
-rw-r--r--app/assets/javascripts/models/photo.js.coffee (renamed from app/assets/javascripts/backbone/models/photo.js.coffee)0
-rw-r--r--app/assets/javascripts/models/profile.js.coffee (renamed from app/assets/javascripts/backbone/models/profile.js.coffee)0
-rw-r--r--app/assets/javascripts/models/tutorials.js.coffee (renamed from app/assets/javascripts/backbone/models/tutorials.js.coffee)0
-rw-r--r--app/assets/javascripts/routers/.gitkeep (renamed from app/assets/javascripts/backbone/routers/.gitkeep)0
-rw-r--r--app/assets/javascripts/routers/cakes_router.js.coffee (renamed from app/assets/javascripts/backbone/routers/cakes_router.js.coffee)0
-rw-r--r--app/assets/javascripts/routers/dashboard_router.js.coffee (renamed from app/assets/javascripts/backbone/routers/dashboard_router.js.coffee)0
-rw-r--r--app/assets/javascripts/routers/profile_router.js.coffee (renamed from app/assets/javascripts/backbone/routers/profile_router.js.coffee)0
-rw-r--r--app/assets/javascripts/routers/tutorials_router.js.coffee (renamed from app/assets/javascripts/backbone/routers/tutorials_router.js.coffee)0
-rw-r--r--app/assets/javascripts/service/embedly_service.js.coffee2
-rw-r--r--app/assets/javascripts/templates/.gitkeep (renamed from app/assets/javascripts/backbone/templates/.gitkeep)0
-rw-r--r--app/assets/javascripts/templates/my/cakes/cake.jst.ejs (renamed from app/assets/javascripts/backbone/templates/cakes/cake.jst.ejs)0
-rw-r--r--app/assets/javascripts/templates/my/cakes/delete_modal.jst.ejs32
-rw-r--r--app/assets/javascripts/templates/my/cakes/edit.jst.ejs39
-rw-r--r--app/assets/javascripts/templates/my/cakes/new.jst.ejs18
-rw-r--r--app/assets/javascripts/templates/my/cakes/no_cakes.jst.ejs (renamed from app/assets/javascripts/backbone/templates/cakes/no_cakes.jst.ejs)0
-rw-r--r--app/assets/javascripts/templates/my/cakes/show.jst.ejs26
-rw-r--r--app/assets/javascripts/templates/my/cakes/thumbnail.jst.ejs8
-rw-r--r--app/assets/javascripts/templates/my/photos/new-modal.jst.ejs24
-rw-r--r--app/assets/javascripts/templates/my/profiles/show.jst.ejs45
-rw-r--r--app/assets/javascripts/templates/my/tutorials/new.jst.ejs23
-rw-r--r--app/assets/javascripts/templates/my/tutorials/no_tutorials.jst.ejs (renamed from app/assets/javascripts/backbone/templates/tutorials/no_tutorials.jst.ejs)0
-rw-r--r--app/assets/javascripts/templates/my/tutorials/show.jst.ejs (renamed from app/assets/javascripts/backbone/templates/tutorials/show.jst.ejs)4
-rw-r--r--app/assets/javascripts/templates/my/tutorials/tutorial.jst.ejs (renamed from app/assets/javascripts/backbone/templates/tutorials/tutorial.jst.ejs)2
-rw-r--r--app/assets/javascripts/views/.gitkeep (renamed from app/assets/javascripts/backbone/views/.gitkeep)0
-rw-r--r--app/assets/javascripts/views/cakes/show_page.js.coffee7
-rw-r--r--app/assets/javascripts/views/disqus_view.js.coffee (renamed from app/assets/javascripts/backbone/views/disqus_view.js.coffee)0
-rw-r--r--app/assets/javascripts/views/error_view.js.coffee (renamed from app/assets/javascripts/backbone/views/error_view.js.coffee)2
-rw-r--r--app/assets/javascripts/views/index.js.coffee9
-rw-r--r--app/assets/javascripts/views/my/cakes/cake_view.js.coffee (renamed from app/assets/javascripts/backbone/views/cakes/cake_view.js.coffee)6
-rw-r--r--app/assets/javascripts/views/my/cakes/delete_cake_modal_view.js.coffee (renamed from app/assets/javascripts/backbone/views/cakes/delete_cake_modal_view.js.coffee)6
-rw-r--r--app/assets/javascripts/views/my/cakes/edit_view.js.coffee (renamed from app/assets/javascripts/backbone/views/cakes/edit_view.js.coffee)11
-rw-r--r--app/assets/javascripts/views/my/cakes/index_view.js.coffee7
-rw-r--r--app/assets/javascripts/views/my/cakes/new_view.js.coffee (renamed from app/assets/javascripts/backbone/views/cakes/new_view.js.coffee)6
-rw-r--r--app/assets/javascripts/views/my/cakes/no_cakes_view.js.coffee3
-rw-r--r--app/assets/javascripts/views/my/cakes/show_view.js.coffee (renamed from app/assets/javascripts/backbone/views/cakes/show_view.js.coffee)11
-rw-r--r--app/assets/javascripts/views/my/cakes/thumbnail_view.js.coffee11
-rw-r--r--app/assets/javascripts/views/my/photos/new_modal_view.js.coffee (renamed from app/assets/javascripts/backbone/views/photos/new_modal_view.js.coffee)9
-rw-r--r--app/assets/javascripts/views/my/profiles/show_view.js.coffee (renamed from app/assets/javascripts/backbone/views/profiles/show_view.js.coffee)17
-rw-r--r--app/assets/javascripts/views/my/tutorials/index_view.js.coffee8
-rw-r--r--app/assets/javascripts/views/my/tutorials/new_view.js.coffee (renamed from app/assets/javascripts/backbone/views/tutorials/new_view.js.coffee)7
-rw-r--r--app/assets/javascripts/views/my/tutorials/no_tutorials_view.js.coffee3
-rw-r--r--app/assets/javascripts/views/my/tutorials/show_view.js.coffee5
-rw-r--r--app/assets/javascripts/views/my/tutorials/tutorial_view.js.coffee8
-rw-r--r--app/assets/stylesheets/application.css.scss5
-rw-r--r--app/assets/stylesheets/custom.css.scss110
-rw-r--r--app/assets/stylesheets/my-kitchens.css.scss5
-rw-r--r--app/controllers/admin/blobs_controller.rb22
-rw-r--r--app/controllers/admin/charts_controller.rb6
-rw-r--r--app/controllers/admin/photos_controller.rb2
-rw-r--r--app/controllers/admin/subscriptions_controller.rb9
-rw-r--r--app/controllers/favorites_controller.rb5
-rw-r--r--app/controllers/photos_controller.rb11
-rw-r--r--app/controllers/tutorial_tags_controller.rb4
-rw-r--r--app/helpers/application_helper.rb15
-rw-r--r--app/models/subscription.rb15
-rw-r--r--app/models/user.rb1
-rw-r--r--app/views/admin/activities/_comment.html.erb18
-rw-r--r--app/views/admin/activities/_favorite.html.erb21
-rw-r--r--app/views/admin/activities/index.html.erb14
-rw-r--r--app/views/admin/blobs/index.html.erb24
-rw-r--r--app/views/admin/blobs/show.html.erb30
-rw-r--r--app/views/admin/charts/index.html.erb24
-rw-r--r--app/views/admin/errors/index.html.erb6
-rw-r--r--app/views/admin/jobs/index.html.erb10
-rw-r--r--app/views/admin/jobs/show.html.erb6
-rw-r--r--app/views/admin/photos/index.html.erb58
-rw-r--r--app/views/admin/photos/show.html.erb6
-rw-r--r--app/views/admin/products/_index.html.erb2
-rw-r--r--app/views/admin/products/index.html.erb8
-rw-r--r--app/views/admin/products/show.html.erb11
-rw-r--r--app/views/admin/sessions/index.html.erb6
-rw-r--r--app/views/admin/subscriptions/index.html.erb26
-rw-r--r--app/views/admin/users/_edit_modal.html.erb106
-rw-r--r--app/views/admin/users/_index.html.erb12
-rw-r--r--app/views/admin/users/index.html.erb6
-rw-r--r--app/views/admin/users/show.html.erb10
-rw-r--r--app/views/cakes/_index.html.erb29
-rw-r--r--app/views/cakes/_show.html.erb31
-rw-r--r--app/views/cakes/index.html.erb41
-rw-r--r--app/views/cakes/show.html.erb20
-rw-r--r--app/views/favorites/index.html.erb21
-rw-r--r--app/views/kaminari/_first_page.html.erb4
-rw-r--r--app/views/kaminari/_gap.html.erb2
-rw-r--r--app/views/kaminari/_last_page.html.erb4
-rw-r--r--app/views/kaminari/_next_page.html.erb4
-rw-r--r--app/views/kaminari/_page.html.erb4
-rw-r--r--app/views/kaminari/_paginator.html.erb6
-rw-r--r--app/views/kaminari/_prev_page.html.erb4
-rw-r--r--app/views/layouts/_footer.html.erb61
-rw-r--r--app/views/layouts/_header.html.erb104
-rw-r--r--app/views/layouts/_messages.html.erb21
-rw-r--r--app/views/layouts/application.html.erb13
-rw-r--r--app/views/my/avatars/new.html.erb18
-rw-r--r--app/views/my/dashboard/_creation.html.erb15
-rw-r--r--app/views/my/dashboard/_tutorial.html.erb6
-rw-r--r--app/views/my/dashboard/index.html.erb25
-rw-r--r--app/views/my/favorites/index.html.erb37
-rw-r--r--app/views/my/kitchens/show.html.erb6
-rw-r--r--app/views/my/passwords/index.html.erb40
-rw-r--r--app/views/my/settings/index.html.erb70
-rw-r--r--app/views/my/shared/_my_nav.html.erb62
-rw-r--r--app/views/passwords/edit.html.erb24
-rw-r--r--app/views/passwords/new.html.erb21
-rw-r--r--app/views/photos/index.html.erb27
-rw-r--r--app/views/photos/show.html.erb22
-rw-r--r--app/views/products/_index.html.erb2
-rw-r--r--app/views/products/index.html.erb5
-rw-r--r--app/views/products/show.html.erb13
-rw-r--r--app/views/profiles/_index.html.erb31
-rw-r--r--app/views/profiles/index.html.erb6
-rw-r--r--app/views/profiles/show.html.erb33
-rw-r--r--app/views/search/index.html.erb168
-rw-r--r--app/views/sessions/new.html.erb95
-rw-r--r--app/views/shared/_account_nav.html.erb27
-rw-r--r--app/views/shared/_paging.html.erb4
-rw-r--r--app/views/tutorial_tags/index.html.erb8
-rw-r--r--app/views/tutorial_tags/show.html.erb36
-rw-r--r--app/views/tutorials/index.html.erb36
-rw-r--r--app/views/tutorials/show.html.erb34
-rw-r--r--config/initializers/mailchimp.rb3
-rw-r--r--config/locales/controllers/sessions/en.yml2
-rw-r--r--config/locales/en.yml20
-rw-r--r--config/routes.rb16
-rw-r--r--db/schema.rb124
-rw-r--r--spec/controllers/favorites_controller_spec.rb14
-rw-r--r--spec/controllers/photos_controller_spec.rb36
-rw-r--r--spec/features/add_to_favorites_spec.rb13
-rw-r--r--spec/features/change_password_spec.rb23
-rw-r--r--spec/features/change_profile_settings_spec.rb23
-rw-r--r--spec/features/registration_spec.rb20
-rw-r--r--spec/features/sessions_spec.rb2
-rw-r--r--spec/features/upload_avatar_spec.rb15
-rw-r--r--spec/javascripts/backbone/views/cake_view_spec.js.coffee4
-rw-r--r--spec/rails_helper.rb1
-rw-r--r--spec/routing/favorites_routing_spec.rb10
-rw-r--r--spec/support/authentication.rb6
-rw-r--r--spec/support/pages/dashboard_page.rb2
-rw-r--r--spec/support/pages/login_page.rb4
-rw-r--r--vendor/assets/javascripts/popper.min.js5
170 files changed, 1203 insertions, 1842 deletions
diff --git a/.env.example b/.env.example
index bb203d94..9eeb300d 100644
--- a/.env.example
+++ b/.env.example
@@ -15,10 +15,6 @@ EXCEPTION_EMAIL_ADDRESS=?@cakeside.com
FACEBOOK_APP_ID=''
FOG_DIRECTORY=cakeside_local
GOOGLE_ANALYTICS=''
-MAILCHIMP_API_KEY=''
-MAILCHIMP_LIST_ID=''
-MIXPANEL_API_KEY=''
-NEWRELIC_KEY=''
SMTP_DOMAIN=''
SMTP_HOST=''
SMTP_PASSWORD=''
diff --git a/Gemfile b/Gemfile
index c249998f..7b83df37 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,7 +5,6 @@ gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
-gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'bcrypt', '~> 3.1.7'
gem 'json', '~> 2.1.0'
@@ -14,7 +13,6 @@ gem 'json', '~> 2.1.0'
gem 'acts-as-taggable-on'
gem 'jquery-ui-rails', '~> 4.0.0'
-gem 'jquery-turbolinks'
gem 'mini_magick'
gem "kaminari"
gem 'delayed_job_active_record'
@@ -24,7 +22,6 @@ gem 'asset_sync', '~> 2.0.0'
gem 'fog-aws'
gem 'unf'
gem 'exception_notification'
-gem 'gibbon'
gem 'twitter'
gem 'spank'
gem 'exifr'
@@ -38,12 +35,10 @@ gem 'browser_sniffer'
gem 'asin'
gem 'curb'
gem 'github-markdown'
-gem 'chartkick'
-gem 'groupdate'
gem 'rack-cors', require: 'rack/cors'
gem 'email_validator'
gem 'font-awesome-rails'
-gem 'bootstrap-sass', '~> 2.3.0'
+gem 'bootstrap', '4.0.0.beta'
group :development do
gem 'better_errors'
diff --git a/Gemfile.lock b/Gemfile.lock
index f2a02b5b..cfe3170e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -52,6 +52,8 @@ GEM
mime-types
unf
ast (2.3.0)
+ autoprefixer-rails (7.1.3)
+ execjs
aws-partitions (1.16.0)
aws-sdk (3.0.0)
aws-sdk-resources (~> 3)
@@ -486,8 +488,10 @@ GEM
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
- bootstrap-sass (2.3.2.2)
- sass (~> 3.2)
+ bootstrap (4.0.0.beta)
+ autoprefixer-rails (>= 6.0.3)
+ popper_js (~> 1.11.1)
+ sass (>= 3.4.19)
browser_sniffer (1.0.13)
buftok (0.2.0)
builder (3.2.3)
@@ -517,7 +521,6 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- chartkick (2.2.4)
chef (12.21.4)
addressable
bundler (>= 1.10)
@@ -638,14 +641,9 @@ GEM
formatador (0.2.5)
fuzzyurl (0.9.0)
geoip (1.6.3)
- gibbon (3.1.0)
- faraday (>= 0.9.1)
- multi_json (>= 1.11.0)
github-markdown (0.6.9)
globalid (0.4.0)
activesupport (>= 4.2.0)
- groupdate (3.2.0)
- activesupport (>= 3)
hashie (3.5.6)
highline (1.7.8)
http (2.2.2)
@@ -681,9 +679,6 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- jquery-turbolinks (2.1.0)
- railties (>= 3.1.0)
- turbolinks
jquery-ui-rails (4.0.5)
railties (>= 3.1.0)
js-routes (1.4.0)
@@ -766,6 +761,7 @@ GEM
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
+ popper_js (1.11.1)
proxifier (1.0.3)
pry (0.10.4)
coderay (~> 1.1.0)
@@ -880,7 +876,7 @@ GEM
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sprockets-rails (3.2.0)
+ sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
@@ -899,9 +895,6 @@ GEM
thread (0.2.2)
thread_safe (0.3.6)
tilt (2.0.8)
- turbolinks (5.0.1)
- turbolinks-source (~> 5)
- turbolinks-source (5.0.3)
twitter (6.1.0)
addressable (~> 2.5)
buftok (~> 0.2.0)
@@ -948,7 +941,7 @@ DEPENDENCIES
bcrypt (~> 3.1.7)
better_errors
binding_of_caller
- bootstrap-sass (~> 2.3.0)
+ bootstrap (= 4.0.0.beta)
browser_sniffer
bullet
byebug
@@ -956,7 +949,6 @@ DEPENDENCIES
capistrano-bundler (~> 1.1)
capistrano-rails
capistrano-rbenv (~> 2.0)
- chartkick
chef
coffee-rails (~> 4.1.0)
curb
@@ -975,13 +967,10 @@ DEPENDENCIES
font-awesome-rails
foreman
geoip
- gibbon
github-markdown
- groupdate
i18n-tasks
jbuilder (~> 2.0)
jquery-rails
- jquery-turbolinks
jquery-ui-rails (~> 4.0.0)
js-routes
json (~> 2.1.0)
@@ -1004,7 +993,6 @@ DEPENDENCIES
spring
spring-commands-rspec
teaspoon-jasmine (~> 2.3.4)
- turbolinks
twitter
uglifier (>= 1.3.0)
unf
@@ -1012,4 +1000,4 @@ DEPENDENCIES
web-console (~> 2.0)
BUNDLED WITH
- 1.14.6
+ 1.15.4
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 1f73af92..88e4080e 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -1,11 +1,10 @@
//= require jquery
-//= require jquery.turbolinks
//= require jquery_ujs
-//= require turbolinks
//= require jquery.ui.all
//= require jquery.validate
//= require jquery.embedly
//= require tag-it
+//= require popper
//= require bootstrap
//= require bootstrap-multiselect
//= require underscore
@@ -14,17 +13,8 @@
//= require backbone.marionette
//= require backbone_rails_sync
//= require backbone_datalink
-//= require backbone/cakeside
//= require backbone-model-file-upload
-//= require_tree .
+//= require cakeside
+//= require_self
-var initialize = function(){
- $('.tooltip-item').tooltip();
- $(window).scroll(function(){
- if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.8){
- $('.more-button').trigger('click');
- }
- });
-};
-$(document).ready(initialize);
-$(document).on("page:load", initialize);
+CakeSide.Behaviour.install();
diff --git a/app/assets/javascripts/backbone/templates/cakes/delete_modal.jst.ejs b/app/assets/javascripts/backbone/templates/cakes/delete_modal.jst.ejs
deleted file mode 100644
index 30d53f86..00000000
--- a/app/assets/javascripts/backbone/templates/cakes/delete_modal.jst.ejs
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h2>Are you ABSOLUTELY sure?</h2>
-</div>
-<div class="modal-body">
- <% if (hasError()) { %>
- <div class="alert">
- <button type="button" class="close" data-dismiss="alert">&times</button>
- <strong>Error!</strong> <%= errorMessage %>
- </div>
- <% } %>
- <p>
- This action <b>CANNOT</b> be undone.
- This will permanently delete <b><%= name %></b> photos, and comments.
- </p>
- <p>
- Please type in the name of the cake to confirm.
- <input id="confirmation-textbox" type="text" class="input-xxlarge" autofocus="" required="" aria-label="Type in the name of the cake to confirm that you want to delete this repository.">
- </p>
-</div>
-<div class="modal-footer">
- <a href="#" class="btn" data-dismiss="modal">Cancel</a>
- <button id="remove-button" type="submit" class="btn btn-danger" disabled="disabled">I understand the consequences, delete this cake</button>
-</div>
diff --git a/app/assets/javascripts/backbone/templates/cakes/edit.jst.ejs b/app/assets/javascripts/backbone/templates/cakes/edit.jst.ejs
deleted file mode 100644
index e589075f..00000000
--- a/app/assets/javascripts/backbone/templates/cakes/edit.jst.ejs
+++ /dev/null
@@ -1,56 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <h1><small>Edit</small> <%= cake.name %></h1>
- <hr />
- <form id="edit-cake" name="cake" class="form-horizontal">
- <fieldset>
- <div class="control-group">
- <label class="control-label"></label>
- <div class="controls">
- <a class="btn btn-primary add-photo">Upload Photo...</a>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="cake_name">Name*</label>
- <div class="controls">
- <input class="input-xxlarge" id="cake_name" name="name" type="text" value="<%= cake.name %>" />
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">Category</label>
- <div class="controls">
- <select id="cake_category_id" name="category_id">
- <% _.each(categories, function(category) { %>
- <option value="<%= category.id %>"><%= category.name %></option>
- <% }); %>
- </select>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="cake_story">Description</label>
- <div class="controls">
- <textarea class="input-xxlarge" id="cake_story" name="story" rows="3"><%= cake.story %></textarea>
- </div>
- </div>
- <div class="control-group">
- <label for="cake_tags" class="control-label">Tags</label>
- <div class="controls">
- <% if (typeof(cake.tags) === "string") { %>
- <% tags = _.map(cake.tags.split(','), function(x){ return x; }) %>
- <% } else { %>
- <% tags = _.map(cake.tags, function(x){ return x.name; }) %>
- <% } %>
- <input name="cake_tags" type="text" id="cake_tags" value="<%= tags %>" class="input-xxlarge" autocomplete="off" />
- </div>
- </div>
- <div class="form-actions">
- <button id='save-button' type="submit" class="btn btn-primary">Publish</button>
- <a href="#cakes/<%= cake.id %>" class="btn">Cancel</a>
- </div>
- </fieldset>
- </form>
- </div>
-</div>
-<div class="row-fluid">
- <ul class="thumbnails"></ul>
-</div>
diff --git a/app/assets/javascripts/backbone/templates/cakes/new.jst.ejs b/app/assets/javascripts/backbone/templates/cakes/new.jst.ejs
deleted file mode 100644
index ad14b2a8..00000000
--- a/app/assets/javascripts/backbone/templates/cakes/new.jst.ejs
+++ /dev/null
@@ -1,26 +0,0 @@
-<h1>Share cake</h1>
-<hr />
-<form id="new-cake" name="cake" class="form-horizontal">
- <fieldset>
- <div class="control-group">
- <label class="control-label" for="cake_name">Name*</label>
- <div class="controls">
- <input class="input-xxlarge" id="cake_name" name="name" type="text">
- </div>
- </div>
- <div class="control-group">
- <label class="control-label">Category</label>
- <div class="controls">
- <select id="cake_category_id" name="category_id">
- <% _.each(categories, function(category) { %>
- <option value="<%= category.id %>"><%= category.name %></option>
- <% }); %>
- </select>
- </div>
- </div>
- <div class="form-actions">
- <button id='save-button' type="submit" class="btn btn-primary">Create</button>
- <a href="#cakes" class="btn">Cancel</a>
- </div>
- </fieldset>
-</form>
diff --git a/app/assets/javascripts/backbone/templates/cakes/show.jst.ejs b/app/assets/javascripts/backbone/templates/cakes/show.jst.ejs
deleted file mode 100644
index 6a32afdf..00000000
--- a/app/assets/javascripts/backbone/templates/cakes/show.jst.ejs
+++ /dev/null
@@ -1,50 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <p>
- <a href="#cakes/<%= id %>/edit" class="btn">
- <i class="icon-edit"></i> <strong>Edit</strong>
- </a>
- <a class="btn add-photo">
- <i class="icon-plus"></i><strong>Add Photo</strong>
- </a>
- <a href="<%= Routes.cake_favorites_path(id) %>" class="btn">
- <i class="icon-heart"></i> <strong>Fan Club</strong>
- </a>
- <a id="remove-cake-button" class="btn btn-danger pull-right">
- <i class="icon-white icon-remove"></i> <strong>Delete this cake</strong>
- </a>
- </p>
- </div>
-</div>
-<div class="row-fluid">
- <div class="span6">
- <% if (hasImage()) { %>
- <% photo = randomPhoto()%>
- <a href="#cakes/<%= id %>/photos/<%= photo.id %>">
- <img class="thumbnail" src="<%= photo.large_url %>" alt="<%= name %>" />
- </a>
- <% } %>
- </div>
- <div class="span6">
- <h1><a href="#cakes/<%= id %>"><%= name %></a></h1>
- <span> <i class="icon-tags"></i> </span>
- <% if (typeof(tags) === "string") { %>
- <% _.each(tags.split(','), function(tag){ %>
- <a href="<%= Routes.creation_tag_path(tag) %>">
- <span class="label"><%= tag %></span>
- </a>
- <% }); %>
- <% } else { %>
- <% _.each(tags, function(tag){ %>
- <a href="<%= Routes.creation_tag_path(tag.name) %>">
- <span class="label"><%= tag.name %></span>
- </a>
- <% }); %>
- <% } %>
- <hr />
- <p><%= story %></p>
- </div>
-</div>
-<div class="row-fluid">
- <ul class="thumbnails"></ul>
-</div>
diff --git a/app/assets/javascripts/backbone/templates/cakes/thumbnail.jst.ejs b/app/assets/javascripts/backbone/templates/cakes/thumbnail.jst.ejs
deleted file mode 100644
index 66533081..00000000
--- a/app/assets/javascripts/backbone/templates/cakes/thumbnail.jst.ejs
+++ /dev/null
@@ -1,11 +0,0 @@
-<div class="thumbnail">
- <% if (uploading()) { %>
- <div class="progress progress-striped active">
- <div class="bar" style="width: <%= percentComplete %>%;"></div>
- </div>
- <% } else { %>
- <a href="#cakes/<%= cake_id %>/photos/<%= id %>">
- <img src="<%= thumb_url %>" />
- </a>
- <% } %>
-</div>
diff --git a/app/assets/javascripts/backbone/templates/photos/new-modal.jst.ejs b/app/assets/javascripts/backbone/templates/photos/new-modal.jst.ejs
deleted file mode 100644
index 7f7a7dfb..00000000
--- a/app/assets/javascripts/backbone/templates/photos/new-modal.jst.ejs
+++ /dev/null
@@ -1,18 +0,0 @@
-<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4>Upload Photo</h4>
-</div>
-<div class="modal-body">
- <span class="btn btn-default btn-file">
- + Browse... <input id="photo-attachment" name="attachment" type="file" accept="image/*">
- </span>
- <p class='pull-right'>
- <input id="watermark" name="watermark" maxlength="30" size="30" type="text" placeholder="watermark" /> on CakeSide.com
- <a class="tooltip-item" data-placement="right" rel="tooltip" href="#" data-original-title="Watermark your name or company on each uploaded image" data-animation="true"><i class="icon-question-sign"></i></a>
- </p>
- <img id="preview-image" src="#" alt="your image" class="hide hidden-phone" />
-</div>
-<div class="modal-footer">
- <a href="#" class="btn" data-dismiss="modal">Cancel</a>
- <button id="upload-photo-button" type="submit" class="btn btn-primary">Upload Photo</button>
-</div>
diff --git a/app/assets/javascripts/backbone/templates/profiles/show.jst.ejs b/app/assets/javascripts/backbone/templates/profiles/show.jst.ejs
deleted file mode 100644
index 5a9903f2..00000000
--- a/app/assets/javascripts/backbone/templates/profiles/show.jst.ejs
+++ /dev/null
@@ -1,59 +0,0 @@
-<h1>Public Profile</h1>
-<hr />
-<div id="status-message" class="alert alert-error hidden">
- <a class="close" data-dismiss="alert" href="#">×</a>
-</div>
-<form id="profile-form" class="form-horizontal">
- <fieldset>
- <div class="control-group">
- <label class="control-label" for="user_name">Name</label>
- <div class="controls">
- <input class="input-xlarge" id="user_name" name="user[name]" type="text" value="<%= name %>">
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="user_email">Email</label>
- <div class="controls">
- <input class="input-xlarge" id="user_email" name="user[email]" type="email" value="<%= email %>">
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="user_website">URL</label>
- <div class="controls">
- <input class="input-xlarge url" id="user_website" name="user[website]" placeholder="https://www.cakeside.com" type="url" value="<%= website %>">
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="user_city">Location</label>
- <div class="controls">
- <input class="input-xlarge" id="user_city" name="user[city]" type="text" value="<%= city %>">
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="user_twitter">Twitter username</label>
- <div class="controls">
- <div class="input-prepend">
- <span class="add-on">@</span>
- <input class="input-xlarge" id="user_twitter" maxlength="15" name="user[twitter]" placeholder="without the @ sign" size="255" type="text" value="<%= twitter %>">
- </div>
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <label class="control-label" for="user_facebook">Facebook</label>
- <div class="controls">
- <input class="input-xlarge" id="user_facebook" maxlength="255" name="user[facebook]" placeholder="http://www.facebook.com/your_profile" size="255" type="text" value="<%= facebook %>">
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="form-actions">
- <input id="save-button" type="submit" class="btn btn-primary" value="Update profile">
- <button id="cancel-button" type="reset" class="btn">Cancel</button>
- </div>
- </fieldset>
-</form>
-
diff --git a/app/assets/javascripts/backbone/templates/tutorials/new.jst.ejs b/app/assets/javascripts/backbone/templates/tutorials/new.jst.ejs
deleted file mode 100644
index 16bc5fed..00000000
--- a/app/assets/javascripts/backbone/templates/tutorials/new.jst.ejs
+++ /dev/null
@@ -1,33 +0,0 @@
-<h1>Share a tutorial link</h1>
-<hr />
-<form id="new-tutorial" name='tutorial' class='form-horizontal'>
- <fieldset>
- <div id="url-group" class="control-group">
- <label class="control-label" for="tutorial_url">Tutorial URL</label>
- <div class="controls">
- <input class="input-xxlarge" id="tutorial_url" name="url" type="text" value="<%= url %>" placeholder="http://www.cakeside.com/" autofocus>
- </div>
- </div>
- <div class="control-group">
- <label for="tags" class="control-label">Tags</label>
- <div class="controls">
- <input type="text" id="tutorial_tags" name="tags" value="" class="input-xxlarge" autocomplete="off" />
- <p class="help-block">
- Note: help people find this tutorial by adding some keyword tags
- </p>
- </div>
- </div>
- <div class="form-actions">
- <button id='save-button' type="submit" class="btn btn-primary">Save</button>
- <a href="#tutorials" class="btn">Cancel</a>
- </div>
- </fieldset>
-</form>
-<div id="preview-panel" class="thumbnail">
- <img class="embed-thumb" src="<%= image_url %>" />
- <div class="caption">
- <h3 class="tutorial-heading"><%= heading %></h3>
- <p id="tag-list"></p>
- <p class="tutorial-description"><%= description %></p>
- </div>
-</div>
diff --git a/app/assets/javascripts/backbone/views/cakes/index_view.js.coffee b/app/assets/javascripts/backbone/views/cakes/index_view.js.coffee
deleted file mode 100644
index 6d6d2f9a..00000000
--- a/app/assets/javascripts/backbone/views/cakes/index_view.js.coffee
+++ /dev/null
@@ -1,8 +0,0 @@
-#= require backbone/views/cakes/no_cakes_view
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.IndexView extends Marionette.CollectionView
- childView: CakeSide.Views.Cakes.CakeView
- emptyView: CakeSide.Views.Cakes.NoCakesView
- className: ''
- tagName: 'div'
diff --git a/app/assets/javascripts/backbone/views/cakes/no_cakes_view.js.coffee b/app/assets/javascripts/backbone/views/cakes/no_cakes_view.js.coffee
deleted file mode 100644
index 278d7d37..00000000
--- a/app/assets/javascripts/backbone/views/cakes/no_cakes_view.js.coffee
+++ /dev/null
@@ -1,5 +0,0 @@
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.NoCakesView extends Marionette.ItemView
- template: JST["backbone/templates/cakes/no_cakes"]
- tagName: 'li'
diff --git a/app/assets/javascripts/backbone/views/cakes/thumbnail_view.js.coffee b/app/assets/javascripts/backbone/views/cakes/thumbnail_view.js.coffee
deleted file mode 100644
index 5e772232..00000000
--- a/app/assets/javascripts/backbone/views/cakes/thumbnail_view.js.coffee
+++ /dev/null
@@ -1,13 +0,0 @@
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.ThumbnailView extends Marionette.ItemView
- template: JST['backbone/templates/cakes/thumbnail']
- tagName: 'li'
- className: 'span2'
- modelEvents:
- 'sync': 'render'
- 'change:percentComplete': 'render'
-
- templateHelpers:
- uploading: ->
- typeof(@percentComplete) != "undefined" && @percentComplete != 100
diff --git a/app/assets/javascripts/backbone/views/tutorials/index_view.js.coffee b/app/assets/javascripts/backbone/views/tutorials/index_view.js.coffee
deleted file mode 100644
index 6cdce8db..00000000
--- a/app/assets/javascripts/backbone/views/tutorials/index_view.js.coffee
+++ /dev/null
@@ -1,9 +0,0 @@
-#= require backbone/views/tutorials/no_tutorials_view
-#= require backbone/views/tutorials/tutorial_view
-CakeSide.Views.Tutorials ||= {}
-
-class CakeSide.Views.Tutorials.IndexView extends Marionette.CollectionView
- childView: CakeSide.Views.Tutorials.TutorialView
- emptyView: CakeSide.Views.Tutorials.NoTutorialsView
- className: ''
- tagName: 'div'
diff --git a/app/assets/javascripts/backbone/views/tutorials/no_tutorials_view.js.coffee b/app/assets/javascripts/backbone/views/tutorials/no_tutorials_view.js.coffee
deleted file mode 100644
index 77b2e71c..00000000
--- a/app/assets/javascripts/backbone/views/tutorials/no_tutorials_view.js.coffee
+++ /dev/null
@@ -1,5 +0,0 @@
-CakeSide.Views.Tutorials ||= {}
-
-class CakeSide.Views.Tutorials.NoTutorialsView extends Marionette.ItemView
- template: JST['backbone/templates/tutorials/no_tutorials']
- tagName: 'li'
diff --git a/app/assets/javascripts/backbone/views/tutorials/show_view.js.coffee b/app/assets/javascripts/backbone/views/tutorials/show_view.js.coffee
deleted file mode 100644
index 9f6ef782..00000000
--- a/app/assets/javascripts/backbone/views/tutorials/show_view.js.coffee
+++ /dev/null
@@ -1,7 +0,0 @@
-CakeSide.Views.Tutorials ||= {}
-
-class CakeSide.Views.Tutorials.ShowView extends Marionette.ItemView
- template: JST["backbone/templates/tutorials/show"]
- templateHelpers:
- displayDate: (date) ->
- date
diff --git a/app/assets/javascripts/backbone/views/tutorials/tutorial_view.js.coffee b/app/assets/javascripts/backbone/views/tutorials/tutorial_view.js.coffee
deleted file mode 100644
index 2766b53e..00000000
--- a/app/assets/javascripts/backbone/views/tutorials/tutorial_view.js.coffee
+++ /dev/null
@@ -1,10 +0,0 @@
-CakeSide.Views.Tutorials ||= {}
-
-class CakeSide.Views.Tutorials.TutorialView extends Marionette.ItemView
- template: JST['backbone/templates/tutorials/tutorial']
- tagName: 'div'
- className: 'media'
-
- templateHelpers:
- displayDate: (date) ->
- new Date(date).toLocaleDateString()
diff --git a/app/assets/javascripts/backbone/cakeside.js.coffee b/app/assets/javascripts/cakeside.js.coffee
index 6f468e52..f49ccd22 100644
--- a/app/assets/javascripts/backbone/cakeside.js.coffee
+++ b/app/assets/javascripts/cakeside.js.coffee
@@ -1,16 +1,18 @@
#= require_self
+#= require_tree ./infrastructure
#= require_tree ./templates
#= require_tree ./models
-#= require_tree ./views
+#= require ./views
#= require_tree ./controllers
#= require_tree ./routers
+#= require_tree ./service
window.CakeSide =
Models: {}
Collections: {}
Routers: {}
Views: {}
- Controllers: {}
+ Controllers: { My: {} }
initialize: (data) ->
$(document).ajaxSend (event, xhr) ->
if data.access_token
@@ -23,13 +25,13 @@ window.CakeSide =
CakeSide.Application.addInitializer (options) ->
new CakeSide.Routers.CakesRouter
- controller: new CakeSide.Controllers.CakesController()
+ controller: new CakeSide.Controllers.My.CakesController()
new CakeSide.Routers.TutorialsRouter
- controller: new CakeSide.Controllers.TutorialsController()
+ controller: new CakeSide.Controllers.My.TutorialsController()
new CakeSide.Routers.DashboardRouter
- controller: new CakeSide.Controllers.DashboardController()
+ controller: new CakeSide.Controllers.My.DashboardController()
new CakeSide.Routers.ProfileRouter
- controller: new CakeSide.Controllers.ProfileController()
+ controller: new CakeSide.Controllers.My.ProfileController()
CakeSide.Application.on 'start', ->
if Backbone.history
diff --git a/app/assets/javascripts/backbone/controllers/cakes_controller.js.coffee b/app/assets/javascripts/controllers/my/cakes_controller.js.coffee
index 70d99253..6a56d6bc 100644
--- a/app/assets/javascripts/backbone/controllers/cakes_controller.js.coffee
+++ b/app/assets/javascripts/controllers/my/cakes_controller.js.coffee
@@ -1,5 +1,5 @@
-class CakeSide.Controllers.CakesController extends Marionette.Controller
- views: CakeSide.Views.Cakes
+class CakeSide.Controllers.My.CakesController extends Marionette.Controller
+ views: CakeSide.Views.My.Cakes
initialize: (options) ->
@content_region = CakeSide.Application.content_region
@cakes = CakeSide.Application.request('CakesRepository')
@@ -30,5 +30,5 @@ class CakeSide.Controllers.CakesController extends Marionette.Controller
#@comment_view.hide()
selectTab: ->
- $('.nav-list').children().removeClass('active')
- $('#cakes-tab').addClass('active')
+ $('.nav-link').removeClass('active')
+ $('a[href="/my#cakes/new"]').addClass('active')
diff --git a/app/assets/javascripts/backbone/controllers/dashboard_controller.js.coffee b/app/assets/javascripts/controllers/my/dashboard_controller.js.coffee
index 23169914..734aedc9 100644
--- a/app/assets/javascripts/backbone/controllers/dashboard_controller.js.coffee
+++ b/app/assets/javascripts/controllers/my/dashboard_controller.js.coffee
@@ -1,4 +1,4 @@
-class CakeSide.Controllers.DashboardController extends Marionette.Controller
+class CakeSide.Controllers.My.DashboardController extends Marionette.Controller
initialize: (options) ->
#@comment_view = CakeSide.Application.request('CommentView')
diff --git a/app/assets/javascripts/backbone/controllers/profile_controller.js.coffee b/app/assets/javascripts/controllers/my/profile_controller.js.coffee
index 984cf4d7..c429c035 100644
--- a/app/assets/javascripts/backbone/controllers/profile_controller.js.coffee
+++ b/app/assets/javascripts/controllers/my/profile_controller.js.coffee
@@ -1,5 +1,5 @@
-class CakeSide.Controllers.ProfileController extends Marionette.Controller
- views: CakeSide.Views.Profiles
+class CakeSide.Controllers.My.ProfileController extends Marionette.Controller
+ views: CakeSide.Views.My.Profiles
initialize: (options) ->
@content_region = CakeSide.Application.content_region
#@comment_view = CakeSide.Application.request('CommentView')
@@ -14,5 +14,5 @@ class CakeSide.Controllers.ProfileController extends Marionette.Controller
@content_region.show(new @views.ShowView(model: profile))
selectTab: ->
- $('.nav-list').children().removeClass('active')
- $('#profile-tab').addClass('active')
+ $('.nav-link').removeClass('active')
+ $('a[href="/my#profile/me"]').addClass('active')
diff --git a/app/assets/javascripts/backbone/controllers/tutorials_controller.js.coffee b/app/assets/javascripts/controllers/my/tutorials_controller.js.coffee
index 5f1997c4..dcee92d5 100644
--- a/app/assets/javascripts/backbone/controllers/tutorials_controller.js.coffee
+++ b/app/assets/javascripts/controllers/my/tutorials_controller.js.coffee
@@ -1,5 +1,5 @@
-class CakeSide.Controllers.TutorialsController extends Marionette.Controller
- views: CakeSide.Views.Tutorials
+class CakeSide.Controllers.My.TutorialsController extends Marionette.Controller
+ views: CakeSide.Views.My.Tutorials
initialize: (options) ->
@content_region = CakeSide.Application.content_region
@tutorials = CakeSide.Application.request('TutorialsRepository')
@@ -25,5 +25,5 @@ class CakeSide.Controllers.TutorialsController extends Marionette.Controller
#url: tutorial.get('url')
selectTab: ->
- $('.nav-list').children().removeClass('active')
- $('#tutorial-tab').addClass('active')
+ $('.nav-link').removeClass('active')
+ $('a[href="/my#tutorials/new"]').addClass('active')
diff --git a/app/assets/javascripts/infrastructure/auto_view.js.coffee b/app/assets/javascripts/infrastructure/auto_view.js.coffee
new file mode 100644
index 00000000..4966221a
--- /dev/null
+++ b/app/assets/javascripts/infrastructure/auto_view.js.coffee
@@ -0,0 +1,23 @@
+class CakeSide.AutoView extends Backbone.View
+ @views: {}
+ @constructors: {}
+
+ @viewName: (name) ->
+ @constructors[name] = this
+ @::name = name
+
+ @install: (element) ->
+ name = $(element).data('autoview')
+ constructor = @constructors[name]
+ if constructor == undefined
+ console.error("Could not find autoview for #{name}")
+ return
+
+ view = new constructor
+ el: element
+ $el: $(element)
+ view.render()
+ @views[name] ?= []
+ @views[name].push(view)
+
+ render: -> { }
diff --git a/app/assets/javascripts/infrastructure/auto_view_setup.js.coffee b/app/assets/javascripts/infrastructure/auto_view_setup.js.coffee
new file mode 100644
index 00000000..c0d71fe2
--- /dev/null
+++ b/app/assets/javascripts/infrastructure/auto_view_setup.js.coffee
@@ -0,0 +1,8 @@
+#= require ./behaviour
+
+class CakeSide.AutoViewSetup extends CakeSide.Behaviour
+ @on "load"
+
+ execute: ->
+ for element in $('[data-autoview]')
+ CakeSide.AutoView.install(element)
diff --git a/app/assets/javascripts/infrastructure/behaviour.js.coffee b/app/assets/javascripts/infrastructure/behaviour.js.coffee
new file mode 100644
index 00000000..a5354e25
--- /dev/null
+++ b/app/assets/javascripts/infrastructure/behaviour.js.coffee
@@ -0,0 +1,12 @@
+class CakeSide.Behaviour
+ @events: {}
+
+ @on: (event) ->
+ @events[event] ?= []
+ @events[event].push(@)
+
+ @install: ->
+ for event of @events
+ window.addEventListener event, () =>
+ for behaviour in @events[event]
+ new behaviour().execute()
diff --git a/app/assets/javascripts/infrastructure/infinite_scroll.js.coffee b/app/assets/javascripts/infrastructure/infinite_scroll.js.coffee
new file mode 100644
index 00000000..ab7d2b61
--- /dev/null
+++ b/app/assets/javascripts/infrastructure/infinite_scroll.js.coffee
@@ -0,0 +1,11 @@
+#= require ./behaviour
+
+class CakeSide.InfiniteScroll extends CakeSide.Behaviour
+ @on "scroll"
+
+ execute: ->
+ $moreButton = $('[data-infinite-scroll]')
+ return if $moreButton.length == 0
+
+ if $(window).scrollTop() >= ($(document).height() - $(window).height())*0.8
+ $moreButton.trigger('click')
diff --git a/app/assets/javascripts/backbone/models/.gitkeep b/app/assets/javascripts/models/.gitkeep
index e69de29b..e69de29b 100644
--- a/app/assets/javascripts/backbone/models/.gitkeep
+++ b/app/assets/javascripts/models/.gitkeep
diff --git a/app/assets/javascripts/backbone/models/cake.js.coffee b/app/assets/javascripts/models/cake.js.coffee
index 7f925394..7f925394 100644
--- a/app/assets/javascripts/backbone/models/cake.js.coffee
+++ b/app/assets/javascripts/models/cake.js.coffee
diff --git a/app/assets/javascripts/backbone/models/category.js.coffee b/app/assets/javascripts/models/category.js.coffee
index 98437966..98437966 100644
--- a/app/assets/javascripts/backbone/models/category.js.coffee
+++ b/app/assets/javascripts/models/category.js.coffee
diff --git a/app/assets/javascripts/backbone/models/photo.js.coffee b/app/assets/javascripts/models/photo.js.coffee
index eb1cff76..eb1cff76 100644
--- a/app/assets/javascripts/backbone/models/photo.js.coffee
+++ b/app/assets/javascripts/models/photo.js.coffee
diff --git a/app/assets/javascripts/backbone/models/profile.js.coffee b/app/assets/javascripts/models/profile.js.coffee
index 189d83e4..189d83e4 100644
--- a/app/assets/javascripts/backbone/models/profile.js.coffee
+++ b/app/assets/javascripts/models/profile.js.coffee
diff --git a/app/assets/javascripts/backbone/models/tutorials.js.coffee b/app/assets/javascripts/models/tutorials.js.coffee
index 9e2e8a1f..9e2e8a1f 100644
--- a/app/assets/javascripts/backbone/models/tutorials.js.coffee
+++ b/app/assets/javascripts/models/tutorials.js.coffee
diff --git a/app/assets/javascripts/backbone/routers/.gitkeep b/app/assets/javascripts/routers/.gitkeep
index e69de29b..e69de29b 100644
--- a/app/assets/javascripts/backbone/routers/.gitkeep
+++ b/app/assets/javascripts/routers/.gitkeep
diff --git a/app/assets/javascripts/backbone/routers/cakes_router.js.coffee b/app/assets/javascripts/routers/cakes_router.js.coffee
index 5a0922ae..5a0922ae 100644
--- a/app/assets/javascripts/backbone/routers/cakes_router.js.coffee
+++ b/app/assets/javascripts/routers/cakes_router.js.coffee
diff --git a/app/assets/javascripts/backbone/routers/dashboard_router.js.coffee b/app/assets/javascripts/routers/dashboard_router.js.coffee
index 513b2f04..513b2f04 100644
--- a/app/assets/javascripts/backbone/routers/dashboard_router.js.coffee
+++ b/app/assets/javascripts/routers/dashboard_router.js.coffee
diff --git a/app/assets/javascripts/backbone/routers/profile_router.js.coffee b/app/assets/javascripts/routers/profile_router.js.coffee
index cf83d4ae..cf83d4ae 100644
--- a/app/assets/javascripts/backbone/routers/profile_router.js.coffee
+++ b/app/assets/javascripts/routers/profile_router.js.coffee
diff --git a/app/assets/javascripts/backbone/routers/tutorials_router.js.coffee b/app/assets/javascripts/routers/tutorials_router.js.coffee
index 9c942e88..9c942e88 100644
--- a/app/assets/javascripts/backbone/routers/tutorials_router.js.coffee
+++ b/app/assets/javascripts/routers/tutorials_router.js.coffee
diff --git a/app/assets/javascripts/service/embedly_service.js.coffee b/app/assets/javascripts/service/embedly_service.js.coffee
index 634bc4d0..d447267c 100644
--- a/app/assets/javascripts/service/embedly_service.js.coffee
+++ b/app/assets/javascripts/service/embedly_service.js.coffee
@@ -1,3 +1,3 @@
-class window.EmbedlyService
+class CakeSide.EmbedlyService
retrieve_info_on: (url, callback) ->
$.embedly.extract(url, {}).progress(callback)
diff --git a/app/assets/javascripts/backbone/templates/.gitkeep b/app/assets/javascripts/templates/.gitkeep
index e69de29b..e69de29b 100644
--- a/app/assets/javascripts/backbone/templates/.gitkeep
+++ b/app/assets/javascripts/templates/.gitkeep
diff --git a/app/assets/javascripts/backbone/templates/cakes/cake.jst.ejs b/app/assets/javascripts/templates/my/cakes/cake.jst.ejs
index e9800ad5..e9800ad5 100644
--- a/app/assets/javascripts/backbone/templates/cakes/cake.jst.ejs
+++ b/app/assets/javascripts/templates/my/cakes/cake.jst.ejs
diff --git a/app/assets/javascripts/templates/my/cakes/delete_modal.jst.ejs b/app/assets/javascripts/templates/my/cakes/delete_modal.jst.ejs
new file mode 100644
index 00000000..370109d5
--- /dev/null
+++ b/app/assets/javascripts/templates/my/cakes/delete_modal.jst.ejs
@@ -0,0 +1,32 @@
+<div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title">Are you ABSOLUTELY sure?</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <div class="modal-body">
+ <% if (hasError()) { %>
+ <div class="alert alert-dismissible fade show alert-danger" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ <strong>Error!</strong> <%= errorMessage %>
+ </div>
+ <% } %>
+ <p>
+ This action <b>CANNOT</b> be undone.
+ This will permanently delete <em><%= name %></em> photos, and comments.
+ </p>
+ <p>
+ Please type in the name of the cake to confirm.
+ <input id="confirmation-textbox" type="text" class="form-control" autofocus="" required="" aria-label="Type in the name of the cake to confirm that you want to delete this repository.">
+ </p>
+ </div>
+ <div class="modal-footer">
+ <button id="remove-button" type="button" class="btn btn-danger" disabled="disabled">I understand the consequences, delete this cake</button>
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
+ </div>
+ </div>
+</div>
diff --git a/app/assets/javascripts/templates/my/cakes/edit.jst.ejs b/app/assets/javascripts/templates/my/cakes/edit.jst.ejs
new file mode 100644
index 00000000..cab7fc92
--- /dev/null
+++ b/app/assets/javascripts/templates/my/cakes/edit.jst.ejs
@@ -0,0 +1,39 @@
+<div class="row">
+ <div class="col">
+ <h1><small>Edit</small> <%= cake.name %></h1>
+ <hr />
+ <form id="edit-cake" name="cake" class="form-horizontal">
+ <div class="form-group">
+ <a class="btn btn-primary add-photo">Upload Photo...</a>
+ </div>
+ <div class="form-group">
+ <label class="" for="cake_name">Name</label>
+ <input class="form-control" id="cake_name" name="name" type="text" value="<%= cake.name %>" required="required" />
+ </div>
+ <div class="form-group">
+ <label for="category_id">Category</label>
+ <select id="cake_category_id" name="category_id" class="form-control">
+ <% _.each(categories, function(category) { %>
+ <option value="<%= category.id %>"><%= category.name %></option>
+ <% }); %>
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="" for="cake_story">Description</label>
+ <textarea class="form-control" id="cake_story" name="story" rows="3"><%= cake.story %></textarea>
+ </div>
+ <div class="form-group">
+ <label for="cake_tags" class="">Tags</label>
+ <% if (typeof(cake.tags) === "string") { %>
+ <% tags = _.map(cake.tags.split(','), function(x){ return x; }) %>
+ <% } else { %>
+ <% tags = _.map(cake.tags, function(x){ return x.name; }) %>
+ <% } %>
+ <input name="cake_tags" type="text" id="cake_tags" value="<%= tags %>" class="form-control" autocomplete="off" />
+ </div>
+ <button id='save-button' type="submit" class="btn btn-primary">Publish</button>
+ <a href="#cakes/<%= cake.id %>" class="btn btn-secondary">Cancel</a>
+ </form>
+ </div>
+</div>
+<div class="card-columns"></div>
diff --git a/app/assets/javascripts/templates/my/cakes/new.jst.ejs b/app/assets/javascripts/templates/my/cakes/new.jst.ejs
new file mode 100644
index 00000000..cc26c43b
--- /dev/null
+++ b/app/assets/javascripts/templates/my/cakes/new.jst.ejs
@@ -0,0 +1,18 @@
+<h1>Share cake</h1>
+<hr />
+<form id="new-cake" name="cake" class="form-horizontal">
+ <div class="form-group">
+ <label for="cake_name">Name</label>
+ <input class="form-control" id="cake_name" name="name" type="text" required="required">
+ </div>
+ <div class="form-group">
+ <label for="category_id">Category</label>
+ <select id="cake_category_id" name="category_id" class="form-control" required="required">
+ <% _.each(categories, function(category) { %>
+ <option value="<%= category.id %>"><%= category.name %></option>
+ <% }); %>
+ </select>
+ </div>
+ <button id='save-button' type="submit" class="btn btn-primary">Create</button>
+ <a href="#cakes" class="btn btn-secondary">Cancel</a>
+</form>
diff --git a/app/assets/javascripts/backbone/templates/cakes/no_cakes.jst.ejs b/app/assets/javascripts/templates/my/cakes/no_cakes.jst.ejs
index 9d8787ba..9d8787ba 100644
--- a/app/assets/javascripts/backbone/templates/cakes/no_cakes.jst.ejs
+++ b/app/assets/javascripts/templates/my/cakes/no_cakes.jst.ejs
diff --git a/app/assets/javascripts/templates/my/cakes/show.jst.ejs b/app/assets/javascripts/templates/my/cakes/show.jst.ejs
new file mode 100644
index 00000000..45fb0cd8
--- /dev/null
+++ b/app/assets/javascripts/templates/my/cakes/show.jst.ejs
@@ -0,0 +1,26 @@
+<div class="row">
+ <div class="col">
+ <h1><a href="#cakes/<%= id %>"><%= name %></a></h1>
+ <hr />
+ <% if (typeof(tags) === "string") { %>
+ <% _.each(tags.split(','), function(tag){ %>
+ <a href="<%= Routes.creation_tag_path(tag) %>">
+ <span class="badge badge-info"><%= tag %></span>
+ </a>
+ <% }); %>
+ <% } else { %>
+ <% _.each(tags, function(tag){ %>
+ <a href="<%= Routes.creation_tag_path(tag.name) %>">
+ <span class="badge badge-info"><%= tag.name %></span>
+ </a>
+ <% }); %>
+ <% } %>
+ <div class="float-right">
+ <a href="#cakes/<%= id %>/edit" class="btn btn-primary">Edit</a>
+ <a class="add-photo btn btn-secondary">Add Photo</a>
+ <a id="remove-cake-button" class="btn btn-danger">Delete this cake</a>
+ </div>
+ <p><%= story %></p>
+ </div>
+</div>
+<div class="card-columns"></div>
diff --git a/app/assets/javascripts/templates/my/cakes/thumbnail.jst.ejs b/app/assets/javascripts/templates/my/cakes/thumbnail.jst.ejs
new file mode 100644
index 00000000..7ae1bef3
--- /dev/null
+++ b/app/assets/javascripts/templates/my/cakes/thumbnail.jst.ejs
@@ -0,0 +1,8 @@
+<% if (uploading()) { %>
+ <div class="progress">
+ <div class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: <%= percentComplete %>%" aria-valuenow="<%= percentComplete %>" aria-valuemin="<%= percentComplete %>" aria-valuemax="100"><%= percentComplete %>%</div>
+ </div>
+<% } %>
+<a href="#cakes/<%= cake_id %>/photos/<%= id %>">
+ <img src="<%= thumb_url %>" class="card-img-top" />
+</a>
diff --git a/app/assets/javascripts/templates/my/photos/new-modal.jst.ejs b/app/assets/javascripts/templates/my/photos/new-modal.jst.ejs
new file mode 100644
index 00000000..c138b423
--- /dev/null
+++ b/app/assets/javascripts/templates/my/photos/new-modal.jst.ejs
@@ -0,0 +1,24 @@
+<div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title">Upload Photo</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <div class="modal-body">
+ <form class="form-horizontal">
+ <span class="btn btn-default btn-file">
+ <input id="photo-attachment" name="attachment" type="file" accept="image/*">
+ </span>
+ <input id="watermark" name="watermark" maxlength="30" size="30" type="text" placeholder="watermark" class="form-control" />
+ <small class="form-text muted"> on CakeSide.com</small>
+ </form>
+ <img id="preview-image" src="#" alt="your image" class="hide" />
+ </div>
+ <div class="modal-footer">
+ <button id="upload-photo-button" type="button" class="btn btn-primary">Save changes</button>
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
+ </div>
+ </div>
+</div>
diff --git a/app/assets/javascripts/templates/my/profiles/show.jst.ejs b/app/assets/javascripts/templates/my/profiles/show.jst.ejs
new file mode 100644
index 00000000..7e861e11
--- /dev/null
+++ b/app/assets/javascripts/templates/my/profiles/show.jst.ejs
@@ -0,0 +1,45 @@
+<h1>Public Profile</h1>
+<hr />
+<div id="status-message" class="alert alert-dismissible alert-danger hide" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+</div>
+
+<form id="profile-form" class="form-horizontal">
+ <div class="form-group">
+ <label class="" for="user_name">Name</label>
+ <input class="form-control" id="user_name" name="user[name]" type="text" value="<%= name %>" required="required">
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <label class="" for="user_email">Email</label>
+ <input class="form-control" id="user_email" name="user[email]" type="email" value="<%= email %>" required="required">
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <label class="" for="user_website">URL</label>
+ <input class="form-control url" id="user_website" name="user[website]" placeholder="https://www.cakeside.com" type="url" value="<%= website %>">
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <label class="" for="user_city">Location</label>
+ <input class="form-control" id="user_city" name="user[city]" type="text" value="<%= city %>">
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <label class="" for="user_twitter">Twitter username</label>
+ <div class="input-group">
+ <span class="input-group-addon">@</span>
+ <input class="form-control" id="user_twitter" maxlength="15" name="user[twitter]" placeholder="" size="255" type="text" value="<%= twitter %>">
+ </div>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <label class="" for="user_facebook">Facebook</label>
+ <input class="form-control" id="user_facebook" maxlength="255" name="user[facebook]" placeholder="https://www.facebook.com/your_profile" size="255" type="text" value="<%= facebook %>">
+ <span class="help-inline"></span>
+ </div>
+ <input id="save-button" type="submit" class="btn btn-primary" value="Update profile">
+ <button id="cancel-button" type="reset" class="btn">Cancel</button>
+</form>
diff --git a/app/assets/javascripts/templates/my/tutorials/new.jst.ejs b/app/assets/javascripts/templates/my/tutorials/new.jst.ejs
new file mode 100644
index 00000000..965a62f1
--- /dev/null
+++ b/app/assets/javascripts/templates/my/tutorials/new.jst.ejs
@@ -0,0 +1,23 @@
+<h1>Share a tutorial link</h1>
+<hr />
+<form id="new-tutorial" name='tutorial' class='form-horizontal'>
+ <div id="url-group" class="form-group">
+ <label for="tutorial_url">Tutorial URL</label>
+ <input class="form-control" id="tutorial_url" name="url" type="text" value="<%= url %>" placeholder="http://www.cakeside.com/" autofocus>
+ </div>
+ <div class="form-group">
+ <label for="tags">Tags</label>
+ <input type="text" id="tutorial_tags" name="tags" value="" class="form-control" autocomplete="off" />
+ <p class="help-block"> Note: help people find this tutorial by adding some keyword tags </p>
+ </div>
+ <button id='save-button' type="submit" class="btn btn-primary">Save</button>
+ <a href="#tutorials" class="btn btn-secondary">Cancel</a>
+</form>
+<div id="preview-panel" class="thumbnail">
+ <img class="embed-thumb" src="<%= image_url %>" />
+ <div class="caption">
+ <h3 class="tutorial-heading"><%= heading %></h3>
+ <p id="tag-list"></p>
+ <p class="tutorial-description"><%= description %></p>
+ </div>
+</div>
diff --git a/app/assets/javascripts/backbone/templates/tutorials/no_tutorials.jst.ejs b/app/assets/javascripts/templates/my/tutorials/no_tutorials.jst.ejs
index ab9705b1..ab9705b1 100644
--- a/app/assets/javascripts/backbone/templates/tutorials/no_tutorials.jst.ejs
+++ b/app/assets/javascripts/templates/my/tutorials/no_tutorials.jst.ejs
diff --git a/app/assets/javascripts/backbone/templates/tutorials/show.jst.ejs b/app/assets/javascripts/templates/my/tutorials/show.jst.ejs
index a0ebe2b9..7dcbea00 100644
--- a/app/assets/javascripts/backbone/templates/tutorials/show.jst.ejs
+++ b/app/assets/javascripts/templates/my/tutorials/show.jst.ejs
@@ -1,5 +1,5 @@
-<div class="row-fluid">
- <div class="span12">
+<div class="row">
+ <div class="col">
<h3><a href="#tutorials/<%= id %>"><%= heading %></a> <small><%= displayDate(created_at) %></small></h3>
<a href="#tutorials/<%= id %>">
<img src="<%= image_url %>" />
diff --git a/app/assets/javascripts/backbone/templates/tutorials/tutorial.jst.ejs b/app/assets/javascripts/templates/my/tutorials/tutorial.jst.ejs
index 431f24b6..255344d7 100644
--- a/app/assets/javascripts/backbone/templates/tutorials/tutorial.jst.ejs
+++ b/app/assets/javascripts/templates/my/tutorials/tutorial.jst.ejs
@@ -1,4 +1,4 @@
-<a href="#tutorials/<%= id %>" class="pull-left">
+<a href="#tutorials/<%= id %>" class="float-left">
<img class="media-object" data-src="<%= image_url %>" alt="64x64" style="width: 64px; height: 64px;" src="<%= image_url %>">
</a>
<div class="media-body">
diff --git a/app/assets/javascripts/backbone/views/.gitkeep b/app/assets/javascripts/views/.gitkeep
index e69de29b..e69de29b 100644
--- a/app/assets/javascripts/backbone/views/.gitkeep
+++ b/app/assets/javascripts/views/.gitkeep
diff --git a/app/assets/javascripts/views/cakes/show_page.js.coffee b/app/assets/javascripts/views/cakes/show_page.js.coffee
new file mode 100644
index 00000000..c83a3c45
--- /dev/null
+++ b/app/assets/javascripts/views/cakes/show_page.js.coffee
@@ -0,0 +1,7 @@
+#= require infrastructure/auto_view
+
+class CakeSide.Views.Cakes.ShowPage extends CakeSide.AutoView
+ @viewName "cakes#show"
+
+ render: ->
+ console.log(@name)
diff --git a/app/assets/javascripts/backbone/views/disqus_view.js.coffee b/app/assets/javascripts/views/disqus_view.js.coffee
index 1379691a..1379691a 100644
--- a/app/assets/javascripts/backbone/views/disqus_view.js.coffee
+++ b/app/assets/javascripts/views/disqus_view.js.coffee
diff --git a/app/assets/javascripts/backbone/views/error_view.js.coffee b/app/assets/javascripts/views/error_view.js.coffee
index 86f907e0..0d232fca 100644
--- a/app/assets/javascripts/backbone/views/error_view.js.coffee
+++ b/app/assets/javascripts/views/error_view.js.coffee
@@ -1,5 +1,3 @@
-CakeSide.Views.Cakes ||= {}
-
class CakeSide.Views.ErrorView extends Backbone.View
initialize: (options) ->
@attributesWithErrors = options.attributesWithErrors
diff --git a/app/assets/javascripts/views/index.js.coffee b/app/assets/javascripts/views/index.js.coffee
new file mode 100644
index 00000000..2ca99abd
--- /dev/null
+++ b/app/assets/javascripts/views/index.js.coffee
@@ -0,0 +1,9 @@
+#= require_self
+#= require_tree .
+
+CakeSide.Views.Cakes ||= {}
+CakeSide.Views.My ||= {}
+CakeSide.Views.My.Cakes ||= {}
+CakeSide.Views.My.Photos ||= {}
+CakeSide.Views.My.Profiles ||= {}
+CakeSide.Views.My.Tutorials ||= {}
diff --git a/app/assets/javascripts/backbone/views/cakes/cake_view.js.coffee b/app/assets/javascripts/views/my/cakes/cake_view.js.coffee
index f0faf97e..86c83a1e 100644
--- a/app/assets/javascripts/backbone/views/cakes/cake_view.js.coffee
+++ b/app/assets/javascripts/views/my/cakes/cake_view.js.coffee
@@ -1,7 +1,5 @@
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.CakeView extends Marionette.ItemView
- template: JST["backbone/templates/cakes/cake"]
+class CakeSide.Views.My.Cakes.CakeView extends Marionette.ItemView
+ template: JST["templates/my/cakes/cake"]
tagName: 'div'
className: 'media'
templateHelpers:
diff --git a/app/assets/javascripts/backbone/views/cakes/delete_cake_modal_view.js.coffee b/app/assets/javascripts/views/my/cakes/delete_cake_modal_view.js.coffee
index 85253924..447932ac 100644
--- a/app/assets/javascripts/backbone/views/cakes/delete_cake_modal_view.js.coffee
+++ b/app/assets/javascripts/views/my/cakes/delete_cake_modal_view.js.coffee
@@ -1,7 +1,5 @@
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.DeleteCakeModalView extends Marionette.ItemView
- template: JST["backbone/templates/cakes/delete_modal"]
+class CakeSide.Views.My.Cakes.DeleteCakeModalView extends Marionette.ItemView
+ template: JST["templates/my/cakes/delete_modal"]
ui:
remove_button: "#remove-button"
confirmation_textbox: '#confirmation-textbox'
diff --git a/app/assets/javascripts/backbone/views/cakes/edit_view.js.coffee b/app/assets/javascripts/views/my/cakes/edit_view.js.coffee
index c568ca95..f3957598 100644
--- a/app/assets/javascripts/backbone/views/cakes/edit_view.js.coffee
+++ b/app/assets/javascripts/views/my/cakes/edit_view.js.coffee
@@ -1,10 +1,9 @@
-#= require backbone/views/cakes/thumbnail_view
-CakeSide.Views.Cakes ||= {}
+#= require views/my/cakes/thumbnail_view
-class CakeSide.Views.Cakes.EditView extends Marionette.CompositeView
- template : JST["backbone/templates/cakes/edit"]
- childView: CakeSide.Views.Cakes.ThumbnailView
- childViewContainer: '.thumbnails'
+class CakeSide.Views.My.Cakes.EditView extends Marionette.CompositeView
+ template : JST["templates/my/cakes/edit"]
+ childView: CakeSide.Views.My.Cakes.ThumbnailView
+ childViewContainer: '.card-columns'
ui:
name: "#cake_name"
description: "#cake_story"
diff --git a/app/assets/javascripts/views/my/cakes/index_view.js.coffee b/app/assets/javascripts/views/my/cakes/index_view.js.coffee
new file mode 100644
index 00000000..45805332
--- /dev/null
+++ b/app/assets/javascripts/views/my/cakes/index_view.js.coffee
@@ -0,0 +1,7 @@
+#= require views/my/cakes/no_cakes_view
+
+class CakeSide.Views.My.Cakes.IndexView extends Marionette.CollectionView
+ childView: CakeSide.Views.My.Cakes.CakeView
+ emptyView: CakeSide.Views.My.Cakes.NoCakesView
+ className: ''
+ tagName: 'div'
diff --git a/app/assets/javascripts/backbone/views/cakes/new_view.js.coffee b/app/assets/javascripts/views/my/cakes/new_view.js.coffee
index 321be655..6988af8a 100644
--- a/app/assets/javascripts/backbone/views/cakes/new_view.js.coffee
+++ b/app/assets/javascripts/views/my/cakes/new_view.js.coffee
@@ -1,7 +1,5 @@
-CakeSide.Views.Cakes ||= {}
-
-class CakeSide.Views.Cakes.NewView extends Marionette.ItemView
- template: JST["backbone/templates/cakes/new"]
+class CakeSide.Views.My.Cakes.NewView extends Marionette.ItemView
+ template: JST["templates/my/cakes/new"]
ui:
name: "#cake_name"
category: "#cake_category_id"
diff --git a/app/assets/javascripts/views/my/cakes/no_cakes_view.js.coffee b/app/assets/javascripts/views/my/cakes/no_cakes_view.js.coffee
new file mode 100644
index 00000000..17f190cc
--- /dev/null
+++ b/app/assets/javascripts/views/my/cakes/no_cakes_view.js.coffee
@@ -0,0 +1,3 @@
+class CakeSide.Views.My.Cakes.NoCakesView extends Marionette.ItemView
+ template: JST["templates/my/cakes/no_cakes"]
+ tagName: 'li'
diff --git a/app/assets/javascripts/backbone/views/cakes/show_view.js.coffee b/app/assets/javascripts/views/my/cakes/show_view.js.coffee
index d180b80a..6050a9e6 100644
--- a/app/assets/javascripts/backbone/views/cakes/show_view.js.coffee
+++ b/app/assets/javascripts/views/my/cakes/show_view.js.coffee
@@ -1,10 +1,9 @@
-#= require backbone/views/cakes/thumbnail_view
-CakeSide.Views.Cakes ||= {}
+#= require views/my/cakes/thumbnail_view
-class CakeSide.Views.Cakes.ShowView extends Marionette.CompositeView
- template: JST["backbone/templates/cakes/show"]
- childView: CakeSide.Views.Cakes.ThumbnailView
- childViewContainer: '.thumbnails'
+class CakeSide.Views.My.Cakes.ShowView extends Marionette.CompositeView
+ template: JST["templates/my/cakes/show"]
+ childView: CakeSide.Views.My.Cakes.ThumbnailView
+ childViewContainer: '.card-columns'
events:
"click .add-photo": "launchAddPhoto"
diff --git a/app/assets/javascripts/views/my/cakes/thumbnail_view.js.coffee b/app/assets/javascripts/views/my/cakes/thumbnail_view.js.coffee
new file mode 100644
index 00000000..fda5ea13
--- /dev/null
+++ b/app/assets/javascripts/views/my/cakes/thumbnail_view.js.coffee
@@ -0,0 +1,11 @@
+class CakeSide.Views.My.Cakes.ThumbnailView extends Marionette.ItemView
+ template: JST['templates/my/cakes/thumbnail']
+ tagName: 'div'
+ className: 'card'
+ modelEvents:
+ 'sync': 'render'
+ 'change:percentComplete': 'render'
+
+ templateHelpers:
+ uploading: ->
+ typeof(@percentComplete) != "undefined" && @percentComplete != 100
diff --git a/app/assets/javascripts/backbone/views/photos/new_modal_view.js.coffee b/app/assets/javascripts/views/my/photos/new_modal_view.js.coffee
index 0972bc52..b2c868c5 100644
--- a/app/assets/javascripts/backbone/views/photos/new_modal_view.js.coffee
+++ b/app/assets/javascripts/views/my/photos/new_modal_view.js.coffee
@@ -1,7 +1,5 @@
-CakeSide.Views.Photos ||= {}
-
-class CakeSide.Views.Photos.NewModalView extends Marionette.ItemView
- template: JST["backbone/templates/photos/new-modal"]
+class CakeSide.Views.My.Photos.NewModalView extends Marionette.ItemView
+ template: JST["templates/my/photos/new-modal"]
ui:
watermark: '#watermark'
upload_button: "#upload-photo-button"
@@ -17,9 +15,6 @@ class CakeSide.Views.Photos.NewModalView extends Marionette.ItemView
@cake = options.cake
@model = new @collection.model(cake_id: @cake.id)
- onRender: ->
- @$('.tooltip-item').tooltip()
-
save: (e) ->
e.preventDefault()
e.stopPropagation()
diff --git a/app/assets/javascripts/backbone/views/profiles/show_view.js.coffee b/app/assets/javascripts/views/my/profiles/show_view.js.coffee
index ef694f4b..91076e5e 100644
--- a/app/assets/javascripts/backbone/views/profiles/show_view.js.coffee
+++ b/app/assets/javascripts/views/my/profiles/show_view.js.coffee
@@ -1,7 +1,5 @@
-CakeSide.Views.Profiles ||= {}
-
-class CakeSide.Views.Profiles.ShowView extends Marionette.ItemView
- template: JST["backbone/templates/profiles/show"]
+class CakeSide.Views.My.Profiles.ShowView extends Marionette.ItemView
+ template: JST["templates/my/profiles/show"]
ui:
name: '#user_name'
email: '#user_email'
@@ -37,8 +35,8 @@ class CakeSide.Views.Profiles.ShowView extends Marionette.ItemView
savedSuccessfully: (profile) =>
@disableSaveButton()
- @ui.status.removeClass('hidden')
- @ui.status.removeClass('alert-error')
+ @ui.status.removeClass('hide')
+ @ui.status.removeClass('alert-danger')
@ui.status.html("Saved!")
couldNotSave: =>
@@ -52,12 +50,12 @@ class CakeSide.Views.Profiles.ShowView extends Marionette.ItemView
displayError: ->
@disableSaveButton()
- @ui.status.addClass('alert-error')
- @ui.status.removeClass('hidden')
+ @ui.status.addClass('alert-danger')
+ @ui.status.removeClass('hide')
@ui.status.html(@model.validationError)
refreshStatus: ->
- @ui.status.addClass('hidden')
+ @ui.status.addClass('hide')
@enableSaveButton()
@model.set('name', @ui.name.val())
@model.set('email', @ui.email.val())
@@ -69,4 +67,3 @@ class CakeSide.Views.Profiles.ShowView extends Marionette.ItemView
cancel: ->
@enableSaveButton()
-
diff --git a/app/assets/javascripts/views/my/tutorials/index_view.js.coffee b/app/assets/javascripts/views/my/tutorials/index_view.js.coffee
new file mode 100644
index 00000000..83692962
--- /dev/null
+++ b/app/assets/javascripts/views/my/tutorials/index_view.js.coffee
@@ -0,0 +1,8 @@
+#= require views/my/tutorials/no_tutorials_view
+#= require views/my/tutorials/tutorial_view
+
+class CakeSide.Views.My.Tutorials.IndexView extends Marionette.CollectionView
+ childView: CakeSide.Views.My.Tutorials.TutorialView
+ emptyView: CakeSide.Views.My.Tutorials.NoTutorialsView
+ className: ''
+ tagName: 'div'
diff --git a/app/assets/javascripts/backbone/views/tutorials/new_view.js.coffee b/app/assets/javascripts/views/my/tutorials/new_view.js.coffee
index e8ba976f..4c915fc7 100644
--- a/app/assets/javascripts/backbone/views/tutorials/new_view.js.coffee
+++ b/app/assets/javascripts/views/my/tutorials/new_view.js.coffee
@@ -1,6 +1,7 @@
#= require service/embedly_service
-class CakeSide.Views.Tutorials.NewView extends Marionette.ItemView
- template: JST['backbone/templates/tutorials/new']
+
+class CakeSide.Views.My.Tutorials.NewView extends Marionette.ItemView
+ template: JST['templates/my/tutorials/new']
ui:
url: '#tutorial_url'
url_group: '#url-group'
@@ -18,7 +19,7 @@ class CakeSide.Views.Tutorials.NewView extends Marionette.ItemView
initialize: ->
@model = new @collection.model()
- @service = new EmbedlyService()
+ @service = new CakeSide.EmbedlyService()
loadUrl: ->
if @model.isValidUrl(@ui.url.val())
diff --git a/app/assets/javascripts/views/my/tutorials/no_tutorials_view.js.coffee b/app/assets/javascripts/views/my/tutorials/no_tutorials_view.js.coffee
new file mode 100644
index 00000000..9b2cf3c5
--- /dev/null
+++ b/app/assets/javascripts/views/my/tutorials/no_tutorials_view.js.coffee
@@ -0,0 +1,3 @@
+class CakeSide.Views.My.Tutorials.NoTutorialsView extends Marionette.ItemView
+ template: JST['templates/my/tutorials/no_tutorials']
+ tagName: 'li'
diff --git a/app/assets/javascripts/views/my/tutorials/show_view.js.coffee b/app/assets/javascripts/views/my/tutorials/show_view.js.coffee
new file mode 100644
index 00000000..8ea4a484
--- /dev/null
+++ b/app/assets/javascripts/views/my/tutorials/show_view.js.coffee
@@ -0,0 +1,5 @@
+class CakeSide.Views.My.Tutorials.ShowView extends Marionette.ItemView
+ template: JST["templates/my/tutorials/show"]
+ templateHelpers:
+ displayDate: (date) ->
+ date
diff --git a/app/assets/javascripts/views/my/tutorials/tutorial_view.js.coffee b/app/assets/javascripts/views/my/tutorials/tutorial_view.js.coffee
new file mode 100644
index 00000000..99631ba2
--- /dev/null
+++ b/app/assets/javascripts/views/my/tutorials/tutorial_view.js.coffee
@@ -0,0 +1,8 @@
+class CakeSide.Views.My.Tutorials.TutorialView extends Marionette.ItemView
+ template: JST['templates/my/tutorials/tutorial']
+ tagName: 'div'
+ className: 'media'
+
+ templateHelpers:
+ displayDate: (date) ->
+ new Date(date).toLocaleDateString()
diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss
index df4707bb..5376d6cc 100644
--- a/app/assets/stylesheets/application.css.scss
+++ b/app/assets/stylesheets/application.css.scss
@@ -17,3 +17,8 @@
@import "font-awesome";
@import "bootstrap";
+@import "my-kitchens";
+
+.hide {
+ display: none;
+}
diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss
deleted file mode 100644
index 20a1b968..00000000
--- a/app/assets/stylesheets/custom.css.scss
+++ /dev/null
@@ -1,110 +0,0 @@
-@import "bootstrap";
-body { padding-top: 60px; }
-@import "bootstrap-responsive";
-.fright{float:right;}
-.hidden{display:none;}
-
-footer {
- margin-top:19px;
- padding-top:19px;
- background: none repeat scroll 0 0 #333333;
- border-top: medium none;
-}
-footer a {
- color: #FFFFFF;
-}
-footer h3 {
- color: #999999;
-}
-
-footer #footer-floor {
- background: none repeat scroll 0 0 #1B1B1B;
- padding-top: 9px;
-}
-
-.logo {
- padding-left: 30px;
- padding-top: 30px;
-}
-
-.field_with_errors{
- @extend .control-group;
- @extend .error;
-}
-.form-horizontal .control-group:before, .form-horizontal .field_with_errors:before, .form-horizontal .control-group:after, .form-horizontal .field_with_errors:after {
- content: normal;
-}
-.ui-autocomplete {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- float: left;
- display: none;
- min-width: 160px;
- _width: 160px;
- padding: 4px 0;
- margin: 2px 0 0 0;
- list-style: none;
- background-color: #ffffff;
- border-color: #ccc;
- border-color: rgba(0, 0, 0, 0.2);
- border-style: solid;
- border-width: 1px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
- *border-right-width: 2px;
- *border-bottom-width: 2px;
-
- .ui-menu-item > a.ui-corner-all {
- display: block;
- padding: 3px 15px;
- clear: both;
- font-weight: normal;
- line-height: 18px;
- color: #555555;
- white-space: nowrap;
-
- &.ui-state-hover, &.ui-state-active
- {
- color: #ffffff;
- text-decoration: none;
- background-color: #0088cc;
- border-radius: 0px;
- -webkit-border-radius: 0px;
- -moz-border-radius: 0px;
- background-image: none;
- }
- }
-}
-
-ul.tagit {
- margin-left: 0px; /* force it to show up left aligned */
-
-}
-.btn-file {
- position: relative;
- overflow: hidden;
-}
-.btn-file input[type=file] {
- position: absolute;
- top: 0;
- right: 0;
- min-width: 100%;
- min-height: 100%;
- font-size: 999px;
- text-align: right;
- filter: alpha(opacity=0);
- opacity: 0;
- outline: none;
- background: white;
- cursor: inherit;
- display: block;
-}
diff --git a/app/assets/stylesheets/my-kitchens.css.scss b/app/assets/stylesheets/my-kitchens.css.scss
new file mode 100644
index 00000000..b2a847ac
--- /dev/null
+++ b/app/assets/stylesheets/my-kitchens.css.scss
@@ -0,0 +1,5 @@
+.my-kitchens.show {
+ #preview-image {
+ max-width: 470px;
+ }
+}
diff --git a/app/controllers/admin/blobs_controller.rb b/app/controllers/admin/blobs_controller.rb
deleted file mode 100644
index e239ba23..00000000
--- a/app/controllers/admin/blobs_controller.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Admin
- class BlobsController < AdminController
- def index
- @objects = bucket.objects
- end
-
- def show
- @object = bucket.objects[params[:id]]
- end
-
- private
-
- def connection
- @connection ||= AWS::S3.new
- end
-
- def bucket
- bucket_name = ENV['FOG_DIRECTORY']
- connection.buckets[bucket_name]
- end
- end
-end
diff --git a/app/controllers/admin/charts_controller.rb b/app/controllers/admin/charts_controller.rb
deleted file mode 100644
index 019cfb1e..00000000
--- a/app/controllers/admin/charts_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Admin
- class ChartsController < AdminController
- def index
- end
- end
-end
diff --git a/app/controllers/admin/photos_controller.rb b/app/controllers/admin/photos_controller.rb
index b730ba30..c34189bc 100644
--- a/app/controllers/admin/photos_controller.rb
+++ b/app/controllers/admin/photos_controller.rb
@@ -7,7 +7,7 @@ module Admin
end
def index
- @photos = @photo_repository.order(id: :desc)
+ @photos = paginate(@photo_repository.order(id: :desc))
end
def show
diff --git a/app/controllers/admin/subscriptions_controller.rb b/app/controllers/admin/subscriptions_controller.rb
deleted file mode 100644
index 49a63833..00000000
--- a/app/controllers/admin/subscriptions_controller.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module Admin
- class SubscriptionsController < AdminController
- def index
- members = Gibbon::API.lists.members({ id: ENV['MAILCHIMP_LIST_ID'], status: 'subscribed'})
- @subscriptions = members["data"]
- @total = members["total"]
- end
- end
-end
diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb
index 095cc23a..d2901dde 100644
--- a/app/controllers/favorites_controller.rb
+++ b/app/controllers/favorites_controller.rb
@@ -1,11 +1,6 @@
class FavoritesController < ApplicationController
before_action :authenticate!
- def index
- @creation = Creation.find(params[:cake_id])
- @favorites = @creation.favorites
- end
-
def create
cake = Creation.find(params[:cake_id])
current_user.add_favorite(cake)
diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb
deleted file mode 100644
index bf11909f..00000000
--- a/app/controllers/photos_controller.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class PhotosController < ApplicationController
- def index
- @creation = Creation.find(params[:cake_id])
- @photos = @creation.photos
- end
-
- def show
- @creation = Creation.find(params[:cake_id])
- @photo = @creation.photos.find(params[:id])
- end
-end
diff --git a/app/controllers/tutorial_tags_controller.rb b/app/controllers/tutorial_tags_controller.rb
index f12eb7e7..06efd762 100644
--- a/app/controllers/tutorial_tags_controller.rb
+++ b/app/controllers/tutorial_tags_controller.rb
@@ -1,8 +1,4 @@
class TutorialTagsController < ApplicationController
- def index
- @tags = Tutorial.tag_counts_on(:tags)
- end
-
def show
@tag = params[:id].downcase.gsub(/ /, '-')
@tutorials = Tutorial.
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 78f36467..a673e7c5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -10,7 +10,7 @@ module ApplicationHelper
end
def full_title(title)
- title.blank? ? "CakeSide - for cake lovers!" : "#{title} - CakeSide"
+ title.blank? ? "CakeSide - for cake lovers!" : "#{title} - CakeSide"
end
def disqus_auth(user = current_user)
@@ -34,4 +34,17 @@ module ApplicationHelper
def configuration_for(key, default)
content_for(key) || default
end
+
+ def flash_to_alert(key)
+ case key.to_sym
+ when :success
+ 'primary'
+ when :error
+ 'danger'
+ when :warning
+ 'warning'
+ else
+ 'info'
+ end
+ end
end
diff --git a/app/models/subscription.rb b/app/models/subscription.rb
deleted file mode 100644
index 4e23b0d6..00000000
--- a/app/models/subscription.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class Subscription
- def self.subscribe(email:, first_name:, last_name:, list_id: ENV['MAILCHIMP_LIST_ID'])
- return if Rails.env.test?
-
- Gibbon::API.lists.subscribe({
- id: list_id,
- email: { email: email },
- merge_vars: {
- FNAME: first_name,
- LNAME: last_name
- },
- double_optin: false
- })
- end
-end
diff --git a/app/models/user.rb b/app/models/user.rb
index 7de4d277..91b3cb42 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -47,7 +47,6 @@ class User < ActiveRecord::Base
def send_welcome_email
UserMailer.welcome_email(self).deliver_later
- Subscription.delay.subscribe(email: email, first_name: name, last_name: '')
end
def recent_activities(limit = 20)
diff --git a/app/views/admin/activities/_comment.html.erb b/app/views/admin/activities/_comment.html.erb
index 648a17ee..da0494a2 100644
--- a/app/views/admin/activities/_comment.html.erb
+++ b/app/views/admin/activities/_comment.html.erb
@@ -1,9 +1,11 @@
-<div>
- <i class="fa fa-comment icon-large"></i>
- <%= avatar_for(subject.user, size: 24) %>
- <%= link_to subject.user.name, profile_path(subject.user) %> commented on <%= link_to subject.creation.name, cake_path(subject.creation) %>
- <small><%= time_ago_in_words(subject.created_at) %> ago.</small>
- <blockquote>
- <%= subject.text %>
- </blockquote>
+<div class="card">
+ <%= avatar_for(subject.user, clazz: 'card-img-top') %>
+ <div class="card-body">
+ <h4 class="card-title"><%= link_to subject.user.name, profile_path(subject.user) %> commented on <%= link_to subject.creation.name, cake_path(subject.creation) %></h4>
+ <p class="card-text"><%= subject.text %></p>
+ </div>
+ <div class="card-footer">
+ <i class="fa fa-comment icon-large"></i>
+ <small class="text-muted"><%= time_ago_in_words(subject.created_at) %> ago.</small>
+ </div>
</div>
diff --git a/app/views/admin/activities/_favorite.html.erb b/app/views/admin/activities/_favorite.html.erb
index 86a2efdd..aa826e69 100644
--- a/app/views/admin/activities/_favorite.html.erb
+++ b/app/views/admin/activities/_favorite.html.erb
@@ -1,9 +1,14 @@
-<div>
- <p>
- <i class="fa fa-heart icon-large"></i>
- <%= avatar_for(subject.user, size: 24) %>
- <%= link_to subject.user.name, profile_path(subject.user) %> added
- <%= link_to subject.creation.name, cake_path(subject.creation) %> to their favorites
- <small><%= time_ago_in_words(subject.created_at) %> ago.</small>
- </p>
+<div class="card">
+ <%= avatar_for(subject.user, clazz: 'card-img-top') %>
+ <div class="card-body">
+ <h4 class="card-title">Favorite Added</h4>
+ <p class="card-text">
+ <%= link_to subject.user.name, profile_path(subject.user) %> added
+ <%= link_to subject.creation.name, cake_path(subject.creation) %> to their favorites
+ </p>
+ </div>
+ <div class="card-footer">
+ <i class="fa fa-heart icon-large"></i>
+ <small class="text-muted"><%= time_ago_in_words(subject.created_at) %> ago.</small>
+ </div>
</div>
diff --git a/app/views/admin/activities/index.html.erb b/app/views/admin/activities/index.html.erb
index b6650f69..167d5497 100644
--- a/app/views/admin/activities/index.html.erb
+++ b/app/views/admin/activities/index.html.erb
@@ -1,12 +1,12 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
- <dl class="dl-horizontal">
- <% @recent_activities.each do |activity| %>
- <%= render activity.subject.class.to_s.downcase, subject: activity.subject %>
+ <div class="col-9">
+ <div class="card-columns">
+ <% @recent_activities.find_each do |activity| %>
+ <%= render(activity.subject.class.to_s.downcase, subject: activity.subject) if activity.subject %>
<% end %>
- </dl>
+ </div>
</div>
</div>
diff --git a/app/views/admin/blobs/index.html.erb b/app/views/admin/blobs/index.html.erb
deleted file mode 100644
index 24448ed2..00000000
--- a/app/views/admin/blobs/index.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="row-fluid">
- <div class="span2">
- <%= render partial: "my/shared/my_nav" %>
- </div>
- <div class="span10">
- <h1>Blobs <small><%= @objects.count %></small></h1>
- <table class="table table-condensed">
- <thead>
- <tr>
- <th>bucket</th>
- <th>key</th>
- </tr>
- </thead>
- <tbody>
- <% @objects.each do |object| %>
- <tr>
- <td><%= object.bucket.name %></td>
- <td><%= link_to object.key, admin_blob_path(object.key) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/app/views/admin/blobs/show.html.erb b/app/views/admin/blobs/show.html.erb
deleted file mode 100644
index 966f7835..00000000
--- a/app/views/admin/blobs/show.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="row-fluid">
- <div class="span2">
- <%= render partial: "my/shared/my_nav" %>
- </div>
- <div class="span10">
- <h1>Blob <small><%= @object.key %></small></h1>
- <p><%= link_to "<< Back", admin_blobs_path %></p>
- <table class="table table-condensed">
- <thead>
- <tr>
- <th>id</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><%= link_to @object.key, admin_blob_path(@object.key) %></td>
- </tr>
- </tbody>
- </table>
- <ul>
- <li><%= @object.acl %></li>
- <li><%= @object.versions %></li>
- <li><%= @object.public_url %></li>
- <li><%= @object.last_modified %></li>
- <li><%= @object.etag %></li>
- <li><%= @object.content_type %></li>
- <li><%= @object.content_length %></li>
- </ul>
- </div>
-</div>
diff --git a/app/views/admin/charts/index.html.erb b/app/views/admin/charts/index.html.erb
deleted file mode 100644
index 49fffe01..00000000
--- a/app/views/admin/charts/index.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<div class="row-fluid">
- <div class="span2">
- <%= render partial: "my/shared/my_nav" %>
- </div>
- <div class="span10">
- <h1>User Sessions <small>(<%= UserSession.count %>)</small></h1>
- <%= line_chart UserSession.group_by_month(:created_at).count %>
-
- <h1>Registrations <small>(<%= User.count %>)</small></h1>
- <%= line_chart User.group_by_month(:created_at).count %>
-
- <h1>Comments <small>(<%= Comment.count %>)</small></h1>
- <%= line_chart Comment.group_by_month(:created_at).count %>
-
- <h1>Favorites <small>(<%= Favorite.count %>)</small></h1>
- <%= line_chart Favorite.group_by_month(:created_at).count %>
-
- <h1>Photos <small>(<%= Photo.count %>)</small></h1>
- <%= line_chart Photo.group_by_month(:created_at).count %>
-
- <h1>Locations <small>(<%= Location.count %>)</small></h1>
- <%= geo_chart Location.group(:country).count %>
- </div>
-</div>
diff --git a/app/views/admin/errors/index.html.erb b/app/views/admin/errors/index.html.erb
index 1cc3024a..f9722597 100644
--- a/app/views/admin/errors/index.html.erb
+++ b/app/views/admin/errors/index.html.erb
@@ -1,8 +1,8 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Errors <small><%= Time.now.utc %></small></h1>
<%= button_to "Raise HECK", admin_errors_path, method: :post %>
diff --git a/app/views/admin/jobs/index.html.erb b/app/views/admin/jobs/index.html.erb
index cf287015..063a1690 100644
--- a/app/views/admin/jobs/index.html.erb
+++ b/app/views/admin/jobs/index.html.erb
@@ -1,8 +1,8 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Jobs <small><%= Time.now.utc %></small></h1>
<table class="table table-condensed">
<thead>
@@ -19,7 +19,7 @@
</tr>
</thead>
<tbody>
- <% @jobs.each do |job| %>
+ <% @jobs.find_each do |job| %>
<tr>
<td><%= link_to job.id, admin_job_path(job) %></td>
<td><%= job.attempts %></td>
@@ -31,7 +31,7 @@
<td><%= job.created_at.try(:to_formatted_s, :short) %></td>
<td><%= job.updated_at.try(:to_formatted_s, :short) %></td>
<td>
- <%= link_to "Retry", admin_job_path(job), method: :put, class: 'btn', disable_with: 'Retrying...' %>
+ <%= link_to "Retry", admin_job_path(job), method: :put, class: 'btn btn-primary', disable_with: 'Retrying...' %>
<%= link_to "Destroy", admin_job_path(job), method: :delete, class: 'btn btn-danger', disable_with: 'Deleting...' %>
</td>
</tr>
diff --git a/app/views/admin/jobs/show.html.erb b/app/views/admin/jobs/show.html.erb
index f20106cf..62891017 100644
--- a/app/views/admin/jobs/show.html.erb
+++ b/app/views/admin/jobs/show.html.erb
@@ -1,9 +1,9 @@
<% provide(:container_class, 'container-fluid') %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1><%= @job.handler %></h1>
<p><%= link_to "<< Back", admin_jobs_path %></p>
<table class="table table-condensed">
diff --git a/app/views/admin/photos/index.html.erb b/app/views/admin/photos/index.html.erb
index 3ec02070..bcd7aff1 100644
--- a/app/views/admin/photos/index.html.erb
+++ b/app/views/admin/photos/index.html.erb
@@ -1,34 +1,32 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
- <h1>Photos <small><%= @photos.count %></small></h1>
- <table class="table table-condensed">
- <thead>
- <tr>
- <th>filename</th>
- <th>content type</th>
- <th>geolocation</th>
- <th>created</th>
- <th>updated</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @photos.each do |photo| %>
- <tr>
- <td><%= link_to "#{photo.id} #{photo.image}", admin_photo_path(photo.id) %></td>
- <td><%= photo.content_type %></td>
- <td><%= photo.latitude %> <%= photo.longitude %></td>
- <td><%= time_ago_in_words(photo.created_at) %> ago</td>
- <td><%= time_ago_in_words(photo.updated_at) %> ago</td>
- <td>
- <%= link_to "Re-Process", admin_photo_path(photo.id), method: :put, class: 'btn', disable_with: 'Re-Processing..' %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
+ <div class="col-9">
+ <h1><%= @photos.total_count %> photos submitted</h1>
+ <div class="card-columns">
+ <% @photos.each do |photo| %>
+ <div class="card">
+ <%= image_tag photo.url_for(:thumb), class: "card-img-top" %>
+ <div class="card-body">
+ <h4 class="card-title"><%= photo.image %></h4>
+ <p class="card-text">
+ This photo has a content type of <em><%= photo.content_type || "unknown" %></em>.
+ <% if photo.latitude && photo.longitude %>
+ It was taken at <%= photo.latitude %>,<%= photo.longitude %>.
+ <% end %>
+ <p>
+ <%= link_to "Re-Process", admin_photo_path(photo.id), method: :put, class: 'btn btn-secondary', disable_with: 'Re-Processing..' %>
+ </p>
+ </p>
+ </div>
+ <div class="card-footer">
+ <small class="text-muted">Created at <%= time_ago_in_words(photo.created_at) %> ago</small>
+ <small class="text-muted">Last updated <%= time_ago_in_words(photo.updated_at) %> ago</small>
+ </div>
+ </div>
+ <% end %>
+ </div>
</div>
</div>
+<%= render "shared/paging", items: @photos %>
diff --git a/app/views/admin/photos/show.html.erb b/app/views/admin/photos/show.html.erb
index 61095fea..11299105 100644
--- a/app/views/admin/photos/show.html.erb
+++ b/app/views/admin/photos/show.html.erb
@@ -1,8 +1,8 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Photo <small><%= @photo.id %></small></h1>
<p><%= link_to "<< Back", admin_photos_path %></p>
<table class="table table-condensed">
diff --git a/app/views/admin/products/_index.html.erb b/app/views/admin/products/_index.html.erb
index b6096965..03db79ad 100644
--- a/app/views/admin/products/_index.html.erb
+++ b/app/views/admin/products/_index.html.erb
@@ -6,7 +6,7 @@
<td>
<%= link_to product.item_attributes.title, admin_product_path(product.asin) %> is made by <%= product.item_attributes.manufacturer %> in category <%= product.item_attributes.product_group %>
</td>
- <td> <%= link_to 'View on Amazon', product.detail_page_url, class: 'btn', target: "_blank" %> </td>
+ <td> <%= link_to 'View on Amazon', product.detail_page_url, target: "_blank" %> </td>
</tr>
<% end %>
</tbody>
diff --git a/app/views/admin/products/index.html.erb b/app/views/admin/products/index.html.erb
index 40e239c7..5cb3bf3c 100644
--- a/app/views/admin/products/index.html.erb
+++ b/app/views/admin/products/index.html.erb
@@ -1,13 +1,13 @@
<%= provide(:search_path, admin_products_path) %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Product Catalog - Amazon</h1>
<%= form_tag admin_products_path(js: true), method: :get, name: 'search', class: 'form-horizontal', remote: true do %>
<%= text_field_tag :q, params[:q], class: "search-query", placeholder: "Search" %>
- <%= submit_tag 'Search', class: 'btn btn-primary' %>
+ <%= submit_tag 'Search', class: 'btn btn-primary', data: { disable_with: 'Searching...' } %>
<% end %>
<div id="results-container">
<%= render partial: "index" %>
diff --git a/app/views/admin/products/show.html.erb b/app/views/admin/products/show.html.erb
index 72301f08..360b19c1 100644
--- a/app/views/admin/products/show.html.erb
+++ b/app/views/admin/products/show.html.erb
@@ -1,9 +1,9 @@
<%= provide(:search_path, admin_products_path) %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<table class="table">
<tr>
<td>asin</td>
@@ -24,7 +24,7 @@
<td>
<% if @tool.present? %>
In the toolbox as <%= @tool.name %>
- <% else %>
+ <% else %>
<%= form_tag admin_products_path do %>
<%= text_field_tag :name, @product.item_attributes['title'] %>
<%= hidden_field_tag "asin", @product.asin %>
@@ -32,7 +32,7 @@
<% end %>
<% end %>
</td>
- </tr>
+ </tr>
<tr>
<td>attributes</td>
<td>
@@ -60,4 +60,3 @@
</table>
</div>
</div>
-
diff --git a/app/views/admin/sessions/index.html.erb b/app/views/admin/sessions/index.html.erb
index 2d7ee574..bcf48a91 100644
--- a/app/views/admin/sessions/index.html.erb
+++ b/app/views/admin/sessions/index.html.erb
@@ -1,8 +1,8 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Users Sessions</h1>
<table class="table table-striped table-condensed">
<thead>
diff --git a/app/views/admin/subscriptions/index.html.erb b/app/views/admin/subscriptions/index.html.erb
deleted file mode 100644
index f750cc92..00000000
--- a/app/views/admin/subscriptions/index.html.erb
+++ /dev/null
@@ -1,26 +0,0 @@
-<div class="row-fluid">
- <div class="span2">
- <%= render partial: "my/shared/my_nav" %>
- </div>
- <div class="span10">
- <h1>Subscriptions <small>(<%= @total %>)</small></h1>
- <table class="table table-condensed">
- <thead>
- <tr>
- <th></th>
- <th>Email</th>
- <th>Timestamp</th>
- </tr>
- </thead>
- <tbody>
- <% @subscriptions.each_with_index do |subscription, index| %>
- <tr>
- <td><%= index+1 %></td>
- <td><%= subscription["email"] %></td>
- <td><%= subscription["timestamp_signup"] %></td>
- </tr>
- </tbody>
- <% end %>
- </table>
- </div>
-</div>
diff --git a/app/views/admin/users/_edit_modal.html.erb b/app/views/admin/users/_edit_modal.html.erb
index b664ab6e..1cc8fc30 100644
--- a/app/views/admin/users/_edit_modal.html.erb
+++ b/app/views/admin/users/_edit_modal.html.erb
@@ -1,63 +1,55 @@
-<div id="edit-user-modal-<%= user.id %>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="myModalLabel">Edit <%= user.name %></h3>
- </div>
- <%= form_for user, url: admin_user_path(user), method: :put, html: { class: 'form-horizontal' } do |f| %>
- <div class="modal-body">
- <div class="control-group">
- <%= f.label :name, class: 'control-label' %>
- <div class="controls">
- <%= f.text_field :name %>
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :email, class: 'control-label' %>
- <div class="controls">
- <%= f.text_field :email %>
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :full_address, class: 'control-label' %>
- <div class="controls">
- <%= f.text_field :full_address %>
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :city, class: 'control-label' %>
- <div class="controls">
- <%= f.text_field :city %>
- <span class="help-inline"></span>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :website, class: 'control-label' %>
- <div class="controls">
- <%= f.url_field :website %>
- <span class="help-inline"></span>
+<div id="edit-user-modal-<%= user.id %>" class="modal">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <%= form_for user, url: admin_user_path(user), method: :put, html: { class: 'form-horizontal' } do |f| %>
+ <div class="modal-header">
+ <h5 class="modal-title">Edit <%= user.name %></h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
</div>
- </div>
- <div class="control-group">
- <%= f.label :twitter, class: 'control-label' %>
- <div class="controls">
- <%= f.text_field :twitter %>
- <span class="help-inline"></span>
+ <div class="modal-body">
+ <div class="form-group">
+ <%= f.label :name %>
+ <%= f.text_field :name, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :email %>
+ <%= f.email_field :email, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :full_address %>
+ <%= f.text_field :full_address, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :city %>
+ <%= f.text_field :city, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :website %>
+ <%= f.url_field :website, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :twitter %>
+ <%= f.text_field :twitter, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
+ <div class="form-group">
+ <%= f.label :facebook %>
+ <%= f.url_field :facebook, class: 'form-control' %>
+ <span class="help-inline"></span>
+ </div>
</div>
- </div>
- <div class="control-group">
- <%= f.label :facebook, class: 'control-label' %>
- <div class="controls">
- <%= f.url_field :facebook %>
- <span class="help-inline"></span>
+ <div class="modal-footer">
+ <%= f.submit "Save Changes", class: 'btn btn-primary', disable_with: "Saving..." %>
+ <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
+ <% end %>
</div>
</div>
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
- <%= f.submit "Save Changes", class: 'btn btn-primary', disable_with: "Saving..." %>
- </div>
- <% end %>
</div>
diff --git a/app/views/admin/users/_index.html.erb b/app/views/admin/users/_index.html.erb
index 823199e2..5831c4db 100644
--- a/app/views/admin/users/_index.html.erb
+++ b/app/views/admin/users/_index.html.erb
@@ -4,7 +4,6 @@
<td></td>
<td>name</td>
<td>email</td>
- <td>urls</td>
<td>
created at
<%= link_to url_for(params.merge(sort: "newest")), remote: true do %>
@@ -17,21 +16,14 @@
</tr>
</thead>
<tbody>
- <%- @users.each do |user| %>
+ <% @users.find_each do |user| %>
<tr>
<td>
<a href="#edit-user-modal-<%= user.id %>" role="button" data-toggle="modal">edit</a>
<%= render partial: 'edit_modal', locals: { user: user } %>
</td>
- <td><%= link_to "#{user.name} (#{user.creations_count})", admin_user_path(user) %></td>
+ <td><%= link_to user.name, admin_user_path(user) %></td>
<td><%= mail_to user.email %></td>
- <td>
- <ul>
- <%= "<li>#{user.website}</li>".html_safe unless user.website.blank? %>
- <%= "<li>#{user.twitter}</li>".html_safe unless user.twitter.blank? %>
- <%= "<li>#{user.facebook}</li>".html_safe unless user.facebook.blank? %>
- </ul>
- </td>
<td><%= user.created_at.to_formatted_s(:short) %></td>
</tr>
<% end %>
diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb
index e68f6314..0caccb9c 100644
--- a/app/views/admin/users/index.html.erb
+++ b/app/views/admin/users/index.html.erb
@@ -1,9 +1,9 @@
<%= provide(:search_path, admin_users_path) %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1>Users <small>(<%= @users.count %>)</small></h1>
<div id="results-container">
<%= render partial: "index" %>
diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb
index 148db8cc..7c2e5b29 100644
--- a/app/views/admin/users/show.html.erb
+++ b/app/views/admin/users/show.html.erb
@@ -1,17 +1,17 @@
<%= provide(:search_path, admin_users_path) %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<h1><%= link_to @user.name, profile_path(@user) %> <small>(<a href="#edit-user-modal-<%= @user.id %>" role="button" data-toggle="modal">edit</a>)</small></h1>
<%= render partial: 'edit_modal', locals: { user: @user } %>
<div class="row">
- <div class="span3">
+ <div class="col">
<%= avatar_for(@user) %>
</div>
- <div class="span8">
+ <div class="col">
<p>name: <%= link_to @user.name, admin_user_path(@user) %></p>
<p>email: <%= mail_to @user.email %></p>
<p>address: <%= mail_to @user.full_address %></p>
diff --git a/app/views/cakes/_index.html.erb b/app/views/cakes/_index.html.erb
index 3f0496a5..0b3e0dda 100644
--- a/app/views/cakes/_index.html.erb
+++ b/app/views/cakes/_index.html.erb
@@ -1,20 +1,17 @@
-<div class="row-fluid">
- <% @cakes.each_slice(6).each do |batch| %>
- <ul class='thumbnails'>
- <% batch.each do |cake| %>
- <% cache cake do %>
- <li class="span2">
- <div class="thumbnail">
- <%= link_to cake_path(cake) do %>
- <%= image_tag cake.primary_image.url_for(:thumb), alt: cake.name %>
- <% end %>
- </div>
- </li>
- <% end %>
+<div class="card-columns">
+ <% @cakes.each do |cake| %>
+ <div class='card'>
+ <%= link_to cake_path(cake) do %>
+ <%= image_tag cake.primary_image.url_for(:thumb), alt: cake.name, class: 'card-img-top' %>
<% end %>
- </ul>
+ <div class="card-body">
+ <h4 class="card-title"><%= cake.name %></h4>
+ <p class="card-text"><%= cake.story %></p>
+ <p class="card-text"><small class="text-muted"><%= cake.created_at %></small></p>
+ </div>
+ </div>
<% end %>
</div>
-<div id='more-button-row' class="row-fluid">
- <%= link_to_next_page @cakes, 'More...', params: { cache: false, sort: params[:sort], q: params[:q] }, remote: true, class: 'btn pull-right more-button hidden', data: { disable_with: 'loading...' } %>
+<div id='more-button-row' class="row">
+ <%= link_to_next_page @cakes, 'More...', params: { cache: false, sort: params[:sort], q: params[:q] }, remote: true, class: 'btn pull-right hidden', data: { disable_with: 'loading...', infinite_scroll: true } %>
</div>
diff --git a/app/views/cakes/_show.html.erb b/app/views/cakes/_show.html.erb
index a99777e4..2e4a01c3 100644
--- a/app/views/cakes/_show.html.erb
+++ b/app/views/cakes/_show.html.erb
@@ -1,19 +1,14 @@
-<div class="row-fluid">
- <div class="span6">
- <img class="thumbnail" src="<%= @primary_image.url_for(:large) %>" alt="<%= @creation.name %>" />
- </div>
- <div class="span6">
+<div class="row" data-autoview="cakes#show">
+ <div class="col">
<h1><%= link_to @creation.name, cake_path(@creation) %></h1>
+ <p>By <%= link_to @creation.user.name, profile_path(@creation.user) %></p>
<% if user_signed_in? && current_user != @creation.user %>
<% if current_user.already_likes(@creation) %>
- <i class="fa fa-star fa-4x pull-right"></i>
+ <i class="fa fa-star fa-4x float-right"></i>
<% else %>
- <%= link_to cake_favorites_path(cake_id: @creation.id), method: :post, id: 'add-to-favorites-button', class: 'pull-right' do %>
- <i class="fa fa-star-o fa-4x"></i>
- <% end %>
+ <%= link_to "Add To Favorites", cake_favorites_path(cake_id: @creation.id), method: :post, id: 'add-to-favorites-button', class: 'btn btn-secondary float-right' %>
<% end %>
<% end %>
- <p>By <%= link_to @creation.user.name, profile_path(@creation.user) %></p>
<p>
<i class="fa fa-filter icon-large"></i>
<%= link_to @creation.category.name, category_path(@creation.category) %>
@@ -22,18 +17,18 @@
<span> <i class="icon-tags"></i> </span>
<% @creation.tags.each do |tag| -%>
<%= link_to creation_tag_path(tag.name) do %>
- <span class="label"><%= tag.name %></span>
+ <span class="badge badge-info"><%= tag.name %></span>
<% end %>
<% end -%>
<% end -%>
<hr />
- <div class="row-fluid">
- <% unless user_signed_in? %>
- <div class="span6">
- <p><%= link_to "SIGN UP FOR FREE", login_path, :class => "btn btn-primary" %></p>
- </div>
- <% end %>
- </div>
<p><%= render_markdown(@creation.story).html_safe -%></p>
</div>
</div>
+<div class="card-columns">
+ <% @creation.photos.each do |photo| %>
+ <div class="card">
+ <%= image_tag photo.url_for(:thumb), class: "card-img-top" %>
+ </div>
+ <% end %>
+</div>
diff --git a/app/views/cakes/index.html.erb b/app/views/cakes/index.html.erb
index e5b63adf..37dae8b9 100644
--- a/app/views/cakes/index.html.erb
+++ b/app/views/cakes/index.html.erb
@@ -1,12 +1,13 @@
<% provide(:description, "CakeSide is a free site to share your cake creations and ideas with other cake fanatics like yourself") -%>
<% provide(:search_path, request.env['PATH_INFO'] || cakes_path) %>
-<% provide(:container_class, 'container-fluid') %>
+<% provide(:container_class, 'container') %>
+
<% unless user_signed_in? -%>
- <div class="row-fluid">
- <div class="span6">
+ <div class="row">
+ <div class="col">
<%= image_tag "cakeside-logo.png", :alt => "Welcome to Cakeside", style: 'max-height:186px' %>
</div>
- <div class="span6">
+ <div class="col">
<h1>Welcome cake enthusiast!</h1>
<p style="font-size:15px;">
<strong>Make</strong> cakes, <strong>sell</strong> cakes, or just <strong>love</strong> eating them? You've come to the right place!
@@ -19,19 +20,25 @@
<% end -%>
<div id="bakery">
- <div class="row-fluid">
- <ul class="nav nav-tabs">
- <li class="<%= "active" if params["category"].blank? %>"><%= link_to "All", url_for(params.merge(category: nil)) %></li>
- <% @categories.each do |category| %>
- <li class="<%= "active" if params["category"] == category.slug %>"><%= link_to category.name.pluralize, url_for(params.merge(category: category.slug)) %></li>
- <% end %>
- <li class="<%= params[:sort] == "oldest" ? "active" : "" %> pull-right"><%= link_to "Oldest", url_for(params.merge(sort: "oldest")) %></li>
- <li class="<%= params[:sort].blank? || params[:sort] == "newest" ? "active" : "" %> pull-right"><%= link_to "Newest", url_for(params.merge(sort: "newest")) %></li>
- </ul>
+ <div class="dropdown float-right">
+ <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Sort
+ </button>
+ <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
+ <%= link_to "Newest", url_for(params.merge(sort: "newest")), class: "dropdown-item" %>
+ <%= link_to "Oldest", url_for(params.merge(sort: "oldest")), class: "dropdown-item" %>
+ </div>
</div>
+ <ul class="nav nav-tabs">
+ <li class="nav-item">
+ <%= link_to "All", url_for(params.merge(category: nil)), class: "nav-link #{"active" if params["category"].blank?}" %>
+ </li>
+ <% @categories.each do |category| %>
+ <li class="nav-item ">
+ <%= link_to category.name.pluralize, url_for(params.merge(category: category.slug)), class: "nav-link #{"active" if params["category"] == category.slug}" %>
+ </li>
+ <% end %>
+ </ul>
<%= render partial: 'index' %>
</div>
-
-<div id='pagination-row' class="row-fluid">
- <%= render "shared/paging", items: @cakes %>
-</div>
+<%= render "shared/paging", items: @cakes %>
diff --git a/app/views/cakes/show.html.erb b/app/views/cakes/show.html.erb
index a9578c8b..9ffeb94d 100644
--- a/app/views/cakes/show.html.erb
+++ b/app/views/cakes/show.html.erb
@@ -6,22 +6,4 @@
<%= render partial: 'show' %>
</div>
-<% if @creation.photos_count > 1 %>
- <div class="row-fluid">
- <div class="span12">
- <% @creation.photos.each_slice(12).each do |batch| %>
- <ul class='thumbnails'>
- <% batch.each do |photo| %>
- <li class="span1">
- <%= link_to cake_path(@creation, photo_id: photo.id), remote: true do %>
- <%= image_tag(photo.url_for(:thumb), class: "thumbnail") %>
- <% end %>
- </li>
- <% end %>
- </ul>
- <% end %>
- </div>
- </div>
-<% end %>
-
-<%= render partial: "shared/disqus", locals: { id: "c-#{@creation.id}" } %>
+<%# render partial: "shared/disqus", locals: { id: "c-#{@creation.id}" } %>
diff --git a/app/views/favorites/index.html.erb b/app/views/favorites/index.html.erb
deleted file mode 100644
index a406b57c..00000000
--- a/app/views/favorites/index.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<% provide(:title, "#{@creation.name} by #{@creation.user.name} - fanclub") -%>
-<div class="row-fluid">
- <div class="span12">
- <h1> Fans of <%= link_to @creation.name, cake_path(@creation) %> </h1>
- <ul class="thumbnails">
- <% @creation.favorites.each do |favorite| %>
- <li class="span3">
- <div class="thumbnail">
- <%= link_to profile_path(favorite.user), class: 'thumbnail' do %>
- <%= avatar_for(favorite.user) %>
- <% end %>
- <div class="caption">
- <h5><%= favorite.user.name %></h5>
- <p><%= favorite.user.city %></p>
- </div>
- </div>
- </li>
- <% end %>
- </ul>
- </div>
-</div>
diff --git a/app/views/kaminari/_first_page.html.erb b/app/views/kaminari/_first_page.html.erb
index 478fdba9..6cc42360 100644
--- a/app/views/kaminari/_first_page.html.erb
+++ b/app/views/kaminari/_first_page.html.erb
@@ -7,7 +7,7 @@
remote: data-remote
-%>
<% unless current_page.first? %>
-<li class="first">
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
+<li class="page-item">
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, class: 'page-link', :remote => remote %>
</li>
<% end %>
diff --git a/app/views/kaminari/_gap.html.erb b/app/views/kaminari/_gap.html.erb
index 53c54315..e56c9fe0 100644
--- a/app/views/kaminari/_gap.html.erb
+++ b/app/views/kaminari/_gap.html.erb
@@ -5,4 +5,4 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
-<li class="page gap disabled"><a href="#" onclick="return false;"><%= raw(t 'views.pagination.truncate') %></a></li>
+<li class="page-item disabled"><a href="#" onclick="return false;"><%= raw(t 'views.pagination.truncate') %></a></li>
diff --git a/app/views/kaminari/_last_page.html.erb b/app/views/kaminari/_last_page.html.erb
index e27c2a73..bdab354e 100644
--- a/app/views/kaminari/_last_page.html.erb
+++ b/app/views/kaminari/_last_page.html.erb
@@ -7,7 +7,7 @@
remote: data-remote
-%>
<% unless current_page.last? %>
-<li class="last next"><%# "next" class present for border styling in twitter bootstrap %>
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
+<li class="page-item"><%# "next" class present for border styling in twitter bootstrap %>
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %>
</li>
<% end %>
diff --git a/app/views/kaminari/_next_page.html.erb b/app/views/kaminari/_next_page.html.erb
index 7bccfdc1..dec0b7a8 100644
--- a/app/views/kaminari/_next_page.html.erb
+++ b/app/views/kaminari/_next_page.html.erb
@@ -7,7 +7,7 @@
remote: data-remote
-%>
<% unless current_page.last? %>
-<li class="next_page">
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
+<li class="page-item">
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, class: 'page-link', :rel => 'next', :remote => remote %>
</li>
<% end %>
diff --git a/app/views/kaminari/_page.html.erb b/app/views/kaminari/_page.html.erb
index 3cf4a8ed..0d2bb6df 100644
--- a/app/views/kaminari/_page.html.erb
+++ b/app/views/kaminari/_page.html.erb
@@ -7,6 +7,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
-<li class="page<%= ' active' if page.current? %>">
- <%= link_to page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
+<li class="page-item<%= ' active' if page.current? %>">
+ <%= link_to page, url, opts = {:remote => remote, class: 'page-link', :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
</li>
diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb
index 92a916da..42bbd5ba 100644
--- a/app/views/kaminari/_paginator.html.erb
+++ b/app/views/kaminari/_paginator.html.erb
@@ -7,8 +7,8 @@
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
- <div class="pagination">
- <ul>
+ <nav>
+ <ul class="pagination justify-content-center">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
@@ -21,5 +21,5 @@
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
- </div>
+ </nav>
<% end -%>
diff --git a/app/views/kaminari/_prev_page.html.erb b/app/views/kaminari/_prev_page.html.erb
index 336073b5..131d5904 100644
--- a/app/views/kaminari/_prev_page.html.erb
+++ b/app/views/kaminari/_prev_page.html.erb
@@ -7,7 +7,7 @@
remote: data-remote
-%>
<% unless current_page.first? %>
-<li class="prev">
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
+<li class="page-item">
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote, class: 'page-link' %>
</li>
<% end %>
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index c8c60642..b33ec496 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -1,38 +1,35 @@
<%= debug(params) if Rails.env.development? %>
-<footer class="hidden-phone">
-<div class="container">
- <div class="row">
- <div class="span4">
- <h3>CakeSide</h3>
- <ul class="unstyled">
- <li> <%= link_to "Home", root_path %> </li>
- <li> <%= link_to "About Us", about_us_path %> </li>
- <li> <%= link_to "Why CakeSide?", why_cakeside_path %> </li>
- </ul>
- </div>
- <div class="span4">
- <h3>Contact Us</h3>
- <ul class="unstyled">
- <li> <a href="https://cakeside.uservoice.com/" target="_blank">Send Feedback</a> </li>
- <li> <a href="https://twitter.com/cakeside">Twitter</a> </li>
- <li> <a href="https://www.facebook.com/pages/CakeSide/214607468615074">Facebook</a> </li>
- </ul>
- </div>
- <div class="span8"></div>
- </div>
-</div>
-<div id="footer-floor">
+<footer>
<div class="container">
<div class="row">
- <div class="span12">
- <p>
- Copyright &copy; 2013 CakeSide Inc. |
- <a href="/terms.html">Terms</a> &amp; <a href="/privacy.html">Privacy</a> |
- Contact Us <a href="https://twitter.com/cakeside">@cakeside</a> |
- <a href="https://www.facebook.com/pages/CakeSide/214607468615074">facebook</a>
- </p>
+ <div class="col">
+ <h3>CakeSide</h3>
+ <ul class="list-unstyled">
+ <li> <%= link_to "Home", root_path %> </li>
+ <li> <%= link_to "About Us", about_us_path %> </li>
+ <li> <%= link_to "Why CakeSide?", why_cakeside_path %> </li>
+ <li> <a href="/terms.html">Terms &amp; Conditions</a> </li>
+ <li> <a href="/privacy.html">Privacy Policy</a> </li>
+ </ul>
+ </div>
+ <div class="col">
+ <h3>Contact Us</h3>
+ <ul class="list-unstyled">
+ <li> <a href="https://cakeside.uservoice.com/" target="_blank">Send Feedback</a> </li>
+ <li> <a href="https://twitter.com/cakeside">Twitter</a> </li>
+ <li> <a href="https://www.facebook.com/pages/CakeSide/214607468615074">Facebook</a> </li>
+ </ul>
+ </div>
+ <div class="col"></div>
+ </div>
+ </div>
+ <div id="footer-floor">
+ <div class="container">
+ <div class="row">
+ <div class="col">
+ <p>Copyright &copy; 2013 CakeSide Inc.</p>
+ </div>
</div>
</div>
- </div>
-</div>
+ </div>
</footer>
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index 5e31d54c..9162a609 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -1,71 +1,49 @@
-<div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <%= link_to "Cakeside", root_path, class: 'brand', style: 'color:hotpink;' %>
- <div class="nav-collapse collapse">
- <ul class="nav">
- <li>
- <%= form_tag(configuration_for(:search_path, search_path), method: :get, name: "search", class: "navbar-search pull-left") do %>
- <%= text_field_tag :q, params[:q], class: 'search-query', placeholder: 'Search' %>
- <% end %>
- </li>
- <li class="<%= "active" if params["controller"] == "cakes" %>"> <%= link_to "Cakes", cakes_path(q: params[:q]) %> </li>
- <li class="<%= "active" if params["controller"] == "profiles" %>"> <%= link_to "Artists", profiles_path(q: params[:q]) %> </li>
- <li class="<%= "active" if params["controller"] == "tutorials" %>"> <%= link_to "Tutorials", tutorials_path(q: params[:q]) %> </li>
- </ul>
+<div class="container">
+ <nav class="navbar navbar-expand-lg navbar-light bg-light">
+ <%= link_to "CakeSide", root_path, class: 'navbar-brand', style: 'color:hotpink;' %>
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ <ul class="navbar-nav mr-auto">
+ <li class="nav-item <%= "active" if params["controller"] == "cakes" %>">
+ <%= link_to "Cakes", cakes_path(q: params[:q]), class: 'nav-link' %>
+ </li>
+ <li class="nav-item <%= "active" if params["controller"] == "profiles" %>">
+ <%= link_to "Artists", profiles_path(q: params[:q]), class: 'nav-link' %>
+ </li>
+ <li class="nav-item <%= "active" if params["controller"] == "tutorials" %>">
+ <%= link_to "Tutorials", tutorials_path(q: params[:q]), class: 'nav-link' %>
+ </li>
<% if user_signed_in? %>
- <ul class="nav pull-right" data-no-turbolink>
- <li>
- <%= link_to my_dashboard_path do %>
- <%= avatar_for(current_user, size: 24) %> <%= current_user.name %>
+ <li class="nav-item dropdown">
+ <%= link_to my_dashboard_path, id: 'navbarDropdownMenuLink', class: 'nav-link dropdown-toggle', data: { toggle: 'dropdown' }, 'aria-haspopup'=>"true", 'aria-expanded'=>"false" do %>
+ <%= avatar_for(current_user, size: 24) %> <%= current_user.name %>
+ <% end %>
+ <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink" data-no-turbolink>
+ <%= link_to my_root_path(anchor: 'cakes/new'), class: 'dropdown-item' do %>
+ <i class="fa fa-upload"></i> New Cake
<% end %>
- </li>
- <li class="dropdown">
- <a class="dropdown-toggle" data-toggle="dropdown" href="#">
- <i class="fa fa-plus"></i> <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li data-no-turbolink>
- <%= link_to my_root_path(anchor: 'cakes/new') do %>
- <i class="fa fa-upload"></i> New Cake
- <% end %>
- </li>
- <li data-no-turbolink>
- <%= link_to my_root_path(anchor: 'tutorials/new') do %>
- <i class="fa fa-pencil-square"></i> New Tutorial
- <% end %>
- </li>
- </ul>
- </li>
- <li data-no-turbolink>
- <%= link_to my_dashboard_path do %>
- <i class="fa fa-inbox"></i>
+ <%= link_to my_root_path(anchor: 'tutorials/new'), class: 'dropdown-item' do %>
+ <i class="fa fa-pencil-square"></i> New Tutorial
<% end %>
- </li>
- <li data-no-turbolink>
- <%= link_to my_root_path(anchor: 'profile/me') do %>
- <i class="fa fa-cog"></i>
+ <%= link_to my_dashboard_path, class: 'dropdown-item' do %>
+ <i class="fa fa-inbox"></i> Dashboard
<% end %>
- </li>
- <li>
- <%= link_to logout_path, method: :delete, title: 'Sign Out', data: { toggle: 'tooltip', placement: 'left', animation: 'true' }, class: 'tooltip-item' do %>
- <i class="fa fa-sign-out"></i>
+ <%= link_to my_root_path(anchor: 'profile/me'), class: 'dropdown-item' do %>
+ <i class="fa fa-cog"></i> Settings
<% end %>
- </li>
- </ul>
- <% else %>
- <%= form_for(UserSession.new, url: sessions_path(UserSession.new), html: { class: "navbar-form pull-right" }) do |f| %>
- <%= email_field_tag 'session[username]', '', placeholder: 'Email', class: 'input-small' %>
- <%= password_field_tag 'session[password]', '', placeholder: 'Password', class: 'input-small' %>
- <%= f.button "Log In", class: 'btn btn-primary', data: { disable_with: "<i class='fa fa-spinner fa-spin'></i> Signing in..." } %>
- <% end %>
+ <%= link_to logout_path, method: :delete, class: 'dropdown-item' do %>
+ <i class="fa fa-sign-out"></i> <%= t('logout') %>
+ <% end %>
+ </div>
+ </li>
<% end %>
- </div><!--/.nav-collapse -->
+ </ul>
+ <%= form_tag(configuration_for(:search_path, search_path), method: :get, name: "search", class: "form-inline my-2 my-lg-0") do %>
+ <%= text_field_tag :q, params[:q], class: 'form-control mr-sm-2', placeholder: 'Search', 'aria-label' => "Search" %>
+ <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
+ <% end %>
</div>
- </div>
+ </nav>
</div>
diff --git a/app/views/layouts/_messages.html.erb b/app/views/layouts/_messages.html.erb
index 47067d20..d8f35d88 100644
--- a/app/views/layouts/_messages.html.erb
+++ b/app/views/layouts/_messages.html.erb
@@ -1,15 +1,12 @@
<% if(flash.any?) -%>
-<div class="row-fluid">
- <div class="span12">
- <% flash.each do |key, value| -%>
- <% Array(value).uniq.each do |message| -%>
- <div class="alert alert-<%= key %>">
- <a class="close" data-dismiss="alert" href="#">×</a>
- <%= message %>
- </div>
- <% end -%>
+ <% flash.each do |key, value| -%>
+ <% Array(value).uniq.each do |message| -%>
+ <div class="alert alert-dismissible fade show alert-<%= flash_to_alert(key) %>" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ <%= message %>
+ </div>
<% end -%>
- &nbsp;
- </div>
-</div>
+ <% end -%>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index bdd212e5..e9220f3a 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -2,37 +2,34 @@
<html lang="en">
<head>
<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title><%= full_title(yield(:title)) %></title>
-<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="<%= yield(:description) %>" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="application-name" content="Cakeside">
<meta name="apple-mobile-web-app-title" content="Cakeside">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
-<%= stylesheet_link_tag "application", media: "all", 'data-turbolinks-track' => true %>
+<%= stylesheet_link_tag "application", media: "all" %>
<%= favicon_link_tag 'favicon.ico' %>
<%= favicon_link_tag 'apple-touch-icon-57x57.png', rel: 'apple-touch-startup-image', type: 'image/png' %>
<%= favicon_link_tag 'apple-touch-icon-57x57.png', rel: 'apple-touch-icon', type: 'image/png', sizes: "57x57" %>
<%= favicon_link_tag 'apple-touch-icon-72x72.png', rel: 'apple-touch-icon', type: 'image/png', sizes: "72x72" %>
<%= favicon_link_tag 'apple-touch-icon-114x114.png', rel: 'apple-touch-icon', type: 'image/png', sizes: "114x114" %>
<%= yield :head %>
-<%= javascript_include_tag "application", 'data-turbolinks-track' => true %>
-<!--[if lt IE 9]>
- <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
-<![endif]-->
+<%= javascript_include_tag "application" %>
<%= render "layouts/embedly"%>
<%= yield :javascript %>
<%= csrf_meta_tags %>
</head>
-<body>
+<body class="<%= params[:controller].parameterize %> <%= params[:action] %>">
<%= render "layouts/header" %>
<div class="<%= configuration_for(:container_class, 'container') %>">
<%= render "layouts/messages" %>
<%= yield %>
</div> <!-- /container -->
<%= render "layouts/footer" %>
-<%= render "layouts/google_analytics" %>
+<%# render "layouts/google_analytics" %>
</body>
</html>
diff --git a/app/views/my/avatars/new.html.erb b/app/views/my/avatars/new.html.erb
index 00578ada..f117caed 100644
--- a/app/views/my/avatars/new.html.erb
+++ b/app/views/my/avatars/new.html.erb
@@ -1,20 +1,14 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<%= avatar_for(current_user) %>
<%= form_for(@avatar, url: my_avatars_path, method: :post, :multipart => true, remote: true, authenticity_token: true) do |f| %>
- <div class="control-group">
- <div class="controls">
- <%= f.file_field :image %>
- </div>
- </div>
- <div class="control-group">
- <div class="controls">
- <%= f.submit "Upload picture", :class => "btn btn-primary", data: { disable_with: "Uploading..." } %>
- </div>
+ <div class="form-group">
+ <%= f.file_field :image, class: 'form-control' %>
</div>
+ <%= f.submit "Upload picture", :class => "btn btn-primary", data: { disable_with: "Uploading..." } %>
<% end %>
</div>
</div>
diff --git a/app/views/my/dashboard/_creation.html.erb b/app/views/my/dashboard/_creation.html.erb
index d8a72b00..69d65e00 100644
--- a/app/views/my/dashboard/_creation.html.erb
+++ b/app/views/my/dashboard/_creation.html.erb
@@ -1,16 +1,13 @@
<div class="media">
- <%= link_to my_root_path(anchor: "cakes/#{item.id}"), class: 'pull-left' do %>
- <img class="media-object" data-src="<%= item.primary_image.url_for(:thumb) %>" alt="64x64" style="width: 64px; height: 64px;" src="<%= item.primary_image.url_for(:thumb) %>">
+ <%= link_to my_root_path(anchor: "cakes/#{item.id}") do %>
+ <%= image_tag item.primary_image.url_for(:thumb), class: 'd-flex mr-3', width: '64px' %>
<% end %>
<div class="media-body">
- <h4 class="media-heading"><%= link_to item.name, my_root_path(anchor: "cakes/#{item.id}") %></h4>
+ <h5 class="mt-0 mb-1"><%= item.name %></h5>
<p>
- <%= link_to my_root_path(anchor: "cakes/#{item.id}/edit") do %>
- <i class="fa fa-pencil-square-o"></i> edit
- <% end %>
- <%= link_to cake_favorites_path(cake_id: item.id) do %>
- <i class="fa fa-heart"></i> fanclub
- <% end %>
+ <%= link_to my_root_path(anchor: "cakes/#{item.id}/edit") do %>
+ <i class="fa fa-pencil-square-o"></i> edit
+ <% end %>
</p>
</div>
</div>
diff --git a/app/views/my/dashboard/_tutorial.html.erb b/app/views/my/dashboard/_tutorial.html.erb
index 0cd22be1..86b8a859 100644
--- a/app/views/my/dashboard/_tutorial.html.erb
+++ b/app/views/my/dashboard/_tutorial.html.erb
@@ -1,5 +1 @@
-<div class="media">
- <div class="media-body">
- <h4 class="media-heading"><%= link_to item.heading, my_root_path(anchor: "tutorials/#{item.id}") %></h4>
- </div>
-</div>
+<li><%= link_to truncate(item.heading, length: 40), my_root_path(anchor: "tutorials/#{item.id}") %></li>
diff --git a/app/views/my/dashboard/index.html.erb b/app/views/my/dashboard/index.html.erb
index b285830f..e16eef03 100644
--- a/app/views/my/dashboard/index.html.erb
+++ b/app/views/my/dashboard/index.html.erb
@@ -1,17 +1,19 @@
<% provide(:title, "Dashboard") -%>
<div class="row">
- <div class="span2">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10" data-no-turbolink>
+ <div class="col-9" data-no-turbolink>
<div class="row">
- <div class="span5">
+ <div class="col">
<h5>My Cakes</h5>
- <% @cakes.each do |item| %>
- <%= render item.class.to_s.downcase, item: item %>
- <% end %>
+ <ul class="list-unstyled">
+ <% @cakes.each do |item| %>
+ <%= render item.class.to_s.downcase, item: item %>
+ <% end %>
+ </ul>
</div>
- <div class="span5">
+ <div class="col">
<div class="well">
<h5>My Notifications</h5>
<% if @activities.empty? %>
@@ -22,11 +24,14 @@
<% end %>
<% end %>
</div>
+
<% if @tutorials.any? %>
<h5>My Tutorials</h5>
- <% @tutorials.each do |item| %>
- <%= render item.class.to_s.downcase, item: item %>
- <% end %>
+ <ol>
+ <% @tutorials.each do |item| %>
+ <%= render item.class.to_s.downcase, item: item %>
+ <% end %>
+ </ol>
<% end %>
</div>
</div>
diff --git a/app/views/my/favorites/index.html.erb b/app/views/my/favorites/index.html.erb
index 7ee52c09..5b70f94d 100644
--- a/app/views/my/favorites/index.html.erb
+++ b/app/views/my/favorites/index.html.erb
@@ -1,24 +1,23 @@
<% provide(:title, "My Favorites") -%>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
- <% @creations.each_slice(6).each do |batch| %>
- <ul class='thumbnails'>
- <% batch.each do |creation| %>
- <li class="span2">
- <div class="thumbnail">
- <%= link_to cake_path(creation) do %>
- <%= image_tag creation.primary_image.url_for(:thumb) %>
- <% end %>
- <div class="caption">
- <small><%= link_to truncate(creation.name, length: 12), cake_path(creation) %></small>
- </div>
- </div>
- </li>
- <% end %>
- </ul>
- <% end %>
+ <div class="col-9">
+ <div class="card-columns">
+ <% @creations.each do |cake| %>
+ <div class="card">
+ <%= link_to cake_path(cake) do %>
+ <%= image_tag cake.primary_image.url_for(:thumb), class: 'card-img-top' %>
+ <% end %>
+ <div class="card-body">
+ <h4 class="card-title"><%= truncate(cake.name, length: 12) %></h4>
+ <p class="card-text"><%= link_to truncate(cake.author.name, length: 25), profile_path(cake.author) %></p>
+ <p class="card-text"><%= truncate(cake.story, length: 25) %></p>
+ <p class="card-text"><small class="text-muted"><%= cake.created_at %></small></p>
+ </div>
+ </div>
+ <% end %>
+ </div>
</div>
</div>
diff --git a/app/views/my/kitchens/show.html.erb b/app/views/my/kitchens/show.html.erb
index 18c00612..6946501e 100644
--- a/app/views/my/kitchens/show.html.erb
+++ b/app/views/my/kitchens/show.html.erb
@@ -16,10 +16,10 @@
<% end %>
<div class="row">
- <div class="span2">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div id="backbone-content" class="span10"></div>
+ <div id="backbone-content" class="col-9"></div>
</div>
-<div id="disqus_thread" class="row-fluid"></div>
+<div id="disqus_thread" class="row"></div>
<div id="modal" class="modal hide fade"></div>
diff --git a/app/views/my/passwords/index.html.erb b/app/views/my/passwords/index.html.erb
index e6dd33f1..a6d8c472 100644
--- a/app/views/my/passwords/index.html.erb
+++ b/app/views/my/passwords/index.html.erb
@@ -1,35 +1,23 @@
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
- <div class="page-header">
- <h1>Change Password</h1>
- </div>
+ <div class="col-9">
+ <h1>Change Password</h1>
<%= form_for @user, url: my_password_path(@user), html: { method: :patch, class: "form-horizontal" } do |f| %>
- <div class="control-group">
- <%= f.label :old_password, "Old password", class: "control-label" %>
- <div class="controls">
- <%= f.password_field :old_password %>
- </div>
+ <div class="form-group">
+ <%= f.label :old_password, "Old password" %>
+ <%= f.password_field :old_password, class: 'form-control' %>
</div>
- <div class="control-group">
- <%= f.label :password, "New password", class: "control-label" %>
- <div class="controls">
- <%= f.password_field :password %>
- </div>
+ <div class="form-group">
+ <%= f.label :password, "New password" %>
+ <%= f.password_field :password, class: 'form-control' %>
</div>
- <div class="control-group">
- <%= f.label :password_confirmation, "Confirm new password", class: "control-label" %>
- <div class="controls">
- <%= f.password_field :password_confirmation %>
- </div>
- </div>
- <div class="control-group">
- <div class="controls">
- <%= f.submit "Update password", class: "btn btn-primary" %>
- </div>
+ <div class="form-group">
+ <%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, class: 'form-control' %>
</div>
+ <%= f.submit "Update password", class: "btn btn-primary" %>
<% end %>
</div>
</div>
diff --git a/app/views/my/settings/index.html.erb b/app/views/my/settings/index.html.erb
index a76c9856..faadccfb 100644
--- a/app/views/my/settings/index.html.erb
+++ b/app/views/my/settings/index.html.erb
@@ -7,55 +7,49 @@
</script>
<% end %>
-<div class="row-fluid">
- <div class="span2">
+<div class="row">
+ <div class="col-3">
<%= render partial: "my/shared/my_nav" %>
</div>
- <div class="span10">
+ <div class="col-9">
<%= form_for(@user, :url => my_setting_path(@user), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
<fieldset>
- <div class="control-group">
- <%= f.label :name, :class => "control-label" %>
- <div class="controls"> <%= f.text_field :name, :class => "input-xlarge" %> </div>
+ <div class="form-group">
+ <%= f.label :name %>
+ <%= f.text_field :name, class: "form-control" %>
</div>
- <div class="control-group">
- <%= f.label :email, :class => "control-label" %>
- <div class="controls"> <%= f.email_field :email, :class => "input-xlarge" %> </div>
+ <div class="form-group">
+ <%= f.label :email %>
+ <%= f.email_field :email, class: "form-control" %>
</div>
- <div class="control-group">
- <%= f.label :city, :class => 'control-label' %>
- <div class="controls"> <%= f.text_field :city, :class => "input-xlarge" %> </div>
+ <div class="form-group">
+ <%= f.label :city %>
+ <%= f.text_field :city, class: "form-control" %>
</div>
- <div class="control-group">
- <%= f.label :website, :class => "control-label" %>
- <div class="controls"> <%= f.url_field :website, :class => "input-xlarge url", :placeholder => "http://cakeside.com" %> </div>
+ <div class="form-group">
+ <%= f.label :website %>
+ <%= f.url_field :website, class: "form-control url", placeholder: "http://cakeside.com" %>
</div>
- <div class="control-group">
- <%= f.label :twitter, "Twitter username @", :class => "control-label" %>
- <div class="controls"> <%= f.text_field :twitter, :class => "input-xlarge", :placeholder => "without the @ sign", :maxlength => "255" %> </div>
+ <div class="form-group">
+ <%= f.label :twitter, "Twitter username @" %>
+ <%= f.text_field :twitter, class: "form-control", placeholder: "without the @ sign", maxlength: "255" %>
</div>
- <div class="control-group">
- <%= f.label :facebook, :class => "control-label" %>
- <div class="controls"> <%= f.text_field :facebook, :class => "input-xlarge", :placeholder => "http://www.facebook.com/your_profile", :maxlength => "255" %> </div>
+ <div class="form-group">
+ <%= f.label :facebook %>
+ <%= f.text_field :facebook, class: "form-control", placeholder: "http://www.facebook.com/your_profile", maxlength: "255" %>
</div>
- <p class="help-block">
- <strong>Note:</strong> Help us better serve you by checking off what best describes you?
- </p>
- <div class="control-group">
- <label class="control-label">About me:</label>
- <div class="controls">
- <% for interest in Interest.all %>
- <label class="checkbox">
- <%= check_box_tag "user[interest_ids][]", interest.id, current_user.interests.include?(interest) %>
- <%= interest.name %>
- </label>
- <% end %>
- </div>
- </div><!-- /control-group -->
- <div class="form-actions">
- <input type="submit" class="btn btn-primary" value="Save changes" />
- <button type="reset" class="btn">Cancel</button>
+ <p class="help-block"><strong>Note:</strong> Help us better serve you by checking off what best describes you?</p>
+ <div class="form-check">
+ <label class="">About me:</label>
+ <% for interest in Interest.all %>
+ <label class="form-check-label">
+ <%= check_box_tag "user[interest_ids][]", interest.id, current_user.interests.include?(interest), class: 'form-check-input' %>
+ <%= interest.name %>
+ </label>
+ <% end %>
</div>
+ <input type="submit" class="btn btn-primary" value="Save changes" />
+ <button type="reset" class="btn btn-secondary">Cancel</button>
</fieldset>
<% end %>
</div>
diff --git a/app/views/my/shared/_my_nav.html.erb b/app/views/my/shared/_my_nav.html.erb
index 5c195037..8cb163b9 100644
--- a/app/views/my/shared/_my_nav.html.erb
+++ b/app/views/my/shared/_my_nav.html.erb
@@ -1,38 +1,28 @@
-<div class="well sidebar-nav">
- <%= link_to new_my_avatar_path, title: 'Change your avatar', data: { toggle: 'tooltip', placement: 'bottom', animation: 'true' }, class: 'tooltip-item' do %>
- <%= avatar_for(current_user) %>
+<%= link_to new_my_avatar_path do %>
+ <%= avatar_for(current_user) %>
+<% end %>
+<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist">
+ <%= link_to t('.dashboard'), my_dashboard_path, class: "nav-link #{"active" if controller?(:dashboard)}" %>
+ <%= link_to my_root_path(anchor: 'cakes/new'), class: "nav-link" do %>
+ <i class="fa fa-upload"></i> <%= t(".new_cake") %>
<% end %>
- <ul class="nav nav-list" data-no-turbolink>
- <li class="nav-header"><%= current_user.name %></li>
- <li class="<%= "active" if controller?(:dashboard) %>"><%= link_to "Dashboard", my_dashboard_path %></li>
- <li id='profile-tab'><%= link_to "Profile", my_root_path(anchor: 'profile/me') %></li>
- <li class="<%= 'active' if controller?(:passwords) %>"><%= link_to "Account", my_passwords_path %></li>
- <li class="<%= "active" if controller?(:favorites) %>"><%= link_to "Favorites", my_favorites_path %></li>
- <li class="<%= 'active' if controller?(:avatars) %>"><%= link_to "Picture", new_my_avatar_path %></li>
- <li class="nav-header">New</li>
- <li>
- <%= link_to my_root_path(anchor: 'cakes/new') do %>
- <i class="fa fa-upload"></i> Cake
- <% end %>
- </li>
- <li>
- <%= link_to my_root_path(anchor: 'tutorials/new') do %>
- <i class="fa fa-pencil-square"></i> Tutorial
- <% end %>
- </li>
- <% if current_user.admin? %>
- <li class="nav-header">Admin</li>
- <li><%= link_to "Users", admin_users_path %></li>
- <li><%= link_to "Jobs", admin_jobs_path %></li>
- <li><%= link_to "Activity", admin_activities_path %></li>
- <li><%= link_to "Subscriptions", admin_subscriptions_path %></li>
- <li><%= link_to "Photos", admin_photos_path %></li>
- <li><%= link_to "Blobs", admin_blobs_path %></li>
- <li><%= link_to "Sessions", admin_sessions_path %></li>
- <li><%= link_to "Products", admin_products_path %></li>
- <li><%= link_to "Charts", admin_charts_path %></li>
- <% end %>
- <li class="nav-header">Other</li>
- <li><%= link_to t('.logout'), logout_path, method: :delete %></li>
- </ul>
+ <%= link_to my_root_path(anchor: 'tutorials/new'), class: "nav-link" do %>
+ <i class="fa fa-pencil-square"></i> <%= t('.new_tutorial') %>
+ <% end %>
+ <%= link_to t(".my_profile"), my_root_path(anchor: 'profile/me'), class: "nav-link" %>
+ <%= link_to t(".favorites"), my_favorites_path, class: "nav-link #{"active" if controller?(:favorites)}" %>
+ <%= link_to t('.avatar'), new_my_avatar_path, class: "nav-link #{"active" if controller?(:avatars)}" %>
+ <%= link_to t('.change_password'), my_passwords_path, class: "nav-link #{"active" if controller?(:passwords)}" %>
+
+ <% if current_user.admin? %>
+ <h5><%= t(".admin") %></h5>
+ <%= link_to t(".users"), admin_users_path, class: "nav-link" %>
+ <%= link_to t(".jobs"), admin_jobs_path, class: "nav-link" %>
+ <%= link_to t(".activity"), admin_activities_path, class: "nav-link" %>
+ <%= link_to t(".photos"), admin_photos_path, class: "nav-link" %>
+ <%= link_to t(".sessions"), admin_sessions_path, class: "nav-link" %>
+ <%= link_to t(".products"), admin_products_path, class: "nav-link" %>
+ <% end %>
+
+ <%= link_to t('logout'), logout_path, method: :delete, class: "nav-link" %>
</div>
diff --git a/app/views/passwords/edit.html.erb b/app/views/passwords/edit.html.erb
index f4c158fa..e9d6a463 100644
--- a/app/views/passwords/edit.html.erb
+++ b/app/views/passwords/edit.html.erb
@@ -1,20 +1,14 @@
-<div class="row-fluid">
- <div class="span12">
+<div class="row">
+ <div class="col">
<h1>Reset Password</h1>
<%= form_for(@user, url: password_path(@user.reset_password_token), html: { method: :put }, class: "form-horizontal") do |f| %>
- <fieldset>
- <legend>Enter your new password</legend>
- <div class="control-group">
- <%= f.label :password, "New password", class: "control-label" %>
- <div class="controls">
- <%= f.password_field :password, class: "input-xlarge" %>
- </div>
- </div>
- <div class="form-actions">
- <%= f.hidden_field :reset_password_token %>
- <%= f.submit "Change my password", class: 'btn btn-primary' %>
- </div>
- </fieldset>
+ <legend>Enter your new password</legend>
+ <div class="form-group">
+ <%= f.label :password, "New password" %>
+ <%= f.password_field :password, class: "form-control" %>
+ </div>
+ <%= f.hidden_field :reset_password_token %>
+ <%= f.submit "Change my password", class: 'btn btn-primary' %>
<% end %>
</div>
</div>
diff --git a/app/views/passwords/new.html.erb b/app/views/passwords/new.html.erb
index 67e6f0f7..60d94e69 100644
--- a/app/views/passwords/new.html.erb
+++ b/app/views/passwords/new.html.erb
@@ -1,20 +1,13 @@
-<div class="page-header">
- <h1>Forgot your password?</h1>
-</div>
-<div class="row-fluid">
- <div class="span12">
- <%= form_for(@user, url: passwords_path, html: { method: :post }, class: "form-horizontal") do |f| %>
+<div class="row">
+ <div class="col">
+ <h1>Forgot your password?</h1>
+ <%= form_for(@user, url: passwords_path) do |f| %>
<fieldset>
<legend>Type your email address below to reset your password.</legend>
- <div class="control-group">
- <%= f.label :email, class: "control-label" %>
- <div class="controls">
- <%= f.email_field :email, placeholder: "Email", class: "input-xlarge" %>
- </div>
- </div>
- <div class="actions">
- <input type="submit" class="btn btn-primary" value="Send me reset password instructions">
+ <div class="form-group">
+ <%= f.email_field :email, placeholder: "Email", class: "form-control" %>
</div>
+ <button type="submit" class="btn btn-primary">Send me reset password instructions</button>
</fieldset>
<% end %>
</div>
diff --git a/app/views/photos/index.html.erb b/app/views/photos/index.html.erb
deleted file mode 100644
index 72b4acd3..00000000
--- a/app/views/photos/index.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <%= link_to "&laquo; Back to creation".html_safe, cake_path(@creation) %>
- <div class="row-fluid">
- <div class="span3">&nbsp;</div>
- <div class="span6">
- <div id="myCarousel" class="carousel slide">
- <ol class="carousel-indicators">
- <% @photos.each_with_index do |photo, index| %>
- <li data-target="#myCarousel" data-slide-to="<%= index %>" class="<%= index == 0 ? "active" : "" %>"></li>
- <% end %>
- </ol>
- <!-- Carousel items -->
- <div class="carousel-inner">
- <% @photos.each_with_index do |photo,index| %>
- <div class="item <%= index == 0 ? "active" : "" %>"><%= image_tag photo.url_for(:large), :class => "thumbnail" %></div>
- <% end %>
- </div>
- <!-- Carousel nav -->
- <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
- <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
- </div>
- </div>
- <div class="span3">&nbsp;</div>
- </div>
- </div>
-</div>
diff --git a/app/views/photos/show.html.erb b/app/views/photos/show.html.erb
deleted file mode 100644
index cd91c020..00000000
--- a/app/views/photos/show.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <h1><%= link_to @creation.name, cake_path(@creation) %></h1>
- <%= link_to cake_photo_path(@creation, @photo) do %>
- <%= image_tag(@photo.url_for(:original), :class => "thumbnail") %>
- <% end %>
- </div>
-</div>
-
-<div class="row-fluid">
- <div class="span12">
- <ul class="thumbnails">
- <% @creation.photos.each do |photo| %>
- <li class="span2">
- <%= link_to cake_photo_path(@creation, photo) do %>
- <%= image_tag(photo.url_for(:thumb), class: "thumbnail") %>
- <% end %>
- </li>
- <% end %>
- </ul>
- </div>
-</div>
diff --git a/app/views/products/_index.html.erb b/app/views/products/_index.html.erb
index 1b7bb5e1..2f26aa70 100644
--- a/app/views/products/_index.html.erb
+++ b/app/views/products/_index.html.erb
@@ -3,7 +3,7 @@
<% @products.each do |product| %>
<tr>
<td> <%= link_to product.item_attributes.title, product_path(product.asin) %> by <%= product.item_attributes.manufacturer %> </td>
- <td> <%= link_to 'View on Amazon', product.detail_page_url, class: 'btn', target: "_blank" %> </td>
+ <td> <%= link_to 'View on Amazon', product.detail_page_url, class: 'btn btn-primary', target: "_blank" %> </td>
</tr>
<% end %>
</tbody>
diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb
index d6b6517d..51030e66 100644
--- a/app/views/products/index.html.erb
+++ b/app/views/products/index.html.erb
@@ -1,7 +1,8 @@
<%= provide(:search_path, products_path) %>
-<div class="row-fluid">
- <div class="span12">
+<div class="row">
+ <div class="col">
<%= link_to "back", params[:boomerang] %>
+
<div id="results-container">
<%= render partial: "index" %>
</div>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb
index ad51542f..89bc5d90 100644
--- a/app/views/products/show.html.erb
+++ b/app/views/products/show.html.erb
@@ -1,17 +1,18 @@
<%= provide(:search_path, products_path) %>
-<div class="row-fluid">
+
+<div class="row">
<div class="page-header">
<h1><%= link_to @product.item_attributes['title'], @product.detail_page_url %></h1>
<p>By <%= link_to @product.item_attributes['manufacturer'], @product.detail_page_url %></p>
</div>
</div>
-<div class="row-fluid">
- <div class="span6">
+<div class="row">
+ <div class="col">
<%= link_to @product.detail_page_url do %>
<img class="thumbnail" src="<%= @product.large_image.url %>" alt="<%= @product.asin %>" />
<% end %>
</div>
- <div class="span6">
+ <div class="col">
<p><%= @product.item_attributes['feature'].join(" ") -%></p>
<ul class='unstyled'>
<% @product.item_links.item_link.each do |link| %>
@@ -24,8 +25,8 @@
</div>
</div>
-<div class="row-fluid">
- <div class="span12">
+<div class="row">
+ <div class="col">
<p><%= @product.editorial_reviews.editorial_review.content.html_safe %></p>
<p class='text-center'>
<%= link_to "View on Amazon", @product.detail_page_url, class: "btn btn-primary" %>
diff --git a/app/views/profiles/_index.html.erb b/app/views/profiles/_index.html.erb
index 06982c32..171a3926 100644
--- a/app/views/profiles/_index.html.erb
+++ b/app/views/profiles/_index.html.erb
@@ -1,23 +1,16 @@
-<div class="row-fluid">
- <% @profiles.each_slice(6).each do |batch| %>
- <ul class='thumbnails'>
- <% batch.each do |profile| %>
- <% cache profile do %>
- <li class="span2">
- <div class="thumbnail">
- <%= link_to profile_path(profile) do %>
- <%= avatar_for(profile) %>
- <% end %>
- <div class="caption">
- <small><%= link_to truncate(profile.name, length: 20), profile_path(profile) %></small>
- </div>
- </div>
- </li>
- <% end %>
+<div class="card-columns">
+ <% @profiles.each do |profile| %>
+ <div class="card">
+ <%= link_to profile_path(profile) do %>
+ <%= avatar_for(profile, clazz: 'card-img-top') %>
<% end %>
- </ul>
+ <div class="card-body">
+ <h4 class="card-title"><%= truncate(profile.name, length: 20) %></h4>
+ <p class="card-text"><small class="text-muted">joined <%= distance_of_time_in_words_to_now profile.created_at %> ago</small></p>
+ </div>
+ </div>
<% end %>
</div>
-<div id='more-button-row' class="row-fluid">
- <%= link_to_next_page @profiles, 'More...', params: { cache: false }, remote: true, class: 'more-button hidden', data: { disable_with: 'loading...' } %>
+<div id='more-button-row' class="row">
+ <%= link_to_next_page @profiles, 'More...', params: { cache: false }, remote: true, class: 'hidden', data: { disable_with: 'loading...', infinite_scroll: true } %>
</div>
diff --git a/app/views/profiles/index.html.erb b/app/views/profiles/index.html.erb
index 9409ca3f..e21fe565 100644
--- a/app/views/profiles/index.html.erb
+++ b/app/views/profiles/index.html.erb
@@ -1,8 +1,6 @@
<%= provide(:search_path, profiles_path) %>
-<% provide(:container_class, 'container-fluid') %>
+<% provide(:container_class, 'container') %>
<div id="bakery">
<%= render partial: 'index' %>
</div>
-<div id="pagination-row" class="row-fluid">
- <%= render "shared/paging", items: @profiles %>
-</div>
+<%= render "shared/paging", items: @profiles %>
diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb
index e3ddc828..8519f38d 100644
--- a/app/views/profiles/show.html.erb
+++ b/app/views/profiles/show.html.erb
@@ -1,12 +1,10 @@
<% provide(:title, @user.name) -%>
<% provide(:search_path, profiles_path) %>
<div class="row">
- <div class="span3">
- <div class="thumbnail">
- <%= avatar_for(@user) %>
- </div>
+ <div class="col-3">
+ <%= avatar_for(@user, clazz: 'img-thumbnail') %>
</div>
- <div class="span9">
+ <div class="col-9">
<h1><%= @user.name %> <small>A member since <%= @user.created_at.to_s :foomat %>, with <%= @user.creations.length %> creations.</small> </h1>
<h5><%= @user.city %></h5>
<hr>
@@ -17,27 +15,18 @@
<p><a href="https://twitter.com/<%= @user.twitter %>" target="_blank" class="twitter-follow-button" data-show-count="false">Follow @<%= @user.twitter %></a></p>
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
<% end %>
- <% unless @user.facebook.blank? %>
- <p><a href="<%= @user.facebook %>" target="_blank"><%= image_tag "f_logo_16x16x32.png", :alt => "Like us on Facebook" %> Like on Facebook</a></p>
+ <% if @user.facebook.present? %>
+ <p><a href="<%= @user.facebook %>" target="_blank"><%= image_tag "f_logo_16x16x32.png", :alt => "Like us on Facebook" %> Like on Facebook</a></p>
<% end %>
</div>
</div>
<hr />
-<div class="row-fluid">
- <% @creations.each_slice(6).each do |batch| %>
- <ul class='thumbnails'>
- <% batch.each do |creation| %>
- <li class="span2">
- <div class="thumbnail">
- <%= link_to cake_path(creation) do %>
- <%= image_tag creation.primary_image.url_for(:thumb) %>
- <% end %>
- <div class="caption">
- <small><%= link_to truncate(creation.name, length: 20), cake_path(creation) %></small>
- </div>
- </div>
- </li>
+<div class="card-columns">
+ <% @creations.each do |creation| %>
+ <div class="card">
+ <%= link_to cake_path(creation) do %>
+ <%= image_tag creation.primary_image.url_for(:thumb), class: 'card-img-top' %>
<% end %>
- </ul>
+ </div>
<% end %>
</div>
diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb
index 3fc3c010..877ccb3c 100644
--- a/app/views/search/index.html.erb
+++ b/app/views/search/index.html.erb
@@ -1,96 +1,92 @@
<% provide(:title, "#{@search}") -%>
-<div class="row-fluid">
- <div class="span12">
- <div class="tabbable tabs-left">
- <ul class="nav nav-tabs">
- <li class="active"><a href="#tab1" data-toggle="tab">Creations</a></li>
- <li><a href="#tab2" data-toggle="tab">Tutorials</a></li>
- <li><a href="#tab3" data-toggle="tab">Artists</a></li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane active" id="tab1">
- <% if @creations.any? %>
- <table class="table table-striped">
- <thead>
- <th></th>
- <th>Artist</th>
- <th>Name</th>
- <th>Description</th>
- </thead>
- <tbody>
- <% @creations.each_with_index do |creation, index| %>
- <% cache creation do %>
- <tr>
- <td>
- <%= link_to cake_path(creation) do %>
- <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %>
- <% end %>
- </td>
- <td><%= link_to creation.user.name, profile_path(creation.user) %></td>
- <td><%= creation.name %></td>
- <td><%= creation.story %></td>
- </tr>
- <% end %>
+<div class="row">
+ <div class="col">
+ <ul class="nav nav-tabs">
+ <li class="nav-item"><a class="nav-link active" href="#tab1" data-toggle="tab">Creations</a></li>
+ <li class="nav-item"><a class="nav-link" href="#tab2" data-toggle="tab">Tutorials</a></li>
+ <li class="nav-item"><a class="nav-link" href="#tab3" data-toggle="tab">Artists</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane show active" id="tab1">
+ <% if @creations.any? %>
+ <table class="table table-striped">
+ <thead>
+ <th></th>
+ <th>Artist</th>
+ <th>Name</th>
+ <th>Description</th>
+ </thead>
+ <tbody>
+ <% @creations.each_with_index do |creation, index| %>
+ <% cache creation do %>
+ <tr>
+ <td>
+ <%= link_to cake_path(creation) do %>
+ <%= image_tag creation.primary_image.url_for(:thumb), class: 'thumbnail', style: "width:65px;" %>
+ <% end %>
+ </td>
+ <td><%= link_to creation.user.name, profile_path(creation.user) %></td>
+ <td><%= creation.name %></td>
+ <td><%= creation.story %></td>
+ </tr>
<% end %>
- </tbody>
- </table>
- <% else %>
- <p>No creations found.</p>
<% end %>
- </div>
- <div class="tab-pane" id="tab2">
- <% if @tutorials.any? %>
- <table class="table table-striped">
- <thead>
- <th>Name</th>
- <th>Description</th>
- </thead>
- <tbody>
- <% @tutorials.each_with_index do |tutorial, index| %>
- <% cache tutorial do %>
- <tr>
- <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td>
- <td><%= tutorial.description %></td>
- </tr>
- <% end %>
+ </tbody>
+ </table>
+ <% else %>
+ <p>No creations found.</p>
+ <% end %>
+ </div>
+ <div class="tab-pane" id="tab2">
+ <% if @tutorials.any? %>
+ <table class="table table-striped">
+ <thead>
+ <th>Name</th>
+ <th>Description</th>
+ </thead>
+ <tbody>
+ <% @tutorials.each_with_index do |tutorial, index| %>
+ <% cache tutorial do %>
+ <tr>
+ <td><%= link_to tutorial.heading, tutorial_path(tutorial) %></td>
+ <td><%= tutorial.description %></td>
+ </tr>
<% end %>
- </tbody>
- </table>
- <% else %>
- <p>No tutorials found.</p>
<% end %>
- </div>
- <div class="tab-pane" id="tab3">
- <% if @members.any? %>
- <table class="table table-striped">
- <thead>
- <th>Artists</th>
- <th>Name</th>
- </thead>
- <tbody>
- <% @members.each_with_index do |artist, index| %>
- <tr>
- <td>
- <%= link_to profile_path(artist) do %>
- <%= avatar_for(artist, size: 65) %>
- <% end %>
- </td>
- <td><%= link_to artist.name, profile_path(artist) %></td>
- <td><%= link_to artist.website, artist.website if artist.website %></td>
- <td><%= link_to artist.twitter, "https://twitter.com/#{artist.twitter}" if artist.twitter.present? %></td>
- <td><%= link_to artist.facebook, artist.facebook if artist.facebook %></td>
- <td><%= artist.city %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <% else %>
- <p>No artists found.</p>
+ </tbody>
+ </table>
+ <% else %>
+ <p>No tutorials found.</p>
+ <% end %>
+ </div>
+ <div class="tab-pane" id="tab3">
+ <% if @members.any? %>
+ <table class="table table-striped">
+ <thead>
+ <th>Artists</th>
+ <th>Name</th>
+ </thead>
+ <tbody>
+ <% @members.each_with_index do |artist, index| %>
+ <tr>
+ <td>
+ <%= link_to profile_path(artist) do %>
+ <%= avatar_for(artist, size: 65) %>
+ <% end %>
+ </td>
+ <td><%= link_to artist.name, profile_path(artist) %></td>
+ <td><%= link_to artist.website, artist.website if artist.website %></td>
+ <td><%= link_to artist.twitter, "https://twitter.com/#{artist.twitter}" if artist.twitter.present? %></td>
+ <td><%= link_to artist.facebook, artist.facebook if artist.facebook %></td>
+ <td><%= artist.city %></td>
+ </tr>
<% end %>
- </div>
+ </tbody>
+ </table>
+ <% else %>
+ <p>No artists found.</p>
+ <% end %>
</div>
</div>
-
-
</div>
</div>
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index fd510845..4b4b1914 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -12,60 +12,49 @@
});
</script>
<% end %>
-<div class="row-fluid">
- <div class="span12">
- <div class="row-fluid">
- <div class="span6 hidden-phone">
- <%= image_tag "cakeside-logo.png" %>
- <div style="padding-left:10px;padding-right:10px;">
- <h3>Why CakeSide?</h3>
- <p>CakeSide is a community dedicated to giving cake artists, bakers, creators, hobbyists, and of course cake lovers a place to share ideas and creations. Explore your creativity and find your inspiration. Resources shared here are all user driven.</p>
- <h3>About Us</h3>
- <p>We are a passionate team dedicated to improving the cake sharing experience. Frustrated with the lack of community that provides more than just photo sharing, CakeSide was born. All features of this site will be user inspired. We love to listen so feel free to give us <a href="https://cakeside.uservoice.com/" target="_blank">feedback</a>. Check back often to see what's new in the CakeSide community!</p>
- </div>
+<div class="row">
+ <div class="col hidden-phone">
+ <%= image_tag "cakeside-logo.png" %>
+ <div style="padding-left:10px;padding-right:10px;">
+ <h3>Why CakeSide?</h3>
+ <p>CakeSide is a community dedicated to giving cake artists, bakers, creators, hobbyists, and of course cake lovers a place to share ideas and creations. Explore your creativity and find your inspiration. Resources shared here are all user driven.</p>
+ <h3>About Us</h3>
+ <p>We are a passionate team dedicated to improving the cake sharing experience. Frustrated with the lack of community that provides more than just photo sharing, CakeSide was born. All features of this site will be user inspired. We love to listen so feel free to give us <a href="https://cakeside.uservoice.com/" target="_blank">feedback</a>. Check back often to see what's new in the CakeSide community!</p>
+ </div>
+ </div>
+ <div class="col">
+ <%= form_for(@session, url: sessions_path(@session), html: { class: "form-horizontal" }) do |f| %>
+ <legend>Got an account? Login!</legend>
+ <div class="form-group">
+ <%= email_field_tag 'session[username]', '', placeholder: 'Email', class: "form-control" %>
</div>
- <div class="span6">
- <%= form_for(@session, url: sessions_path(@session), html: { class: "well form-inline"}) do |f| %>
- <legend>Got an account? Login!</legend>
- <%= email_field_tag 'session[username]', '', :placeholder => 'Email', :class=> "input-medium" %>
- <%= password_field_tag 'session[password]', '', :placeholder => 'Password', :class=> "input-medium" %>
- <%= f.submit "Sign In", :class => "btn" %>
- <br />
- <p><%= link_to "Forgot your password?", new_password_path %></p>
- <% end %>
- <%= form_for(User.new, as: :user, url: registration_path, html: { :class=> 'form-horizontal' }) do |f| %>
- <fieldset>
- <legend>New to CakeSide? Join Us!</legend>
- </fieldset>
- <div class="control-group">
- <%= f.label :name, 'Full name', :class => "control-label" %>
- <div class="controls">
- <%= f.text_field :name, :placeholder => 'required' %>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :email, 'Email', :class => "control-label" %>
- <div class="controls">
- <%= f.email_field :email, :placeholder => 'required' %>
- </div>
- </div>
- <div class="control-group">
- <%= f.label :password, 'Password', :class => "control-label" %>
- <div class="controls">
- <%= f.password_field :password, :placeholder => 'required' %>
- </div>
- </div>
- <div class="control-group">
- <label for="accepted" class="control-label"></label>
- <div class="controls">
- <input id="accepted" name="accepted" type="checkbox" value="" checked="checked" /> I have read the <a href="/terms.html">terms and conditions</a> and the <a href="/privacy.html">privacy policy</a>
- </div>
- </div>
- <div class="form-actions">
- <%= f.submit "Sign up", :id => 'submit-registration', :class=> "btn btn-primary" %>
- </div>
- <% end %>
+ <div class="form-group">
+ <%= password_field_tag 'session[password]', '', placeholder: 'Password', class: "form-control" %>
</div>
- </div>
+ <p><%= link_to "Forgot your password?", new_password_path %></p>
+ <%= f.submit t(".sign_in"), class: "btn btn-primary" %>
+ <br />
+ <% end %>
+ <%= form_for(User.new, as: :user, url: registration_path, html: { class: 'form-horizontal' }) do |f| %>
+ <fieldset>
+ <legend>New to CakeSide? Join Us!</legend>
+ </fieldset>
+ <div class="form-group">
+ <%= f.text_field :name, placeholder: 'Full name', class: 'form-control' %>
+ </div>
+ <div class="form-group">
+ <%= f.email_field :email, placeholder: 'Email', class: 'form-control' %>
+ </div>
+ <div class="form-group">
+ <%= f.password_field :password, placeholder: 'Password', class: 'form-control' %>
+ </div>
+ <div class="form-check">
+ <label>
+ <input id="accepted" name="accepted" type="checkbox" value="" />
+ I have read the <a href="/terms.html">terms and conditions</a> and the <a href="/privacy.html">privacy policy</a>
+ </label>
+ </div>
+ <%= f.submit "Register", id: 'submit-registration', class: "btn btn-primary" %>
+ <% end %>
</div>
</div>
diff --git a/app/views/shared/_account_nav.html.erb b/app/views/shared/_account_nav.html.erb
deleted file mode 100644
index c529a7e5..00000000
--- a/app/views/shared/_account_nav.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div class="row-fluid">
- <div class="span12">
- <ul class="nav nav-tabs">
- <li class="pull-right"><%= link_to t('.logout'), logout_path, method: :delete, class: "btn btn-inverse" %></li>
- <% if current_user.admin? %>
- <li class="pull-right"><%= link_to t('.admin'), admin_root_path %></li>
- <% end %>
- <li class="dropdown pull-right">
- <a class="dropdown-toggle" data-toggle="dropdown" href="#">
- <i class="icon-plus"></i> <b class="caret"></b>
- </a>
- <ul class="dropdown-menu">
- <li>
- <%= link_to my_root_path(anchor: 'cakes/new') do %>
- <i class="icon-camera"></i> New Cake
- <% end %>
- </li>
- <li>
- <%= link_to my_root_path(anchor: 'tutorials/new') do %>
- <i class="icon-edit"></i> New Tutorial
- <% end %>
- </li>
- </ul>
- </li>
- </ul>
- </div>
-</div>
diff --git a/app/views/shared/_paging.html.erb b/app/views/shared/_paging.html.erb
index d0e59b71..c9f7ba8f 100644
--- a/app/views/shared/_paging.html.erb
+++ b/app/views/shared/_paging.html.erb
@@ -1,3 +1 @@
-<div class="row-fluid">
- <div class="span12 text-center"> <%= paginate items %> </div>
-</div>
+<%= paginate items %>
diff --git a/app/views/tutorial_tags/index.html.erb b/app/views/tutorial_tags/index.html.erb
deleted file mode 100644
index 6dfdca8a..00000000
--- a/app/views/tutorial_tags/index.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<% provide(:title, "Tag, you're it".html_safe) -%>
-<div class="row-fluid">
- <div class="span12">
- <% tag_cloud(@tags, %w(btn-mini btn-small btn-large)) do |tag, css_class| %>
- <%= link_to "#{tag.name} x #{tag.count}", tutorial_tag_path(tag.name), class: "#{css_class} btn" %>
- <% end %>
- </div>
-</div>
diff --git a/app/views/tutorial_tags/show.html.erb b/app/views/tutorial_tags/show.html.erb
index 527ff838..3420b184 100644
--- a/app/views/tutorial_tags/show.html.erb
+++ b/app/views/tutorial_tags/show.html.erb
@@ -1,21 +1,21 @@
<% provide(:title, @tag) -%>
<% provide(:search_path, tutorials_path) %>
-<div class="row-fluid">
- <table class='table'>
- <% @tutorials.each do |tutorial| %>
- <tr>
- <td>
- <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
- <% tutorial.tags.each do |tag| -%>
- <%= link_to tutorial_tag_path(tag.name) do %>
- <span class="label"><%= tag.name %></span>
- <% end %>
- <% end -%>
- </td>
- </tr>
- <% end %>
- </table>
-</div>
-<div class="row-fluid">
- <%= render "shared/paging", items: @tutorials %>
+<div class="row">
+ <div class="col">
+ <table class='table'>
+ <% @tutorials.each do |tutorial| %>
+ <tr>
+ <td>
+ <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
+ <% tutorial.tags.each do |tag| -%>
+ <%= link_to tutorial_tag_path(tag.name) do %>
+ <span class="badge badge-light"><%= tag.name %></span>
+ <% end %>
+ <% end -%>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+ </div>
</div>
+<%= render "shared/paging", items: @tutorials %>
diff --git a/app/views/tutorials/index.html.erb b/app/views/tutorials/index.html.erb
index 063fa8a0..e31f8cea 100644
--- a/app/views/tutorials/index.html.erb
+++ b/app/views/tutorials/index.html.erb
@@ -1,20 +1,20 @@
<% provide(:search_path, tutorials_path) %>
-<div class="row-fluid">
- <table class='table'>
- <% @tutorials.each do |tutorial| %>
- <tr>
- <td>
- <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
- <% tutorial.tags.each do |tag| -%>
- <%= link_to tutorial_tag_path(tag.name) do %>
- <span class="label"><%= tag.name %></span>
- <% end %>
- <% end -%>
- </td>
- </tr>
- <% end %>
- </table>
-</div>
-<div class="row-fluid">
- <%= render "shared/paging", items: @tutorials %>
+<div class="row">
+ <div class="col">
+ <table class='table table-bordered'>
+ <tbody>
+ <% @tutorials.each do |tutorial| %>
+ <tr>
+ <td>
+ <h4><%= link_to tutorial.heading, tutorial.url %> <small><%= tutorial.created_at.to_s :foomat %></small></h4>
+ <% tutorial.tags.each do |tag| -%>
+ <%= link_to tag.name, tutorial_tag_path(tag.name), class: 'badge badge-secondary' %>
+ <% end -%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
</div>
+<%= render "shared/paging", items: @tutorials %>
diff --git a/app/views/tutorials/show.html.erb b/app/views/tutorials/show.html.erb
index e9cd6e38..c4ae624f 100644
--- a/app/views/tutorials/show.html.erb
+++ b/app/views/tutorials/show.html.erb
@@ -1,20 +1,20 @@
<%= provide(:search_path, tutorials_path) %>
-<div class="row-fluid">
- <div class="span12">
- <div class="thumbnail">
- <img src="<%= @tutorial.image_url %>" />
- <div class="caption">
- <h3><a href="<%= @tutorial.url %>" target="_blank"><%= @tutorial.heading %></a> <small><%= @tutorial.created_at.to_s :foomat %></small></h3>
- <p>
- <% @tutorial.tags.each do |tag| -%>
- <%= link_to tutorial_tag_path(tag.name) do %>
- <span class="label"><%= tag.name %></span>
- <% end %>
- <% end -%>
- </p>
- <p><%= @tutorial.description %></p>
- <p><a class="btn btn-primary" href="<%= @tutorial.url %>">Read full article</a></p>
- </div>
- </div>
+
+<div class="row">
+ <div class="col">
+ <img src="<%= @tutorial.image_url %>" />
+ </div>
+ <div class="col">
+ <h3><%= @tutorial.heading %></h3>
+ <small><%= @tutorial.created_at.to_s :foomat %></small>
+ <p>
+ <% @tutorial.tags.each do |tag| -%>
+ <%= link_to tutorial_tag_path(tag.name) do %>
+ <span class="badge badge-info"><%= tag.name %></span>
+ <% end %>
+ <% end -%>
+ </p>
+ <p><%= @tutorial.description %></p>
+ <p><a class="btn btn-primary" href="<%= @tutorial.url %>" target="_blank">Read full article</a></p>
</div>
</div>
diff --git a/config/initializers/mailchimp.rb b/config/initializers/mailchimp.rb
deleted file mode 100644
index d1487a99..00000000
--- a/config/initializers/mailchimp.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-Gibbon::Request.api_key = ENV['MAILCHIMP_API_KEY']
-Gibbon::Request.timeout = 15
-Gibbon::Request.throws_exceptions = false
diff --git a/config/locales/controllers/sessions/en.yml b/config/locales/controllers/sessions/en.yml
index 42d7f755..cc868578 100644
--- a/config/locales/controllers/sessions/en.yml
+++ b/config/locales/controllers/sessions/en.yml
@@ -1,6 +1,8 @@
---
en:
sessions:
+ new:
+ sign_in: "Sign In"
create:
failure:
invalid: Invalid email or password.
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 787bd715..534c58e8 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,12 +1,22 @@
---
en:
avatar_uploaded: Your avatar has been updated.
+ logout: Sign Out
my:
shared:
my_nav:
- logout: Log Out
+ activity: "Activity"
+ admin: "Admin"
+ avatar: "My Photo"
+ change_password: "Change My Password"
+ dashboard: "Dashboard"
+ favorites: "My Favorites"
+ jobs: "Jobs"
+ my_profile: "My Profile"
+ new_cake: "Cake"
+ new_tutorial: "Tutorial"
+ photos: "Photos"
+ products: "Products"
+ sessions: "Sessions"
+ users: "Users"
profile_saved: Your settings have been updated successfully!
- shared:
- account_nav:
- admin: Admin
- logout: Logout
diff --git a/config/routes.rb b/config/routes.rb
index 330366fe..61f597a3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -9,15 +9,14 @@ Cake::Application.routes.draw do
resources :tutorials, only: [:index, :show] do
get 'page/:page', action: :index, on: :collection
end
- resources :tutorial_tags, only: [:index, :show], path: :tt do
+ resources :tutorial_tags, only: [:show], path: :tt do
member do
get 'page/:page', action: :show
end
end
resources :cakes, only: [:index, :show], path: :cakes do
- resources :photos, only: [:index, :show]
- resources :favorites, only: [:index, :create]
+ resources :favorites, only: [:create]
get 'page/:page', action: :index, on: :collection, as: :paginate
collection do
get :newest, action: 'index', sort: 'newest'
@@ -78,16 +77,13 @@ Cake::Application.routes.draw do
namespace :admin do
root to: "users#index"
- resources :users, only: [:index, :show, :update]
- resources :jobs, only: [:index, :show, :update, :destroy]
resources :activities, only: [:index]
- resources :subscriptions, only: [:index]
- resources :photos, only: [:index, :show, :update]
- resources :blobs, only: [:index, :show]
resources :errors, only: [:index, :create]
- resources :sessions, only: [:index, :destroy]
+ resources :jobs, only: [:index, :show, :update, :destroy]
+ resources :photos, only: [:index, :show, :update]
resources :products, only: [:index, :show, :create]
- resources :charts, only: [:index]
+ resources :sessions, only: [:index, :destroy]
+ resources :users, only: [:index, :show, :update]
end
namespace :my do
diff --git a/db/schema.rb b/db/schema.rb
index 3a251d85..3bc1881b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -18,11 +18,11 @@ ActiveRecord::Schema.define(version: 20170831205234) do
enable_extension "uuid-ossp"
create_table "activities", force: :cascade do |t|
- t.integer "subject_id", null: false
- t.string "subject_type", limit: 255, null: false
- t.integer "user_id", null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.integer "subject_id", null: false
+ t.string "subject_type", null: false
+ t.integer "user_id", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
add_index "activities", ["subject_id"], name: "index_activities_on_subject_id", using: :btree
@@ -31,20 +31,20 @@ ActiveRecord::Schema.define(version: 20170831205234) do
create_table "avatars", force: :cascade do |t|
t.integer "user_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.string "avatar", limit: 255
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "avatar"
t.boolean "avatar_processing"
- t.string "avatar_tmp", limit: 255
+ t.string "avatar_tmp"
end
add_index "avatars", ["user_id"], name: "index_avatars_on_user_id", using: :btree
create_table "categories", force: :cascade do |t|
- t.string "name", limit: 255
+ t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "slug", limit: 255
+ t.string "slug"
end
add_index "categories", ["slug"], name: "index_categories_on_slug", using: :btree
@@ -52,7 +52,7 @@ ActiveRecord::Schema.define(version: 20170831205234) do
create_table "comments", force: :cascade do |t|
t.integer "user_id"
t.integer "creation_id"
- t.string "text", limit: 255
+ t.string "text"
t.integer "disqus_id"
t.datetime "created_at"
t.datetime "updated_at"
@@ -62,15 +62,15 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
create_table "creations", force: :cascade do |t|
- t.string "name", limit: 255
+ t.string "name"
t.text "story"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
- t.string "image", limit: 255
- t.string "watermark", limit: 255
- t.integer "photos_count", default: 0
- t.integer "favorites_count", default: 0
+ t.string "image"
+ t.string "watermark"
+ t.integer "photos_count", default: 0
+ t.integer "favorites_count", default: 0
t.integer "category_id"
end
@@ -79,17 +79,17 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "creations", ["user_id"], name: "index_creations_on_user_id", using: :btree
create_table "delayed_jobs", force: :cascade do |t|
- t.integer "priority", default: 0
- t.integer "attempts", default: 0
+ t.integer "priority", default: 0
+ t.integer "attempts", default: 0
t.text "handler"
t.text "last_error"
t.datetime "run_at"
t.datetime "locked_at"
t.datetime "failed_at"
- t.string "locked_by", limit: 255
- t.string "queue", limit: 255
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "locked_by"
+ t.string "queue"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree
@@ -105,18 +105,18 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "favorites", ["user_id"], name: "index_favorites_on_user_id", using: :btree
create_table "interests", force: :cascade do |t|
- t.string "name", limit: 255
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.string "name"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "locations", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
t.uuid "locatable_id"
- t.string "locatable_type", limit: 255
- t.string "latitude", limit: 255
- t.string "longitude", limit: 255
- t.string "city", limit: 255
- t.string "country", limit: 255
+ t.string "locatable_type"
+ t.string "latitude"
+ t.string "longitude"
+ t.string "city"
+ t.string "country"
t.datetime "created_at"
t.datetime "updated_at"
end
@@ -125,18 +125,18 @@ ActiveRecord::Schema.define(version: 20170831205234) do
create_table "photos", force: :cascade do |t|
t.integer "imageable_id"
- t.string "image", limit: 255
+ t.string "image"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "image_tmp", limit: 255
+ t.string "image_tmp"
t.boolean "image_processing"
- t.string "content_type", limit: 255
- t.string "original_filename", limit: 255
+ t.string "content_type"
+ t.string "original_filename"
t.float "latitude"
t.float "longitude"
- t.string "sha256", limit: 255
- t.string "watermark", limit: 255
- t.string "imageable_type", limit: 255
+ t.string "sha256"
+ t.string "watermark"
+ t.string "imageable_type"
end
add_index "photos", ["imageable_id", "imageable_type"], name: "index_photos_on_imageable_id_and_imageable_type", using: :btree
@@ -145,9 +145,9 @@ ActiveRecord::Schema.define(version: 20170831205234) do
create_table "taggings", force: :cascade do |t|
t.integer "tag_id"
t.integer "taggable_id"
- t.string "taggable_type", limit: 255
+ t.string "taggable_type"
t.integer "tagger_id"
- t.string "tagger_type", limit: 255
+ t.string "tagger_type"
t.string "context", limit: 128
t.datetime "created_at"
end
@@ -164,8 +164,8 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "taggings", ["tagger_type"], name: "index_taggings_on_tagger_type", using: :btree
create_table "tags", force: :cascade do |t|
- t.string "name", limit: 255
- t.integer "taggings_count", default: 0
+ t.string "name"
+ t.integer "taggings_count", default: 0
end
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
@@ -182,15 +182,15 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "tools", ["name"], name: "index_tools_on_name", unique: true, using: :btree
create_table "tutorials", force: :cascade do |t|
- t.string "heading", limit: 255
+ t.string "heading"
t.text "description"
- t.string "url", limit: 255
+ t.string "url"
t.integer "user_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.string "image_url", limit: 255
- t.string "author", limit: 255
- t.string "author_url", limit: 255
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "image_url"
+ t.string "author"
+ t.string "author_url"
end
add_index "tutorials", ["user_id"], name: "index_tutorials_on_user_id", using: :btree
@@ -199,8 +199,8 @@ ActiveRecord::Schema.define(version: 20170831205234) do
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "key", limit: 255
- t.string "ip", limit: 255
+ t.string "key"
+ t.string "ip"
t.text "user_agent"
t.datetime "accessed_at"
t.datetime "revoked_at"
@@ -212,20 +212,20 @@ ActiveRecord::Schema.define(version: 20170831205234) do
add_index "user_sessions", ["user_id"], name: "index_user_sessions_on_user_id", using: :btree
create_table "users", force: :cascade do |t|
- t.string "email", limit: 255, default: "", null: false
- t.string "password_digest", limit: 128, default: "", null: false
- t.string "reset_password_token", limit: 255
+ t.string "email", default: "", null: false
+ t.string "password_digest", default: "", null: false
+ t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "name", limit: 255
- t.string "website", limit: 255
- t.string "twitter", limit: 255
- t.string "facebook", limit: 255
- t.string "city", limit: 255
- t.string "authentication_token", limit: 255
- t.string "full_address", limit: 255
- t.integer "creations_count", default: 0
+ t.string "name"
+ t.string "website"
+ t.string "twitter"
+ t.string "facebook"
+ t.string "city"
+ t.string "authentication_token"
+ t.string "full_address"
+ t.integer "creations_count", default: 0
t.boolean "admin"
end
diff --git a/spec/controllers/favorites_controller_spec.rb b/spec/controllers/favorites_controller_spec.rb
index ffb7f1a4..626f7938 100644
--- a/spec/controllers/favorites_controller_spec.rb
+++ b/spec/controllers/favorites_controller_spec.rb
@@ -7,20 +7,6 @@ describe FavoritesController do
before { http_login(user) }
- context "when loading all the favorites for a cake" do
- let(:favorite) { create(:favorite, creation: cake, user: user) }
-
- before :each do
- cake.favorites << favorite
- cake.save!
- get :index, cake_id: cake.id
- end
-
- it "should return them all" do
- expect(assigns(:favorites)).to include(favorite)
- end
- end
-
context "when adding a cake to your favorites" do
before :each do
post :create, cake_id: cake.id
diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb
deleted file mode 100644
index 2c7ea067..00000000
--- a/spec/controllers/photos_controller_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'rails_helper'
-
-describe PhotosController do
- let(:cake){ create(:cake) }
-
- describe "#index" do
- before :each do
- get :index, cake_id: cake.id
- end
-
- it "loads the cake" do
- expect(assigns(:creation)).to eql(cake)
- end
-
- it "loads the photos" do
- expect(assigns(:photos)).to match_array(cake.photos)
- end
- end
-
- describe "#show" do
- let(:photo) { create(:photo) }
-
- before :each do
- cake.photos.push(photo)
- get :show, cake_id: cake.id, id: photo.id
- end
-
- it "loads the cake" do
- expect(assigns(:creation)).to eql(cake)
- end
-
- it "loads the photo" do
- expect(assigns(:photo)).to eql(photo)
- end
- end
-end
diff --git a/spec/features/add_to_favorites_spec.rb b/spec/features/add_to_favorites_spec.rb
index 42f7bb31..4ec6ac4a 100644
--- a/spec/features/add_to_favorites_spec.rb
+++ b/spec/features/add_to_favorites_spec.rb
@@ -4,19 +4,12 @@ describe "adding a cake to your favorites" do
let!(:creation) { create(:creation, user: create(:user), photos: [create(:photo)]) }
let!(:me) { create(:user, password: "password") }
- before :each do
- visit login_path
- within('.form-inline') do
- fill_in('session_username', with: me.email)
- fill_in('session_password', with: "password")
- end
- click_button("Sign In")
+ before { http_login(me) }
+
+ it "redirects you to the cake after" do
visit root_path
click_link(creation.name[0...12])
click_link_or_button("add-to-favorites-button")
- end
-
- it "redirects you to the cake after" do
expect(page).to have_content("This has been added to your favorites")
end
end
diff --git a/spec/features/change_password_spec.rb b/spec/features/change_password_spec.rb
index 1ba10715..6db340bb 100644
--- a/spec/features/change_password_spec.rb
+++ b/spec/features/change_password_spec.rb
@@ -4,25 +4,18 @@ describe "changing my password", js: true do
context "when changing my password" do
let(:user) { create(:user, password: "password") }
- before :each do
- visit login_path
- within(".form-inline") do
- fill_in("session_username", with: user.email)
- fill_in("session_password", with: "password")
- end
- click_button("Sign In")
+ before { http_login(user) }
+
+ it "displays a confirmation message" do
visit my_dashboard_path
- click_link("Account")
+ click_link(I18n.t("my.shared.my_nav.change_password"))
+
within(".form-horizontal") do
- fill_in("user_password", with: "mopass")
- fill_in("user_password_confirmation", with: "mopass")
+ fill_in("user_password", with: "secret")
+ fill_in("user_password_confirmation", with: "secret")
end
click_button "Update password"
- end
-
- it "displays a confirmation message" do
- confirmation_message = I18n.translate("my.passwords.updated")
- expect(page).to have_content(confirmation_message)
+ expect(page).to have_content(I18n.translate("my.passwords.updated"))
end
end
end
diff --git a/spec/features/change_profile_settings_spec.rb b/spec/features/change_profile_settings_spec.rb
index 32e55860..5da192e7 100644
--- a/spec/features/change_profile_settings_spec.rb
+++ b/spec/features/change_profile_settings_spec.rb
@@ -1,26 +1,19 @@
require "rails_helper"
describe "Change settings", js: true do
- let(:user) { create(:user, :password => "password") }
+ let(:user) { create(:user, password: "password") }
- before :each do
- visit login_path
- within('.form-inline') do
- fill_in('session_username', :with => user.email)
- fill_in('session_password', :with => "password")
- end
- click_button("Sign In")
+ before { http_login(user) }
+
+ it "saves the changes properly" do
visit my_settings_path
within(".form-horizontal") do
- fill_in('user_city', :with => "Calgary, Alberta, Canada")
- fill_in('user_website', :with => "http://mokhan.ca/")
- fill_in('user_twitter', :with => "mocheen")
- fill_in('user_facebook', :with => "yeah right!")
+ fill_in('user_city', with: "Calgary, Alberta, Canada")
+ fill_in('user_website', with: "https://www.cakeside.com/")
+ fill_in('user_twitter', with: "cakeside")
+ fill_in('user_facebook', with: "cakeside")
end
click_button "Save changes"
- end
-
- it "should save the changes properly" do
expect(page).to have_content(I18n.translate(:profile_saved))
end
end
diff --git a/spec/features/registration_spec.rb b/spec/features/registration_spec.rb
index 2c0fc842..288acff4 100644
--- a/spec/features/registration_spec.rb
+++ b/spec/features/registration_spec.rb
@@ -1,23 +1,17 @@
require "rails_helper"
-describe "Registration", :js => true do
+describe "Registration", js: true do
context "when an email is not registered" do
- before :each do
+ it "lets you register with that email address" do
visit login_path
- within(".form-horizontal") do
- fill_in('user_name', :with => 'John Smith')
- fill_in('user_email',:with => FFaker::Internet.email)
- fill_in('user_password', :with => 'password')
+ within("#new_user") do
+ fill_in('user_name', with: 'John Smith')
+ fill_in('user_email', with: FFaker::Internet.email)
+ fill_in('user_password', with: 'password')
+ check('accepted')
click_button "submit-registration"
end
- end
-
- it "should let you register with that email address" do
expect(page).to have_content("Dashboard")
end
-
- xit "should take you to the settings page" do
- page.should have_content("Settings")
- end
end
end
diff --git a/spec/features/sessions_spec.rb b/spec/features/sessions_spec.rb
index daf5845d..5071e564 100644
--- a/spec/features/sessions_spec.rb
+++ b/spec/features/sessions_spec.rb
@@ -17,7 +17,7 @@ describe "Logins" do
end
it "logs the user in" do
- expect(page).to have_content("Log Out")
+ expect(page).to have_content(I18n.t("logout"))
end
it "has no errors" do
diff --git a/spec/features/upload_avatar_spec.rb b/spec/features/upload_avatar_spec.rb
index 176c7aed..ad5c1f9d 100644
--- a/spec/features/upload_avatar_spec.rb
+++ b/spec/features/upload_avatar_spec.rb
@@ -2,23 +2,16 @@ require "rails_helper"
describe "uploading an avatar", js: true do
let(:user) { create(:user, :password => "password") }
+ let(:file) { File.expand_path(File.join(Rails.root, '/spec/fixtures/images/gorilla.jpg')) }
- before :each do
- visit login_path
- within('.form-inline') do
- fill_in('session_username', :with => user.email)
- fill_in('session_password', :with => "password")
- end
- click_button("Sign In")
+ before { http_login(user) }
+
+ it "displays a success message" do
visit new_my_avatar_path
- file = File.expand_path(File.join(Rails.root, '/spec/fixtures/images/gorilla.jpg'))
within(".new_photo") do
attach_file('photo_image', file)
end
click_button "Upload picture"
- end
-
- it "should display a success message" do
expect(page).to have_content(I18n.t(:avatar_uploaded))
end
end
diff --git a/spec/javascripts/backbone/views/cake_view_spec.js.coffee b/spec/javascripts/backbone/views/cake_view_spec.js.coffee
index 5c61f37f..f84d70a4 100644
--- a/spec/javascripts/backbone/views/cake_view_spec.js.coffee
+++ b/spec/javascripts/backbone/views/cake_view_spec.js.coffee
@@ -1,8 +1,8 @@
-describe "CakeSide.Views.Cakes.CakeView", ->
+describe "CakeSide.Views.My.Cakes.CakeView", ->
cake = new CakeSide.Models.Cake
id: '1'
name: 'chocolate'
- subject = new CakeSide.Views.Cakes.CakeView
+ subject = new CakeSide.Views.My.Cakes.CakeView
model: cake
describe "when there are no photos", ->
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index c8862bdc..9f54576c 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -50,6 +50,7 @@ RSpec.configure do |config|
# https://relishapp.com/rspec/rspec-rails/docs
config.infer_spec_type_from_file_location!
config.include Authentication, type: :controller
+ config.include Authentication::Capybara, type: :feature
config.include WaitForAjax, type: :feature
config.include FactoryGirl::Syntax::Methods
diff --git a/spec/routing/favorites_routing_spec.rb b/spec/routing/favorites_routing_spec.rb
index 3319f7ff..685be194 100644
--- a/spec/routing/favorites_routing_spec.rb
+++ b/spec/routing/favorites_routing_spec.rb
@@ -1,13 +1,7 @@
require "rails_helper"
describe FavoritesController do
- describe "routing" do
- it "routes to #index" do
- expect(get: "/cakes/1/favorites").to route_to(controller: "favorites", action: "index", cake_id: "1")
- end
-
- it "routes to #create" do
- expect(post: "/cakes/1/favorites").to route_to(controller: "favorites", action: "create", cake_id: "1")
- end
+ it "routes to #create" do
+ expect(post: "/cakes/1/favorites").to route_to(controller: "favorites", action: "create", cake_id: "1")
end
end
diff --git a/spec/support/authentication.rb b/spec/support/authentication.rb
index c56c027d..1145db3c 100644
--- a/spec/support/authentication.rb
+++ b/spec/support/authentication.rb
@@ -11,4 +11,10 @@ module Authentication
encode_credentials(user.authentication_token)
request.env["HTTP_AUTHORIZATION"] = encoded_credentials
end
+
+ module Capybara
+ def http_login(user)
+ LoginPage.new.visit_page.login_with(email: user.email, password: "password")
+ end
+ end
end
diff --git a/spec/support/pages/dashboard_page.rb b/spec/support/pages/dashboard_page.rb
index 3fb2992e..54331655 100644
--- a/spec/support/pages/dashboard_page.rb
+++ b/spec/support/pages/dashboard_page.rb
@@ -6,6 +6,6 @@ class DashboardPage < WebPage
end
def logout
- click_link("Sign Out")
+ click_link(I18n.t("logout"))
end
end
diff --git a/spec/support/pages/login_page.rb b/spec/support/pages/login_page.rb
index 90010093..6619ce50 100644
--- a/spec/support/pages/login_page.rb
+++ b/spec/support/pages/login_page.rb
@@ -6,10 +6,10 @@ class LoginPage < WebPage
end
def login_with(email:, password: "password")
- within(".form-inline") do
+ within("#new_user_session") do
fill_in("session_username", with: email)
fill_in("session_password", with: password)
end
- click_button("Sign In")
+ click_button(I18n.t('sessions.new.sign_in'))
end
end
diff --git a/vendor/assets/javascripts/popper.min.js b/vendor/assets/javascripts/popper.min.js
new file mode 100644
index 00000000..51df7c5f
--- /dev/null
+++ b/vendor/assets/javascripts/popper.min.js
@@ -0,0 +1,5 @@
+/*
+ Copyright (C) Federico Zivolo 2017
+ Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
+ */const nativeHints=['native code','[object MutationObserverConstructor]'];var isNative=(e)=>nativeHints.some((t)=>-1<(e||'').toString().indexOf(t));const isBrowser='undefined'!=typeof window,longerTimeoutBrowsers=['Edge','Trident','Firefox'];let timeoutDuration=0;for(let e=0;e<longerTimeoutBrowsers.length;e+=1)if(isBrowser&&0<=navigator.userAgent.indexOf(longerTimeoutBrowsers[e])){timeoutDuration=1;break}function microtaskDebounce(e){let t=!1,o=0;const i=document.createElement('span'),n=new MutationObserver(()=>{e(),t=!1});return n.observe(i,{attributes:!0}),()=>{t||(t=!0,i.setAttribute('x-index',o),++o)}}function taskDebounce(e){let t=!1;return()=>{t||(t=!0,setTimeout(()=>{t=!1,e()},timeoutDuration))}}const supportsNativeMutationObserver=isBrowser&&isNative(window.MutationObserver);var debounce=supportsNativeMutationObserver?microtaskDebounce:taskDebounce;function isFunction(e){return e&&'[object Function]'==={}.toString.call(e)}function getStyleComputedProperty(e,t){if(1!==e.nodeType)return[];const o=window.getComputedStyle(e,null);return t?o[t]:o}function getParentNode(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function getScrollParent(e){if(!e||-1!==['HTML','BODY','#document'].indexOf(e.nodeName))return window.document.body;const{overflow:t,overflowX:o,overflowY:i}=getStyleComputedProperty(e);return /(auto|scroll)/.test(t+i+o)?e:getScrollParent(getParentNode(e))}function getOffsetParent(e){const t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?-1!==['TD','TABLE'].indexOf(t.nodeName)&&'static'===getStyleComputedProperty(t,'position')?getOffsetParent(t):t:window.document.documentElement}function isOffsetContainer(e){const{nodeName:t}=e;return'BODY'!==t&&('HTML'===t||getOffsetParent(e.firstElementChild)===e)}function getRoot(e){return null===e.parentNode?e:getRoot(e.parentNode)}function findCommonOffsetParent(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return window.document.documentElement;const o=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=o?e:t,n=o?t:e,r=document.createRange();r.setStart(i,0),r.setEnd(n,0);const{commonAncestorContainer:p}=r;if(e!==p&&t!==p||i.contains(n))return isOffsetContainer(p)?p:getOffsetParent(p);const d=getRoot(e);return d.host?findCommonOffsetParent(d.host,t):findCommonOffsetParent(e,getRoot(t).host)}function getScroll(e,t='top'){const o='top'===t?'scrollTop':'scrollLeft',i=e.nodeName;if('BODY'===i||'HTML'===i){const e=window.document.documentElement,t=window.document.scrollingElement||e;return t[o]}return e[o]}function includeScroll(e,t,o=!1){const i=getScroll(t,'top'),n=getScroll(t,'left'),r=o?-1:1;return e.top+=i*r,e.bottom+=i*r,e.left+=n*r,e.right+=n*r,e}function getBordersSize(e,t){const o='x'===t?'Left':'Top',i='Left'==o?'Right':'Bottom';return+e[`border${o}Width`].split('px')[0]+ +e[`border${i}Width`].split('px')[0]}let isIE10;var isIE10$1=function(){return void 0==isIE10&&(isIE10=-1!==navigator.appVersion.indexOf('MSIE 10')),isIE10};function getSize(e,t,o,i){return Math.max(t[`offset${e}`],t[`scroll${e}`],o[`client${e}`],o[`offset${e}`],o[`scroll${e}`],isIE10$1()?o[`offset${e}`]+i[`margin${'Height'===e?'Top':'Left'}`]+i[`margin${'Height'===e?'Bottom':'Right'}`]:0)}function getWindowSizes(){const e=window.document.body,t=window.document.documentElement,o=isIE10$1()&&window.getComputedStyle(t);return{height:getSize('Height',e,t,o),width:getSize('Width',e,t,o)}}var _extends=Object.assign||function(e){for(var t,o=1;o<arguments.length;o++)for(var i in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};function getClientRect(e){return _extends({},e,{right:e.left+e.width,bottom:e.top+e.height})}function getBoundingClientRect(e){let t={};if(isIE10$1())try{t=e.getBoundingClientRect();const o=getScroll(e,'top'),i=getScroll(e,'left');t.top+=o,t.left+=i,t.bottom+=o,t.right+=i}catch(e){}else t=e.getBoundingClientRect();const o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i='HTML'===e.nodeName?getWindowSizes():{},n=i.width||e.clientWidth||o.right-o.left,r=i.height||e.clientHeight||o.bottom-o.top;let p=e.offsetWidth-n,d=e.offsetHeight-r;if(p||d){const t=getStyleComputedProperty(e);p-=getBordersSize(t,'x'),d-=getBordersSize(t,'y'),o.width-=p,o.height-=d}return getClientRect(o)}function getOffsetRectRelativeToArbitraryNode(e,t){const o=isIE10$1(),i='HTML'===t.nodeName,n=getBoundingClientRect(e),r=getBoundingClientRect(t),p=getScrollParent(e),d=getStyleComputedProperty(t),s=+d.borderTopWidth.split('px')[0],a=+d.borderLeftWidth.split('px')[0];let f=getClientRect({top:n.top-r.top-s,left:n.left-r.left-a,width:n.width,height:n.height});if(f.marginTop=0,f.marginLeft=0,!o&&i){const e=+d.marginTop.split('px')[0],t=+d.marginLeft.split('px')[0];f.top-=s-e,f.bottom-=s-e,f.left-=a-t,f.right-=a-t,f.marginTop=e,f.marginLeft=t}return(o?t.contains(p):t===p&&'BODY'!==p.nodeName)&&(f=includeScroll(f,t)),f}function getViewportOffsetRectRelativeToArtbitraryNode(e){var t=Math.max;const o=window.document.documentElement,i=getOffsetRectRelativeToArbitraryNode(e,o),n=t(o.clientWidth,window.innerWidth||0),r=t(o.clientHeight,window.innerHeight||0),p=getScroll(o),d=getScroll(o,'left'),s={top:p-i.top+i.marginTop,left:d-i.left+i.marginLeft,width:n,height:r};return getClientRect(s)}function isFixed(e){const t=e.nodeName;return'BODY'===t||'HTML'===t?!1:!('fixed'!==getStyleComputedProperty(e,'position'))||isFixed(getParentNode(e))}function getBoundaries(e,t,o,i){let n={top:0,left:0};const r=findCommonOffsetParent(e,t);if('viewport'===i)n=getViewportOffsetRectRelativeToArtbitraryNode(r);else{let t;'scrollParent'===i?(t=getScrollParent(getParentNode(e)),'BODY'===t.nodeName&&(t=window.document.documentElement)):'window'===i?t=window.document.documentElement:t=i;const o=getOffsetRectRelativeToArbitraryNode(t,r);if('HTML'===t.nodeName&&!isFixed(r)){const{height:e,width:t}=getWindowSizes();n.top+=o.top-o.marginTop,n.bottom=e+o.top,n.left+=o.left-o.marginLeft,n.right=t+o.left}else n=o}return n.left+=o,n.top+=o,n.right-=o,n.bottom-=o,n}function getArea({width:e,height:t}){return e*t}function computeAutoPlacement(e,t,o,i,n,r=0){if(-1===e.indexOf('auto'))return e;const p=getBoundaries(o,i,r,n),d={top:{width:p.width,height:t.top-p.top},right:{width:p.right-t.right,height:p.height},bottom:{width:p.width,height:p.bottom-t.bottom},left:{width:t.left-p.left,height:p.height}},s=Object.keys(d).map((e)=>_extends({key:e},d[e],{area:getArea(d[e])})).sort((e,t)=>t.area-e.area),a=s.filter(({width:e,height:t})=>e>=o.clientWidth&&t>=o.clientHeight),f=0<a.length?a[0].key:s[0].key,l=e.split('-')[1];return f+(l?`-${l}`:'')}function getReferenceOffsets(e,t,o){const i=findCommonOffsetParent(t,o);return getOffsetRectRelativeToArbitraryNode(o,i)}function getOuterSizes(e){const t=window.getComputedStyle(e),o=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight),n={width:e.offsetWidth+i,height:e.offsetHeight+o};return n}function getOppositePlacement(e){const t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,(e)=>t[e])}function getPopperOffsets(e,t,o){o=o.split('-')[0];const i=getOuterSizes(e),n={width:i.width,height:i.height},r=-1!==['right','left'].indexOf(o),p=r?'top':'left',d=r?'left':'top',s=r?'height':'width',a=r?'width':'height';return n[p]=t[p]+t[s]/2-i[s]/2,n[d]=o===d?t[d]-i[a]:t[getOppositePlacement(d)],n}function find(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function findIndex(e,t,o){if(Array.prototype.findIndex)return e.findIndex((e)=>e[t]===o);const i=find(e,(e)=>e[t]===o);return e.indexOf(i)}function runModifiers(e,t,o){const i=void 0===o?e:e.slice(0,findIndex(e,'name',o));return i.forEach((e)=>{e.function&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');const o=e.function||e.fn;e.enabled&&isFunction(o)&&(t.offsets.popper=getClientRect(t.offsets.popper),t.offsets.reference=getClientRect(t.offsets.reference),t=o(t,e))}),t}function update(){if(this.state.isDestroyed)return;let e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=getReferenceOffsets(this.state,this.popper,this.reference),e.placement=computeAutoPlacement(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.offsets.popper=getPopperOffsets(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position='absolute',e=runModifiers(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}function isModifierEnabled(e,t){return e.some(({name:e,enabled:o})=>o&&e===t)}function getSupportedPropertyName(e){const t=[!1,'ms','Webkit','Moz','O'],o=e.charAt(0).toUpperCase()+e.slice(1);for(let n=0;n<t.length-1;n++){const i=t[n],r=i?`${i}${o}`:e;if('undefined'!=typeof window.document.body.style[r])return r}return null}function destroy(){return this.state.isDestroyed=!0,isModifierEnabled(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.left='',this.popper.style.position='',this.popper.style.top='',this.popper.style[getSupportedPropertyName('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function attachToScrollParents(e,t,o,i){const n='BODY'===e.nodeName,r=n?window:e;r.addEventListener(t,o,{passive:!0}),n||attachToScrollParents(getScrollParent(r.parentNode),t,o,i),i.push(r)}function setupEventListeners(e,t,o,i){o.updateBound=i,window.addEventListener('resize',o.updateBound,{passive:!0});const n=getScrollParent(e);return attachToScrollParents(n,'scroll',o.updateBound,o.scrollParents),o.scrollElement=n,o.eventsEnabled=!0,o}function enableEventListeners(){this.state.eventsEnabled||(this.state=setupEventListeners(this.reference,this.options,this.state,this.scheduleUpdate))}function removeEventListeners(e,t){return window.removeEventListener('resize',t.updateBound),t.scrollParents.forEach((e)=>{e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function disableEventListeners(){this.state.eventsEnabled&&(window.cancelAnimationFrame(this.scheduleUpdate),this.state=removeEventListeners(this.reference,this.state))}function isNumeric(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function setStyles(e,t){Object.keys(t).forEach((o)=>{let i='';-1!==['width','height','top','right','bottom','left'].indexOf(o)&&isNumeric(t[o])&&(i='px'),e.style[o]=t[o]+i})}function setAttributes(e,t){Object.keys(t).forEach(function(o){const i=t[o];!1===i?e.removeAttribute(o):e.setAttribute(o,t[o])})}function applyStyle(e){return setStyles(e.instance.popper,e.styles),setAttributes(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&setStyles(e.arrowElement,e.arrowStyles),e}function applyStyleOnLoad(e,t,o,i,n){const r=getReferenceOffsets(n,t,e),p=computeAutoPlacement(o.placement,r,t,e,o.modifiers.flip.boundariesElement,o.modifiers.flip.padding);return t.setAttribute('x-placement',p),setStyles(t,{position:'absolute'}),o}function computeStyle(e,t){var o=Math.floor;const{x:i,y:n}=t,{popper:r}=e.offsets,p=find(e.instance.modifiers,(e)=>'applyStyle'===e.name).gpuAcceleration;void 0!==p&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');const d=void 0===p?t.gpuAcceleration:p,s=getOffsetParent(e.instance.popper),a=getBoundingClientRect(s),f={position:r.position},l={left:o(r.left),top:o(r.top),bottom:o(r.bottom),right:o(r.right)},m='bottom'===i?'top':'bottom',c='right'===n?'left':'right',h=getSupportedPropertyName('transform');let u,g;if(g='bottom'==m?-a.height+l.bottom:l.top,u='right'==c?-a.width+l.right:l.left,d&&h)f[h]=`translate3d(${u}px, ${g}px, 0)`,f[m]=0,f[c]=0,f.willChange='transform';else{const e='bottom'==m?-1:1,t='right'==c?-1:1;f[m]=g*e,f[c]=u*t,f.willChange=`${m}, ${c}`}const b={"x-placement":e.placement};return e.attributes=_extends({},b,e.attributes),e.styles=_extends({},f,e.styles),e.arrowStyles=_extends({},e.offsets.arrow,e.arrowStyles),e}function isModifierRequired(e,t,o){const i=find(e,({name:e})=>e===t),n=!!i&&e.some((e)=>e.name===o&&e.enabled&&e.order<i.order);if(!n){const e=`\`${t}\``,i=`\`${o}\``;console.warn(`${i} modifier is required by ${e} modifier in order to work, be sure to include it before ${e}!`)}return n}function arrow(e,t){if(!isModifierRequired(e.instance.modifiers,'arrow','keepTogether'))return e;let o=t.element;if('string'==typeof o){if(o=e.instance.popper.querySelector(o),!o)return e;}else if(!e.instance.popper.contains(o))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;const i=e.placement.split('-')[0],{popper:n,reference:r}=e.offsets,p=-1!==['left','right'].indexOf(i),d=p?'height':'width',s=p?'Top':'Left',a=s.toLowerCase(),f=p?'left':'top',l=p?'bottom':'right',m=getOuterSizes(o)[d];r[l]-m<n[a]&&(e.offsets.popper[a]-=n[a]-(r[l]-m)),r[a]+m>n[l]&&(e.offsets.popper[a]+=r[a]+m-n[l]);const c=r[a]+r[d]/2-m/2,h=getStyleComputedProperty(e.instance.popper,`margin${s}`).replace('px','');let u=c-getClientRect(e.offsets.popper)[a]-h;return u=Math.max(Math.min(n[d]-m,u),0),e.arrowElement=o,e.offsets.arrow={},e.offsets.arrow[a]=Math.round(u),e.offsets.arrow[f]='',e}function getOppositeVariation(e){if('end'===e)return'start';return'start'===e?'end':e}var placements=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'];const validPlacements=placements.slice(3);function clockwise(e,t=!1){const o=validPlacements.indexOf(e),i=validPlacements.slice(o+1).concat(validPlacements.slice(0,o));return t?i.reverse():i}const BEHAVIORS={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'};function flip(e,t){if(isModifierEnabled(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;const o=getBoundaries(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement);let i=e.placement.split('-')[0],n=getOppositePlacement(i),r=e.placement.split('-')[1]||'',p=[];switch(t.behavior){case BEHAVIORS.FLIP:p=[i,n];break;case BEHAVIORS.CLOCKWISE:p=clockwise(i);break;case BEHAVIORS.COUNTERCLOCKWISE:p=clockwise(i,!0);break;default:p=t.behavior;}return p.forEach((d,s)=>{if(i!==d||p.length===s+1)return e;i=e.placement.split('-')[0],n=getOppositePlacement(i);const a=e.offsets.popper,f=e.offsets.reference,l=Math.floor,m='left'===i&&l(a.right)>l(f.left)||'right'===i&&l(a.left)<l(f.right)||'top'===i&&l(a.bottom)>l(f.top)||'bottom'===i&&l(a.top)<l(f.bottom),c=l(a.left)<l(o.left),h=l(a.right)>l(o.right),u=l(a.top)<l(o.top),g=l(a.bottom)>l(o.bottom),b='left'===i&&c||'right'===i&&h||'top'===i&&u||'bottom'===i&&g,y=-1!==['top','bottom'].indexOf(i),w=!!t.flipVariations&&(y&&'start'===r&&c||y&&'end'===r&&h||!y&&'start'===r&&u||!y&&'end'===r&&g);(m||b||w)&&(e.flipped=!0,(m||b)&&(i=p[s+1]),w&&(r=getOppositeVariation(r)),e.placement=i+(r?'-'+r:''),e.offsets.popper=_extends({},e.offsets.popper,getPopperOffsets(e.instance.popper,e.offsets.reference,e.placement)),e=runModifiers(e.instance.modifiers,e,'flip'))}),e}function keepTogether(e){const{popper:t,reference:o}=e.offsets,i=e.placement.split('-')[0],n=Math.floor,r=-1!==['top','bottom'].indexOf(i),p=r?'right':'bottom',d=r?'left':'top',s=r?'width':'height';return t[p]<n(o[d])&&(e.offsets.popper[d]=n(o[d])-t[s]),t[d]>n(o[p])&&(e.offsets.popper[d]=n(o[p])),e}function toValue(e,t,o,i){var n=Math.max;const r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),p=+r[1],d=r[2];if(!p)return e;if(0===d.indexOf('%')){let e;switch(d){case'%p':e=o;break;case'%':case'%r':default:e=i;}const n=getClientRect(e);return n[t]/100*p}if('vh'===d||'vw'===d){let e;return e='vh'===d?n(document.documentElement.clientHeight,window.innerHeight||0):n(document.documentElement.clientWidth,window.innerWidth||0),e/100*p}return p}function parseOffset(e,t,o,i){const n=[0,0],r=-1!==['right','left'].indexOf(i),p=e.split(/(\+|\-)/).map((e)=>e.trim()),d=p.indexOf(find(p,(e)=>-1!==e.search(/,|\s/)));p[d]&&-1===p[d].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');const s=/\s*,\s*|\s+/;let a=-1===d?[p]:[p.slice(0,d).concat([p[d].split(s)[0]]),[p[d].split(s)[1]].concat(p.slice(d+1))];return a=a.map((e,i)=>{const n=(1===i?!r:r)?'height':'width';let p=!1;return e.reduce((e,t)=>''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,p=!0,e):p?(e[e.length-1]+=t,p=!1,e):e.concat(t),[]).map((e)=>toValue(e,n,t,o))}),a.forEach((e,t)=>{e.forEach((o,i)=>{isNumeric(o)&&(n[t]+=o*('-'===e[i-1]?-1:1))})}),n}function offset(e,{offset:t}){const{placement:o,offsets:{popper:i,reference:n}}=e,r=o.split('-')[0];let p;return p=isNumeric(+t)?[+t,0]:parseOffset(t,i,n,r),'left'===r?(i.top+=p[0],i.left-=p[1]):'right'===r?(i.top+=p[0],i.left+=p[1]):'top'===r?(i.left+=p[0],i.top-=p[1]):'bottom'===r&&(i.left+=p[0],i.top+=p[1]),e.popper=i,e}function preventOverflow(e,t){let o=t.boundariesElement||getOffsetParent(e.instance.popper);e.instance.reference===o&&(o=getOffsetParent(o));const i=getBoundaries(e.instance.popper,e.instance.reference,t.padding,o);t.boundaries=i;const n=t.priority;let r=e.offsets.popper;const p={primary(e){let o=r[e];return r[e]<i[e]&&!t.escapeWithReference&&(o=Math.max(r[e],i[e])),{[e]:o}},secondary(e){const o='right'===e?'left':'top';let n=r[o];return r[e]>i[e]&&!t.escapeWithReference&&(n=Math.min(r[o],i[e]-('right'===e?r.width:r.height))),{[o]:n}}};return n.forEach((e)=>{const t=-1===['left','top'].indexOf(e)?'secondary':'primary';r=_extends({},r,p[t](e))}),e.offsets.popper=r,e}function shift(e){const t=e.placement,o=t.split('-')[0],i=t.split('-')[1];if(i){const{reference:t,popper:n}=e.offsets,r=-1!==['bottom','top'].indexOf(o),p=r?'left':'top',d=r?'width':'height',s={start:{[p]:t[p]},end:{[p]:t[p]+t[d]-n[d]}};e.offsets.popper=_extends({},n,s[i])}return e}function hide(e){if(!isModifierRequired(e.instance.modifiers,'hide','preventOverflow'))return e;const t=e.offsets.reference,o=find(e.instance.modifiers,(e)=>'preventOverflow'===e.name).boundaries;if(t.bottom<o.top||t.left>o.right||t.top>o.bottom||t.right<o.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}function inner(e){const t=e.placement,o=t.split('-')[0],{popper:i,reference:n}=e.offsets,r=-1!==['left','right'].indexOf(o),p=-1===['top','left'].indexOf(o);return i[r?'left':'top']=n[o]-(p?i[r?'width':'height']:0),e.placement=getOppositePlacement(t),e.offsets.popper=getClientRect(i),e}var modifiers={shift:{order:100,enabled:!0,fn:shift},offset:{order:200,enabled:!0,fn:offset,offset:0},preventOverflow:{order:300,enabled:!0,fn:preventOverflow,priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:keepTogether},arrow:{order:500,enabled:!0,fn:arrow,element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:flip,behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:inner},hide:{order:800,enabled:!0,fn:hide},computeStyle:{order:850,enabled:!0,fn:computeStyle,gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:applyStyle,onLoad:applyStyleOnLoad,gpuAcceleration:void 0}},Defaults={placement:'bottom',eventsEnabled:!0,removeOnDestroy:!1,onCreate:()=>{},onUpdate:()=>{},modifiers};class Popper{constructor(e,t,o={}){this.scheduleUpdate=()=>requestAnimationFrame(this.update),this.update=debounce(this.update.bind(this)),this.options=_extends({},Popper.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e.jquery?e[0]:e,this.popper=t.jquery?t[0]:t,this.options.modifiers={},Object.keys(_extends({},Popper.Defaults.modifiers,o.modifiers)).forEach((e)=>{this.options.modifiers[e]=_extends({},Popper.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map((e)=>_extends({name:e},this.options.modifiers[e])).sort((e,t)=>e.order-t.order),this.modifiers.forEach((e)=>{e.enabled&&isFunction(e.onLoad)&&e.onLoad(this.reference,this.popper,this.options,e,this.state)}),this.update();const i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}update(){return update.call(this)}destroy(){return destroy.call(this)}enableEventListeners(){return enableEventListeners.call(this)}disableEventListeners(){return disableEventListeners.call(this)}}Popper.Utils=('undefined'==typeof window?global:window).PopperUtils,Popper.placements=placements,Popper.Defaults=Defaults;export default Popper;
+//# sourceMappingURL=popper.min.js.map