diff --git a/Gemfile b/Gemfile index 1befa0d9..1786de34 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '4.1.6' +gem 'rails', '4.1.7' gem 'pg', group: :postgres gem 'mysql2', group: :mysql @@ -16,10 +16,12 @@ gem 'sdoc', '~> 0.4.1', group: :doc gem 'bcrypt', '~> 3.1.7' gem 'haml' -gem 'semantic-ui-sass', '~> 0.19.3.0' +gem 'bootstrap-sass', '~> 3.2.0.1' +gem 'bootswatch-rails', '~> 3.2.0' gem 'will_paginate' gem 'http_accept_language' gem 'devise' +gem 'bootstrap_form' gem 'font-kit-rails' gem 'nprogress-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 65bcba8f..0552361e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,27 +1,27 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.1.6) - actionpack (= 4.1.6) - actionview (= 4.1.6) + actionmailer (4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) mail (~> 2.5, >= 2.5.4) - actionpack (4.1.6) - actionview (= 4.1.6) - activesupport (= 4.1.6) + actionpack (4.1.7) + actionview (= 4.1.7) + activesupport (= 4.1.7) rack (~> 1.5.2) rack-test (~> 0.6.2) - actionview (4.1.6) - activesupport (= 4.1.6) + actionview (4.1.7) + activesupport (= 4.1.7) builder (~> 3.1) erubis (~> 2.7.0) - activemodel (4.1.6) - activesupport (= 4.1.6) + activemodel (4.1.7) + activesupport (= 4.1.7) builder (~> 3.1) - activerecord (4.1.6) - activemodel (= 4.1.6) - activesupport (= 4.1.6) + activerecord (4.1.7) + activemodel (= 4.1.7) + activesupport (= 4.1.7) arel (~> 5.0.0) - activesupport (4.1.6) + activesupport (4.1.7) i18n (~> 0.6, >= 0.6.9) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -29,6 +29,11 @@ GEM tzinfo (~> 1.1) arel (5.0.1.20140414130214) bcrypt (3.1.9) + bootstrap-sass (3.2.0.2) + sass (~> 3.2) + bootstrap_form (2.2.0) + bootswatch-rails (3.2.4) + railties (>= 3.1) builder (3.2.2) coffee-rails (4.1.0) coffee-script (>= 2.2.0) @@ -38,7 +43,7 @@ GEM execjs coffee-script-source (1.8.0) daemons (1.1.9) - devise (3.4.0) + devise (3.4.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -49,7 +54,7 @@ GEM erubis (2.7.0) eventmachine (1.0.3) execjs (2.2.2) - font-kit-rails (1.0.2) + font-kit-rails (1.1.0) rails haml (4.0.5) tilt @@ -76,19 +81,19 @@ GEM rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (4.1.6) - actionmailer (= 4.1.6) - actionpack (= 4.1.6) - actionview (= 4.1.6) - activemodel (= 4.1.6) - activerecord (= 4.1.6) - activesupport (= 4.1.6) + rails (4.1.7) + actionmailer (= 4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) + activemodel (= 4.1.7) + activerecord (= 4.1.7) + activesupport (= 4.1.7) bundler (>= 1.3.0, < 2.0) - railties (= 4.1.6) + railties (= 4.1.7) sprockets-rails (~> 2.0) - railties (4.1.6) - actionpack (= 4.1.6) - activesupport (= 4.1.6) + railties (4.1.7) + actionpack (= 4.1.7) + activesupport (= 4.1.7) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.13.0) @@ -98,23 +103,21 @@ GEM responders (1.1.1) railties (>= 3.2, < 4.2) sass (3.2.19) - sass-rails (4.0.3) + sass-rails (4.0.4) railties (>= 4.0.0, < 5.0) - sass (~> 3.2.0) - sprockets (~> 2.8, <= 2.11.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 2.12) sprockets-rails (~> 2.0) sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - semantic-ui-sass (0.19.3.0) - sass (~> 3.2) simplecov (0.9.1) docile (~> 1.1.0) multi_json (~> 1.0) simplecov-html (~> 0.8.0) simplecov-html (0.8.0) spring (1.1.3) - sprockets (2.11.0) + sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -130,7 +133,7 @@ GEM thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) - turbolinks (2.4.0) + turbolinks (2.5.1) coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) @@ -150,6 +153,9 @@ PLATFORMS DEPENDENCIES bcrypt (~> 3.1.7) + bootstrap-sass (~> 3.2.0.1) + bootstrap_form + bootswatch-rails (~> 3.2.0) coffee-rails (~> 4.1.0) devise font-kit-rails @@ -160,10 +166,9 @@ DEPENDENCIES mysql2 nprogress-rails pg - rails (= 4.1.6) + rails (= 4.1.7) sass-rails (~> 4.0.3) sdoc (~> 0.4.1) - semantic-ui-sass (~> 0.19.3.0) simplecov spring thin diff --git a/app/assets/javascripts/application.coffee b/app/assets/javascripts/application.coffee index 2711098f..dc7e2ae7 100644 --- a/app/assets/javascripts/application.coffee +++ b/app/assets/javascripts/application.coffee @@ -1,9 +1,6 @@ #= require jquery #= require jquery_ujs #= require turbolinks -#= require semantic-ui +#= require bootstrap #= require_tree . -$(document).ready -> - $('.ui.dropdown').dropdown - on: "hover" \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 60160db8..87984a7f 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -1,73 +1,9 @@ /* - *= require font-kit-rails/open-sans + *= require rails_bootstrap_forms *= require_self */ -@import "semantic-ui"; +@import "bootswatch/flatly/variables"; +@import "bootstrap"; +body { padding-top: $navbar-height; } +@import "bootswatch/flatly/bootswatch"; @import "base"; - -html, -body { - font-size: 15px; - height: 100%; -} - -body { - font-family: "Open Sans", "Helvetica Neue", "Helvetica", "DejaVu Sans", "Arial", sans-serif; - background: #FFFFFF; - margin: 0px; - padding: 0px; - color: #555555; - text-rendering: optimizeLegibility; - min-width: 320px; -} - - -/* mobile only */ - -@media only screen and (max-width : 768px) { - .ui.page.grid.segment { - padding-top: 2rem; - padding-bottom: 2rem; - } - - h1.ui.header { - font-size: 1.5em; - } - - .masthead.segment { - background-size: auto; - } - - .masthead.segment .information { - margin-left: 190px; - } - - .masthead.segment .image { - bottom: -65px; - width: 150px; - } - - .masthead.segment .button { - font-size: 1rem; - } - - .overview .divided.grid .header .icon { - font-size: 1.5em; - } - - .overview .divided.grid .header + p { - min-height: 0px; - } - - .masthead.segment .column { - font-size: 0.7rem; - } - - .masthead.segment .column p { - display: none; - } -} - -@media only screen and (max-width : 1000px) { - -} \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d298ed14..0f01df3d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,9 +1,6 @@ module ApplicationHelper - def nav_entry(body, path, options={}) - options = {class: "", icon: "", label: "", label_color: "red"}.merge options - body = semantic_icon(options[:icon]) + " " + body unless options[:icon].empty? - body = body + " " + content_tag(:div, options[:label], class: "ui #{options[:label_color]} label") unless options[:label].empty? - link_to(body, path, class: "#{'active' if current_page? path} item #{options[:class]}") + def nav_entry(body, path) + content_tag(:li, link_to(body, path), class: ('active' if current_page? path)) end ## diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 00000000..434fe000 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,12 @@ +

