diff --git a/Gemfile b/Gemfile index dca9d2a..15bfabb 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,11 @@ gem 'omniauth-twitter' gem "paperclip", "~> 3.0" +gem "twitter-bootstrap-rails" + +gem "haml" +gem "html2haml" + # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 76125c4..d1fc37c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,8 +51,16 @@ GEM execjs (2.0.2) faraday (0.8.8) multipart-post (~> 1.2.0) + haml (4.0.3) + tilt hashie (2.0.5) hike (1.2.3) + hpricot (0.8.6) + html2haml (1.0.1) + erubis (~> 2.7.0) + haml (>= 4.0.0.rc.1) + hpricot (~> 0.8.6) + ruby_parser (~> 3.1.1) httpauth (0.2.0) i18n (0.6.5) jbuilder (1.5.1) @@ -125,6 +133,8 @@ GEM rake (10.1.0) rdoc (3.12.2) json (~> 1.4) + ruby_parser (3.1.3) + sexp_processor (~> 4.1) sass (3.2.11) sass-rails (4.0.0) railties (>= 4.0.0.beta, < 5.0) @@ -133,6 +143,7 @@ GEM sdoc (0.3.20) json (>= 1.1.3) rdoc (~> 3.10) + sexp_processor (4.3.0) slop (3.4.6) sprockets (2.10.0) hike (~> 1.2) @@ -152,6 +163,11 @@ GEM polyglot (>= 0.3.1) turbolinks (1.3.0) coffee-rails + twitter-bootstrap-rails (2.2.8) + actionpack (>= 3.1) + execjs + rails (>= 3.1) + railties (>= 3.1) tzinfo (0.3.37) uglifier (2.2.1) execjs (>= 0.3.0) @@ -165,6 +181,8 @@ PLATFORMS DEPENDENCIES coffee-rails (~> 4.0.0) devise + haml + html2haml jbuilder (~> 1.2) jquery-rails mysql2 @@ -176,4 +194,5 @@ DEPENDENCIES sass-rails (~> 4.0.0) sdoc turbolinks + twitter-bootstrap-rails uglifier (>= 1.3.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..3885622 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,5 +12,6 @@ // //= require jquery //= require jquery_ujs +//= require twitter/bootstrap //= require turbolinks //= require_tree . diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee new file mode 100644 index 0000000..9440679 --- /dev/null +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -0,0 +1,3 @@ +jQuery -> + $("a[rel~=popover], .has-popover").popover() + $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3192ec8..37dad60 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -11,3 +11,30 @@ *= require_self *= require_tree . */ + +/* User sign in and sign forms. */ +.border-form-div { + max-width: 300px; + padding: 19px 29px 29px; + margin: 0 auto 20px; + background-color: #fff; + border: 1px solid #e5e5e5; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); + -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05); + box-shadow: 0 1px 2px rgba(0,0,0,.05); +} +.border-form-div .form-signin-heading, +.border-form-div .checkbox { + margin-bottom: 10px; +} +.border-form-div input[type="text"], +.border-form-div input[type="email"], +.border-form-div input[type="password"] { + font-size: 16px; + height: auto; + margin-bottom: 15px; + padding: 7px 9px; +} diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css b/app/assets/stylesheets/bootstrap_and_overrides.css new file mode 100644 index 0000000..131fcfd --- /dev/null +++ b/app/assets/stylesheets/bootstrap_and_overrides.css @@ -0,0 +1,7 @@ +/* + =require twitter-bootstrap-static/bootstrap + + Use Font Awesome icons (default) + To use Glyphicons sprites instead of Font Awesome, replace with "require twitter-bootstrap-static/sprites" + =require twitter-bootstrap-static/fontawesome + */ \ No newline at end of file diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index 9c27eb7..0000000 --- a/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Resend confirmation instructions

- -<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, :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 new file mode 100644 index 0000000..88c6373 --- /dev/null +++ b/app/views/devise/confirmations/new.html.haml @@ -0,0 +1,9 @@ +%h2 Resend confirmation instructions += form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| + = devise_error_messages! + %div + = f.label :email + %br/ + = f.email_field :email, :autofocus => true + %div= f.submit "Resend confirmation instructions" += render "devise/shared/links" diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index 36670f9..0000000 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome <%= @email %>!

