Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit ff84a49071c7acd10614964bf4113646b615bb04 Alper committed Feb 24, 2012
Showing with 1,328 additions and 0 deletions.
  1. BIN .DS_Store
  2. +15 −0 .gitignore
  3. +41 −0 Gemfile
  4. +131 −0 Gemfile.lock
  5. +1 −0 README.rdoc
  6. +7 −0 Rakefile
  7. BIN app/assets/images/rails.png
  8. +15 −0 app/assets/javascripts/application.js
  9. +3 −0 app/assets/javascripts/main.js.coffee
  10. +13 −0 app/assets/stylesheets/application.css
  11. +3 −0 app/assets/stylesheets/main.css.scss
  12. +16 −0 app/controllers/application_controller.rb
  13. +4 −0 app/controllers/main_controller.rb
  14. +2 −0 app/helpers/application_helper.rb
  15. +2 −0 app/helpers/main_helper.rb
  16. 0 app/mailers/.gitkeep
  17. 0 app/models/.gitkeep
  18. +9 −0 app/models/user.rb
  19. +14 −0 app/views/layouts/application.html.erb
  20. +1 −0 app/views/main/index.html.erb
  21. +25 −0 app/views/users/_links.erb
  22. +12 −0 app/views/users/confirmations/new.html.erb
  23. +5 −0 app/views/users/mailer/confirmation_instructions.html.erb
  24. +8 −0 app/views/users/mailer/reset_password_instructions.html.erb
  25. +7 −0 app/views/users/mailer/unlock_instructions.html.erb
  26. +16 −0 app/views/users/passwords/edit.html.erb
  27. +12 −0 app/views/users/passwords/new.html.erb
  28. +25 −0 app/views/users/registrations/edit.html.erb
  29. +21 −0 app/views/users/registrations/new.html.erb
  30. +17 −0 app/views/users/sessions/new.html.erb
  31. +12 −0 app/views/users/unlocks/new.html.erb
  32. +4 −0 config.ru
  33. +59 −0 config/application.rb
  34. +6 −0 config/boot.rb
  35. +25 −0 config/database.yml
  36. +5 −0 config/environment.rb
  37. +39 −0 config/environments/development.rb
  38. +67 −0 config/environments/production.rb
  39. +37 −0 config/environments/test.rb
  40. +7 −0 config/initializers/backtrace_silencers.rb
  41. +223 −0 config/initializers/devise.rb
  42. +15 −0 config/initializers/inflections.rb
  43. +5 −0 config/initializers/mime_types.rb
  44. +7 −0 config/initializers/secret_token.rb
  45. +8 −0 config/initializers/session_store.rb
  46. +14 −0 config/initializers/wrap_parameters.rb
  47. +57 −0 config/locales/devise.en.yml
  48. +5 −0 config/locales/en.yml
  49. +2 −0 config/locales/tr.yml
  50. +65 −0 config/routes.rb
  51. +52 −0 db/migrate/20120224102558_devise_create_users.rb
  52. +36 −0 db/schema.rb
  53. +7 −0 db/seeds.rb
  54. +2 −0 doc/README_FOR_APP
  55. BIN lib/.DS_Store
  56. 0 lib/assets/.gitkeep
  57. BIN lib/data/.DS_Store
  58. BIN lib/data/GeoIP.dat
  59. 0 lib/tasks/.gitkeep
  60. 0 log/.gitkeep
  61. +26 −0 public/404.html
  62. +26 −0 public/422.html
  63. +25 −0 public/500.html
  64. 0 public/favicon.ico
  65. +5 −0 public/robots.txt
  66. +6 −0 script/rails
  67. 0 test/fixtures/.gitkeep
  68. +11 −0 test/fixtures/users.yml
  69. 0 test/functional/.gitkeep
  70. +9 −0 test/functional/main_controller_test.rb
  71. 0 test/integration/.gitkeep
  72. +12 −0 test/performance/browsing_test.rb
  73. +13 −0 test/test_helper.rb
  74. 0 test/unit/.gitkeep
  75. +4 −0 test/unit/helpers/main_helper_test.rb
  76. +7 −0 test/unit/user_test.rb
  77. 0 vendor/assets/javascripts/.gitkeep
  78. 0 vendor/assets/stylesheets/.gitkeep
  79. 0 vendor/plugins/.gitkeep
