");
5 | }
6 |
7 | $('.tasks-list').prepend('<%=j render(partial: 'task', locals: { task: @task }) %>');
8 | $('.new-task #task_title').val('');
9 | $('.point-radio input').prop('checked', false);
10 | Ktra.tasks.toggle_point_radio_buttons();
11 |
--------------------------------------------------------------------------------
/app/views/tasks/destroy.js.erb:
--------------------------------------------------------------------------------
1 | var target = '#task<%= @task.id %>';
2 | $(target).hide('blind', 400, function(){
3 | $(target).remove();
4 | });
5 |
--------------------------------------------------------------------------------
/app/views/tasks/edit.js.erb:
--------------------------------------------------------------------------------
1 | var target = '#task<%= @task.id %>';
2 | var targetEdit = '#task<%= @task.id %> .edit';
3 |
4 | if($(targetEdit).length){
5 | $(targetEdit).hide('blind', 400);
6 | $(targetEdit).promise().done(function(){
7 | $(targetEdit).remove();
8 | });
9 | } else {
10 | $(target).append('<%=j render(partial: 'edit', locals: {task: @task}) %>');
11 | $(target).promise().done(function(){
12 | $(targetEdit).show('blind', 400);
13 | });
14 | }
15 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_done.html.haml:
--------------------------------------------------------------------------------
1 | = form_for(task, remote: true, url: task_status_path(task)) do |f|
2 | = f.hidden_field :finished_at, value: Time.now.to_s(:db)
3 | = f.hidden_field :status, value: 'done'
4 | = f.hidden_field :week_id, value: @this_week.id
5 | = f.button "#{content_tag(:i, '', class: 'fa fa-check-circle')}DONE".html_safe, type: :submit
6 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_points.html.haml:
--------------------------------------------------------------------------------
1 | %ul
2 | - Task::POINTS.each do |pt|
3 | %li{class: "pt#{pt}"}
4 | = f.radio_button :point, pt, id: "task_point_#{pt + edit}"
5 | = f.label :point, for: "task_point_#{pt + edit}" do
6 | %span.num<>= pt
7 | pt
8 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_restart.html.haml:
--------------------------------------------------------------------------------
1 | = form_for(task, remote: true, url: task_status_path(task)) do |f|
2 | = f.hidden_field :started_at, value: Time.now.to_s(:db)
3 | = f.hidden_field :status, value: 'doing'
4 | = f.hidden_field :week_id, value: nil
5 | = f.button "#{content_tag(:i, '', class: 'fa fa-repeat')}RESTART".html_safe, type: :submit
6 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_start.html.haml:
--------------------------------------------------------------------------------
1 | = form_for(task, remote: true, url: task_status_path(task)) do |f|
2 | = f.hidden_field :started_at, value: Time.now.to_s(:db)
3 | = f.hidden_field :status, value: 'doing'
4 | = f.hidden_field :week_id, value: nil
5 | = f.button " #{content_tag(:i, '', class: 'fa fa-play-circle')}START".html_safe, type: :submit
6 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_stop.html.haml:
--------------------------------------------------------------------------------
1 | = form_for(task, remote: true, url: task_status_path(task)) do |f|
2 | = f.hidden_field :status, value: 'unstarted'
3 | = f.hidden_field :week_id, value: nil
4 | = f.button "#{content_tag(:i, '', class: 'fa fa-pause')}STOP".html_safe, type: :submit
5 |
--------------------------------------------------------------------------------
/app/views/tasks/form/_title.html.haml:
--------------------------------------------------------------------------------
1 | = f.text_field :title, class: 'task-title', autocomplete: 'off', placeholder: placeholder, required: true, class: "#{'allow-submit' unless local_assigns[:new_task]}"
2 | %i.fa.fa-pencil
3 |
--------------------------------------------------------------------------------
/app/views/tasks/index.html.haml:
--------------------------------------------------------------------------------
1 | - if user_signed_in?
2 | .form.new-task
3 | = form_for(@task, remote: true) do |f|
4 | - if @task.errors.any?
5 | #error_explanation
6 | %h2
7 | = pluralize(@task.errors.count, "error")
8 | prohibited this task from being saved:
9 | %ul
10 | - @task.errors.full_messages.each do |msg|
11 | %li= msg
12 | .field
13 | = render ('tasks/form/title'), f: f, placeholder: 'NEW TASK TITLE', new_task: true
14 | .field.point-radio
15 | = render partial: 'tasks/form/points', locals: {f: f, edit: ''}
16 | - else
17 | - # FIXME
18 | = link_to '/users/auth/twitter' do
19 | Sign in with Twitter
20 |
21 | .week-summary
22 | = link_to week_path(@this_week) do
23 | = render 'weeks/summary', week: @this_week, tasks: true
24 |
25 | - if user_signed_in? && @tasks.present?
26 | = render 'tasks'
27 | - else
28 | %p.error-message There's no tasks yet.
29 |
--------------------------------------------------------------------------------
/app/views/tasks/statuses/_doing.html.haml:
--------------------------------------------------------------------------------
1 | %h2
2 | DOING
3 | %i.fa.fa-arrow-right
4 | = render ('tasks/form/done'), task: @task
5 | = render ('tasks/form/stop'), task: @task
6 |
--------------------------------------------------------------------------------
/app/views/tasks/statuses/_done.html.haml:
--------------------------------------------------------------------------------
1 | %h2
2 | DONE
3 | %i.fa.fa-arrow-right
4 | = render ('tasks/form/restart'), task: @task
5 |
--------------------------------------------------------------------------------
/app/views/tasks/statuses/_unstarted.html.haml:
--------------------------------------------------------------------------------
1 | %h2
2 | STANDBY
3 | %i.fa.fa-arrow-right
4 | = render ('tasks/form/start'), task: @task
5 |
--------------------------------------------------------------------------------
/app/views/tasks/task/_doing.html.haml:
--------------------------------------------------------------------------------
1 | %span.status<>
2 | = render ('tasks/form/done'), task: task
3 |
--------------------------------------------------------------------------------
/app/views/tasks/task/_done.html.haml:
--------------------------------------------------------------------------------
1 | %span.status<>
2 | = render ('tasks/form/restart'), task: task
3 |
--------------------------------------------------------------------------------
/app/views/tasks/task/_unstarted.html.haml:
--------------------------------------------------------------------------------
1 | %span.status<>
2 | = render ('tasks/form/start'), task: task
3 |
--------------------------------------------------------------------------------
/app/views/tasks/update.js.erb:
--------------------------------------------------------------------------------
1 | var target = '#task<%= @task.id %>';
2 | var targetEdit = '#task<%= @task.id %> .edit';
3 |
4 | $(targetEdit).hide('blind', 400, function(){
5 | $(target).replaceWith('<%=j render(partial: 'task', locals: {task: @task}) %>');
6 | });
7 |
--------------------------------------------------------------------------------
/app/views/weeks/_summary.html.haml:
--------------------------------------------------------------------------------
1 | .date
2 | - unless local_assigns[:weeks]
3 | %i.fa.fa-calendar
4 | %ul.start-date
5 | %li.year.num= "#{week.start_date.year}"
6 | %li.month.num= "#{p sprintf("%0#2d", week.start_date.month)}"
7 | %li.day.num= p sprintf("%0#2d", week.start_date.day)
8 | %i.fa.fa-arrow-right
9 | %ul.end-date
10 | %li.month.num= "#{p sprintf("%0#2d", week.end_date.month)}"
11 | %li.day.num= p sprintf("%0#2d", week.end_date.day)
12 | - if local_assigns[:tasks]
13 | %i.fa.fa-chevron-right
14 | .right
15 | .total-points
16 | %i.fa.fa-check
17 | %span.num<>
18 | = week.total_point(current_user)
19 | pt
20 | - if local_assigns[:weeks]
21 | %i.fa.fa-chevron-right
22 |
--------------------------------------------------------------------------------
/app/views/weeks/index.html.haml:
--------------------------------------------------------------------------------
1 | %ul.weeks-list
2 | - @weeks.each do |week|
3 | %li.week
4 | =link_to week_path(week) do
5 | .week-summary= render ('weeks/summary'), week: week, weeks: true
6 |
--------------------------------------------------------------------------------
/app/views/weeks/show.html.haml:
--------------------------------------------------------------------------------
1 | .week-summary
2 | = render 'weeks/summary', week: @week
3 | - if @tasks.present?
4 | = render 'tasks/tasks'
5 | - else
6 | %p.error-message There's no tasks yet.
7 |
--------------------------------------------------------------------------------
/app/views/welcome/index.html.haml:
--------------------------------------------------------------------------------
1 | %h1
2 | = image_tag 'ktra.svg', alt: 'K-tra! The Lightweight Task Tracker.', class: 'ktra-image'
3 | .logo K-tra!
4 | .catch The Lightweight Task Tracker.
5 | .sign-in-wrapper
6 | = link_to '/users/auth/twitter', class: 'sign-in' do
7 | %i.fa.fa-twitter
8 | %span Sign in
9 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path("../spring", __FILE__)
4 | rescue LoadError
5 | end
6 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
7 |
8 | APP_PATH = File.expand_path('../../config/application', __FILE__)
9 | require File.expand_path('../../config/boot', __FILE__)
10 | require 'rails/commands'
11 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path("../spring", __FILE__)
4 | rescue LoadError
5 | end
6 | require 'bundler/setup'
7 | load Gem.bin_path('rake', 'rake')
8 |
--------------------------------------------------------------------------------
/bin/rspec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | begin
3 | load File.expand_path("../spring", __FILE__)
4 | rescue LoadError
5 | end
6 | require 'bundler/setup'
7 | load Gem.bin_path('rspec-core', 'rspec')
8 |
--------------------------------------------------------------------------------
/bin/spring:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | # This file loads spring without using Bundler, in order to be fast
4 | # It gets overwritten when you run the `spring binstub` command
5 |
6 | unless defined?(Spring)
7 | require "rubygems"
8 | require "bundler"
9 |
10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
11 | ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12 | ENV["GEM_HOME"] = nil
13 | Gem.paths = ENV
14 |
15 | gem "spring", match[1]
16 | require "spring/binstub"
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/circle.yml:
--------------------------------------------------------------------------------
1 | machine:
2 | ruby:
3 | version: 2.2.0
4 | timezone: Asia/Tokyo
5 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Ktra::Application
5 |
--------------------------------------------------------------------------------
/config/application.example.yml:
--------------------------------------------------------------------------------
1 | TWITTER_KEY: 'hogehoge'
2 | TWITTER_SECRET: 'fugofugo'
3 | production:
4 | BUGSNAG_API_KEY: ''
5 | SECRET_TOKEN: 'aaa'
6 | SESSION_KEY: '_ktra_session'
7 | staging:
8 | RAILS_ENV: 'staging'
9 | RACK_ENV: 'staging'
10 | SECRET_TOKEN: 'bbb'
11 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(:default, Rails.env)
8 |
9 | module Ktra
10 | class Application < Rails::Application
11 | # Settings in config/environments/* take precedence over those specified here.
12 | # Application configuration should go into files in config/initializers
13 | # -- all .rb files in that directory are automatically loaded.
14 |
15 | # Custom directories with classes and modules you want to be autoloadable.
16 | # config.autoload_paths += %W(#{config.root}/extras)
17 |
18 | # Only load the plugins named here, in the order given (default is alphabetical).
19 | # :all can be used as a placeholder for all plugins not explicitly named.
20 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21 |
22 | # Activate observers that should always be running.
23 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24 |
25 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27 | # config.time_zone = 'Central Time (US & Canada)'
28 |
29 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31 | # config.i18n.default_locale = :de
32 | config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
33 | I18n.enforce_available_locales = true
34 | config.i18n.default_locale = :ja
35 |
36 | # Configure the default encoding used in templates for Ruby 1.9.
37 | config.encoding = "utf-8"
38 |
39 | # Configure sensitive parameters which will be filtered from the log file.
40 | config.filter_parameters += [:password]
41 |
42 | # Enable escaping HTML in JSON.
43 | config.active_support.escape_html_entities_in_json = true
44 |
45 | # Use SQL instead of Active Record's schema dumper when creating the database.
46 | # This is necessary if your schema can't be completely dumped by the schema dumper,
47 | # like if you have constraints or database-specific column types
48 | # config.active_record.schema_format = :sql
49 |
50 | config.sass.line_comments = false
51 | config.sass.cache = false
52 | config.assets.initialize_on_precompile = false
53 | end
54 | end
55 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 |
3 | # Set up gems listed in the Gemfile.
4 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 |
6 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
7 |
--------------------------------------------------------------------------------
/config/compass.rb:
--------------------------------------------------------------------------------
1 | # Require any additional compass plugins here.
2 | project_type = :rails
3 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | development: &development
2 | adapter: postgresql
3 | database: ktra_development
4 | encoding: utf8
5 | host: localhost
6 | pool: 5
7 | timeout: 5000
8 |
9 | test:
10 | <<: *development
11 | database: ktra_test
12 |
13 | staging:
14 | <<: *development
15 | url: <%= ENV["DATABASE_URL"] %>
16 |
17 | production:
18 | <<: *development
19 | url: <%= ENV["DATABASE_URL"] %>
20 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the rails application
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the rails application
5 | Ktra::Application.initialize!
6 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Ktra::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | config.eager_load = false
10 |
11 | # Show full error reports and disable caching
12 | config.consider_all_requests_local = true
13 | config.action_controller.perform_caching = false
14 |
15 | # Don't care if the mailer can't send
16 | config.action_mailer.raise_delivery_errors = false
17 |
18 | # Print deprecation notices to the Rails logger
19 | config.active_support.deprecation = :log
20 |
21 | # Only use best-standards-support built into browsers
22 | config.action_dispatch.best_standards_support = :builtin
23 |
24 | # Do not compress assets
25 | config.assets.compress = false
26 |
27 | # Expands the lines which load the assets
28 | config.assets.debug = true
29 | end
30 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Ktra::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # Code is not reloaded between requests
5 | config.cache_classes = true
6 |
7 | # Full error reports are disabled and caching is turned on
8 | config.consider_all_requests_local = false
9 | config.action_controller.perform_caching = true
10 |
11 | # Disable Rails's static asset server (Apache or nginx will already do this)
12 | config.serve_static_assets = true
13 |
14 | # Compress JavaScripts and CSS
15 | config.assets.compress = true
16 |
17 | # Don't fallback to assets pipeline if a precompiled asset is missed
18 | config.assets.compile = true
19 |
20 | # Generate digests for assets URLs
21 | config.assets.digest = true
22 |
23 | # Defaults to nil and saved in location specified by config.assets.prefix
24 | # config.assets.manifest = YOUR_PATH
25 |
26 | # Specifies the header that your server uses for sending files
27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29 |
30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31 | config.force_ssl = true
32 |
33 | # See everything in the log (default is :info)
34 | # config.log_level = :debug
35 |
36 | # Prepend all log lines with the following tags
37 | # config.log_tags = [ :subdomain, :uuid ]
38 |
39 | # Use a different logger for distributed setups
40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41 |
42 | # Use a different cache store in production
43 | # config.cache_store = :mem_cache_store
44 |
45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server
46 | # config.action_controller.asset_host = "http://assets.example.com"
47 |
48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49 | # config.assets.precompile += %w( search.js )
50 | config.assets.precompile += %w( welcome.js )
51 |
52 | # Disable delivery errors, bad email addresses will be ignored
53 | # config.action_mailer.raise_delivery_errors = false
54 |
55 | # Enable threaded mode
56 | # config.threadsafe!
57 |
58 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
59 | # the I18n.default_locale when a translation can not be found)
60 | config.i18n.fallbacks = true
61 |
62 | # Send deprecation notices to registered listeners
63 | config.active_support.deprecation = :notify
64 |
65 | config.eager_load = false
66 |
67 | end
68 |
--------------------------------------------------------------------------------
/config/environments/staging.rb:
--------------------------------------------------------------------------------
1 | Ktra::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb
3 |
4 | # Code is not reloaded between requests
5 | config.cache_classes = true
6 |
7 | # Full error reports are disabled and caching is turned on
8 | config.consider_all_requests_local = false
9 | config.action_controller.perform_caching = true
10 |
11 | # Disable Rails's static asset server (Apache or nginx will already do this)
12 | config.serve_static_assets = true
13 |
14 | # Compress JavaScripts and CSS
15 | config.assets.compress = true
16 |
17 | # Don't fallback to assets pipeline if a precompiled asset is missed
18 | config.assets.compile = true
19 |
20 | # Generate digests for assets URLs
21 | config.assets.digest = true
22 |
23 | # Defaults to nil and saved in location specified by config.assets.prefix
24 | # config.assets.manifest = YOUR_PATH
25 |
26 | # Specifies the header that your server uses for sending files
27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29 |
30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31 | config.force_ssl = true
32 |
33 | # See everything in the log (default is :info)
34 | # config.log_level = :debug
35 |
36 | # Prepend all log lines with the following tags
37 | # config.log_tags = [ :subdomain, :uuid ]
38 |
39 | # Use a different logger for distributed setups
40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41 |
42 | # Use a different cache store in production
43 | # config.cache_store = :mem_cache_store
44 |
45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server
46 | # config.action_controller.asset_host = "http://assets.example.com"
47 |
48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49 | # config.assets.precompile += %w( search.js )
50 |
51 | # Disable delivery errors, bad email addresses will be ignored
52 | # config.action_mailer.raise_delivery_errors = false
53 |
54 | # Enable threaded mode
55 | # config.threadsafe!
56 |
57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58 | # the I18n.default_locale when a translation can not be found)
59 | config.i18n.fallbacks = true
60 |
61 | # Send deprecation notices to registered listeners
62 | config.active_support.deprecation = :notify
63 |
64 | # Log the query plan for queries taking more than this (works
65 | # with SQLite, MySQL, and PostgreSQL)
66 | # config.active_record.auto_explain_threshold_in_seconds = 0.5
67 |
68 | config.eager_load = false
69 |
70 | end
71 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Ktra::Application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = true
17 | config.static_cache_control = "public, max-age=3600"
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 |
37 | ActionMailer::Base.delivery_method = :test
38 | ActionMailer::Base.perform_deliveries = true
39 | ActionMailer::Base.deliveries = []
40 | end
41 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/config/initializers/bugsnag.rb:
--------------------------------------------------------------------------------
1 | if Rails.env.production? && ENV['BUGSNAG_API_KEY'].present?
2 | Bugsnag.configure do |config|
3 | config.api_key = ENV['BUGSNAG_API_KEY']
4 | config.use_ssl = true
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # Use this hook to configure devise mailer, warden hooks and so forth.
2 | # Many of these configuration options can be set straight in your model.
3 | Devise.setup do |config|
4 | # ==> Mailer Configuration
5 | # Configure the e-mail address which will be shown in Devise::Mailer,
6 | # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7 | config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8 |
9 | # Configure the class responsible to send e-mails.
10 | # config.mailer = "Devise::Mailer"
11 |
12 | # ==> ORM configuration
13 | # Load and configure the ORM. Supports :active_record (default) and
14 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
15 | # available as additional gems.
16 | require 'devise/orm/active_record'
17 |
18 | # ==> Configuration for any authentication mechanism
19 | # Configure which keys are used when authenticating a user. The default is
20 | # just :email. You can configure it to use [:username, :subdomain], so for
21 | # authenticating a user, both parameters are required. Remember that those
22 | # parameters are used only when authenticating and not when retrieving from
23 | # session. If you need permissions, you should implement that in a before filter.
24 | # You can also supply a hash where the value is a boolean determining whether
25 | # or not authentication should be aborted when the value is not present.
26 | # config.authentication_keys = [ :email ]
27 |
28 | # Configure parameters from the request object used for authentication. Each entry
29 | # given should be a request method and it will automatically be passed to the
30 | # find_for_authentication method and considered in your model lookup. For instance,
31 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
32 | # The same considerations mentioned for authentication_keys also apply to request_keys.
33 | # config.request_keys = []
34 |
35 | # Configure which authentication keys should be case-insensitive.
36 | # These keys will be downcased upon creating or modifying a user and when used
37 | # to authenticate or find a user. Default is :email.
38 | config.case_insensitive_keys = [ :email ]
39 |
40 | # Configure which authentication keys should have whitespace stripped.
41 | # These keys will have whitespace before and after removed upon creating or
42 | # modifying a user and when used to authenticate or find a user. Default is :email.
43 | config.strip_whitespace_keys = [ :email ]
44 |
45 | # Tell if authentication through request.params is enabled. True by default.
46 | # config.params_authenticatable = true
47 |
48 | # Tell if authentication through HTTP Basic Auth is enabled. False by default.
49 | # config.http_authenticatable = false
50 |
51 | # If http headers should be returned for AJAX requests. True by default.
52 | # config.http_authenticatable_on_xhr = true
53 |
54 | # The realm used in Http Basic Authentication. "Application" by default.
55 | # config.http_authentication_realm = "Application"
56 |
57 | # It will change confirmation, password recovery and other workflows
58 | # to behave the same regardless if the e-mail provided was right or wrong.
59 | # Does not affect registerable.
60 | # config.paranoid = true
61 |
62 | # ==> Configuration for :database_authenticatable
63 | # For bcrypt, this is the cost for hashing the password and defaults to 10. If
64 | # using other encryptors, it sets how many times you want the password re-encrypted.
65 | #
66 | # Limiting the stretches to just one in testing will increase the performance of
67 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
68 | # a value less than 10 in other environments.
69 | config.stretches = Rails.env.test? ? 1 : 10
70 |
71 | # Setup a pepper to generate the encrypted password.
72 | # config.pepper = "717017c2117472e31483d56ea165c69d70c6eb44121393c3db3febfc7b7c65834b75477875773e896a0f39773cec7c9a5cd2a3fd0d236c2f0b600b0f167c5728"
73 |
74 | # ==> Configuration for :confirmable
75 | # A period that the user is allowed to access the website even without
76 | # confirming his account. For instance, if set to 2.days, the user will be
77 | # able to access the website for two days without confirming his account,
78 | # access will be blocked just in the third day. Default is 0.days, meaning
79 | # the user cannot access the website without confirming his account.
80 | # config.confirm_within = 2.days
81 |
82 | # Defines which key will be used when confirming an account
83 | # config.confirmation_keys = [ :email ]
84 |
85 | # ==> Configuration for :rememberable
86 | # The time the user will be remembered without asking for credentials again.
87 | # config.remember_for = 2.weeks
88 |
89 | # If true, a valid remember token can be re-used between multiple browsers.
90 | # config.remember_across_browsers = true
91 |
92 | # If true, extends the user's remember period when remembered via cookie.
93 | # config.extend_remember_period = false
94 |
95 | # Options to be passed to the created cookie. For instance, you can set
96 | # :secure => true in order to force SSL only cookies.
97 | # config.cookie_options = {}
98 |
99 | # ==> Configuration for :validatable
100 | # Range for password length. Default is 6..128.
101 | # config.password_length = 6..128
102 |
103 | # Email regex used to validate email formats. It simply asserts that
104 | # an one (and only one) @ exists in the given string. This is mainly
105 | # to give user feedback and not to assert the e-mail validity.
106 | # config.email_regexp = /\A[^@]+@[^@]+\z/
107 |
108 | # ==> Configuration for :timeoutable
109 | # The time you want to timeout the user session without activity. After this
110 | # time the user will be asked for credentials again. Default is 30 minutes.
111 | # config.timeout_in = 30.minutes
112 |
113 | # ==> Configuration for :lockable
114 | # Defines which strategy will be used to lock an account.
115 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
116 | # :none = No lock strategy. You should handle locking by yourself.
117 | # config.lock_strategy = :failed_attempts
118 |
119 | # Defines which key will be used when locking and unlocking an account
120 | # config.unlock_keys = [ :email ]
121 |
122 | # Defines which strategy will be used to unlock an account.
123 | # :email = Sends an unlock link to the user email
124 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
125 | # :both = Enables both strategies
126 | # :none = No unlock strategy. You should handle unlocking by yourself.
127 | # config.unlock_strategy = :both
128 |
129 | # Number of authentication tries before locking an account if lock_strategy
130 | # is failed attempts.
131 | # config.maximum_attempts = 20
132 |
133 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
134 | # config.unlock_in = 1.hour
135 |
136 | # ==> Configuration for :recoverable
137 | #
138 | # Defines which key will be used when recovering the password for an account
139 | # config.reset_password_keys = [ :email ]
140 |
141 | # Time interval you can reset your password with a reset password key.
142 | # Don't put a too small interval or your users won't have the time to
143 | # change their passwords.
144 | config.reset_password_within = 2.hours
145 |
146 | # ==> Configuration for :encryptable
147 | # Allow you to use another encryption algorithm besides bcrypt (default). You can use
148 | # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
149 | # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
150 | # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
151 | # REST_AUTH_SITE_KEY to pepper)
152 | # config.encryptor = :sha512
153 |
154 | # ==> Configuration for :token_authenticatable
155 | # Defines name of the authentication token params key
156 | # config.token_authentication_key = :auth_token
157 |
158 | # If true, authentication through token does not store user in session and needs
159 | # to be supplied on each request. Useful if you are using the token as API token.
160 | # config.stateless_token = false
161 |
162 | # ==> Scopes configuration
163 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
164 | # "users/sessions/new". It's turned off by default because it's slower if you
165 | # are using only default views.
166 | # config.scoped_views = false
167 |
168 | # Configure the default scope given to Warden. By default it's the first
169 | # devise role declared in your routes (usually :user).
170 | # config.default_scope = :user
171 |
172 | # Configure sign_out behavior.
173 | # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
174 | # The default is true, which means any logout action will sign out all active scopes.
175 | # config.sign_out_all_scopes = true
176 |
177 | # ==> Navigation configuration
178 | # Lists the formats that should be treated as navigational. Formats like
179 | # :html, should redirect to the sign in page when the user does not have
180 | # access, but formats like :xml or :json, should return 401.
181 | #
182 | # If you have any extra navigational formats, like :iphone or :mobile, you
183 | # should add them to the navigational formats lists.
184 | #
185 | # The :"*/*" and "*/*" formats below is required to match Internet
186 | # Explorer requests.
187 | # config.navigational_formats = [:"*/*", "*/*", :html]
188 |
189 | # The default HTTP method used to sign out a resource. Default is :delete.
190 | config.sign_out_via = :delete
191 |
192 | # ==> OmniAuth
193 | # Add a new OmniAuth provider. Check the wiki for more information on setting
194 | # up on your models and hooks.
195 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
196 | config.omniauth :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET'], {
197 | secure_image_url: 'true',
198 | image_size: 'bigger', # 大きい画像を使っちゃおうね
199 | }
200 |
201 | # ==> Warden configuration
202 | # If you want to use other strategies, that are not supported by Devise, or
203 | # change the failure app, you can configure them inside the config.warden block.
204 | #
205 | # config.warden do |manager|
206 | # manager.intercept_401 = false
207 | # manager.default_strategies(:scope => :user).unshift :some_external_strategy
208 | # end
209 |
210 | config.secret_key = '625bef6226fac9196d9c0a0853c24c1bb4e183e3c17affd83bb8a801eb23e81066e2b2143fcd6807c9d211aee998c6a44a24321dc1b55ce8214ed4318fa8c982'
211 | end
212 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format
4 | # (all these examples are active by default):
5 | # ActiveSupport::Inflector.inflections do |inflect|
6 | # inflect.plural /^(ox)$/i, '\1en'
7 | # inflect.singular /^(ox)en/i, '\1'
8 | # inflect.irregular 'person', 'people'
9 | # inflect.uncountable %w( fish sheep )
10 | # end
11 | #
12 | # These inflection rules are supported but not enabled by default:
13 | # ActiveSupport::Inflector.inflections do |inflect|
14 | # inflect.acronym 'RESTful'
15 | # end
16 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 | # Mime::Type.register_alias "text/html", :iphone
6 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Ktra::Application.config.session_store :cookie_store, key: ENV['SESSION_KEY'] || "_ktra_session_#{Rails.env}", expire_after: 1.months
4 |
5 | # Use the database for sessions instead of the cookie-based default,
6 | # which shouldn't be used to store highly confidential information
7 | # (create the session table with "rails generate session_migration")
8 | # Ktra::Application.config.session_store :active_record_store
9 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 | #
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 | # Disable root element in JSON by default.
12 | ActiveSupport.on_load(:active_record) do
13 | self.include_root_in_json = false
14 | end
15 |
--------------------------------------------------------------------------------
/config/locales/devise/en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2 |
3 | en:
4 | errors:
5 | messages:
6 | expired: "has expired, please request a new one"
7 | not_found: "not found"
8 | already_confirmed: "was already confirmed, please try signing in"
9 | not_locked: "was not locked"
10 | not_saved:
11 | one: "1 error prohibited this %{resource} from being saved:"
12 | other: "%{count} errors prohibited this %{resource} from being saved:"
13 |
14 | devise:
15 | failure:
16 | already_authenticated: 'You are already signed in.'
17 | unauthenticated: 'You need to sign in or sign up before continuing.'
18 | unconfirmed: 'You have to confirm your account before continuing.'
19 | locked: 'Your account is locked.'
20 | invalid: 'Invalid email or password.'
21 | invalid_token: 'Invalid authentication token.'
22 | timeout: 'Your session expired, please sign in again to continue.'
23 | inactive: 'Your account was not activated yet.'
24 | sessions:
25 | signed_in: 'Signed in successfully.'
26 | signed_out: 'Signed out successfully.'
27 | passwords:
28 | send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29 | updated: 'Your password was changed successfully. You are now signed in.'
30 | updated_not_active: 'Your password was changed successfully.'
31 | send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
32 | confirmations:
33 | send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
34 | send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
35 | confirmed: 'Your account was successfully confirmed. You are now signed in.'
36 | registrations:
37 | signed_up: 'Welcome! You have signed up successfully.'
38 | inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
39 | updated: 'You updated your account successfully.'
40 | destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
41 | reasons:
42 | inactive: 'inactive'
43 | unconfirmed: 'unconfirmed'
44 | locked: 'locked'
45 | unlocks:
46 | send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
47 | unlocked: 'Your account was successfully unlocked. You are now signed in.'
48 | send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
49 | omniauth_callbacks:
50 | success: 'Successfully authorized from %{kind} account.'
51 | failure: 'Could not authorize you from %{kind} because "%{reason}".'
52 | mailer:
53 | confirmation_instructions:
54 | subject: 'Confirmation instructions'
55 | reset_password_instructions:
56 | subject: 'Reset password instructions'
57 | unlock_instructions:
58 | subject: 'Unlock Instructions'
59 |
--------------------------------------------------------------------------------
/config/locales/devise/ja.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2 |
3 | ja:
4 | errors:
5 | messages:
6 | expired: "有効期限切れです。新規登録してください"
7 | not_found: "は見つかりませんでした"
8 | already_confirmed: "は既に登録済みです。ログインしてください"
9 | not_locked: "ロックされていません"
10 | not_saved:
11 | one: "エラーがあります"
12 | other: "エラーがあります"
13 | devise:
14 | failure:
15 | already_authenticated: 'ログイン済みです'
16 | inactive: 'アカウントがまだ有効になっていません'
17 | invalid: 'メールアドレスまたはパスワードが違います'
18 | invalid_token: '認証キーが不正です'
19 | locked: 'アカウントはロックされています'
20 | not_found_in_database: "メールアドレスまたはパスワードが違います"
21 | timeout: '一定時間が経過したため、再度ログインが必要です'
22 | unauthenticated: 'ログインまたは登録が必要です'
23 | unconfirmed: '本登録を行ってください'
24 | sessions:
25 | signed_in: 'ログインしました'
26 | signed_out: 'ログアウトしました'
27 | passwords:
28 | send_instructions: 'パスワードのリセット方法を記載したメールを送信しました'
29 | updated: 'パスワードを変更しました。ログイン済みです'
30 | updated_not_active: 'パスワードを変更しました'
31 | send_paranoid_instructions: "ご登録のメールアドレスが保存されている場合、パスワード復旧用のリンク先をメールでご連絡します"
32 | confirmations:
33 | send_instructions: 'アカウントの確認方法を数分以内にメールでご連絡します'
34 | send_paranoid_instructions: 'ご登録のメールアドレスが保存されている場合、アカウントの確認方法をメールでご連絡します'
35 | confirmed: 'アカウントが確認されました。ログインしています'
36 | registrations:
37 | destroyed: 'ご利用ありがとうございました。アカウントが削除されました。またのご利用をお待ちしています'
38 | signed_up: 'ようこそ! アカウントが登録されました'
39 | signed_up_but_inactive: 'アカウントがアクティブではないようです。'
40 | signed_up_but_locked: 'アカウントがロックされてます'
41 | signed_up_but_unconfirmed: 'アカウントのメールアドレスが未確認です'
42 | update_needs_confirmation: "アカウント情報の更新をしましたが、新しいメールアドレスの確認がされていません。確認メールをご確認下さい。"
43 | inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
44 | updated: 'You updated your account successfully.'
45 | reasons:
46 | inactive: 'inactive'
47 | unconfirmed: 'unconfirmed'
48 | locked: 'locked'
49 | unlocks:
50 | send_instructions: 'アカウントのロックを解除する方法を数分以内にメールでご連絡します'
51 | unlocked: 'アカウントのロックが解除されました。ログインしています。'
52 | send_paranoid_instructions: 'アカウントが存在する場合、ロックを解除する方法をメールでご連絡します'
53 | omniauth_callbacks:
54 | success: '%{kind}アカウントでログインしました。'
55 | failure: '%{kind} から承認されませんでした。理由:"%{reason}".'
56 | mailer:
57 | confirmation_instructions:
58 | subject: 'アカウントの登録方法'
59 | reset_password_instructions:
60 | subject: 'パスワードの再設定'
61 | unlock_instructions:
62 | subject: 'アカウントのロック解除'
63 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Sample localization file for English. Add more files in this directory for other locales.
2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3 |
4 | en:
5 | hello: "Hello world"
6 |
--------------------------------------------------------------------------------
/config/locales/ja.yml:
--------------------------------------------------------------------------------
1 | ja:
2 | hello: "Hello world"
3 |
4 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Ktra::Application.routes.draw do
2 | devise_for :users, controllers: { omniauth_callbacks: 'sessions' }, skip: [:sessions]
3 | devise_scope :user do
4 | delete '/sessions' => 'devise/sessions#destroy', as: :user_session
5 | end
6 | resources :tasks do
7 | member do
8 | post 'done'
9 | end
10 | resource :status, only: [:update]
11 | end
12 | resources :weeks do
13 | resources :tasks
14 | end
15 | authenticated :user do
16 | root 'tasks#index', as: :authenticated_user_root
17 | end
18 | root :to => 'welcome#index'
19 | get '/auth/failure' => 'sessions#failure'
20 | resource :account, only: [:show]
21 |
22 | # The priority is based upon order of creation:
23 | # first created -> highest priority.
24 |
25 | # Sample of regular route:
26 | # match 'products/:id' => 'catalog#view'
27 | # Keep in mind you can assign values other than :controller and :action
28 |
29 | # Sample of named route:
30 | # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
31 | # This route can be invoked with purchase_url(:id => product.id)
32 |
33 | # Sample resource route (maps HTTP verbs to controller actions automatically):
34 | # resources :products
35 |
36 | # Sample resource route with options:
37 | # resources :products do
38 | # member do
39 | # get 'short'
40 | # post 'toggle'
41 | # end
42 | #
43 | # collection do
44 | # get 'sold'
45 | # end
46 | # end
47 |
48 | # Sample resource route with sub-resources:
49 | # resources :products do
50 | # resources :comments, :sales
51 | # resource :seller
52 | # end
53 |
54 | # Sample resource route with more complex sub-resources
55 | # resources :products do
56 | # resources :comments
57 | # resources :sales do
58 | # get 'recent', :on => :collection
59 | # end
60 | # end
61 |
62 | # Sample resource route within a namespace:
63 | # namespace :admin do
64 | # # Directs /admin/products/* to Admin::ProductsController
65 | # # (app/controllers/admin/products_controller.rb)
66 | # resources :products
67 | # end
68 |
69 | # You can have the root of your site routed with "root"
70 | # just remember to delete public/index.html.
71 | # root :to => 'welcome#index'
72 |
73 | # See how all your routes lay out with "rake routes"
74 |
75 | # This is a legacy wild controller route that's not recommended for RESTful applications.
76 | # Note: This route will make all actions in every controller accessible via GET requests.
77 | # match ':controller(/:action(/:id))(.:format)'
78 | end
79 |
--------------------------------------------------------------------------------
/config/secrets.yml:
--------------------------------------------------------------------------------
1 | development:
2 | secret_key_base: f1266f11f1e7ae4f53d75d2e0b70e7a9114258db1bee71dbfc505c2e57d6ee009ca1860f4e9d9e9b36475c02f66f67f31aece46b02937d53c110c4992b0fbbb3
3 |
4 | test:
5 | secret_key_base: f1266f11f1e7ae4f53d75d2e0b70e7a9114258db1bee71dbfc505c2e57d6ee009ca1860f4e9d9e9b36475c02f66f67f31aece46b02937d53c110c4992b0fbbb3
6 |
7 | production:
8 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
9 |
--------------------------------------------------------------------------------
/db/migrate/20130425112957_create_tasks.rb:
--------------------------------------------------------------------------------
1 | class CreateTasks < ActiveRecord::Migration
2 | def change
3 | create_table :tasks do |t|
4 | t.string :title
5 | t.integer :point
6 | t.string :status
7 | t.text :memo
8 | t.datetime :started_at
9 | t.datetime :finished_at
10 |
11 | t.timestamps
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20130619112425_create_iterations.rb:
--------------------------------------------------------------------------------
1 | class CreateIterations < ActiveRecord::Migration
2 | def change
3 | create_table :iterations do |t|
4 | t.date :start_date
5 | t.date :end_date
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20130619113001_add_iteration_id_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddIterationIdToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :iteration_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20130815115856_create_users.rb:
--------------------------------------------------------------------------------
1 | class CreateUsers < ActiveRecord::Migration
2 | def change
3 | create_table :users do |t|
4 | t.string :uid, null: false
5 | t.string :name
6 | t.string :nickname
7 | t.string :image
8 | t.string :token
9 | t.string :secret
10 |
11 | t.timestamps
12 | end
13 | add_index :users, :uid, unique: true
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/db/migrate/20140306103013_add_user_id_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddUserIdToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :user_id, :integer
4 | add_index :tasks, :user_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140401074621_change_iterations_to_weeks.rb:
--------------------------------------------------------------------------------
1 | class ChangeIterationsToWeeks < ActiveRecord::Migration
2 | def change
3 | rename_column :tasks, :iteration_id, :week_id
4 | rename_table :iterations, :weeks
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | # This file is auto-generated from the current state of the database. Instead
3 | # of editing this file, please use the migrations feature of Active Record to
4 | # incrementally modify your database, and then regenerate this schema definition.
5 | #
6 | # Note that this schema.rb definition is the authoritative source for your
7 | # database schema. If you need to create the application database on another
8 | # system, you should be using db:schema:load, not running all the migrations
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 | # you'll amass, the slower it'll run and the greater likelihood for issues).
11 | #
12 | # It's strongly recommended that you check this file into your version control system.
13 |
14 | ActiveRecord::Schema.define(version: 20140401074621) do
15 |
16 | # These are extensions that must be enabled in order to support this database
17 | enable_extension "plpgsql"
18 |
19 | create_table "tasks", force: true do |t|
20 | t.string "title"
21 | t.integer "point"
22 | t.string "status"
23 | t.text "memo"
24 | t.datetime "started_at"
25 | t.datetime "finished_at"
26 | t.datetime "created_at"
27 | t.datetime "updated_at"
28 | t.integer "week_id"
29 | t.integer "user_id"
30 | end
31 |
32 | add_index "tasks", ["user_id"], name: "index_tasks_on_user_id", using: :btree
33 |
34 | create_table "users", force: true do |t|
35 | t.string "uid", null: false
36 | t.string "name"
37 | t.string "nickname"
38 | t.string "image"
39 | t.string "token"
40 | t.string "secret"
41 | t.datetime "created_at"
42 | t.datetime "updated_at"
43 | end
44 |
45 | add_index "users", ["uid"], name: "index_users_on_uid", unique: true, using: :btree
46 |
47 | create_table "weeks", force: true do |t|
48 | t.date "start_date"
49 | t.date "end_date"
50 | t.datetime "created_at"
51 | t.datetime "updated_at"
52 | end
53 |
54 | end
55 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7 | # Mayor.create(name: 'Emanuel', city: cities.first)
8 |
--------------------------------------------------------------------------------
/doc/README_FOR_APP:
--------------------------------------------------------------------------------
1 | Use this README file to introduce your application and point to useful places in the API for learning more.
2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
3 |
--------------------------------------------------------------------------------
/doc/apple-touch-icon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/apple-touch-icon.psd
--------------------------------------------------------------------------------
/doc/favicon/favicon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-128.png
--------------------------------------------------------------------------------
/doc/favicon/favicon-128.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-128.psd
--------------------------------------------------------------------------------
/doc/favicon/favicon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-16.png
--------------------------------------------------------------------------------
/doc/favicon/favicon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-32.png
--------------------------------------------------------------------------------
/doc/favicon/favicon-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-48.png
--------------------------------------------------------------------------------
/doc/favicon/favicon-96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon-96.png
--------------------------------------------------------------------------------
/doc/favicon/favicon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/favicon/favicon.psd
--------------------------------------------------------------------------------
/doc/ktra-design.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/ktra-design.ai
--------------------------------------------------------------------------------
/doc/ktra-goods-base.ai:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/ktra-goods-base.ai
--------------------------------------------------------------------------------
/doc/ktra-tshirt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/doc/ktra-tshirt.png
--------------------------------------------------------------------------------
/lib/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/lib/assets/.gitkeep
--------------------------------------------------------------------------------
/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/lib/tasks/.gitkeep
--------------------------------------------------------------------------------
/log/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taea/ktra/927b4829ac3c40c8db345e393f128621de84cb78/log/.gitkeep
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
17 |
18 |
19 |
20 |
21 |
22 |
The page you were looking for doesn't exist.
23 |
You may have mistyped the address or the page may have moved.