- -

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/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml new file mode 100644 index 0000000..dfa5989 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -0,0 +1,4 @@ +%p + Welcome #{@email}! +%p You can confirm your account email through the link below: +%p= 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 deleted file mode 100644 index 93de6d0..0000000 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

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/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml new file mode 100644 index 0000000..eda27ee --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -0,0 +1,6 @@ +%p + Hello #{@resource.email}! +%p Someone has requested a link to change your password. You can do this through the link below. +%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @token) +%p If you didn't request this, please ignore this email. +%p 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 deleted file mode 100644 index f59615f..0000000 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

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/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml new file mode 100644 index 0000000..47f55a5 --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -0,0 +1,5 @@ +%p + Hello #{@resource.email}! +%p Your account has been locked due to an excessive number of unsuccessful sign in attempts. +%p Click the link below to unlock your account: +%p= 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 deleted file mode 100644 index 34a4960..0000000 --- a/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

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 %>
- -
<%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation %>
- -
<%= 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 new file mode 100644 index 0000000..8515688 --- /dev/null +++ b/app/views/devise/passwords/edit.html.haml @@ -0,0 +1,14 @@ +%h2 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 + %div + = f.label :password, "New password" + %br/ + = f.password_field :password, :autofocus => true + %div + = f.label :password_confirmation, "Confirm new password" + %br/ + = f.password_field :password_confirmation + %div= f.submit "Change my password" += render "devise/shared/links" diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb deleted file mode 100644 index 5a400df..0000000 --- a/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Forgot your password?

- -<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :email %>
- <%= f.email_field :email, :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 new file mode 100644 index 0000000..591033b --- /dev/null +++ b/app/views/devise/passwords/new.html.haml @@ -0,0 +1,9 @@ +%h2 Forgot your password? += form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| + = devise_error_messages! + %div + = f.label :email + %br/ + = f.email_field :email, :autofocus => true + %div= f.submit "Send me reset password instructions" += render "devise/shared/links" diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index cb9d15f..0000000 --- a/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -

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 :first_name %>
- <%= f.text_field :first_name, maxlength: 50, required: true%>
- -
<%= f.label :last_name %>
- <%= f.text_field :last_name, maxlength: 50, required: true%>
- -
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
- - <%= f.label :avatar %>
- <%= f.file_field :avatar %> - - <% 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 %>
- - <%= f.collection_select :plan_id, Plan.all, :id, :name%> - -
<%= 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 new file mode 100644 index 0000000..337f993 --- /dev/null +++ b/app/views/devise/registrations/edit.html.haml @@ -0,0 +1,35 @@ +%div.border-form-div + %h3 + 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! + %div + = f.text_field :login, :autofocus => true, :placeholder => 'Login', maxlength: 50, required: true + %div + = f.text_field :first_name, placeholder: 'First name', maxlength: 50, required: true + %div + = f.text_field :last_name, placeholder: 'Last name', maxlength: 50, required: true + %div + = f.email_field :email, placeholder: 'Email' + - if devise_mapping.confirmable? && resource.pending_reconfirmation? + %div + Currently waiting confirmation for: #{resource.unconfirmed_email} + %div + = f.label 'Avatar' + = f.file_field :avatar + %div + %br/ + %i (leave blank if you don't want to change it) + %br/ + = f.password_field :password, :autocomplete => "off", placeholder: 'New password' + %div + = f.password_field :password_confirmation, placeholder: 'Password confirmation' + %div + %i (we need your current password to confirm your changes) + %br/ + = f.password_field :current_password, placeholder: 'Current password' + %div= f.submit "Update", class: 'btn btn-primary' + %br/ + %p + 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/new.html.erb b/app/views/devise/registrations/new.html.erb deleted file mode 100644 index ac80b0f..0000000 --- a/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -

Sign up