Binary file not shown.
@@ -0,0 +1,15 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
@@ -0,0 +1,41 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.1'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+gem 'devise'
+gem 'geoip'
+gem 'pry'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer'
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
@@ -0,0 +1,131 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.1)
+ actionpack (= 3.2.1)
+ mail (~> 2.4.0)
+ actionpack (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.1)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.1)
+ activesupport (= 3.2.1)
+ builder (~> 3.0.0)
+ activerecord (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ arel (~> 3.0.0)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ activesupport (3.2.1)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bcrypt-ruby (3.0.1)
+ builder (3.0.0)
+ coderay (1.0.5)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
+ devise (2.0.4)
+ bcrypt-ruby (~> 3.0)
+ orm_adapter (~> 0.0.3)
+ railties (~> 3.1)
+ warden (~> 1.1.1)
+ erubis (2.7.0)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ geoip (1.1.2)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ jquery-rails (2.0.0)
+ railties (>= 3.2.0.beta, < 5.0)
+ thor (~> 0.14)
+ json (1.6.5)
+ mail (2.4.1)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ method_source (0.7.0)
+ mime-types (1.17.2)
+ multi_json (1.1.0)
+ orm_adapter (0.0.6)
+ polyglot (0.3.3)
+ pry (0.9.8.2)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7)
+ slop (>= 2.4.4, < 3)
+ rack (1.4.1)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.1)
+ actionmailer (= 3.2.1)
+ actionpack (= 3.2.1)
+ activerecord (= 3.2.1)
+ activeresource (= 3.2.1)
+ activesupport (= 3.2.1)
+ bundler (~> 1.0)
+ railties (= 3.2.1)
+ railties (3.2.1)
+ actionpack (= 3.2.1)
+ activesupport (= 3.2.1)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.1.15)
+ sass-rails (3.2.4)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ slop (2.4.4)
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.5)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.31)
+ uglifier (1.2.3)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+ warden (1.1.1)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ devise
+ geoip
+ jquery-rails
+ pry
+ rails (= 3.2.1)
+ sass-rails (~> 3.2.3)
+ sqlite3
+ uglifier (>= 1.0.3)
@@ -0,0 +1 @@
+== Rails, timezone from GeoIP, locale from request header or parameter sample
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Int::Application.load_tasks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+*/
@@ -0,0 +1,3 @@
+// Place all the styles related to the main controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,16 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+
+ before_filter :set_locale
+
+ def set_locale
+ I18n.locale = params[:locale] || current_user.try(:locale) || extract_locale_from_accept_language_header
+ end
+
+private
+
+ def extract_locale_from_accept_language_header
+ request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[EN|TR]{2}/).first || I18n.default_locale
+ end
+
+end
@@ -0,0 +1,4 @@
+class MainController < ApplicationController
+ def index
+ end
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,2 @@
+module MainHelper
+end
No changes.
No changes.
@@ -0,0 +1,9 @@
+class User < ActiveRecord::Base
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
+ devise :database_authenticatable, :registerable,
+ :recoverable, :rememberable, :trackable, :validatable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+end
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Int</title>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
@@ -0,0 +1 @@
+<h1><%= t 'hello' %></h1>
@@ -0,0 +1,25 @@
+<%- if controller_name != 'sessions' %>
+ <%= link_to "Sign in", new_session_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
+<% end -%>
+
+<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
+<% 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) %><br />
+<% 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) %><br />
+ <% end -%>
+<% end -%>
@@ -0,0 +1,12 @@
+<h2>Resend confirmation instructions</h2>
+
+<%= 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 %></div>
+
+ <div><%= f.submit "Resend confirmation instructions" %></div>
+<% end %>
+
+<%= render "links" %>
@@ -0,0 +1,5 @@
+<p>Welcome <%= @resource.email %>!</p>
+
+<p>You can confirm your account email through the link below:</p>
+
+<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -0,0 +1,8 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
+
+<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
+
+<p>If you didn't request this, please ignore this email.</p>
+<p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,7 @@
+<p>Hello <%= @resource.email %>!</p>
+
+<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
+
+<p>Click the link below to unlock your account:</p>
+
+<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -0,0 +1,16 @@
+<h2>Change your password</h2>
+
+<%= 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 %></div>
+
+ <div><%= f.label :password_confirmation, "Confirm new password" %><br />
+ <%= f.password_field :password_confirmation %></div>
+
+ <div><%= f.submit "Change my password" %></div>
+<% end %>
+
+<%= render "links" %>
@@ -0,0 +1,12 @@
+<h2>Forgot your password?</h2>
+
+<%= 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 %></div>
+
+ <div><%= f.submit "Send me reset password instructions" %></div>
+<% end %>
+
+<%= render "links" %>
Oops, something went wrong. Retry.

0 comments on commit ff84a49

Please sign in to comment.