Resend confirmation instructions

+ +<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :screen_name %>
+ <%= f.email_field :screen_name, autofocus: true %>
+ +
<%= f.submit "Resend confirmation instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 221f47e0..d967cb74 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,6 +1,6 @@ .container %h1 Resend confirmation instructions - = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| + = bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| = devise_error_messages! = f.email_field :screen_name, autofocus: true, label: "User name" diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 00000000..39b47121 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @screen_name %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 00000000..f667dc12 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 00000000..41e148bf --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 00000000..55350988 --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,16 @@ +

Change your password

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> + +
<%= f.label :password, "New password" %>
+ <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
+ +
<%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ +
<%= f.submit "Change my password" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index bb48dec5..2a4e5d0f 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,6 +1,6 @@ .container %h1 Change your password - = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| + = bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| = devise_error_messages! = f.hidden_field :reset_password_token diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 00000000..208e7a40 --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,12 @@ +

Forgot your password?

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :screen_name %>
+ <%= f.email_field :screen_name, autofocus: true %>
+ +
<%= f.submit "Send me reset password instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 2531b53b..eee273ad 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,6 +1,6 @@ .container %h1 Forgot your password? - = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| + = bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| = devise_error_messages! = f.text_field :screen_name, autofocus: true, "User name" diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 00000000..c6356a0e --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,31 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :screen_name %>
+ <%= f.email_field :screen_name, autofocus: true %>
+
<%= f.label :email %>
+ <%= f.email_field :email %>
+ + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
<%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "off" %>
+ +
<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %>
+ +
<%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password, autocomplete: "off" %>
+ +
<%= f.submit "Update" %>
+<% end %> + +