- -<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> - <%= devise_error_messages! %> - -
<%= f.label :login %>
- <%= f.text_field :login , autofocus: true, maxlength: 50, required: true%>
- -
<%= f.label :first_name %>
- <%= f.text_field :first_name, maxlength: 50, required: true%>
- -
<%= f.label :last_name %>
- <%= f.text_field :last_name, maxlength: 50, required: true%>
- -
<%= f.label :email %>
- <%= f.email_field :email%>
- - - <%= f.label :avatar %>
- <%= f.file_field :avatar %> - -
<%= f.label :password %>
- <%= f.password_field :password %>
- -
<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>
- -
<%= f.submit "Sign up" %>
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml new file mode 100644 index 0000000..3c1858e --- /dev/null +++ b/app/views/devise/registrations/new.html.haml @@ -0,0 +1,23 @@ +%div.border-form-div + %h3 + Create #{resource_name.to_s.humanize} + = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| + = devise_error_messages! + %div + = f.text_field :login, :autofocus => true, :placeholder => 'Login', maxlength: 50, required: true + %div + = f.text_field :first_name, placeholder: 'First name', maxlength: 50, required: true + %div + = f.text_field :last_name, placeholder: 'Last name', maxlength: 50, required: true + %div + = f.email_field :email, placeholder: 'Email' + %div + = f.label 'Avatar' + = f.file_field :avatar + %br + %div + = f.password_field :password, placeholder: 'Password' + %div + = f.password_field :password_confirmation, placeholder: 'Password confirmation' + %div= f.submit "Sign up", class: 'btn btn-primary' + = render "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb deleted file mode 100644 index 2a09441..0000000 --- a/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -

Sign in

- -<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
<%= f.label :login %>
- <%= f.text_field :login, :autofocus => true %>
- -
<%= f.label :password %>
- <%= f.password_field :password %>
- - <% if devise_mapping.rememberable? -%> -
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
- <% end -%> - -
<%= f.submit "Sign in" %>
-<% end %> - -<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml new file mode 100644 index 0000000..2930580 --- /dev/null +++ b/app/views/devise/sessions/new.html.haml @@ -0,0 +1,14 @@ +%div.border-form-div + %h3 + Sign in + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| + %div + = f.text_field :login, placeholder: 'Login', :autofocus => true + %div + = f.password_field :password, placeholder: 'Password' + - if devise_mapping.rememberable? + %div + = f.check_box :remember_me + = f.label :remember_me + %div= f.submit "Sign in", class: 'btn btn-primary' + = render "devise/shared/links" diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb deleted file mode 100644 index d84bdde..0000000 --- a/app/views/devise/shared/_links.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%- 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/shared/_links.haml b/app/views/devise/shared/_links.haml new file mode 100644 index 0000000..f763fdc --- /dev/null +++ b/app/views/devise/shared/_links.haml @@ -0,0 +1,19 @@ +- if controller_name != 'sessions' + = link_to "Sign in", new_session_path(resource_name) + %br/ +- if devise_mapping.registerable? && controller_name != 'registrations' + = link_to "Sign up", new_registration_path(resource_name) + %br/ +- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' + = link_to "Forgot your password?", new_password_path(resource_name) + %br/ +- if devise_mapping.confirmable? && controller_name != 'confirmations' + = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) + %br/ +- 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) + %br/ +- 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) + %br/ diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index 020787f..0000000 --- a/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

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 new file mode 100644 index 0000000..d3c87d0 --- /dev/null +++ b/app/views/devise/unlocks/new.html.haml @@ -0,0 +1,9 @@ +%h2 Resend unlock instructions += form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| + = devise_error_messages! + %div + = f.label :email + %br/ + = f.email_field :email, :autofocus => true + %div= f.submit "Resend unlock instructions" += render "devise/shared/links" diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb deleted file mode 100644 index 2085730..0000000 --- a/app/views/home/index.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Home#index

-

Find me in app/views/home/index.html.erb

diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml new file mode 100644 index 0000000..e69de29 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 84ba4fe..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,30 +0,0 @@ - - - - RssReader - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - -

<%= notice %>

-

<%= alert %>

- -