Cancel my account

+ +

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 150fa9f1..5bf72700 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -1,6 +1,6 @@ .container %h1 Edit #{resource_name.to_s.humanize} - = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| + = bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| = devise_error_messages! = f.text_field :screen_name, autofocus: true, label: "User name" diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 80a57944..80d46542 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,7 +1,7 @@ .container %h1 Sign up - = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| + = bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| = devise_error_messages! = f.text_field :screen_name, autofocus: true, label: "User name" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 8caed3d5..a9721102 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -2,7 +2,7 @@ %h1 Sign in = render 'layouts/messages' - = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| + = bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| = f.text_field :login, autofocus: true, label: "User name" = f.password_field :password, autocomplete: "off", label: "Password" diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb new file mode 100644 index 00000000..d84bdde9 --- /dev/null +++ b/app/views/devise/shared/_links.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Sign in", new_session_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> +<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 00000000..6fb5612b --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,12 @@ +

Resend unlock instructions

+ +<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
<%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %>
+ +
<%= f.submit "Resend unlock instructions" %>
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index b59e5b44..487ca679 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -2,7 +2,7 @@ %h1 Resend unlock instructions = render 'layouts/messages' - = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| + = bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| = devise_error_messages! = f.email_field :email, autofocus: true, label: "Email address" diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 704c55bd..1014359d 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1,19 +1,26 @@ -%nav.ui.fixed.inverted.main.menu - %h3.header.item justask - = nav_entry "Home", "/", icon: "home" - - if user_signed_in? - = nav_entry "Inbox", "/inbox", icon: "inbox", label: "2" - - else - = nav_entry "About", "/about", icon: "" - .right.menu - - if user_signed_in? - .ui.dropdown.item - = current_user.screen_name - = semantic_icon "dropdown" - .menu - = link_to "Profile", edit_user_registration_path, class: "item" - = link_to "Settings", "#", class: "item" - = link_to "Logout", destroy_user_session_path, method: :delete, class: "item" - - else - = nav_entry "Sign in", new_user_session_path #, "right floated text" - = nav_entry "Sign up", new_user_registration_path #, "right floated text" \ No newline at end of file +%nav.navbar.navbar-default.navbar-fixed-top{role: "navigation"} + .container + .navbar-header + %button.navbar-toggle{"data-target" => "#j2-main-navbar-collapse", "data-toggle" => "collapse", type: "button"} + %span.sr-only Toggle navigation + %span.icon-bar + %span.icon-bar + %span.icon-bar + %a.navbar-brand{href: "/"} justask2 + #j2-main-navbar-collapse.collapse.navbar-collapse + %ul.nav.navbar-nav + = nav_entry "Front", "/" + %ul.nav.navbar-nav.navbar-right + - if user_signed_in? + %li.dropdown + %a.dropdown-toggle{href: "#", "data-toggle" => "dropdown"} + = current_user.screen_name + %b.caret + %ul.dropdown-menu + %li= link_to "Profile", edit_user_registration_path + %li= link_to "Settings", "#" + %li.divider + %li= link_to "Logout", destroy_user_session_path, method: :delete + - else + = nav_entry "Sign in", new_user_session_path + = nav_entry "Sign up", new_user_registration_path \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index a737041a..11b2cb74 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,7 +1,7 @@ !!! 5 %html %head - %title justask + %title justask2 = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true = csrf_meta_tags @@ -11,5 +11,5 @@ - if Rails.env.development? %hr .container - %p.text-danger Debug output: + %p.text-danger EVIL DEBUG MODE OF DOOM ENABLED!!! = debug params \ No newline at end of file