├── log
└── .keep
├── app
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── concerns
│ │ └── .keep
│ ├── doorkeeper_application.rb
│ ├── task_key_result.rb
│ ├── user_oauth_application.rb
│ ├── task_assignee.rb
│ ├── reporting_manager.rb
│ ├── oauth_application.rb
│ ├── key_result.rb
│ ├── objective.rb
│ ├── comment.rb
│ ├── project_manager.rb
│ ├── team_member.rb
│ ├── work_log.rb
│ ├── okr.rb
│ ├── team.rb
│ └── project.rb
├── assets
│ ├── images
│ │ ├── .keep
│ │ ├── iconsprite.png
│ │ └── fallback
│ │ │ ├── icon_user.png
│ │ │ ├── icon32_user.png
│ │ │ ├── icon_project.png
│ │ │ ├── thumbnail_user.png
│ │ │ └── thumbnail_project.png
│ ├── stylesheets
│ │ ├── comments.css.scss
│ │ ├── projects.css.scss
│ │ ├── work_logs.css.scss
│ │ ├── key_results.css.scss
│ │ ├── objectives.css.scss
│ │ ├── oauth_applications.css.scss
│ │ ├── calendar.css.scss
│ │ ├── teams.css.scss
│ │ ├── application.css
│ │ ├── bootstrap-notify.css
│ │ ├── doorkeeper.css.scss
│ │ ├── okrs.css.scss
│ │ └── login.css.scss
│ └── javascripts
│ │ ├── okrs.js.coffee
│ │ ├── reports.js.coffee
│ │ ├── tasks.js.coffee
│ │ ├── teams.js.coffee
│ │ ├── calendar.js.coffee
│ │ ├── comments.js.coffee
│ │ ├── home.js.coffee
│ │ ├── key_results.js.coffee
│ │ ├── objectives.js.coffee
│ │ ├── work_logs.js.coffee
│ │ ├── oauth_applications.js.coffee
│ │ ├── component.json
│ │ ├── projects.js.coffee
│ │ ├── datetimepicker.jquery.json
│ │ └── application.js
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── application_controller.rb
│ ├── api
│ │ └── v1
│ │ │ ├── credentials_controller.rb
│ │ │ └── api_controller.rb
│ ├── users
│ │ └── omniauth_callbacks_controller.rb
│ └── calendar_controller.rb
├── views
│ ├── users
│ │ ├── create.html.erb
│ │ ├── update.html.erb
│ │ ├── show.json.jbuilder
│ │ ├── change_password.html.erb
│ │ ├── index.html.erb
│ │ ├── index.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── show.js.erb
│ │ ├── show.html.erb
│ │ ├── _user_list.erb
│ │ ├── _user_index.erb
│ │ └── _password_form.html.erb
│ ├── home
│ │ ├── index.html.erb
│ │ ├── search.js.erb
│ │ ├── search.html.erb
│ │ └── dashboard.html.erb
│ ├── calendar
│ │ ├── day.html.erb
│ │ ├── index.html.erb
│ │ ├── week.js.erb
│ │ ├── day.js.erb
│ │ ├── monthly.html.erb
│ │ └── _week.erb
│ ├── oauth_applications
│ │ ├── show.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── index.json.jbuilder
│ │ ├── show.js.erb
│ │ ├── index.html.erb
│ │ ├── show.html.erb
│ │ └── _app_index.erb
│ ├── okrs
│ │ ├── show.json.jbuilder
│ │ ├── approve.js.erb
│ │ ├── index.json.jbuilder
│ │ ├── edit.html.erb
│ │ ├── new.html.erb
│ │ ├── index.html.erb
│ │ ├── show.html.erb
│ │ ├── _approval.erb
│ │ ├── _key_result_fields.erb
│ │ ├── _okrs.erb
│ │ └── _objective_fields.erb
│ ├── comments
│ │ ├── new.html.erb
│ │ ├── index.js.erb
│ │ ├── show.json.jbuilder
│ │ ├── edit.html.erb
│ │ ├── create.js.erb
│ │ ├── reply.js.erb
│ │ ├── post_reply.js.erb
│ │ ├── index.json.jbuilder
│ │ ├── _form.html.erb
│ │ ├── show.html.erb
│ │ ├── _comments.erb
│ │ └── index.html.erb
│ ├── projects
│ │ ├── _new_link.erb
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── new.js.erb
│ │ ├── show.js.erb
│ │ ├── edit.html.erb
│ │ ├── new.html.erb
│ │ ├── show.html.erb
│ │ ├── _project_card.erb
│ │ ├── index.html.erb
│ │ └── _project_list.erb
│ ├── reports
│ │ ├── activities.html.erb
│ │ ├── okrs.js.erb
│ │ ├── pdf_report.pdf.erb
│ │ ├── tasks.js.erb
│ │ ├── worklogs.js.erb
│ │ ├── employee_day.js.erb
│ │ ├── employee_range.js.erb
│ │ ├── employee_tasks.js.erb
│ │ ├── employees_daily.js.erb
│ │ ├── employees_time_range.js.erb
│ │ ├── day_log.pdf.erb
│ │ ├── okrs.pdf.erb
│ │ ├── task.pdf.erb
│ │ ├── worklogs.pdf.erb
│ │ ├── csv_report.csv.erb
│ │ ├── tasks.pdf.erb
│ │ ├── employee_day.pdf.erb
│ │ ├── employee_tasks.pdf.erb
│ │ ├── employee_range.pdf.erb
│ │ ├── employees_daily.pdf.erb
│ │ ├── employees_time_range.pdf.erb
│ │ ├── get_selection_list.js.erb
│ │ ├── _task.erb
│ │ ├── assignments.pdf.erb
│ │ ├── assignments.js.erb
│ │ ├── task.js.erb
│ │ ├── day_log.js.erb
│ │ ├── index.html.erb
│ │ ├── day_log.html.erb
│ │ ├── _selections.erb
│ │ ├── _report_types.erb
│ │ ├── task.html.erb
│ │ ├── excel_report.xls.erb
│ │ ├── employee_day.html.erb
│ │ ├── okrs.html.erb
│ │ ├── employee_range.html.erb
│ │ ├── employee_tasks.html.erb
│ │ ├── employees_daily.html.erb
│ │ └── _day_log.erb
│ ├── tasks
│ │ ├── edit.html.erb
│ │ ├── new.js.erb
│ │ ├── completion.js.erb
│ │ ├── show.json.jbuilder
│ │ ├── index.html.erb
│ │ ├── show.js.erb
│ │ ├── index.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── _show_detailed.erb
│ │ ├── index.js.erb
│ │ ├── completed_index.js.erb
│ │ ├── show.html.erb
│ │ ├── _pending_task_page.erb
│ │ ├── _completion.erb
│ │ ├── _task_page.erb
│ │ ├── _sub_task.erb
│ │ ├── _completed_task_page.erb
│ │ └── _task_listings.erb
│ ├── teams
│ │ ├── edit.html.erb
│ │ ├── get_member_list.js.erb
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── new.js.erb
│ │ ├── new.html.erb
│ │ ├── show.html.erb
│ │ ├── index.html.erb
│ │ ├── _team_list.erb
│ │ └── _team_index.erb
│ ├── work_logs
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── show.json.jbuilder
│ │ ├── show.js.erb
│ │ ├── index.json.jbuilder
│ │ ├── show.html.erb
│ │ ├── new.js.erb
│ │ ├── _logs.erb
│ │ ├── create.js.erb
│ │ └── index.html.erb
│ ├── bootstrapped
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── _form.html.erb
│ │ └── show.html.erb
│ ├── key_results
│ │ ├── new.html.erb
│ │ ├── show.json.jbuilder
│ │ ├── edit.html.erb
│ │ ├── index.json.jbuilder
│ │ ├── show.html.erb
│ │ ├── index.html.erb
│ │ └── _form.html.erb
│ ├── objectives
│ │ ├── show.json.jbuilder
│ │ ├── edit.html.erb
│ │ ├── new.html.erb
│ │ ├── index.json.jbuilder
│ │ ├── _key_result_fields.erb
│ │ ├── show.html.erb
│ │ ├── _okr.erb
│ │ ├── _form.html.erb
│ │ └── index.html.erb
│ ├── doorkeeper
│ │ ├── applications
│ │ │ ├── new.html.erb
│ │ │ ├── edit.html.erb
│ │ │ ├── _delete_form.html.erb
│ │ │ ├── index.html.erb
│ │ │ └── show.html.erb
│ │ ├── authorizations
│ │ │ ├── show.html.erb
│ │ │ ├── error.html.erb
│ │ │ └── new.html.erb
│ │ └── authorized_applications
│ │ │ ├── _delete_form.html.erb
│ │ │ └── index.html.erb
│ ├── devise
│ │ ├── mailer
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── unlock_instructions.html.erb
│ │ │ └── reset_password_instructions.html.erb
│ │ ├── unlocks
│ │ │ └── new.html.erb
│ │ ├── passwords
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ │ ├── confirmations
│ │ │ └── new.html.erb
│ │ ├── registrations
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ │ ├── shared
│ │ │ └── _links.erb
│ │ └── sessions
│ │ │ └── new.html.erb
│ └── layouts
│ │ ├── pdf.html.erb
│ │ ├── doorkeeper.html.erb
│ │ └── login.html.erb
└── helpers
│ ├── home_helper.rb
│ ├── okrs_helper.rb
│ ├── tasks_helper.rb
│ ├── teams_helper.rb
│ ├── reports_helper.rb
│ ├── calendar_helper.rb
│ ├── comments_helper.rb
│ ├── objectives_helper.rb
│ ├── projects_helper.rb
│ ├── work_logs_helper.rb
│ ├── key_results_helper.rb
│ └── oauth_applications_helper.rb
├── lib
├── assets
│ └── .keep
├── tasks
│ ├── .keep
│ └── refresh_counts.rake
├── omniauth
│ └── strategies
│ │ └── fluxapp.rb
└── time_to_diff.rb
├── test
├── helpers
│ ├── .keep
│ ├── home_helper_test.rb
│ ├── okrs_helper_test.rb
│ ├── tasks_helper_test.rb
│ ├── teams_helper_test.rb
│ ├── calendar_helper_test.rb
│ ├── comments_helper_test.rb
│ ├── projects_helper_test.rb
│ ├── reports_helper_test.rb
│ ├── work_logs_helper_test.rb
│ ├── key_results_helper_test.rb
│ ├── objectives_helper_test.rb
│ └── oauth_applications_helper_test.rb
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── okr_test.rb
│ ├── task_test.rb
│ ├── team_test.rb
│ ├── user_test.rb
│ ├── comment_test.rb
│ ├── project_test.rb
│ ├── work_log_test.rb
│ ├── key_result_test.rb
│ ├── objective_test.rb
│ ├── team_member_test.rb
│ ├── task_assignee_test.rb
│ ├── project_manager_test.rb
│ ├── task_key_result_test.rb
│ ├── oauth_application_test.rb
│ ├── reporting_manager_test.rb
│ ├── doorkeeper_application_test.rb
│ └── user_oauth_application_test.rb
├── controllers
│ ├── .keep
│ ├── home_controller_test.rb
│ ├── calendar_controller_test.rb
│ ├── reports_controller_test.rb
│ ├── okrs_controller_test.rb
│ ├── projects_controller_test.rb
│ ├── comments_controller_test.rb
│ └── objectives_controller_test.rb
├── fixtures
│ ├── .keep
│ ├── reporting_managers.yml
│ ├── task_key_results.yml
│ ├── oauth_applications.yml
│ ├── user_oauth_applications.yml
│ ├── project_managers.yml
│ ├── task_assignees.yml
│ ├── team_members.yml
│ ├── comments.yml
│ ├── okrs.yml
│ ├── projects.yml
│ ├── objectives.yml
│ ├── key_results.yml
│ ├── users.yml
│ ├── doorkeeper_applications.yml
│ ├── work_logs.yml
│ ├── teams.yml
│ └── tasks.yml
├── integration
│ └── .keep
└── test_helper.rb
├── .ruby-version
├── .ruby-gemset
├── vendor
└── assets
│ ├── javascripts
│ └── .keep
│ └── stylesheets
│ └── .keep
├── db.env.example
├── app.env.example
├── public
├── favicon.ico
├── robots.txt
├── stylesheets
│ └── pdf.css
├── 500.html
├── 422.html
└── 404.html
├── bin
├── rake
├── bundle
└── rails
├── db
├── migrate
│ ├── 20140421085607_create_oauth_applications.rb
│ ├── 20140314131027_add_image_to_users.rb
│ ├── 20140324091718_add_task_id_to_tasks.rb
│ ├── 20140314131351_add_image_to_projects.rb
│ ├── 20140315072257_add_priority_to_tasks.rb
│ ├── 20140402172524_add_okr_fields_to_o_and_kr.rb
│ ├── 20140325091622_add_status_to_tasks.rb
│ ├── 20140325092027_add_comment_id_to_comments.rb
│ ├── 20140410093527_add_approval_to_okrs.rb
│ ├── 20140407054344_add_completion_date_to_tasks.rb
│ ├── 20140329045545_add_columns_to_users.rb
│ ├── 20160604102931_add_delete_request_to_work_logs.rb
│ ├── 20140315065654_create_task_assignees.rb
│ ├── 20140409062344_add_admin_asset_count_to_users.rb
│ ├── 20140403065220_create_task_key_results.rb
│ ├── 20140315065242_create_reporting_managers.rb
│ ├── 20140314125623_add_columns_to_projects.rb
│ ├── 20140315065611_create_comments.rb
│ ├── 20140326083715_add_task_id_to_work_logs.rb
│ ├── 20140313044626_create_projects.rb
│ ├── 20140315064834_create_project_managers.rb
│ ├── 20140421102655_create_user_oauth_applications.rb
│ ├── 20140329062237_create_objectives.rb
│ ├── 20140402172421_create_okrs.rb
│ ├── 20140315065219_create_team_members.rb
│ ├── 20140319095724_add_soft_delete_fields_to_users_tasks_and_comments.rb
│ ├── 20140329062251_create_key_results.rb
│ ├── 20140320071932_create_work_logs.rb
│ ├── 20140402095057_add_active_status_to_missing.rb
│ ├── 20140315065143_add_additional_fields_to_users.rb
│ ├── 20140315065513_create_tasks.rb
│ ├── 20140315065003_create_teams.rb
│ ├── 20140409044941_create_friendly_id_slugs.rb
│ └── 20140314051737_devise_create_users.rb
└── seeds.rb
├── config.ru
├── config
├── initializers
│ ├── session_store.rb
│ ├── wicked_pdf.rb
│ ├── filter_parameter_logging.rb
│ ├── mime_types.rb
│ ├── backtrace_silencers.rb
│ ├── wrap_parameters.rb
│ ├── secret_token.rb
│ └── inflections.rb
├── boot.rb
├── environment.rb
├── app_config.yml.example
├── locales
│ └── en.yml
├── database.yml.example
└── environments
│ └── development.rb
├── Rakefile
├── docker-compose.yml
├── README.rdoc
├── .gitignore
└── Dockerfile.development
/log/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.1.0
2 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-gemset:
--------------------------------------------------------------------------------
1 | fluxday
2 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/users/create.html.erb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/users/update.html.erb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/db.env.example:
--------------------------------------------------------------------------------
1 | MYSQL_ROOT_PASSWORD=fluxday
2 |
--------------------------------------------------------------------------------
/app/helpers/home_helper.rb:
--------------------------------------------------------------------------------
1 | module HomeHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/okrs_helper.rb:
--------------------------------------------------------------------------------
1 | module OkrsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/tasks_helper.rb:
--------------------------------------------------------------------------------
1 | module TasksHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/teams_helper.rb:
--------------------------------------------------------------------------------
1 | module TeamsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/reports_helper.rb:
--------------------------------------------------------------------------------
1 | module ReportsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/calendar_helper.rb:
--------------------------------------------------------------------------------
1 | module CalendarHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/comments_helper.rb:
--------------------------------------------------------------------------------
1 | module CommentsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/objectives_helper.rb:
--------------------------------------------------------------------------------
1 | module ObjectivesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/projects_helper.rb:
--------------------------------------------------------------------------------
1 | module ProjectsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/work_logs_helper.rb:
--------------------------------------------------------------------------------
1 | module WorkLogsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/key_results_helper.rb:
--------------------------------------------------------------------------------
1 | module KeyResultsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/oauth_applications_helper.rb:
--------------------------------------------------------------------------------
1 | module OauthApplicationsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app.env.example:
--------------------------------------------------------------------------------
1 | DB_NAME=fluxday
2 | DB_HOST=db
3 | DB_USER=root
4 | DB_PASS=fluxday
5 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/app/models/doorkeeper_application.rb:
--------------------------------------------------------------------------------
1 | class DoorkeeperApplication < ActiveRecord::Base
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/home/index.html.erb:
--------------------------------------------------------------------------------
1 |
Home#index
2 | Find me in app/views/home/index.html.erb
3 |
--------------------------------------------------------------------------------
/app/assets/images/iconsprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/iconsprite.png
--------------------------------------------------------------------------------
/app/views/calendar/day.html.erb:
--------------------------------------------------------------------------------
1 | <%= render :partial => 'calendar/day',:locals=>{:date=>@date,:entries=>@entries} %>
--------------------------------------------------------------------------------
/app/views/calendar/index.html.erb:
--------------------------------------------------------------------------------
1 | Calendar#index
2 | Find me in app/views/calendar/index.html.erb
3 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @oauth_application, :id, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/test/helpers/home_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class HomeHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/okrs_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OkrsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/tasks_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TasksHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/teams_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TeamsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/okrs/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @okr, :id, :user_id, :name, :start_date, :end_date, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/test/helpers/calendar_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CalendarHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/comments_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CommentsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/projects_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ProjectsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/reports_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ReportsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/work_logs_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class WorkLogsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/app/assets/images/fallback/icon_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/fallback/icon_user.png
--------------------------------------------------------------------------------
/app/views/comments/new.html.erb:
--------------------------------------------------------------------------------
1 | New comment
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Back', comments_path %>
6 |
--------------------------------------------------------------------------------
/app/views/okrs/approve.js.erb:
--------------------------------------------------------------------------------
1 | $('.okr-approval-<%= @okr.id %>').html("<%= escape_javascript(render :partial => 'okrs/approval') %>")
--------------------------------------------------------------------------------
/app/views/projects/_new_link.erb:
--------------------------------------------------------------------------------
1 | <%= link_to 'New department', new_project_path, :remote => false,:class=>'dashed_link transition' %>
--------------------------------------------------------------------------------
/app/views/reports/activities.html.erb:
--------------------------------------------------------------------------------
1 | Reports#activities
2 | Find me in app/views/reports/activities.html.erb
3 |
--------------------------------------------------------------------------------
/app/views/reports/okrs.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/okr_report') %>")
2 |
--------------------------------------------------------------------------------
/app/views/reports/pdf_report.pdf.erb:
--------------------------------------------------------------------------------
1 | <%= @titles.join(",") %>
2 | <% @fields.each do |f| %>
3 | <%= f.join(',') %>
4 | <% end %>
--------------------------------------------------------------------------------
/app/views/reports/tasks.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/task_reports') %>")
2 |
--------------------------------------------------------------------------------
/app/views/reports/worklogs.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/worklogs') %>")
2 |
--------------------------------------------------------------------------------
/test/helpers/key_results_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class KeyResultsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/test/helpers/objectives_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ObjectivesHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/app/assets/images/fallback/icon32_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/fallback/icon32_user.png
--------------------------------------------------------------------------------
/app/assets/images/fallback/icon_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/fallback/icon_project.png
--------------------------------------------------------------------------------
/app/models/task_key_result.rb:
--------------------------------------------------------------------------------
1 | class TaskKeyResult < ActiveRecord::Base
2 | belongs_to :task
3 | belongs_to :key_result
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/comments/index.js.erb:
--------------------------------------------------------------------------------
1 | $('.comments-<%= @task.id %>').html("<%= escape_javascript(render :partial => 'comments/comments') %>")
--------------------------------------------------------------------------------
/app/views/comments/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @comment, :id, :source_id, :source_type, :body, :user_id, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/app/views/projects/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @project, :id, :name, :code, :description, :is_deleted, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/app/views/tasks/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'form' %>
2 |
--------------------------------------------------------------------------------
/app/views/tasks/new.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'tasks/form') %>")
2 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/teams/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'form' %>
2 |
--------------------------------------------------------------------------------
/app/views/work_logs/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'form' %>
2 |
--------------------------------------------------------------------------------
/app/assets/images/fallback/thumbnail_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/fallback/thumbnail_user.png
--------------------------------------------------------------------------------
/app/views/bootstrapped/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @project, :id, :name, :code, :description, :is_deleted, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/app/views/key_results/new.html.erb:
--------------------------------------------------------------------------------
1 | New key_result
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Back', key_results_path %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/employee_day.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/employee_day') %>")
2 |
--------------------------------------------------------------------------------
/app/views/reports/employee_range.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/employee_range') %>")
2 |
--------------------------------------------------------------------------------
/app/views/reports/employee_tasks.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/employee_tasks') %>")
2 |
--------------------------------------------------------------------------------
/app/views/work_logs/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%#= render 'form' %>
2 |
--------------------------------------------------------------------------------
/app/assets/images/fallback/thumbnail_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foradian/fluxday/HEAD/app/assets/images/fallback/thumbnail_project.png
--------------------------------------------------------------------------------
/app/views/reports/employees_daily.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/employee_daily') %>")
2 |
--------------------------------------------------------------------------------
/app/views/users/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @user, :id, :email, :image, :name, :nickname, :employee_code, :joining_date, :status, :role
2 |
--------------------------------------------------------------------------------
/test/helpers/oauth_applications_helper_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OauthApplicationsHelperTest < ActionView::TestCase
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/objectives/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @objective, :id, :name, :user_id, :author_id, :start_date, :end_date, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/db/migrate/20140421085607_create_oauth_applications.rb:
--------------------------------------------------------------------------------
1 | class CreateOauthApplications < ActiveRecord::Migration
2 | def change
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/user_oauth_application.rb:
--------------------------------------------------------------------------------
1 | class UserOauthApplication < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :oauth_application
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/reports/employees_time_range.js.erb:
--------------------------------------------------------------------------------
1 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/employee_time_range') %>")
2 |
--------------------------------------------------------------------------------
/app/views/work_logs/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @work_log, :id, :user_id, :name, :task, :start_time, :end_time, :is_deleted, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/test/models/okr_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OkrTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/calendar/week.js.erb:
--------------------------------------------------------------------------------
1 | $('.weekdays-container').html("<%= escape_javascript(render :partial => 'calendar/week',:locals=>{:date=>@date,:entries=>@entries}) %>")
2 |
--------------------------------------------------------------------------------
/app/views/key_results/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @key_result, :id, :name, :user_id, :objective_id, :author_id, :start_date, :end_date, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/app/views/reports/day_log.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/day_log' %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/okrs.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/okr_report' %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/task.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | Task report
3 |
4 |
5 | <%= render :partial => 'reports/task_report' %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/worklogs.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/worklogs' %>
6 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/test/models/task_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TaskTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/team_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TeamTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/user_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class UserTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/comments/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing comment
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Show', @comment %> |
6 | <%= link_to 'Back', comments_path %>
7 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/applications/new.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 | <%= render 'form', :application => @application %>
6 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'oauth_applications/app_index' %>
3 | <% end %>
4 | <%= render 'form' %>
5 |
--------------------------------------------------------------------------------
/app/views/reports/csv_report.csv.erb:
--------------------------------------------------------------------------------
1 | <%= @titles.join(",") %>
2 | <% @fields.each do |f| %>
3 | <%#= f.join(',') %>
4 | <%= f.map(&:inspect).join(', ').html_safe %>
5 | <% end %>
--------------------------------------------------------------------------------
/app/views/reports/tasks.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | Tasks report
3 |
4 |
5 | <%= render :partial => 'reports/task_reports' %>
6 |
--------------------------------------------------------------------------------
/app/views/users/change_password.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial=>'users/user_index' %>
3 | <% end %>
4 |
5 | <%= render 'password_form' %>
6 |
--------------------------------------------------------------------------------
/db/migrate/20140314131027_add_image_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddImageToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :image, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/test/models/comment_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CommentTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/project_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ProjectTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/work_log_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class WorkLogTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/models/task_assignee.rb:
--------------------------------------------------------------------------------
1 | class TaskAssignee < ActiveRecord::Base
2 | belongs_to :task
3 | belongs_to :user
4 |
5 | default_scope {where.not(status:'archived')}
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/applications/edit.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 | <%= render 'form', :application => @application %>
6 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'oauth_applications/app_index' %>
3 | <% end %>
4 | <%= render 'edit_form' %>
--------------------------------------------------------------------------------
/app/views/objectives/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing objective
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Show', @objective %> |
6 | <%= link_to 'Back', objectives_path %>
7 |
--------------------------------------------------------------------------------
/app/views/reports/employee_day.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/employee_day' %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/employee_tasks.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/okr_report' %>
6 |
--------------------------------------------------------------------------------
/app/views/tasks/completion.js.erb:
--------------------------------------------------------------------------------
1 | $('.completion-area.drop-task-<%= @task.id %>').html("<%= escape_javascript(render :partial => 'tasks/completion',:locals => {:task => @task}) %>")
--------------------------------------------------------------------------------
/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 Rails.application
5 |
--------------------------------------------------------------------------------
/db/migrate/20140324091718_add_task_id_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddTaskIdToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :task_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/test/models/key_result_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class KeyResultTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/objective_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ObjectiveTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/team_member_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TeamMemberTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/key_results/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing key_result
2 |
3 | <%= render 'form' %>
4 |
5 | <%= link_to 'Show', @key_result %> |
6 | <%= link_to 'Back', key_results_path %>
7 |
--------------------------------------------------------------------------------
/app/views/okrs/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@okrs) do |okr|
2 | json.extract! okr, :id, :user_id, :name, :start_date, :end_date
3 | json.url okr_url(okr, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/reports/employee_range.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | OKR report
3 |
4 |
5 | <%= render :partial => 'reports/_employee_range' %>
6 |
--------------------------------------------------------------------------------
/db/migrate/20140314131351_add_image_to_projects.rb:
--------------------------------------------------------------------------------
1 | class AddImageToProjects < ActiveRecord::Migration
2 | def change
3 | add_column :projects, :image, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20140315072257_add_priority_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddPriorityToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :priority, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/test/models/task_assignee_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TaskAssigneeTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/comments/create.js.erb:
--------------------------------------------------------------------------------
1 | <% unless @comment.errors.present? %>
2 | $('.comments-<%= @task.id %>').html("<%= escape_javascript(render :partial => 'comments/comments') %>")
3 | <% end %>
--------------------------------------------------------------------------------
/app/views/comments/reply.js.erb:
--------------------------------------------------------------------------------
1 | <% unless @comment.errors.present? %>
2 | $('.comments-<%= @task.id %>').html("<%= escape_javascript(render :partial => 'comments/comments') %>")
3 | <% end %>
--------------------------------------------------------------------------------
/app/views/objectives/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%#= render :partial => 'teams/team_index', :locals => {:teams => @teams} %>
3 | <% end %>
4 | <%= render 'form' %>
5 |
--------------------------------------------------------------------------------
/app/views/reports/employees_daily.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | Employee report
3 |
4 |
5 | <%= render :partial => 'reports/employee_daily' %>
6 |
--------------------------------------------------------------------------------
/app/views/teams/get_member_list.js.erb:
--------------------------------------------------------------------------------
1 | $('.assignees-select').html("<%= escape_javascript(render :partial => 'teams/members') %>")
2 | $('select').not('.select_add').select2({'width':'100%'});
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Fluxday::Application.config.session_store :cookie_store, key: '_tracker_session'
4 |
--------------------------------------------------------------------------------
/test/models/project_manager_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ProjectManagerTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/task_key_result_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class TaskKeyResultTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/comments/post_reply.js.erb:
--------------------------------------------------------------------------------
1 | <% unless @comment.errors.present? %>
2 | $('.comments-<%= @task.id %>').html("<%= escape_javascript(render :partial => 'comments/comments') %>")
3 | <% end %>
--------------------------------------------------------------------------------
/app/views/tasks/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @task, :id, :name, :description, :start_date, :end_date, :project_id, :team_id, :user_id, :tracker_id, :comments_count, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/config/initializers/wicked_pdf.rb:
--------------------------------------------------------------------------------
1 | # place wkhtmltopdf executable in lib folder to generate pdf reports
2 | WickedPdf.config = {
3 | :exe_path => "#{::Rails.root}/lib/wkhtmltopdf"
4 | }
5 |
6 |
--------------------------------------------------------------------------------
/db/migrate/20140402172524_add_okr_fields_to_o_and_kr.rb:
--------------------------------------------------------------------------------
1 | class AddOkrFieldsToOAndKr < ActiveRecord::Migration
2 | def change
3 | add_column :objectives, :okr_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/test/models/oauth_application_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OauthApplicationTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/reporting_manager_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ReportingManagerTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/reports/employees_time_range.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | Employee report
3 |
4 |
5 | <%= render :partial => 'reports/employee_time_range' %>
6 |
--------------------------------------------------------------------------------
/app/views/reports/get_selection_list.js.erb:
--------------------------------------------------------------------------------
1 | $('.report_options').html("<%= escape_javascript(render :partial => 'reports/selections') %>")
2 | $('select').not('.select_add').select2({'width':'100%'});
--------------------------------------------------------------------------------
/app/views/teams/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! @team, :id, :name, :code, :description, :project_id, :members_count, :managers_count, :is_deleted, :pending_tasks, :status, :created_at, :updated_at
2 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5 |
--------------------------------------------------------------------------------
/db/migrate/20140325091622_add_status_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddStatusToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :status, :string, :default=>'active'
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20140325092027_add_comment_id_to_comments.rb:
--------------------------------------------------------------------------------
1 | class AddCommentIdToComments < ActiveRecord::Migration
2 | def change
3 | add_column :comments, :comment_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20140410093527_add_approval_to_okrs.rb:
--------------------------------------------------------------------------------
1 | class AddApprovalToOkrs < ActiveRecord::Migration
2 | def change
3 | add_column :okrs, :approved, :boolean,:default=>false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/models/reporting_manager.rb:
--------------------------------------------------------------------------------
1 | class ReportingManager < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :manager, :class_name=>"User"
4 | default_scope {where.not(status:'archived')}
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/tasks/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'tasks/task_list' %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/db/migrate/20140407054344_add_completion_date_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddCompletionDateToTasks < ActiveRecord::Migration
2 | def change
3 | add_column :tasks, :completed_on, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/test/models/doorkeeper_application_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class DoorkeeperApplicationTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/user_oauth_application_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class UserOauthApplicationTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/comments/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@comments) do |comment|
2 | json.extract! comment, :id, :source_id, :source_type, :body, :user_id
3 | json.url comment_url(comment, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/projects/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@projects) do |project|
2 | json.extract! project, :id, :name, :code, :description, :is_deleted
3 | json.url project_url(project, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/tasks/show.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'tasks/show_detailed',:locals => {:task => @task, :project => @project, :team => @team}) %>")
2 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/users/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'users/user_index' %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/app/views/work_logs/show.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'work_logs/show',:locals => {:task => @task, :project => @project, :team => @team}) %>")
2 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/bootstrapped/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@projects) do |project|
2 | json.extract! project, :id, :name, :code, :description, :is_deleted
3 | json.url project_url(project, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/db/migrate/20140329045545_add_columns_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddColumnsToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :provider, :string
4 | add_column :users, :uid, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/comments.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Comments controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/projects.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Projects controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/work_logs.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the work_logs controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@oauth_applications) do |oauth_application|
2 | json.extract! oauth_application, :id
3 | json.url oauth_application_url(oauth_application, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/users/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@users) do |user|
2 | json.extract! user, :id, :email, :image, :name, :nickname, :employee_code, :joining_date, :status, :role
3 | json.url user_url(user, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/users/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial=>'users/user_index' %>
3 | <% end %>
4 | <%= render 'form' %>
5 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 | require './lib/time_to_diff.rb'
4 |
5 | # Initialize the Rails application.
6 | Fluxday::Application.initialize!
7 |
--------------------------------------------------------------------------------
/db/migrate/20160604102931_add_delete_request_to_work_logs.rb:
--------------------------------------------------------------------------------
1 | class AddDeleteRequestToWorkLogs < ActiveRecord::Migration
2 | def change
3 | add_column :work_logs, :delete_request, :boolean, :default => 0
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/key_results.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the KeyResults controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/authorizations/show.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | <%= params[:code] %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/objectives/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@objectives) do |objective|
2 | json.extract! objective, :id, :name, :user_id, :author_id, :start_date, :end_date
3 | json.url objective_url(objective, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/okrs/edit.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :pane2 do %>
2 | <%= render :partial => 'okrs/okrs' %>
3 | <% end %>
4 |
5 | <%= render 'form' %>
6 |
9 |
--------------------------------------------------------------------------------
/app/views/okrs/new.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :pane2 do %>
2 | <%= render :partial => 'okrs/okrs' %>
3 | <% end %>
4 |
5 | <%= render 'form' %>
6 |
9 |
--------------------------------------------------------------------------------
/app/views/work_logs/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@work_logs) do |work_log|
2 | json.extract! work_log, :id, :user_id, :name, :task, :start_time, :end_time, :is_deleted
3 | json.url work_log_url(work_log, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | User-agent: *
5 | Disallow: /
6 |
--------------------------------------------------------------------------------
/app/views/calendar/day.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'calendar/day',:locals=>{:date=>@date,:entries=>@entries}) %>")
2 | $('.work-logs').html("<%= escape_javascript(render :partial => 'work_logs/logs') %>")
--------------------------------------------------------------------------------
/app/views/doorkeeper/authorizations/error.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | <%= @pre_auth.error_response.body[:error_description] %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/users/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial=>'users/user_index' %>
3 | <% end %>
4 |
5 | <%= render 'edit_form' %>
6 |
--------------------------------------------------------------------------------
/test/fixtures/reporting_managers.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | user_id: 1
5 | manager_id: 1
6 |
7 | two:
8 | user_id: 1
9 | manager_id: 1
10 |
--------------------------------------------------------------------------------
/test/fixtures/task_key_results.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | task_id: 1
5 | key_result_id: 1
6 |
7 | two:
8 | task_id: 1
9 | key_result_id: 1
10 |
--------------------------------------------------------------------------------
/app/models/oauth_application.rb:
--------------------------------------------------------------------------------
1 | class OauthApplication < ActiveRecord::Base
2 | has_many :user_oauth_applications
3 | has_many :users, :through => :user_oauth_applications
4 | scope :by_name, -> { order("oauth_applications.name ASC") }
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/reports/_task.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= @task.name %> (<%= @task.status %>)
3 |
4 |
5 | <%= @task.description %>
6 |
7 |
8 |
9 | <%= render 'reports/task_report' %>
--------------------------------------------------------------------------------
/app/views/key_results/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@key_results) do |key_result|
2 | json.extract! key_result, :id, :name, :user_id, :objective_id, :author_id, :start_date, :end_date
3 | json.url key_result_url(key_result, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/work_logs/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'tasks/task_list' %>
3 | <% end %>
4 |
5 | <%= render :partial => 'show' %>
6 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/app/assets/javascripts/okrs.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/reports.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/tasks.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/teams.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/views/tasks/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@tasks) do |task|
2 | json.extract! task, :id, :name, :description, :start_date, :end_date, :project_id, :team_id, :user_id, :tracker_id, :comments_count
3 | json.url task_url(task, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/test/fixtures/oauth_applications.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyString
5 | redirect_uri: MyText
6 |
7 | two:
8 | name: MyString
9 | redirect_uri: MyText
10 |
--------------------------------------------------------------------------------
/test/fixtures/user_oauth_applications.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | user_id:
5 | oauth_application_id:
6 |
7 | two:
8 | user_id:
9 | oauth_application_id:
10 |
--------------------------------------------------------------------------------
/app/assets/javascripts/calendar.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/comments.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/home.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
5 |
--------------------------------------------------------------------------------
/app/assets/javascripts/key_results.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/objectives.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/work_logs.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/views/tasks/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'teams/team_index', :locals => {:teams => @teams} %>
3 | <% end %>
4 | <%= render 'form' %>
5 |
--------------------------------------------------------------------------------
/app/views/teams/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array!(@teams) do |team|
2 | json.extract! team, :id, :name, :code, :description, :project_id, :members_count, :managers_count, :is_deleted, :pending_tasks, :status
3 | json.url team_url(team, format: :json)
4 | end
5 |
--------------------------------------------------------------------------------
/app/assets/javascripts/oauth_applications.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Welcome <%= @email %>!
2 |
3 | You can confirm your account email through the link below:
4 |
5 | <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6 |
--------------------------------------------------------------------------------
/app/views/home/search.js.erb:
--------------------------------------------------------------------------------
1 | $('.paginator').append('<%= j render 'tasks/task_listings' %>');
2 | <% if @tasks.next_page %>
3 | $('.pagination').replaceWith('<%= j will_paginate @tasks %>');
4 | <% else %>
5 | $(window).off('scroll');
6 | $('.pagination').remove();
7 | <% end %>
--------------------------------------------------------------------------------
/app/views/oauth_applications/show.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'oauth_applications/show') %>")
2 | $(document).foundation({
3 | tab: {
4 | callback: function (tab) {
5 | }
6 | }
7 | });
8 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/users/show.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'users/show',:locals=>{:user=>@user}) %>")
2 | $(document).foundation({
3 | tab: {
4 | callback: function (tab) {
5 | }
6 | }
7 | });
8 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/bootstrapped/new.html.erb:
--------------------------------------------------------------------------------
1 | <%- model_class = Project -%>
2 |
5 | <%= render :partial => 'form' %>
6 |
--------------------------------------------------------------------------------
/app/views/tasks/_show_detailed.erb:
--------------------------------------------------------------------------------
1 |
6 |
7 | <%= render :partial=>'tasks/show',:locals=>{:task=>task,:project=>project,:team=>team} %>
8 |
--------------------------------------------------------------------------------
/app/views/teams/new.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'teams/form',:locals=>{:project=>@project}) %>")
2 | $(document).foundation({
3 | tab: {
4 | callback: function (tab) {
5 | }
6 | }
7 | });
8 | window.location = '#pane3'
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Fluxday::Application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/views/bootstrapped/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%- model_class = Project -%>
2 |
5 | <%= render :partial => 'form' %>
6 |
--------------------------------------------------------------------------------
/app/views/projects/new.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'projects/form',:locals=>{:project=>@project}) %>")
2 | $(document).foundation({
3 | tab: {
4 | callback: function (tab) {
5 | }
6 | }
7 | });
8 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/projects/show.js.erb:
--------------------------------------------------------------------------------
1 | $('.pane3').html("<%= escape_javascript(render :partial => 'projects/show',:locals=>{:project=>@project}) %>")
2 | $(document).foundation({
3 | tab: {
4 | callback: function (tab) {
5 | }
6 | }
7 | });
8 | window.location = '#pane3'
--------------------------------------------------------------------------------
/test/fixtures/project_managers.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | project_id: 1
5 | user_id: 1
6 | status: MyString
7 |
8 | two:
9 | project_id: 1
10 | user_id: 1
11 | status: MyString
12 |
--------------------------------------------------------------------------------
/app/views/reports/assignments.pdf.erb:
--------------------------------------------------------------------------------
1 |
2 | Tasks assigned to <%= @user.name %> from <%= @start_date.strftime('%d %B %y') %> to <%= @end_date.strftime('%d %B %y') %>
3 |
4 |
5 | <%= render :partial => 'reports/assignments' %>
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/objectives.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Objectives controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 | .okr-area{
5 | clear: both;
6 | padding-top: 20px;
7 | }
--------------------------------------------------------------------------------
/db/migrate/20140315065654_create_task_assignees.rb:
--------------------------------------------------------------------------------
1 | class CreateTaskAssignees < ActiveRecord::Migration
2 | def change
3 | create_table :task_assignees do |t|
4 | t.integer :task_id
5 | t.integer :user_id
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140409062344_add_admin_asset_count_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddAdminAssetCountToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :admin_teams_count, :integer, :default=>0
4 | add_column :users, :admin_projects_count, :integer, :default=>0
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/okrs/index.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :pane2 do %>
2 | <%= render :partial => 'okrs/okrs' %>
3 | <% end %>
4 |
5 |
6 | <%= render :partial => 'okrs/okr' %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/okrs/show.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for :pane2 do %>
2 | <%= render :partial => 'okrs/okrs' %>
3 | <% end %>
4 |
5 |
6 | <%= render :partial => 'okrs/okr' %>
7 |
8 |
--------------------------------------------------------------------------------
/test/fixtures/task_assignees.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | task_id: 1
5 | assignee_type: MyString
6 | assignee_id: 1
7 |
8 | two:
9 | task_id: 1
10 | assignee_type: MyString
11 | assignee_id: 1
12 |
--------------------------------------------------------------------------------
/db/migrate/20140403065220_create_task_key_results.rb:
--------------------------------------------------------------------------------
1 | class CreateTaskKeyResults < ActiveRecord::Migration
2 | def change
3 | create_table :task_key_results do |t|
4 | t.integer :task_id
5 | t.integer :key_result_id
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140315065242_create_reporting_managers.rb:
--------------------------------------------------------------------------------
1 | class CreateReportingManagers < ActiveRecord::Migration
2 | def change
3 | create_table :reporting_managers do |t|
4 | t.integer :user_id
5 | t.integer :manager_id
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/applications/_delete_form.html.erb:
--------------------------------------------------------------------------------
1 | <%- submit_btn_css ||= 'btn btn-link' %>
2 | <%= form_tag [:oauth, application] do %>
3 |
4 | <%= submit_tag 'Destroy', onclick: "return confirm('Are you sure?')", class: submit_btn_css %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/test/fixtures/team_members.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | team_id: 1
5 | user_id: 1
6 | role: MyString
7 | status: MyString
8 |
9 | two:
10 | team_id: 1
11 | user_id: 1
12 | role: MyString
13 | status: MyString
14 |
--------------------------------------------------------------------------------
/app/views/reports/assignments.js.erb:
--------------------------------------------------------------------------------
1 | <% if @user.present? %>
2 | $('.report-renderer').html("<%= escape_javascript(render :partial => 'reports/assignments') %>")
3 | <% else %>
4 | $('.alert-area').notify({message: { text: 'Access denied' }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 10000 }}).show();
5 | <% end %>
--------------------------------------------------------------------------------
/app/views/tasks/index.js.erb:
--------------------------------------------------------------------------------
1 | $('.task-paginator').append('<%= j render 'tasks/task_page' %>');
2 | <% if @tasks.next_page %>
3 | $('#pending .pagination').replaceWith('<%= j will_paginate @tasks %>');
4 | <% else %>
5 | $(window).off('scroll');
6 | $('#pending .pagination').remove();
7 | <% end %>
8 | window.location = '#pane2'
--------------------------------------------------------------------------------
/db/migrate/20140314125623_add_columns_to_projects.rb:
--------------------------------------------------------------------------------
1 | class AddColumnsToProjects < ActiveRecord::Migration
2 | def change
3 | add_column :projects, :team_count, :integer, :default=>0
4 | add_column :projects, :member_count, :integer, :default=>0
5 | add_column :projects, :website, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/test/fixtures/comments.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | source_id: 1
5 | source_type: MyString
6 | body: MyText
7 | user_id: 1
8 |
9 | two:
10 | source_id: 1
11 | source_type: MyString
12 | body: MyText
13 | user_id: 1
14 |
--------------------------------------------------------------------------------
/app/views/tasks/completed_index.js.erb:
--------------------------------------------------------------------------------
1 | $('.fin-task-paginator').append('<%= j render 'tasks/completed_task_page' %>');
2 | <% if @fin_tasks.next_page %>
3 | $('#completed .pagination').replaceWith('<%= j will_paginate @fin_tasks %>');
4 | <% else %>
5 | $(window).off('scroll');
6 | $('#completed .pagination').remove();
7 | <% end %>
--------------------------------------------------------------------------------
/app/assets/stylesheets/oauth_applications.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the OauthApplications controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 | .api-table{
5 | margin: 20px 0;
6 | }
7 | .set-users{
8 | margin-bottom: 10px;
9 | }
--------------------------------------------------------------------------------
/db/migrate/20140315065611_create_comments.rb:
--------------------------------------------------------------------------------
1 | class CreateComments < ActiveRecord::Migration
2 | def change
3 | create_table :comments do |t|
4 | t.integer :source_id
5 | t.string :source_type
6 | t.text :body
7 | t.integer :user_id
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/views/projects/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
3 | <% end %>
4 | <%= content_for :pane3 do %>
5 | <%= render :partial => 'form' %>
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/app/views/projects/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
3 | <% end %>
4 | <%= content_for :pane3 do %>
5 | <%= render :partial => 'form' %>
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/db/migrate/20140326083715_add_task_id_to_work_logs.rb:
--------------------------------------------------------------------------------
1 | class AddTaskIdToWorkLogs < ActiveRecord::Migration
2 | def change
3 | add_column :work_logs, :task_id, :integer
4 | add_column :work_logs, :minutes, :integer
5 | add_column :work_logs, :description, :text
6 | remove_column :work_logs, :task, :string
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/test/fixtures/okrs.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | user_id: 1
5 | name: MyString
6 | start_date: 2014-04-02
7 | end_date: 2014-04-02
8 |
9 | two:
10 | user_id: 1
11 | name: MyString
12 | start_date: 2014-04-02
13 | end_date: 2014-04-02
14 |
--------------------------------------------------------------------------------
/test/fixtures/projects.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyString
5 | code: MyString
6 | description: MyText
7 | is_deleted: false
8 |
9 | two:
10 | name: MyString
11 | code: MyString
12 | description: MyText
13 | is_deleted: false
14 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/authorized_applications/_delete_form.html.erb:
--------------------------------------------------------------------------------
1 | <%- submit_btn_css ||= 'btn btn-link' %>
2 | <%= form_tag oauth_authorized_application_path(application) do %>
3 |
4 | <%= submit_tag 'Revoke', onclick: "return confirm('Are you sure?')", class: submit_btn_css %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/db/migrate/20140313044626_create_projects.rb:
--------------------------------------------------------------------------------
1 | class CreateProjects < ActiveRecord::Migration
2 | def change
3 | create_table :projects do |t|
4 | t.string :name
5 | t.string :code
6 | t.text :description
7 | t.boolean :is_deleted, :default=>false
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20140315064834_create_project_managers.rb:
--------------------------------------------------------------------------------
1 | class CreateProjectManagers < ActiveRecord::Migration
2 | def change
3 | create_table :project_managers do |t|
4 | t.integer :project_id
5 | t.integer :user_id
6 | t.string :status,:default=>'active'
7 |
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/unlock_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4 |
5 | Click the link below to unlock your account:
6 |
7 | <%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
8 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'oauth_applications/app_index' %>
3 | <% end %>
4 |
5 | <%= content_for :pane3 do %>
6 | <%= render :partial => 'oauth_applications/show' %>
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/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 | Mime::Type.register "application/pdf", :pdf
7 | Mime::Type.register "application/xls", :xls
8 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'oauth_applications/app_index' %>
3 | <% end %>
4 |
5 | <%= content_for :pane3 do %>
6 | <%= render :partial => 'oauth_applications/show' %>
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/reports/task.js.erb:
--------------------------------------------------------------------------------
1 | <% if @task.present? %>
2 | $('.modal-content').html("<%= escape_javascript(render :partial => 'reports/task') %>")
3 | $('#myModal').foundation('reveal', 'open');
4 | <% else %>
5 | $('.alert-area').notify({message: { text: 'Access denied' }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 10000 }}).show();
6 | <% end %>
--------------------------------------------------------------------------------
/db/migrate/20140421102655_create_user_oauth_applications.rb:
--------------------------------------------------------------------------------
1 | class CreateUserOauthApplications < ActiveRecord::Migration
2 | def change
3 | create_table :user_oauth_applications do |t|
4 | t.belongs_to :user, index: true
5 | t.belongs_to :oauth_application, index: true
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/test/controllers/home_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class HomeControllerTest < ActionController::TestCase
4 | test "should get index" do
5 | get :index
6 | assert_response :success
7 | end
8 |
9 | test "should get dashboard" do
10 | get :dashboard
11 | assert_response :success
12 | end
13 |
14 | end
15 |
--------------------------------------------------------------------------------
/app/views/reports/day_log.js.erb:
--------------------------------------------------------------------------------
1 | <% if @user.present? %>
2 | $('.modal-content').html("<%= escape_javascript(render :partial => 'reports/day_log') %>")
3 | $('#myModal').foundation('reveal', 'open');
4 | <% else %>
5 | $('.alert-area').notify({message: { text: 'Access denied' }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 10000 }}).show();
6 | <% end %>
--------------------------------------------------------------------------------
/db/migrate/20140329062237_create_objectives.rb:
--------------------------------------------------------------------------------
1 | class CreateObjectives < ActiveRecord::Migration
2 | def change
3 | create_table :objectives do |t|
4 | t.text :name
5 | t.integer :user_id
6 | t.integer :author_id
7 | t.date :start_date
8 | t.date :end_date
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/test/controllers/calendar_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CalendarControllerTest < ActionController::TestCase
4 | test "should get index" do
5 | get :index
6 | assert_response :success
7 | end
8 |
9 | test "should get monthly" do
10 | get :monthly
11 | assert_response :success
12 | end
13 |
14 | end
15 |
--------------------------------------------------------------------------------
/test/controllers/reports_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ReportsControllerTest < ActionController::TestCase
4 | test "should get index" do
5 | get :index
6 | assert_response :success
7 | end
8 |
9 | test "should get activities" do
10 | get :activities
11 | assert_response :success
12 | end
13 |
14 | end
15 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/calendar.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the calendar controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 |
5 | //.month-calendar-field{visibility: hidden;}
6 | //.datepicker.datepicker-dropdown.dropdown-menu{display: block !important;}
7 |
8 |
--------------------------------------------------------------------------------
/db/migrate/20140402172421_create_okrs.rb:
--------------------------------------------------------------------------------
1 | class CreateOkrs < ActiveRecord::Migration
2 | def change
3 | create_table :okrs do |t|
4 | t.integer :user_id
5 | t.string :name
6 | t.date :start_date
7 | t.date :end_date
8 | t.boolean :is_deleted, :default=>false
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/models/key_result.rb:
--------------------------------------------------------------------------------
1 | class KeyResult < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :objective
4 | #has_many :tasks
5 | has_many :task_key_results
6 | has_many :tasks,:through=>:task_key_results
7 | has_many :work_logs,:through=>:tasks
8 | scope :active, -> { where(is_deleted: false) }
9 |
10 | validates_presence_of :name
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20140315065219_create_team_members.rb:
--------------------------------------------------------------------------------
1 | class CreateTeamMembers < ActiveRecord::Migration
2 | def change
3 | create_table :team_members do |t|
4 | t.integer :team_id
5 | t.integer :user_id
6 | t.string :role, :default=>'member'
7 | t.string :status,:default=>'active'
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/fixtures/objectives.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyText
5 | user_id: 1
6 | author_id: 1
7 | start_date: 2014-03-29
8 | end_date: 2014-03-29
9 |
10 | two:
11 | name: MyText
12 | user_id: 1
13 | author_id: 1
14 | start_date: 2014-03-29
15 | end_date: 2014-03-29
16 |
--------------------------------------------------------------------------------
/app/views/reports/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Reports
4 | Select report ▾
5 |
6 | <%= render 'reports/report_types' %>
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/db/migrate/20140319095724_add_soft_delete_fields_to_users_tasks_and_comments.rb:
--------------------------------------------------------------------------------
1 | class AddSoftDeleteFieldsToUsersTasksAndComments < ActiveRecord::Migration
2 | def change
3 | add_column :users, :is_deleted, :boolean, :default=>false
4 | add_column :tasks, :is_deleted, :boolean, :default=>false
5 | add_column :comments, :is_deleted, :boolean, :default=>false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20140329062251_create_key_results.rb:
--------------------------------------------------------------------------------
1 | class CreateKeyResults < ActiveRecord::Migration
2 | def change
3 | create_table :key_results do |t|
4 | t.text :name
5 | t.integer :user_id
6 | t.integer :objective_id
7 | t.integer :author_id
8 | t.date :start_date
9 | t.date :end_date
10 |
11 | t.timestamps
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/app/models/objective.rb:
--------------------------------------------------------------------------------
1 | class Objective < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :okr
4 | has_many :key_results
5 | has_many :tasks,:through=>:key_results
6 | accepts_nested_attributes_for :key_results, :reject_if => lambda { |a| a[:name].blank? },allow_destroy: true
7 |
8 | validates_presence_of :name
9 |
10 | scope :active, -> { where(is_deleted: false) }
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/users/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'users/user_index' %>
3 | <% end %>
4 |
5 | <%= content_for :pane3 do %>
6 | <% if @user.present? %>
7 | <%= render :partial => 'users/show', :locals => {:user=>@user,:teams=>@teams} %>
8 | <% end %>
9 | <% end %>
10 |
--------------------------------------------------------------------------------
/db/migrate/20140320071932_create_work_logs.rb:
--------------------------------------------------------------------------------
1 | class CreateWorkLogs < ActiveRecord::Migration
2 | def change
3 | create_table :work_logs do |t|
4 | t.integer :user_id
5 | t.string :name
6 | t.integer :task
7 | t.time :start_time
8 | t.time :end_time
9 | t.date :date
10 | t.boolean :is_deleted,:default=>false
11 |
12 | t.timestamps
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/test/fixtures/key_results.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyText
5 | user_id: 1
6 | objective_id: 1
7 | author_id: 1
8 | start_date: 2014-03-29
9 | end_date: 2014-03-29
10 |
11 | two:
12 | name: MyText
13 | user_id: 1
14 | objective_id: 1
15 | author_id: 1
16 | start_date: 2014-03-29
17 | end_date: 2014-03-29
18 |
--------------------------------------------------------------------------------
/test/fixtures/users.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | # This model initially had no columns defined. If you add columns to the
4 | # model remove the '{}' from the fixture names and add the columns immediately
5 | # below each fixture, per the syntax in the comments below
6 | #
7 | one: {}
8 | # column: value
9 | #
10 | two: {}
11 | # column: value
12 |
--------------------------------------------------------------------------------
/db/migrate/20140402095057_add_active_status_to_missing.rb:
--------------------------------------------------------------------------------
1 | class AddActiveStatusToMissing < ActiveRecord::Migration
2 | def change
3 | add_column :reporting_managers, :status, :string, :default=>'active'
4 | add_column :task_assignees, :status, :string, :default=>'active'
5 | add_column :objectives, :is_deleted, :boolean, :default=>false
6 | add_column :key_results, :is_deleted, :boolean, :default=>false
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/test/fixtures/doorkeeper_applications.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | # This model initially had no columns defined. If you add columns to the
4 | # model remove the '{}' from the fixture names and add the columns immediately
5 | # below each fixture, per the syntax in the comments below
6 | #
7 | one: {}
8 | # column: value
9 | #
10 | two: {}
11 | # column: value
12 |
--------------------------------------------------------------------------------
/app/views/comments/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for(@comment, :remote => true, :data => {:abide => true}) do |f| %>
2 | <%= f.hidden_field :source_id, :value => @comment.source_id %>
3 | <%= f.hidden_field :source_type, :value => @comment.source_type %>
4 | <%= f.hidden_field :user_id, :value => current_user.id %>
5 |
6 | <%= f.text_field :body, :placeholder => 'Add comment',:required => '' %>
7 |
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/db/migrate/20140315065143_add_additional_fields_to_users.rb:
--------------------------------------------------------------------------------
1 | class AddAdditionalFieldsToUsers < ActiveRecord::Migration
2 | def change
3 | add_column :users, :name, :string
4 | add_column :users, :nickname, :string
5 | add_column :users, :employee_code, :string
6 | add_column :users, :joining_date, :datetime
7 | add_column :users, :role, :string
8 | add_column :users, :status, :string,:default=>'active'
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/test/fixtures/work_logs.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | user_id: 1
5 | name: MyString
6 | task: 1
7 | start_time: 2014-03-20 12:49:32
8 | end_time: 2014-03-20 12:49:32
9 | is_deleted: false
10 |
11 | two:
12 | user_id: 1
13 | name: MyString
14 | task: 1
15 | start_time: 2014-03-20 12:49:32
16 | end_time: 2014-03-20 12:49:32
17 | is_deleted: false
18 |
--------------------------------------------------------------------------------
/app/views/devise/unlocks/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend unlock instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 | <%= f.label :email %>
7 | <%= f.email_field :email, autofocus: true %>
8 |
9 | <%= f.submit "Resend unlock instructions" %>
10 | <% end %>
11 |
12 | <%= render "devise/shared/links" %>
13 |
--------------------------------------------------------------------------------
/app/models/comment.rb:
--------------------------------------------------------------------------------
1 | class Comment < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :source, :polymorphic=>true
4 | scope :active, -> {where(is_deleted: false)}
5 |
6 | validates_presence_of :user_id,:body,:source
7 |
8 | after_save :update_comment_count
9 | #default_scope where(is_deleted: false)
10 |
11 | def update_comment_count
12 | source.update_attributes(:comments_count=>source.comments.active.count)
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 | Forgot your password?
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 | <%= f.label :email %>
7 | <%= f.email_field :email, autofocus: true %>
8 |
9 | <%= f.submit "Send me reset password instructions" %>
10 | <% end %>
11 |
12 | <%= render "devise/shared/links" %>
13 |
--------------------------------------------------------------------------------
/app/models/project_manager.rb:
--------------------------------------------------------------------------------
1 | class ProjectManager < ActiveRecord::Base
2 | belongs_to :project
3 | belongs_to :user
4 | default_scope {where.not(status:'archived')}
5 | #default_scope order("name ASC")
6 |
7 | after_save :update_numbers
8 | after_destroy :update_numbers
9 |
10 | def update_numbers
11 | user.update_attributes(:admin_projects_count=>user.projects.count)
12 | #update_attributes(:team_count=>self.teams.count)
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Someone has requested a link to change your password. You can do this through the link below.
4 |
5 | <%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
6 |
7 | If you didn't request this, please ignore this email.
8 | Your password won't change until you access the link above and create a new one.
9 |
--------------------------------------------------------------------------------
/app/views/objectives/_key_result_fields.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= f.label :name %>
4 | <%= f.text_field :name %>
5 |
6 |
7 | <%= f.label :start_date %>
8 | <%= f.text_field :start_date %>
9 |
10 |
11 | <%= f.label :end_date %>
12 | <%= f.text_field :end_date %>
13 |
14 | <%= link_to_remove_association "remove task", f %>
15 |
16 |
--------------------------------------------------------------------------------
/app/views/okrs/_approval.erb:
--------------------------------------------------------------------------------
1 | <% if ((can? :destroy, @okr) && !@okr.approved) %>
2 | <%= button_to 'Approve', approve_user_okr_path(@okr.user_id, @okr), :remote => true, :class => 'btn btn-sec' %>
3 | <% elsif (can? :cru, @okr) %>
4 | <%= @okr.approved ? raw("") : raw("") %>
5 | <% end %>
--------------------------------------------------------------------------------
/app/views/devise/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend confirmation instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 | <%= f.label :email %>
7 | <%= f.email_field :email, autofocus: true %>
8 |
9 | <%= f.submit "Resend confirmation instructions" %>
10 | <% end %>
11 |
12 | <%= render "devise/shared/links" %>
13 |
--------------------------------------------------------------------------------
/app/views/tasks/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 | <%= render :partial => 'tasks/task_list' %>
3 | <% end %>
4 |
5 |
10 |
11 |
12 | <%= render :partial => 'show', :locals => {:task => @task, :project => @project, :team => @team} %>
13 |
14 |
--------------------------------------------------------------------------------
/db/migrate/20140315065513_create_tasks.rb:
--------------------------------------------------------------------------------
1 | class CreateTasks < ActiveRecord::Migration
2 | def change
3 | create_table :tasks do |t|
4 | t.string :name
5 | t.text :description
6 | t.datetime :start_date
7 | t.datetime :end_date
8 | t.integer :project_id
9 | t.integer :team_id
10 | t.integer :user_id
11 | t.string :tracker_id
12 | t.integer :comments_count, :default=>0
13 |
14 | t.timestamps
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/views/work_logs/new.js.erb:
--------------------------------------------------------------------------------
1 | <% unless @entries.empty? %>
2 | $('.pane3').html("<%= escape_javascript(render :partial => 'work_logs/form') %>")
3 | <% else %>
4 | $('.alert-area').notify({message: { text: '<%= "You have no task assigned for #{@date.strftime('%d %B %Y')}" %>' }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 10000 }}).show();
5 | <% end %>
6 | $(document).foundation({
7 | tab: {
8 | callback: function (tab) {
9 | }
10 | }
11 | });
12 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 |
6 | before_filter :authenticate_user!
7 |
8 |
9 | #check_authorization
10 | #before_filter :authorize_resource
11 |
12 | rescue_from CanCan::AccessDenied do |exception|
13 | redirect_to root_url, :alert => exception.message
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/views/comments/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 |
4 | Source:
5 | <%= @comment.source_id %>
6 |
7 |
8 |
9 | Source type:
10 | <%= @comment.source_type %>
11 |
12 |
13 |
14 | Body:
15 | <%= @comment.body %>
16 |
17 |
18 |
19 | User:
20 | <%= @comment.user_id %>
21 |
22 |
23 | <%= link_to 'Edit', edit_comment_path(@comment) %> |
24 | <%= link_to 'Back', comments_path %>
25 |
--------------------------------------------------------------------------------
/app/views/reports/day_log.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Reports
4 | Worklogs ▾
5 |
6 | <%= render 'reports/report_types' %>
7 |
8 |
9 |
10 |
11 |
12 | <%= render :partial => 'reports/day_log' %>
13 |
14 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/credentials_controller.rb:
--------------------------------------------------------------------------------
1 | module Api::V1
2 | class CredentialsController < ApiController
3 | respond_to :html, :xml, :json
4 | skip_before_filter :authenticate_user!, :only=>[:me]
5 | doorkeeper_for :all
6 |
7 | #respond_to :json
8 |
9 | def me
10 | if current_resource_owner
11 | respond_with current_resource_owner
12 | else
13 | error = { :error => "Invalid grant." }
14 | respond_with error
15 | end
16 | end
17 |
18 |
19 | end
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/app/views/reports/_selections.erb:
--------------------------------------------------------------------------------
1 | <% if @projects.present? %>
2 | <%= select_tag 'report[project_id]', options_for_select(@projects.map { |x| [x.name, x.id] }), :class => 'report_type_select' %>
3 | <% elsif @teams.present? %>
4 | <%= select_tag 'report[team_id]', options_for_select(@teams.map { |x| [x.name, x.id] }), :class => 'report_type_select' %>
5 | <% elsif @users.present? %>
6 | <%= select_tag 'report[user_id]', options_for_select(@users.map { |x| [x.name, x.id] }), :class => 'report_type_select' %>
7 | <% else %>
8 |
9 | <% end %>
--------------------------------------------------------------------------------
/db/migrate/20140315065003_create_teams.rb:
--------------------------------------------------------------------------------
1 | class CreateTeams < ActiveRecord::Migration
2 | def change
3 | create_table :teams do |t|
4 | t.string :name
5 | t.string :code
6 | t.text :description
7 | t.integer :project_id
8 | t.integer :members_count, :default=>0
9 | t.integer :managers_count, :default=>0
10 | t.boolean :is_deleted, :default=>false
11 | t.integer :pending_tasks
12 | t.string :status,:default=>'active'
13 |
14 | t.timestamps
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/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 | User.create(:email=>'admin@fluxday.io',:name=>'admin',:nickname=>'admin',:password=>'password',:password_confirmation=>'password',:employee_code=>'FT00',:role=>'admin')
9 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | services:
3 | fluxday-db:
4 | container_name: fluxday-db
5 | image: mysql
6 | env_file:
7 | - db.env
8 |
9 | fluxday-app:
10 | container_name: fluxday-app
11 | tty: true
12 | stdin_open: true
13 | build:
14 | context: .
15 | dockerfile: Dockerfile.development
16 | volumes:
17 | - .:/share
18 | env_file:
19 | - app.env
20 | depends_on:
21 | - fluxday-db
22 | links:
23 | - fluxday-db
24 | ports:
25 | - 3000:3000
26 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/api_controller.rb:
--------------------------------------------------------------------------------
1 | module Api::V1
2 | class ApiController < ApplicationController
3 |
4 |
5 | #respond_to :json
6 | #
7 | #def explore
8 | # @json = doorkeeper_access_token.get("api/v1/#{params[:api]}").parsed
9 | # respond_with @json
10 | #end
11 | #
12 | #private
13 | def current_resource_owner
14 | user = OauthApplication.find(doorkeeper_token.try(&:application_id)).users.where(id:doorkeeper_token.try(&:resource_owner_id)).first
15 | end
16 |
17 | end
18 | end
19 |
20 |
21 |
--------------------------------------------------------------------------------
/test/fixtures/teams.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyString
5 | code: MyString
6 | description: MyText
7 | project_id: 1
8 | members_count: 1
9 | managers_count: 1
10 | is_deleted: false
11 | pending_tasks: 1
12 | status: MyString
13 |
14 | two:
15 | name: MyString
16 | code: MyString
17 | description: MyText
18 | project_id: 1
19 | members_count: 1
20 | managers_count: 1
21 | is_deleted: false
22 | pending_tasks: 1
23 | status: MyString
24 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 | require File.expand_path('../../config/environment', __FILE__)
3 | require 'rails/test_help'
4 |
5 | class ActiveSupport::TestCase
6 | ActiveRecord::Migration.check_pending!
7 |
8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
9 | #
10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests
11 | # -- they do not yet inherit this setting
12 | fixtures :all
13 |
14 | # Add more helper methods to be used by all tests here...
15 | end
16 |
--------------------------------------------------------------------------------
/app/models/team_member.rb:
--------------------------------------------------------------------------------
1 | class TeamMember < ActiveRecord::Base
2 | belongs_to :team
3 | belongs_to :user
4 |
5 | default_scope {where.not(status:'archived')}
6 |
7 | after_save :update_member_counts
8 |
9 | def update_member_counts
10 | user.update_attributes(:admin_teams_count=>user.admin_teams.count) if self.role == 'lead'
11 | team.update_attributes(:members_count=>team.members.count,:managers_count=>team.team_leads.active.count)
12 | team.project.update_attribute(:member_count, team.project.project_members.active.count)
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/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] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/test/fixtures/tasks.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | name: MyString
5 | description: MyString
6 | start_date: 2014-03-15 12:25:13
7 | end_date: 2014-03-15 12:25:13
8 | project_id: 1
9 | team_id: 1
10 | user_id: 1
11 | tracker_id: MyString
12 | comments_count: 1
13 |
14 | two:
15 | name: MyString
16 | description: MyString
17 | start_date: 2014-03-15 12:25:13
18 | end_date: 2014-03-15 12:25:13
19 | project_id: 1
20 | team_id: 1
21 | user_id: 1
22 | tracker_id: MyString
23 | comments_count: 1
24 |
--------------------------------------------------------------------------------
/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 | rake doc:app .
29 |
--------------------------------------------------------------------------------
/app/views/work_logs/_logs.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <% unless @work_logs.empty? %>
4 | Log
5 | <% end %>
6 |
7 | <% @work_logs.each do |log| %>
8 | <%= link_to work_log_path(log), :remote => true do %>
9 |
10 |
11 | <%= log.task.try(&:name) %>
12 |
13 |
14 | <%= log.hours %>
15 |
16 |
17 | <% end %>
18 | <% end %>
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/views/objectives/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 |
4 | Name:
5 | <%= @objective.name %>
6 |
7 |
8 |
9 | User:
10 | <%= @objective.user_id %>
11 |
12 |
13 |
14 | Author:
15 | <%= @objective.author_id %>
16 |
17 |
18 |
19 | Start date:
20 | <%= @objective.start_date %>
21 |
22 |
23 |
24 | End date:
25 | <%= @objective.end_date %>
26 |
27 |
28 | <%= link_to 'Edit', edit_objective_path(@objective) %> |
29 | <%= link_to 'Back', objectives_path %>
30 |
--------------------------------------------------------------------------------
/app/views/reports/_report_types.erb:
--------------------------------------------------------------------------------
1 | <%= link_to 'Grouped Employee daily report', reports_employees_daily_path %>
2 | <%= link_to 'Grouped Employee report for a time range', reports_employees_time_range_path %>
3 | <%= link_to 'Employee report for a day', reports_employee_day_path %>
4 | <%= link_to 'Employee report for a time range', reports_employee_range_path %>
5 | <%= link_to 'Task reports', reports_tasks_path %>
6 | <%= link_to 'OKR', reports_okrs_path %>
7 | <%= link_to 'Assignments', reports_assignments_path %>
8 | <%= link_to 'Worklogs', reports_worklogs_path %>
--------------------------------------------------------------------------------
/app/assets/stylesheets/teams.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the Teams controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 | .team-list-item{
5 | clear: both;
6 | padding: 3% 0;
7 | font-size: 1.2em;
8 | .team-name{
9 | float: left;
10 | }
11 | .team-glymplse{
12 | float: right;
13 | margin-left: 10px;
14 |
15 | }
16 | .btn.btn-sec{
17 | margin-top: -3px;
18 | opacity: 0;
19 | }
20 | }
21 | .team-list-item:hover{
22 | .btn-sec{opacity: 1;}
23 | }
24 |
25 | .new-team{
26 | margin-top: 10px;
27 | }
--------------------------------------------------------------------------------
/config/app_config.yml.example:
--------------------------------------------------------------------------------
1 | development:
2 | google:
3 | key: 'google access key'
4 | secret: 'google secret'
5 | scope: "userinfo.email, userinfo.profile, http://gdata.youtube.com, https://www.googleapis.com/auth/youtube"
6 | callback_url: "http://localhost:9292/users/auth/google_oauth2/callback"
7 |
8 | production:
9 | google:
10 | key: 'google access key'
11 | secret: 'google secret'
12 | scope: "userinfo.email, userinfo.profile, http://gdata.youtube.com, https://www.googleapis.com/auth/youtube"
13 | callback_url: "http://localhost:9292/users/auth/google_oauth2/callback"
--------------------------------------------------------------------------------
/app/views/projects/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= content_for :pane2 do %>
3 | <%# @projects.each do |project| %>
4 | <%= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
5 | <%# end %>
6 |
7 | <% end %>
8 |
9 |
10 | <%= content_for :pane3 do %>
11 | <% if @project.present? %>
12 | <%= render :partial => 'projects/show', :locals => {:project => @project} %>
13 | <% end %>
14 | <% end %>
15 |
16 |
--------------------------------------------------------------------------------
/app/views/comments/_comments.erb:
--------------------------------------------------------------------------------
1 | <%= render :partial => 'comments/form' %>
2 | <% @comments.each do |comment| %>
3 |
15 | <% end %>
--------------------------------------------------------------------------------
/app/views/devise/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 | Sign up
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 | <%= f.label :email %>
7 | <%= f.email_field :email, autofocus: true %>
8 |
9 | <%= f.label :password %>
10 | <%= f.password_field :password, autocomplete: "off" %>
11 |
12 | <%= f.label :password_confirmation %>
13 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
14 |
15 | <%= f.submit "Sign up" %>
16 | <% end %>
17 |
18 | <%= render "devise/shared/links" %>
19 |
--------------------------------------------------------------------------------
/app/views/teams/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= content_for :pane2 do %>
3 | <%# @projects.each do |project| %>
4 | <%= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
5 | <%# end %>
6 | <% end %>
7 |
8 |
9 |
10 |
11 | <%= render :partial => 'teams/form' %>
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/views/home/search.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 |
3 |
6 |
7 |
8 |
9 | <%= render 'tasks/task_listings' %>
10 |
11 |
12 |
13 | <%= will_paginate @tasks %>
14 |
15 |
16 |
17 | <% end %>
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/db/migrate/20140409044941_create_friendly_id_slugs.rb:
--------------------------------------------------------------------------------
1 | class CreateFriendlyIdSlugs < ActiveRecord::Migration
2 | def change
3 | create_table :friendly_id_slugs do |t|
4 | t.string :slug, :null => false
5 | t.integer :sluggable_id, :null => false
6 | t.string :sluggable_type, :limit => 50
7 | t.string :scope
8 | t.datetime :created_at
9 | end
10 | add_index :friendly_id_slugs, :sluggable_id
11 | add_index :friendly_id_slugs, [:slug, :sluggable_type]
12 | add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true
13 | add_index :friendly_id_slugs, :sluggable_type
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/assets/javascripts/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "jt.timepicker",
3 | "version" : "1.3.5",
4 | "description" : "A jQuery timepicker plugin inspired by Google Calendar.",
5 | "homepage" : "http://jonthornton.github.com/jquery-timepicker",
6 | "main" : [ "./jquery.timepicker.js", "./jquery.timepicker.min.js", "./jquery.timepicker.css" ],
7 | "dependencies" : {
8 | "jquery" : ">= 1.7"
9 | },
10 | "keywords" : [ "time", "picker", "google calendar" ],
11 | "author" : {
12 | "name" : "Jon Thornton",
13 | "web" : "https://github.com/jonthornton"
14 | },
15 | "license": "http://opensource.org/licenses/MIT"
16 | }
17 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the top of the
9 | * compiled file, but it's generally better to create a new file per style scope.
10 | *
11 | *= require_self
12 | *= require foundation_and_overrides
13 | *= require select2
14 | *= require_tree .
15 | */
16 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/bootstrap-notify.css:
--------------------------------------------------------------------------------
1 | .notifications {
2 | position: fixed;
3 | }
4 |
5 | /* Positioning */
6 | .notifications.top-right {
7 | right: 10px;
8 | top: 25px;
9 | }
10 |
11 | .notifications.top-left {
12 | left: 10px;
13 | top: 25px;
14 | }
15 |
16 | .notifications.bottom-left {
17 | left: 10px;
18 | bottom: 25px;
19 | }
20 |
21 | .notifications.bottom-right {
22 | right: 10px;
23 | bottom: 25px;
24 | }
25 |
26 | /* Notification Element */
27 | .notifications > div {
28 | position: relative;
29 | z-index: 9999;
30 | margin: 5px 0px;
31 | }
32 |
33 | .alert-area{
34 | position: fixed;
35 | right: 40px;
36 | bottom: 40px;
37 | z-index: 6;
38 | }
--------------------------------------------------------------------------------
/app/views/devise/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 | Change your password
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= devise_error_messages! %>
5 | <%= f.hidden_field :reset_password_token %>
6 |
7 | <%= f.label :password, "New password" %>
8 | <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
9 |
10 | <%= f.label :password_confirmation, "Confirm new password" %>
11 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
12 |
13 | <%= f.submit "Change my password" %>
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/projects/_project_card.erb:
--------------------------------------------------------------------------------
1 | <%= link_to project_path(project),:remote=>false do %>
2 |
3 |
4 | <%= image_tag(project.image.icon) %>
5 |
6 |
7 |
<%= project.name %>
8 |
9 | <%= "#{project.team_count} #{'team'.pluralize(project.team_count)}" %>
10 | <%= "#{project.member_count} #{'team'.pluralize(project.member_count)}" %>
11 |
12 |
13 | <%= project.website %>
14 |
15 |
16 |
17 | <% end %>
--------------------------------------------------------------------------------
/app/views/projects/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 |
3 | <%#= render :partial=>'projects/new_link' %>
4 | <%# @projects.each do |project| %>
5 | <%= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
6 | <%# end %>
7 |
8 |
9 |
10 | <% end %>
11 | <%= content_for :pane3 do %>
12 | <% if @project.present? %>
13 | <%= render :partial => 'projects/show', :locals => {:project => @project} %>
14 | <% end %>
15 | <% end %>
16 |
17 |
--------------------------------------------------------------------------------
/app/models/work_log.rb:
--------------------------------------------------------------------------------
1 | class WorkLog < ActiveRecord::Base
2 | belongs_to :user
3 | belongs_to :task
4 |
5 | validates_presence_of :task_id
6 | # validates_inclusion_of :date, :in => 6.day.ago..Date.today,:message=>'Date should be older than 5 days'
7 | validates_inclusion_of :date, :in => Proc.new{ 6.day.ago..Date.today },:message=>'Date should be older than 5 days'
8 | #default_scope{ where.not(is_deleted: true) }
9 |
10 | scope :active, -> { where(is_deleted: false) }
11 |
12 | def self.user_logs_dated(user, date)
13 | user.work_logs.find_by_date(Date.today.to_date)
14 | end
15 |
16 | def hours
17 | return "#{self.minutes.to_i/60}:#{ '%02d' % (self.minutes.to_i%60)}"
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/public/stylesheets/pdf.css:
--------------------------------------------------------------------------------
1 | .pdf{
2 |
3 | }
4 |
5 | body{
6 | font-size: 12px;
7 | }
8 | .table, tr, td, th{
9 | padding: 10px;
10 | border:solid 1px #000;
11 | border-collapse: collapse;
12 | }
13 | th{
14 | background: #cccccc;
15 | }
16 | h1{
17 | text-align: center;
18 | }
19 | .title{
20 | text-align: center;
21 | margin-bottom: 20px;
22 | padding-bottom: 20px;
23 | font-weight: bold;
24 | border-bottom: solid 1px #000000;
25 | }
26 | #footer{
27 | border-top: solid;
28 | }
29 | .export-options{
30 | display: none;
31 | }
32 | a{
33 | text-decoration: none;
34 | color: #000000;
35 | }
36 | tfoot{
37 | font-weight: bold;
38 | background: #DDDDDD;
39 | }
--------------------------------------------------------------------------------
/app/models/okr.rb:
--------------------------------------------------------------------------------
1 | class Okr < ActiveRecord::Base
2 | belongs_to :user
3 | has_many :objectives
4 | has_many :key_results, :through =>:objectives
5 | accepts_nested_attributes_for :objectives, :reject_if => lambda { |a| a[:name].blank? },allow_destroy: true
6 |
7 | after_save :update_children
8 |
9 | validates_presence_of :name, :user_id, :start_date, :end_date
10 |
11 | scope :active, -> { where(is_deleted: false) }
12 | scope :approved, -> { where(approved: true) }
13 |
14 | def update_children
15 | objectives.update_all(:user_id=>user_id,:start_date=>start_date,:end_date=>end_date)
16 | key_results.update_all(:user_id=>user_id,:start_date=>start_date,:end_date=>end_date)
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/app/views/key_results/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 |
4 | Name:
5 | <%= @key_result.name %>
6 |
7 |
8 |
9 | User:
10 | <%= @key_result.user_id %>
11 |
12 |
13 |
14 | Objective:
15 | <%= @key_result.objective_id %>
16 |
17 |
18 |
19 | Author:
20 | <%= @key_result.author_id %>
21 |
22 |
23 |
24 | Start date:
25 | <%= @key_result.start_date %>
26 |
27 |
28 |
29 | End date:
30 | <%= @key_result.end_date %>
31 |
32 |
33 | <%= link_to 'Edit', edit_key_result_path(@key_result) %> |
34 | <%= link_to 'Back', key_results_path %>
35 |
--------------------------------------------------------------------------------
/config/initializers/secret_token.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure your secret_key_base is kept private
11 | # if you're sharing your code publicly.
12 | Fluxday::Application.config.secret_key_base = 'a1878bcc8a37aa076581e9ef1204c7cecdb572c3492bc36e1ab63bea12c28c8d088505dd3de0296bc6830d20b4cf39b19bf478160c9384534ad9569d0a529203'
13 |
--------------------------------------------------------------------------------
/app/views/users/_user_list.erb:
--------------------------------------------------------------------------------
1 |
2 | <% users.each do |user| %>
3 |
4 |
5 |
6 | <%= link_to image_tag(user.image.icon, :class => 'rounded_pic pic48'), user_path(user), :remote => true %>
7 |
8 |
9 | <%= link_to user.name, user_path(user), :remote => true,:class=>'name' %>
10 | <%= link_to raw("(#{user.nickname})"), user_path(user), :remote => true,:class=>'nickname' %>
11 |
12 |
13 |
14 |
15 |
16 |
17 | <% end %>
18 |
--------------------------------------------------------------------------------
/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. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/authorized_applications/index.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 | Application
10 | Created At
11 |
12 |
13 |
14 |
15 |
16 | <% @applications.each do |application| %>
17 |
18 | <%= application.name %>
19 | <%= application.created_at.strftime('%Y-%m-%d %H:%M:%S') %>
20 | <%= render 'delete_form', application: application %>
21 |
22 | <% end %>
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore files with sensitive info
8 | /config/database.yml
9 | /app.env
10 | /db.env
11 |
12 | # Ignore bundler config.
13 | /.bundle
14 |
15 | # Ignore the default SQLite database.
16 | /db/*.sqlite3
17 | /db/*.sqlite3-journal
18 |
19 | # Ignore all logfiles and tempfiles.
20 | /log/*.log
21 | /tmp
22 | /config/database.yml
23 | /public/uploads
24 | /public/assets
25 | /db/schema.rb
26 | /config/app_config.yml
27 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/app/views/teams/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%# @projects.each do |project| %>
3 | <%= content_for :pane2 do %>
4 | <%= render :partial => 'teams/team_index', :locals => {:teams => @teams} %>
5 | <% end %>
6 | <%#= render :partial => 'projects/project_list', :locals => {:projects => @projects} %>
7 | <%# end %>
8 |
9 |
10 |
11 | <%= content_for :pane3 do %>
12 | <% if @team.present? %>
13 | <%= render :partial => 'teams/show', :locals => {:team => @team,:projects=>@projects,:members=>@members,:team_leads=>@team_leads} %>
14 | <% end %>
15 | <% end %>
16 |
17 |
--------------------------------------------------------------------------------
/app/views/oauth_applications/_app_index.erb:
--------------------------------------------------------------------------------
1 |
4 | <% assignables = Team.assignable_by_user(current_user).collect(&:id) %>
5 |
6 | <%= link_to 'Add an application', new_oauth_application_path, :remote => false, :class => 'dashed_link transition' %>
7 | <% @oauth_applications.each do |app| %>
8 |
9 |
10 | <%= link_to app.name, oauth_application_path(app), :class => 'grey-link' %>
11 |
12 |
13 | <%= link_to app.redirect_uri, oauth_application_path(app), :class => 'team-project' %>
14 |
15 |
16 | <% end %>
17 |
--------------------------------------------------------------------------------
/app/views/teams/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= content_for :pane2 do %>
3 | <%# @projects.each do |project| %>
4 | <%= render :partial => 'teams/team_index', :locals => {:teams => @teams} %>
5 | <%# end %>
6 | <% end %>
7 |
8 |
9 |
10 | <%# if @project.present? %>
11 | <%#= link_to 'New team',new_project_team_path(@project),:remote=>true %>
12 | <%# else %>
13 | <%#= link_to 'New team',new_team_path(@project),:remote=>true %>
14 | <%# end %>
15 | <%#= content_for :pane3 do %>
16 | <% if @project.present? %>
17 | <%#= render :partial=>'projects/show',:locals=>{:project=>@project} %>
18 | <% end %>
19 | <%# end %>
20 |
21 |
--------------------------------------------------------------------------------
/app/views/layouts/pdf.html.erb:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 | <%= wicked_pdf_stylesheet_link_tag "/stylesheets/pdf.css" %>
7 | <%= wicked_pdf_stylesheet_link_tag "stylesheets/pdf.css" -%>
8 | <%= wicked_pdf_javascript_include_tag "number_pages" %>
9 |
10 |
11 |
12 |
18 |
19 | <%= yield %>
20 |
21 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/applications/index.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 | <%= link_to 'New Application', new_oauth_application_path, class: 'btn btn-success' %>
6 |
7 |
8 |
9 |
10 | Name
11 | Callback URL
12 |
13 |
14 |
15 |
16 |
17 | <% @applications.each do |application| %>
18 |
19 | <%= link_to application.name, [:oauth, application] %>
20 | <%= application.redirect_uri %>
21 | <%= link_to 'Edit', edit_oauth_application_path(application), class: 'btn btn-link' %>
22 | <%= render 'delete_form', application: application %>
23 |
24 | <% end %>
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/views/reports/task.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Reports
4 | Task report ▾
5 |
6 | <%= render 'reports/report_types' %>
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | <%= render :partial => 'reports/task_report' %>
15 |
16 |
--------------------------------------------------------------------------------
/app/views/tasks/_pending_task_page.erb:
--------------------------------------------------------------------------------
1 | <% @tasks.each do |task| %>
2 | <%= link_to task_path(task),:remote=>true do %>
3 |
4 |
5 | <%= task.name %>
6 |
7 |
8 | <%= task.time_to_end %>
9 |
10 | <%= raw("
") if task.user_id == current_user.id %>
11 | <%= raw("
") if task.user_ids.include?(current_user.id) %>
12 |
13 |
14 |
15 | <%= task.team.name %>
16 |
17 |
18 | <% end %>
19 | <% end %>
--------------------------------------------------------------------------------
/app/views/teams/_team_list.erb:
--------------------------------------------------------------------------------
1 | <% if can? :edit, @project %>
2 | <% if defined? project %>
3 | <%= link_to 'New team', new_project_team_path(project), :remote => false, :class => 'dashed_link transition new-team' %>
4 | <% end %>
5 | <% end %>
6 | <% assignables = Team.assignable_by_user(current_user).collect(&:id) %>
7 | <% teams.each do |team| %>
8 |
9 |
10 | <%= link_to team.name, team_path(team), :class => 'grey-link' %>
11 |
12 |
13 | <%= team.members_count %>
14 |
15 | <% if assignables.include?(team.id) %>
16 | <%= link_to 'Add task', new_task_path(:team_id => team.id), :remote => false, :class => 'btn btn-sec right transition' %>
17 | <% end %>
18 |
19 | <% end %>
--------------------------------------------------------------------------------
/app/views/layouts/doorkeeper.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <%= content_for?(:title) ? yield(:title) : "Fluxday" %>
7 |
8 |
9 |
10 | <%= stylesheet_link_tag "application" %>
11 | <%= javascript_include_tag "vendor/modernizr" %>
12 | <%= csrf_meta_tags %>
13 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
14 |
15 |
16 |
17 |
18 |
19 | <%= yield %>
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/views/comments/index.html.erb:
--------------------------------------------------------------------------------
1 | Listing comments
2 |
3 |
4 |
5 |
6 | Source
7 | Source type
8 | Body
9 | User
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | <% @comments.each do |comment| %>
18 |
19 | <%= comment.source_id %>
20 | <%= comment.source_type %>
21 | <%= comment.body %>
22 | <%= comment.user_id %>
23 | <%= link_to 'Show', comment %>
24 | <%= link_to 'Edit', edit_comment_path(comment) %>
25 | <%= link_to 'Destroy', comment, method: :delete, data: { confirm: 'Are you sure?' } %>
26 |
27 | <% end %>
28 |
29 |
30 |
31 |
32 |
33 | <%= link_to 'New Comment', new_comment_path %>
34 |
--------------------------------------------------------------------------------
/app/views/okrs/_key_result_fields.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
22 | <%#= f.label :start_date %>
23 | <%#= f.text_field :start_date %>
24 |
25 |
26 | <%#= f.label :end_date %>
27 | <%#= f.text_field :end_date %>
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/config/database.yml.example:
--------------------------------------------------------------------------------
1 | # MySQL. Versions 4.1 and 5.0 are recommended.
2 | #
3 | # Install the MYSQL driver
4 | # gem install mysql2
5 | #
6 | # Ensure the MySQL gem is defined in your Gemfile
7 | # gem 'mysql2'
8 | #
9 | # And be sure to use new-style password hashing:
10 | # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11 | default: &default
12 | adapter: mysql2
13 | encoding: utf8
14 | pool: 5
15 | database: <%= ENV['DB_NAME'] %>
16 | username: <%= ENV['DB_USER'] %>
17 | password: <%= ENV['DB_PASS'] %>
18 | host: <%= ENV['DB_HOST'] %>
19 |
20 | development:
21 | <<: *default
22 |
23 | # Warning: The database defined as "test" will be erased and
24 | # re-generated from your development database when you run "rake".
25 | # Do not set this db to the same as development or production.
26 | test:
27 | database: flux-tests
28 | <<: *default
29 |
30 | production:
31 | <<: *default
32 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/doorkeeper.css.scss:
--------------------------------------------------------------------------------
1 | .doorkeeper-layout{
2 | background: #ecf0f1;
3 | height: 100%;
4 | width: 100%;
5 | .centered-contents{
6 | margin: auto;
7 | position: absolute;
8 | top: 0; left: 0; bottom: 0; right: 0;
9 | //width: 100%;
10 | max-width: 400px;
11 | max-height: 300px;
12 | }
13 | .actions.right{
14 | form{float: left;}
15 | }
16 | .text-info{
17 | color: #e74c3c;
18 | }
19 | .button{
20 | font-size: 15px;
21 | margin-top: 8px;
22 | }
23 | .button.white{
24 | margin-top: 7px;
25 | margin-left: 10px;
26 | padding: 5px 10px;
27 |
28 | }
29 |
30 | .login-title{
31 | text-align: center;
32 | height: 90px;
33 | }
34 |
35 | main{
36 | border-bottom: solid 1px #cccccc;
37 | padding-bottom: 50px;
38 | overflow: hidden;
39 | }
40 | }
41 | .button.white{
42 | background: #FFFFFF;
43 | color: #e74c3c;
44 | border: solid 1px #cccccc;
45 | }
--------------------------------------------------------------------------------
/lib/omniauth/strategies/fluxapp.rb:
--------------------------------------------------------------------------------
1 | module OmniAuth
2 | module Strategies
3 | class Fluxapp < OmniAuth::Strategies::OAuth2
4 | # change the class name and the :name option to match your application name
5 | option :name, :fluxapp
6 |
7 | option :client_options, {
8 | :site => "http://192.168.1.19:3000",
9 | :authorize_url => "/oauth/authorize"
10 | }
11 |
12 | uid { raw_info["id"] }
13 |
14 | info do
15 | {
16 | :email => raw_info["email"],
17 | :name => raw_info["name"],
18 | :nickname => raw_info["nickname"]
19 | # and anything else you want to return to your API consumers
20 | }
21 | end
22 |
23 | #def callback_phase
24 | # p params['code']
25 | #end
26 |
27 | def raw_info
28 | @raw_info ||= access_token.get('/api/v1/me.json').parsed
29 | end
30 | end
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/app/views/reports/excel_report.xls.erb:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | <%= @titles.each do |t| %>
11 |
12 | <%= t %>
13 | |
14 | <% end %>
15 |
16 | <% @fields.each do |f| %>
17 |
18 | <% f.each do |val| %>
19 |
20 | <%= val %>
21 | |
22 | <% end %>
23 |
24 | <% end %>
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/views/tasks/_completion.erb:
--------------------------------------------------------------------------------
1 |
2 | <% if task.status == 'completed' %>
3 |
Completed on <%= task.completed_on.strftime('%d/%m/%Y %H:%M') %>
4 | <% else %>
5 | <%= form_for :task, :url => completion_task_path(task.id), :remote => true do |f| %>
6 |
7 |
8 |
9 |
10 | Done
11 | <%= f.text_field :completed_on, :value => Time.now.strftime('%d/%m/%Y %H:%M'), :class => 'right' %>
12 | <%= f.label :completed_on, :class => 'right inline' %>
13 |
14 |
15 |
16 |
17 |
18 | <% end %>
19 | <% end %>
20 |
--------------------------------------------------------------------------------
/app/views/objectives/_okr.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Sl no
5 | Objective
6 | Key results
7 |
8 |
9 |
10 | <% @objectives.each_with_index do |o, i| %>
11 |
12 | <%= i+1 %>
13 | <%= o.name %>
14 |
15 | <% o.key_results.each_with_index do |kr, j| %>
16 | <%= "#{j+1}. #{kr.name}" %>
17 | <% unless j ==0 %>
18 |
19 | <% end %>
20 |
21 | <% end %>
22 |
23 |
24 |
25 | <% end %>
26 |
27 |
28 |
29 | <%= link_to 'New OKR', new_user_objective_path(:user_id => @user.id, :start_date => @start_date, :end_date => @end_date) %>
--------------------------------------------------------------------------------
/app/views/tasks/_task_page.erb:
--------------------------------------------------------------------------------
1 | <% @tasks.each do |task| %>
2 | <%= link_to task_path(task),:remote=>true do %>
3 |
4 |
5 | <%= task.name %>
6 |
7 |
8 | <%= task.time_to_end %>
9 |
10 | <%= raw("
") if task.user_id == current_user.id %>
11 | <%= raw("
") if task.user_ids.include?(current_user.id) %>
12 | <%= raw("
#{task.priority}
") %>
13 |
14 |
15 |
16 | <%= task.team.name %>
17 |
18 |
19 | <% end %>
20 | <% end %>
--------------------------------------------------------------------------------
/app/views/work_logs/create.js.erb:
--------------------------------------------------------------------------------
1 | <% if @work_log.present? && @work_log.id.present? %>
2 | $('.pane3').html("<%= escape_javascript(render :partial => 'work_logs/show') %>")
3 | $('.date-card.date-<%= @work_log.date.to_s %> .entries ul').append('<%= link_to "#{@work_log.task.try(&:name)}(#{@work_log.hours})", work_log_path(@work_log), :remote => true %> ')
4 | $('.alert-area').notify({message: { text: "Log added successfully" }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 30000 }}).show();
5 | <% else %>
6 | <% unless @entries.empty? %>
7 | $('.pane3').html("<%= escape_javascript(render :partial => 'work_logs/form') %>")
8 | <% else %>
9 | $('.alert-area').notify({message: { text: '<%= "You have no task assigned for #{@date.strftime('%d %B %Y')}" %>' }, type: 'tracker-alert', fadeOut: { enabled: true, delay: 10000 }}).show();
10 | <% end %>
11 | <% end %>
12 | $(document).foundation({
13 | tab: {
14 | callback: function (tab) {
15 | }
16 | }
17 | });
18 | window.location = '#pane3'
--------------------------------------------------------------------------------
/app/views/tasks/_sub_task.erb:
--------------------------------------------------------------------------------
1 |
2 | Subtask
3 | <%= count %>:
4 | <%= link_to task.name,task_path(task) %>
5 |
6 |
7 |
Added by
8 |
<%= task.user.name %>
9 | on
10 |
<%= task.created_at.strftime('%d %B %Y') %>
11 |
12 | Priority: <%= task.priority %>
13 |
14 |
15 |
16 |
17 |
Start date
18 |
<%= task.start_date.strftime('%d %B %Y') %>
19 | End date
20 |
<%= task.end_date.strftime('%d %B %Y') %>
21 |
22 |
23 |
24 |
Assigned to
25 |
26 | <% task.users.each_with_index do |u, i| %>
27 | <%= link_to u.name, user_path(u) %>
28 | <%= i+1 != task.users.count ? "," : '' %>
29 | <% end %>
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/views/tasks/_completed_task_page.erb:
--------------------------------------------------------------------------------
1 | <% if @fin_tasks.present? %>
2 | <% @fin_tasks.each do |task| %>
3 | <%= link_to task_path(task),:remote=>true do %>
4 |
5 |
6 | <%= task.name %>
7 |
8 |
9 | <%= task.time_to_end %>
10 |
11 | <%= raw("
") if task.user_id == current_user.id %>
12 | <%= raw("
") if task.user_ids.include?(current_user.id) %>
13 | <%= raw("
#{task.priority}
") %>
14 |
15 |
16 |
17 | <%= task.team.name %>
18 |
19 |
20 | <% end %>
21 | <% end %>
22 | <% end %>
--------------------------------------------------------------------------------
/app/views/users/_user_index.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 | <% if can? :manage, User %>
6 | <%= link_to 'Add user', new_user_path, :remote => false, :class => 'dashed_link transition' %>
7 | <% end %>
8 | <% @users.each do |user| %>
9 |
10 |
11 |
12 | <%= link_to image_tag(user.image.icon, :class => 'rounded_pic pic48'), user_path(user) %>
13 |
14 |
15 | <%= link_to user.name, user_path(user), :class => 'name' %>
16 |
17 | <%= link_to raw("(#{user.nickname})"), user_path(user), :class => 'nickname' %>
18 |
19 | <% if can? :edit, user %>
20 |
21 | <%= link_to 'OKR', user_okrs_path(user) %>
22 |
23 | <% end %>
24 |
25 |
26 | <% end %>
27 |
--------------------------------------------------------------------------------
/app/views/objectives/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for(@objective, :data => {:abide => true}) do |f| %>
2 |
3 | <%= f.label :name %>
4 |
5 | <%= f.text_field :name,:required=>true %>
6 |
7 |
8 | <%= f.label :start_date %>
9 |
10 | <%= f.text_field :start_date %>
11 |
12 |
13 | <%= f.label :end_date %>
14 |
15 | <%= f.text_field :end_date %>
16 |
17 | Tasks
18 |
19 | <%= f.fields_for :key_results do |kr| %>
20 | <%= render 'key_result_fields', :f => kr %>
21 | <% end %>
22 |
23 | <%= link_to_add_association 'add task', f, :key_results %>
24 |
25 |
26 | <%= f.submit %>
27 | <% end %>
28 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/views/tasks/_task_listings.erb:
--------------------------------------------------------------------------------
1 |
2 | <% @tasks.each do |task| %>
3 | <%= link_to task_path(task),:remote=>true do %>
4 |
5 |
6 | <%= task.name %>
7 |
8 |
9 | <%= task.time_to_end %>
10 |
11 | <%= raw("
") if task.user_id == current_user.id %>
12 | <%= raw("
") if task.user_ids.include?(current_user.id) %>
13 | <%= raw("
#{task.priority}
") %>
14 |
15 |
16 |
17 | <%= task.team.name %>
18 |
19 |
20 | <% end %>
21 | <% end %>
22 |
23 |
--------------------------------------------------------------------------------
/Dockerfile.development:
--------------------------------------------------------------------------------
1 | FROM phusion/baseimage:0.9.19
2 | MAINTAINER Halisson Vitor
3 |
4 | # Use baseimage-docker's init system.
5 | CMD ["/sbin/my_init"]
6 |
7 | ENV LANGUAGE en_US.UTF-8
8 |
9 | # Install os dependencies
10 | RUN apt-add-repository ppa:brightbox/ruby-ng
11 | RUN apt-get update
12 | RUN apt-get upgrade -y
13 | RUN apt-get install -y nodejs \
14 | ruby2.1 \
15 | ruby2.1-dev \
16 | build-essential \
17 | curl \
18 | zlib1g-dev \
19 | libssl-dev \
20 | libreadline-dev \
21 | libyaml-dev \
22 | libxml2-dev \
23 | libxslt-dev \
24 | libpq-dev \
25 | git python-virtualenv \
26 | libmysqlclient-dev \
27 | libmagickwand-dev \
28 | gnuplot \
29 | imagemagick-doc \
30 | imagemagick \
31 | wkhtmltopdf
32 |
33 | RUN gem install bundler
34 |
35 | ENV APP_HOME /share
36 | RUN mkdir $APP_HOME
37 | WORKDIR $APP_HOME
38 |
39 | ADD Gemfile* $APP_HOME/
40 | RUN bundle install
41 |
42 | ADD . $APP_HOME
43 |
44 | # Clean up APT when done.
45 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
46 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/okrs.css.scss:
--------------------------------------------------------------------------------
1 | // Place all the styles related to the okrs controller here.
2 | // They will automatically be included in application.css.
3 | // You can use Sass (SCSS) here: http://sass-lang.com/
4 | .field{width: 100%;}
5 | .field-half{width: 48%;float: left;margin-right: 1%;}
6 |
7 | .objective-set{
8 | border: solid 1px #cccccc;
9 | margin: 20px 45px;
10 | }
11 |
12 |
13 | .okr-form{
14 | .links{
15 | margin: 20px 45px;
16 | }
17 | .nested-title{
18 | margin: 20px 45px 0px;
19 | }
20 | }
21 |
22 | .remove-links{
23 | a{
24 | color: #fff;
25 | background: url('/assets/iconsprite.png') no-repeat -32px -30px;
26 | height: 16px;
27 | width: 16px;
28 | display: inline-block;
29 | // margin: 10px 0px 0px 10px;
30 | margin: 10px 0px 0px 0px;
31 | }
32 |
33 | }
34 |
35 | .pane-2-selector{
36 | margin-top: -11px;
37 | }
38 | ol.objectives{
39 | //list-style-type:lower-alpha
40 | }
41 | ol.key_results{
42 | list-style-type:lower-alpha
43 | }
44 |
45 | .okr-details{
46 | line-height: 1.8em;
47 | .name{font-weight: bold;}
48 | .period{font-size: 0.8em}
49 | }
--------------------------------------------------------------------------------
/app/views/key_results/index.html.erb:
--------------------------------------------------------------------------------
1 | Listing key_results
2 |
3 |
4 |
5 |
6 | Name
7 | User
8 | Objective
9 | Author
10 | Start date
11 | End date
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | <% @key_results.each do |key_result| %>
20 |
21 | <%= key_result.name %>
22 | <%= key_result.user_id %>
23 | <%= key_result.objective_id %>
24 | <%= key_result.author_id %>
25 | <%= key_result.start_date %>
26 | <%= key_result.end_date %>
27 | <%= link_to 'Show', key_result %>
28 | <%= link_to 'Edit', edit_key_result_path(key_result) %>
29 | <%= link_to 'Destroy', key_result, method: :delete, data: { confirm: 'Are you sure?' } %>
30 |
31 | <% end %>
32 |
33 |
34 |
35 |
36 |
37 | <%= link_to 'New Key result', new_key_result_path %>
38 |
--------------------------------------------------------------------------------
/app/views/work_logs/index.html.erb:
--------------------------------------------------------------------------------
1 | Listing work_logs
2 |
3 |
4 |
5 |
6 | User
7 | Name
8 | Task
9 | Start time
10 | End time
11 | Is deleted
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | <% @work_logs.each do |work_log| %>
20 |
21 | <%= work_log.user_id %>
22 | <%= work_log.name %>
23 | <%= work_log.task %>
24 | <%= work_log.start_time %>
25 | <%= work_log.end_time %>
26 | <%= work_log.is_deleted %>
27 | <%= link_to 'Show', work_log %>
28 | <%= link_to 'Edit', edit_work_log_path(work_log) %>
29 | <%= link_to 'Destroy', work_log, method: :delete, data: { confirm: 'Are you sure?' } %>
30 |
31 | <% end %>
32 |
33 |
34 |
35 |
36 |
37 | <%= link_to 'New Work log', new_work_log_path %>
38 |
--------------------------------------------------------------------------------
/app/assets/javascripts/projects.js.coffee:
--------------------------------------------------------------------------------
1 | # Place all the behaviors and hooks related to the matching controller here.
2 | # All this logic will automatically be available in application.js.
3 | # You can use CoffeeScript in this file: http://coffeescript.org/
4 |
5 | #$(document).on "page:change", ->
6 | # alert "page has loaded!"
7 |
8 | $(document).on "page:change", ->
9 | $(document).foundation();
10 | $('select').not('.select_add').select2({'width':'100%'});
11 | # $('.select_add').multiSelect({});
12 | $('.time-field').timepicker({ 'step': 15 });
13 | $('.date-input').datetimepicker();
14 | $('.date-only-input').datetimepicker({timepicker:false,format:'Y-m-d'});
15 | $('textarea').autosize();
16 | # $('.dates-input').fdatetimepicker({
17 | # weekStart: 1,
18 | # todayHighlight: true,
19 | # autoclose: true
20 | # })
21 | $('.month-calendar-field').fdatepicker({'show','weekStart':0}).on "changeDate", (ev) ->
22 | $.get("/calendar/day.js?date="+ev.date.getFullYear()+'-'+("0" + (ev.date.getMonth() + 1)).slice(-2)+'-'+("0" + ev.date.getDate()).slice(-2));
23 | # $(".sortable-table").tablesorter();
24 |
25 | $(document).foundation tab:
26 | callback: (tab) ->
--------------------------------------------------------------------------------
/app/views/objectives/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Objectives
4 |
5 |
6 |
7 |
8 | <%= form_for(:okr, :url => {:controller => 'objectives', :action => 'index'},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
9 |
10 | <%= label_tag :user_id, "Employee" %>
11 | <%= select_tag('user_id', options_for_select(@users.map { |x| [x.name, x.id] }, @user.id)) %>
12 |
13 |
14 | Go
15 |
16 |
17 | <%= text_field_tag 'end_date', @end_date, :class => 'date-only-input' %>
18 | <%= text_field_tag 'start_date', @start_date, :class => 'date-only-input' %>
19 |
20 |
21 | Go
22 |
23 |
24 | <% end %>
25 |
26 |
27 |
28 | <%= render :partial => 'objectives/okr' %>
29 |
30 |
--------------------------------------------------------------------------------
/app/views/calendar/monthly.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 |
5 | <%#= text_field_tag('test', '', {:class => 'month-calendar-field'}) %>
6 | <% end %>
7 |
8 |
9 |
10 | <%#= (Date::ABBR_DAYNAMES+['Sun'])[x+1].to_s.upcase %>
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/views/okrs/_okrs.erb:
--------------------------------------------------------------------------------
1 |
13 |
14 | <% if can? :cru, Okr, @user %>
15 | <%= link_to 'New OKR', new_user_okr_path(@user), :class => "dashed_link transition" %>
16 | <% end %>
17 | <% @okrs.each do |okr| %>
18 | <%= link_to user_okr_path(@user, okr) do %>
19 |
20 |
<%= okr.name %>
21 |
22 |
23 |
<%= "#{okr.start_date.strftime("%d %B %Y")} - #{okr.end_date.strftime("%d %B %Y")}" %>
24 |
25 | <% end %>
26 | <% end %>
27 |
28 |
--------------------------------------------------------------------------------
/app/views/projects/_project_list.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 | <% if can? :create, Project %>
6 | <%= link_to 'Create department', new_project_path, :remote => false, :class => 'dashed_link transition' %>
7 | <% end %>
8 | <% projects = Project.active if projects.nil? %>
9 | <% projects.each do |project| %>
10 | <%= link_to project_path(project), :remote => false do %>
11 |
12 |
13 | <%= image_tag(project.image.icon) %>
14 |
15 |
16 |
<%= project.name %>
17 |
18 | <%= "#{project.team_count} #{'team'.pluralize(project.team_count)}" %>
19 | <%= "#{project.member_count} #{'member'.pluralize(project.member_count)}" %>
20 |
21 |
22 | <%= project.website %>
23 |
24 |
25 |
26 | <% end %>
27 | <% end %>
28 |
--------------------------------------------------------------------------------
/app/views/bootstrapped/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for @project, :html => { :class => 'form-horizontal' } do |f| %>
2 |
3 | <%= f.label :name, :class => 'control-label' %>
4 |
5 | <%= f.text_field :name, :class => 'text_field' %>
6 |
7 |
8 |
9 | <%= f.label :code, :class => 'control-label' %>
10 |
11 | <%= f.text_field :code, :class => 'text_field' %>
12 |
13 |
14 |
15 | <%= f.label :description, :class => 'control-label' %>
16 |
17 | <%= f.text_field :description, :class => 'text_field' %>
18 |
19 |
20 |
21 | <%= f.label :is_deleted, :class => 'control-label' %>
22 |
23 | <%= f.text_field :is_deleted, :class => 'text_field' %>
24 |
25 |
26 |
27 |
28 | <%= f.submit nil, :class => 'btn btn-primary' %>
29 | <%= link_to t('.cancel', :default => t("helpers.links.cancel")),
30 | projects_path, :class => 'btn' %>
31 |
32 | <% end %>
33 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/applications/show.html.erb:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
Application Id:
8 |
9 |
<%= @application.uid %>
10 |
11 |
Secret:
12 |
13 |
<%= @application.secret %>
14 |
15 |
Callback urls:
16 |
17 |
18 | <% @application.redirect_uri.split.each do |uri| %>
19 |
20 |
21 | <%= uri %>
22 |
23 |
24 | <%= link_to 'Authorize', oauth_authorization_path(:client_id => @application.uid, :redirect_uri => uri, :response_type => 'code'), class: 'btn btn-success', target: '_blank' %>
25 |
26 |
27 | <% end %>
28 |
29 |
30 |
31 |
32 |
Actions
33 |
34 |
<%= link_to 'Edit', edit_oauth_application_path(@application), class: 'btn btn-primary' %>
35 |
36 |
<%= render 'delete_form', application: @application, submit_btn_css: 'btn btn-danger' %>
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/views/key_results/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for(@key_result) do |f| %>
2 | <% if @key_result.errors.any? %>
3 |
4 |
<%= pluralize(@key_result.errors.count, "error") %> prohibited this key_result from being saved:
5 |
6 |
7 | <% @key_result.errors.full_messages.each do |msg| %>
8 | <%= msg %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
14 |
15 | <%= f.label :name %>
16 | <%= f.text_area :name %>
17 |
18 |
19 | <%= f.label :user_id %>
20 | <%= f.number_field :user_id %>
21 |
22 |
23 | <%= f.label :objective_id %>
24 | <%= f.number_field :objective_id %>
25 |
26 |
27 | <%= f.label :author_id %>
28 | <%= f.number_field :author_id %>
29 |
30 |
31 | <%= f.label :start_date %>
32 | <%= f.date_select :start_date %>
33 |
34 |
35 | <%= f.label :end_date %>
36 | <%= f.date_select :end_date %>
37 |
38 |
39 | <%= f.submit %>
40 |
41 | <% end %>
42 |
--------------------------------------------------------------------------------
/app/controllers/users/omniauth_callbacks_controller.rb:
--------------------------------------------------------------------------------
1 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
2 | def google_oauth2
3 | # You need to implement the method below in your model (e.g. app/models/user.rb)
4 | @user = User.find_for_google_oauth2(request.env["omniauth.auth"], current_user)
5 |
6 | if @user.present? && @user.persisted?
7 | flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Google"
8 | sign_in_and_redirect @user, :event => :authentication
9 | else
10 | session["devise.google_data"] = request.env["omniauth.auth"]
11 | redirect_to new_user_session_path, :alert=> 'No user account is associated with this email'
12 | end
13 | end
14 |
15 | def fluxapp
16 | @user = User.find_by_email(request.env["omniauth.auth"].info.email)
17 | if @user.present? && @user.persisted?
18 | flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Flux"
19 | sign_in_and_redirect @user, :event => :authentication
20 | else
21 | #session["devise.google_data"] = request.env["omniauth.auth"]
22 | redirect_to new_user_session_path, :alert=> 'No user account is associated with this email'
23 | end
24 | end
25 | end
--------------------------------------------------------------------------------
/app/views/devise/shared/_links.erb:
--------------------------------------------------------------------------------
1 | <%- if controller_name != 'sessions' %>
2 | <%= link_to "Sign in", new_session_path(resource_name) %>
3 | <% end -%>
4 |
5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end -%>
8 |
9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end -%>
12 |
13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end -%>
16 |
17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end -%>
20 |
21 | <%#- if devise_mapping.omniauthable? %>
22 | <%#- resource_class.omniauth_providers.each do |provider| %>
23 | <%#= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
24 | <%# end -%>
25 | <%# end -%>
26 |
--------------------------------------------------------------------------------
/lib/tasks/refresh_counts.rake:
--------------------------------------------------------------------------------
1 | namespace :tracker do
2 | desc "Update counts"
3 | task :update_counts => :environment do
4 | logger = Logger.new('log/count_update.log')
5 | logger.info "------------------------------- #{Date.today.strftime('%d-%m-%Y')} --------------------------------"
6 | logger.info "--------------------------- Processing user ----------------------------"
7 | User.all.each do |user|
8 | user.admin_teams_count = user.admin_teams.count
9 | user.admin_projects_count = user.projects.count
10 | user.save
11 | end
12 | logger.info "--------------------------- Processing project ----------------------------"
13 | Project.all.each do |project|
14 | project.team_count = project.teams.active.count
15 | project.member_count = project.project_members.active.count
16 | project.save
17 | end
18 | logger.info "--------------------------- Processing team ----------------------------"
19 | Team.all.each do |team|
20 | team.members_count = team.users.active.count
21 | team.managers_count = team.team_leads.active.count
22 | team.save
23 | end
24 | logger.info "***************************************************************************"
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/app/views/teams/_team_index.erb:
--------------------------------------------------------------------------------
1 |
4 | <% assignables = Team.assignable_by_user(current_user).collect(&:id) %>
5 |
6 | <%# if defined? project %>
7 | <%#= link_to 'New team', new_project_team_path(project), :remote => false, :class => 'dashed_link transition' %>
8 | <%# else %>
9 | <%#= link_to 'New team', new_team_path, :remote => false, :class => 'dashed_link transition' %>
10 | <%# end %>
11 | <% teams.each do |team| %>
12 |
13 |
14 | <%= link_to team.name, team_path(team), :class => 'grey-link' %>
15 |
16 |
17 | <%= "#{team.members_count} #{'Member'.pluralize(team.members_count)}" %>
18 |
19 |
20 | <%= link_to team.project.name, project_path(team.project_id), :class => 'team-project' %>
21 | <% if assignables.include?(team.id) %>
22 | <%= link_to 'Add task', new_task_path(:team_id => team.id), :remote => false, :class => 'btn btn-sec right' %>
23 | <% end %>
24 |
25 |
26 | <% end %>
27 |
--------------------------------------------------------------------------------
/lib/time_to_diff.rb:
--------------------------------------------------------------------------------
1 | require 'active_support/inflections'
2 | module TimeExtenstions
3 |
4 | def max_diff
5 | if Time.now >= self
6 | delta = Time.now - self
7 | value = 0
8 | ['year', 'month', 'day', 'hour', 'minute', 'second'].each do |x|
9 | quo = delta.to_i / 1.send(x)
10 | value = quo.to_i.to_s+" "+x.pluralize(quo)+' ago' if (quo >= 1 && value == 0)
11 | end
12 | return value == 0 ? 'Just now' : value
13 | else
14 | return self.strftime('%d-%m-%Y %H:%M')
15 | end
16 | end
17 | end
18 |
19 | module DateExtenstions
20 |
21 | def to_quarters
22 | date = self
23 | qs = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]] #qs - quarters
24 | q = qs[(date.month - 1) / 3] #q - quarter
25 | unless q == [10, 11, 12]
26 | ["#{date.year}-#{q[0]}-1".to_date, ("#{date.year}-#{q[2]+1}-1".to_date - 1.days)]
27 | else
28 | ["#{date.year}-#{q[0]}-1".to_date, ("#{date.year}-#{12}-31".to_date)]
29 | end
30 | end
31 | end
32 |
33 | module IntExtenstions
34 | def to_duration
35 | return "#{self/60}:#{ '%02d' % (self%60)}"
36 | end
37 | end
38 |
39 | class Time
40 | include TimeExtenstions
41 | end
42 |
43 | class Date
44 | include DateExtenstions
45 | end
46 |
47 | class Fixnum
48 | include IntExtenstions
49 | end
50 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 | Edit <%= resource_name.to_s.humanize %>
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 | <%= f.label :email %>
7 | <%= f.email_field :email, autofocus: true %>
8 |
9 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
10 | Currently waiting confirmation for: <%= resource.unconfirmed_email %>
11 | <% end %>
12 |
13 | <%= f.label :password %> (leave blank if you don't want to change it)
14 | <%= f.password_field :password, autocomplete: "off" %>
15 |
16 | <%= f.label :password_confirmation %>
17 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
18 |
19 | <%= f.label :current_password %> (we need your current password to confirm your changes)
20 | <%= f.password_field :current_password, autocomplete: "off" %>
21 |
22 | <%= f.submit "Update" %>
23 | <% end %>
24 |
25 | Cancel my account
26 |
27 | Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
28 |
29 | <%= link_to "Back", :back %>
30 |
--------------------------------------------------------------------------------
/app/views/reports/employee_day.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | <%= form_for(:report, :url => {:controller=>'reports',:action=>'employee_day'},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
14 |
15 | <%= select_tag('employee_id', options_for_select(@users.map { |x| [x.name, x.id] }, @user.id)) %>
16 |
17 |
18 |
19 | Go
20 |
21 |
22 | <%= text_field_tag 'start_date', @date, :class => 'date-only-input' %>
23 |
24 |
25 | Go
26 |
27 |
28 |
29 | <% end %>
30 |
31 |
32 | <%= render :partial => 'reports/employee_day' %>
33 |
34 |
--------------------------------------------------------------------------------
/app/views/bootstrapped/show.html.erb:
--------------------------------------------------------------------------------
1 | <%- model_class = Project -%>
2 |
5 |
6 |
7 | <%= model_class.human_attribute_name(:name) %>:
8 | <%= @project.name %>
9 | <%= model_class.human_attribute_name(:code) %>:
10 | <%= @project.code %>
11 | <%= model_class.human_attribute_name(:description) %>:
12 | <%= @project.description %>
13 | <%= model_class.human_attribute_name(:is_deleted) %>:
14 | <%= @project.is_deleted %>
15 |
16 |
17 |
18 | <%= link_to t('.back', :default => t("helpers.links.back")),
19 | projects_path, :class => 'btn' %>
20 | <%= link_to t('.edit', :default => t("helpers.links.edit")),
21 | edit_project_path(@project), :class => 'btn' %>
22 | <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
23 | project_path(@project),
24 | :method => 'delete',
25 | :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
26 | :class => 'btn btn-danger' %>
27 |
28 |
--------------------------------------------------------------------------------
/test/controllers/okrs_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class OkrsControllerTest < ActionController::TestCase
4 | setup do
5 | @okr = okrs(:one)
6 | end
7 |
8 | test "should get index" do
9 | get :index
10 | assert_response :success
11 | assert_not_nil assigns(:okrs)
12 | end
13 |
14 | test "should get new" do
15 | get :new
16 | assert_response :success
17 | end
18 |
19 | test "should create okr" do
20 | assert_difference('Okr.count') do
21 | post :create, okr: { end_date: @okr.end_date, name: @okr.name, start_date: @okr.start_date, user_id: @okr.user_id }
22 | end
23 |
24 | assert_redirected_to okr_path(assigns(:okr))
25 | end
26 |
27 | test "should show okr" do
28 | get :show, id: @okr
29 | assert_response :success
30 | end
31 |
32 | test "should get edit" do
33 | get :edit, id: @okr
34 | assert_response :success
35 | end
36 |
37 | test "should update okr" do
38 | patch :update, id: @okr, okr: { end_date: @okr.end_date, name: @okr.name, start_date: @okr.start_date, user_id: @okr.user_id }
39 | assert_redirected_to okr_path(assigns(:okr))
40 | end
41 |
42 | test "should destroy okr" do
43 | assert_difference('Okr.count', -1) do
44 | delete :destroy, id: @okr
45 | end
46 |
47 | assert_redirected_to okrs_path
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/app/models/team.rb:
--------------------------------------------------------------------------------
1 | class Team < ActiveRecord::Base
2 | belongs_to :project
3 | has_many :team_members
4 | has_many :tasks
5 | has_many :users, :through => :team_members
6 | has_many :okrs, :through => :users
7 | has_many :key_results, :through => :okrs
8 | has_many :leads, -> { where role: 'lead' }, class_name: 'TeamMember'
9 | has_many :team_leads, :through => :leads, :source => :user #,:foreign_key=>'user_id'
10 | has_many :members, -> { uniq }, :through => :team_members, :source => :user
11 |
12 | validates_presence_of :name, :code, :project_id
13 |
14 | default_scope { where.not(is_deleted: true).order("teams.name ASC") }
15 |
16 | scope :active, -> { where(status: 'active') }
17 |
18 | after_save :update_project_team_count
19 |
20 | def update_project_team_count
21 | project.update_attributes(:team_count => project.teams.active.count)
22 | end
23 |
24 | def self.for_user(user)
25 | teams = Team.where("project_id IN (?) OR id IN (?)",user.project_ids,(user.admin_team_ids + user.team_ids).uniq)
26 | end
27 |
28 | def self.admind_by_user(user)
29 | teams = Team.where("project_id IN (?) OR id IN (?)",user.project_ids,user.admin_team_ids.uniq)
30 | end
31 |
32 | def self.assignable_by_user(user)
33 | teams = Team.where(project_id:(user.project_ids+user.admin_teams.collect(&:project_id).uniq))
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/app/models/project.rb:
--------------------------------------------------------------------------------
1 | class Project < ActiveRecord::Base
2 | mount_uploader :image, ImageUploader
3 | has_many :teams
4 | has_many :tasks
5 | has_many :project_managers
6 | has_many :users,:through=>:project_managers,:after_remove => :update_user_project_count
7 | has_many :team_members, :through => :teams
8 | has_many :project_members, -> { uniq }, :through => :team_members, :source => :user
9 | scope :active, -> {where(is_deleted: false)}
10 |
11 | validates_presence_of :name, :code
12 | validates_uniqueness_of :code
13 |
14 | #default_scope where(is_deleted: false)
15 | default_scope{ order("projects.name ASC")}
16 |
17 | #after_save :update_numbers
18 |
19 | def members
20 | return project_members.active.uniq
21 | end
22 |
23 | def update_user_project_count(pm)
24 | pm.update_attributes(:admin_projects_count=>pm.projects.count)
25 | end
26 |
27 | def update_numbers
28 | update_attributes(:team_count=>self.teams.count)
29 | end
30 |
31 | def destroy
32 | if self.update_attribute(:is_deleted, true)
33 | self.teams.update_all(:is_deleted => true)
34 | self.teams.update_all(:is_deleted => true)
35 | self.tasks.update_all(:is_deleted => true)
36 | self.team_members.update_all(:status => 'archived')
37 | self.project_managers.update_all(:status => 'archived')
38 | end
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/app/views/reports/okrs.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Reports
4 | OKR report ▾
5 |
6 | <%= render 'reports/report_types' %>
7 |
8 |
9 |
10 |
11 |
12 |
13 | <%= form_for(:report, :url => {:controller => 'reports', :action => 'okrs'},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
14 |
15 | <%= select_tag('employee_id', options_for_select(@users.map { |x| [x.name, x.id] }, @user.id)) %>
16 |
17 |
18 | Go
19 |
20 |
21 | <%= text_field_tag 'start_date', @start_date, :class => 'date-only-input' %>
22 | <%= text_field_tag 'end_date', @end_date, :class => 'date-only-input' %>
23 |
24 |
25 | Go
26 |
27 |
28 | <% end %>
29 |
30 |
31 | <%= render :partial => 'reports/okr_report' %>
32 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/login.css.scss:
--------------------------------------------------------------------------------
1 |
2 | .login{
3 | text-align: center;
4 | .login-title, .btn-login{
5 | font-family: 'Source Sans Pro', sans-serif;
6 | }
7 |
8 | background: #ecf0f1;
9 | height: 100%;
10 | width: 100%;
11 | .remebrance label{
12 | font-size: 0.8em;
13 | }
14 | .login-title{
15 | color: #e74b3c;
16 | font-size: 2em;
17 | text-align: center;
18 | margin-bottom: 30px;
19 | }
20 | .login-links{
21 | font-size: 0.8em;
22 | a{color: #333333;}
23 | }
24 | .alter{
25 | font-size: 0.8em;
26 | }
27 | .login-fields{
28 | margin: auto;
29 | position: absolute;
30 | top: 0; left: 0; bottom: 0; right: 0;
31 | //width: 100%;
32 | max-width: 600px;
33 | max-height: 300px;
34 | //margin: 0 auto;
35 | }
36 | .set{overflow: hidden;}
37 | .field{
38 | width: 40% ;
39 | min-width: 200px;
40 | input{
41 | border-radius: 3px;
42 | }
43 | }
44 | .field-login{
45 | width: 14%;
46 | .btn-login{
47 | width: 100%;
48 | text-align: center;
49 | color: #333333;
50 | border: solid 1px #e74b3c;
51 | padding: 7px 0;
52 | background: none;
53 | border-radius: 3px;
54 | }
55 | }
56 | .field,.field-login{
57 | float: left;
58 | //.input-field{
59 | margin-left: 1%;
60 | margin-right: 1%;
61 | //}
62 | }
63 | }
--------------------------------------------------------------------------------
/app/views/devise/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
2 |
3 |
4 |
5 |
6 |
7 | <%= f.email_field :email, autofocus: true, :placeholder => 'Email', :class => 'login-field' %>
8 |
9 |
10 |
11 | <%= f.password_field :password, autocomplete: "off", :placeholder => 'Password', :class => 'login-field' %>
12 |
13 |
14 | Login
15 |
16 |
17 |
18 |
19 | <% if devise_mapping.rememberable? -%>
20 | <%= f.check_box :remember_me %> <%= f.label :remember_me %>
21 | <% end -%>
22 |
23 |
24 | <%#= render "devise/shared/links" %>
25 |
26 |
27 |
28 |
29 |
30 | Or sign in using
31 | <%= link_to 'Google account',user_omniauth_authorize_path(:google_oauth2) %>
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | <%#= f.submit "Sign in" %>
40 | <% end %>
41 |
42 |
--------------------------------------------------------------------------------
/app/views/okrs/_objective_fields.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
21 |
22 |
23 |
24 | <%#= f.label :start_date %>
25 | <%#= f.text_field :start_date %>
26 |
27 |
28 | <%#= f.label :end_date %>
29 | <%#= f.text_field :end_date %>
30 |
31 |
32 |
33 | Key results:
34 |
35 |
36 | <%= f.fields_for :key_results do |kr| %>
37 | <%= render 'key_result_fields', :f => kr %>
38 | <% end %>
39 |
40 | <%= link_to_add_association 'Add key result', f, :key_results %>
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/views/reports/employee_range.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | <%= form_for(:report, :url => {:controller => 'reports', :action => 'employee_range'},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
14 |
15 | <%= select_tag('employee_id', options_for_select(@users.map { |x| [x.name, x.id] }, @user.id)) %>
16 |
17 |
18 | Go
19 |
20 |
21 | <%= text_field_tag 'start_date', @start_date, :class => 'date-only-input' %>
22 | <%= text_field_tag 'end_date', @end_date, :class => 'date-only-input' %>
23 |
24 |
25 | Go
26 |
27 |
28 | <% end %>
29 |
30 |
31 | <%= render :partial => 'reports/employee_range' %>
32 |
--------------------------------------------------------------------------------
/app/views/reports/employee_tasks.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | <%= form_for(:report, :url => {:controller => 'reports', :action => 'employee_tasks',:task_id=>@task.id},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
14 |
15 | <%= select_tag('user_id', options_for_select(@users.map { |x| [x.name, x.id] }, @user.id)) %>
16 |
17 |
18 | Go
19 |
20 |
21 | <%= text_field_tag 'start_date', @start_date, :class => 'date-only-input' %>
22 | <%= text_field_tag 'end_date', @end_date, :class => 'date-only-input' %>
23 |
24 |
25 | Go
26 |
27 |
28 | <% end %>
29 |
30 |
31 | <%= render :partial => 'reports/employee_tasks' %>
32 |
--------------------------------------------------------------------------------
/app/views/users/_password_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for(@user, :url => {:controller => 'users', :action => 'change_password'},:method=>'post', :html => {:class => 'form-horizontal', :multipart => true, :data => {:abide => true}}) do |f| %>
2 | <% if @user.errors.any? %>
3 |
4 | <% @user.errors.full_messages.each do |msg| %>
5 |
<%= msg %>
6 | <% end %>
7 |
8 |
9 | <% end %>
10 |
11 | <% if current_user == @user %>
12 |
13 |
14 | <%= build_field('user', 'password', 'Password', 'password', @user.password) %>
15 | <%= build_field('user', 'password_confirmation', 'Confirm password', 'password', @user.password_confirmation) %>
16 |
17 |
18 | <% end %>
19 |
20 |
21 |
29 | <% end %>
30 |
--------------------------------------------------------------------------------
/app/views/calendar/_week.erb:
--------------------------------------------------------------------------------
1 |
2 | <% (@start_date..@end_date).to_a.reverse.each do |date| %>
3 |
4 | <% unless date == Date.today %>
5 | <%= link_to date.strftime('%A %d %B %Y'), calendar_day_path(:date => date.to_s), :remote => true, :class => 'cal-date' %>
6 | <% else %>
7 | <%= link_to 'Today', calendar_day_path(:date => date.to_s), :remote => true, :class => 'cal-date' %>
8 | <% end %>
9 | <% if date <= Date.today && date >= 5.days.ago %>
10 | <%= link_to 'Add log', new_work_log_path(:date => date), :remote => true, :class => 'btn btn-sec right' %>
11 | <% end %>
12 |
13 |
14 | <% @entry_hash[date].each do |e| %>
15 |
16 | <%= link_to "#{e.task.try(&:name)}(#{e.hours})", work_log_path(e), :remote => true %>
17 |
18 | <% end %>
19 |
20 |
21 |
22 | <% end %>
23 |
24 |
25 | <%= link_to calendar_week_path(:date => @start_date-7.days), :remote => true do %>
26 |
27 | <% end %>
28 | <%= link_to calendar_week_path(:date => @end_date+1.days), :remote => true do %>
29 |
30 | <% end %>
31 |
--------------------------------------------------------------------------------
/app/assets/javascripts/datetimepicker.jquery.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "datetimepicker",
3 | "version": "2.1.9",
4 | "title": "jQuery Date and Time picker",
5 | "description": "jQuery plugin for date, time, or datetime manipulation in form",
6 | "keywords": [
7 | "calendar",
8 | "date",
9 | "time",
10 | "form",
11 | "datetime",
12 | "datepicker",
13 | "timepicker",
14 | "datetimepicker",
15 | "validation",
16 | "ui",
17 | "scroller",
18 | "picker",
19 | "i18n",
20 | "input",
21 | "jquery",
22 | "touch"
23 | ],
24 | "author": {
25 | "name": "Chupurnov Valeriy",
26 | "email": "chupurnov@gmail.com",
27 | "url": "http://xdsoft.net/contacts.html"
28 | },
29 | "maintainers": [{
30 | "name": "Chupurnov Valeriy",
31 | "email": "chupurnov@gmail.com",
32 | "url": "http://xdsoft.net"
33 | }],
34 | "licenses": [
35 | {
36 | "type": "MIT",
37 | "url": "https://github.com/xdan/datetimepicker/blob/master/MIT-LICENSE.txt"
38 | }
39 | ],
40 | "bugs": "https://github.com/xdan/datetimepicker/issues",
41 | "homepage": "http://xdsoft.net/jqplugins/datetimepicker/",
42 | "docs": "http://xdsoft.net/jqplugins/datetimepicker/",
43 | "download": "https://github.com/xdan/datetimepicker/archive/master.zip",
44 | "dependencies": {
45 | "jquery": ">=1.7"
46 | }
47 | }
--------------------------------------------------------------------------------
/app/views/layouts/login.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <%= content_for?(:title) ? yield(:title) : "Fluxday" %>
7 |
8 |
9 |
10 | <%= stylesheet_link_tag "application" %>
11 | <%= javascript_include_tag "vendor/modernizr",:async=>true %>
12 | <%= csrf_meta_tags %>
13 | <%= javascript_include_tag "application", "data-turbolinks-track" => true,:async=>true %>
14 |
15 |
16 |
17 |
18 |
19 |
20 | <%= yield %>
21 |
22 |
23 |
24 |
25 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/test/controllers/projects_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ProjectsControllerTest < ActionController::TestCase
4 | setup do
5 | @project = projects(:one)
6 | end
7 |
8 | test "should get index" do
9 | get :index
10 | assert_response :success
11 | assert_not_nil assigns(:projects)
12 | end
13 |
14 | test "should get new" do
15 | get :new
16 | assert_response :success
17 | end
18 |
19 | test "should create project" do
20 | assert_difference('Project.count') do
21 | post :create, project: { code: @project.code, description: @project.description, is_deleted: @project.is_deleted, name: @project.name }
22 | end
23 |
24 | assert_redirected_to project_path(assigns(:project))
25 | end
26 |
27 | test "should show project" do
28 | get :show, id: @project
29 | assert_response :success
30 | end
31 |
32 | test "should get edit" do
33 | get :edit, id: @project
34 | assert_response :success
35 | end
36 |
37 | test "should update project" do
38 | patch :update, id: @project, project: { code: @project.code, description: @project.description, is_deleted: @project.is_deleted, name: @project.name }
39 | assert_redirected_to project_path(assigns(:project))
40 | end
41 |
42 | test "should destroy project" do
43 | assert_difference('Project.count', -1) do
44 | delete :destroy, id: @project
45 | end
46 |
47 | assert_redirected_to projects_path
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/test/controllers/comments_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class CommentsControllerTest < ActionController::TestCase
4 | setup do
5 | @comment = comments(:one)
6 | end
7 |
8 | test "should get index" do
9 | get :index
10 | assert_response :success
11 | assert_not_nil assigns(:comments)
12 | end
13 |
14 | test "should get new" do
15 | get :new
16 | assert_response :success
17 | end
18 |
19 | test "should create comment" do
20 | assert_difference('Comment.count') do
21 | post :create, comment: { body: @comment.body, source_id: @comment.source_id, source_type: @comment.source_type, user_id: @comment.user_id }
22 | end
23 |
24 | assert_redirected_to comment_path(assigns(:comment))
25 | end
26 |
27 | test "should show comment" do
28 | get :show, id: @comment
29 | assert_response :success
30 | end
31 |
32 | test "should get edit" do
33 | get :edit, id: @comment
34 | assert_response :success
35 | end
36 |
37 | test "should update comment" do
38 | patch :update, id: @comment, comment: { body: @comment.body, source_id: @comment.source_id, source_type: @comment.source_type, user_id: @comment.user_id }
39 | assert_redirected_to comment_path(assigns(:comment))
40 | end
41 |
42 | test "should destroy comment" do
43 | assert_difference('Comment.count', -1) do
44 | delete :destroy, id: @comment
45 | end
46 |
47 | assert_redirected_to comments_path
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/app/views/doorkeeper/authorizations/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Authorization required
9 |
10 |
11 | Allow <%= @pre_auth.client.name %> to use your account?
12 |
13 |
14 |
15 | <%= form_tag oauth_authorization_path, :method => :post do %>
16 | <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
17 | <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
18 | <%= hidden_field_tag :state, @pre_auth.state %>
19 | <%= hidden_field_tag :response_type, @pre_auth.response_type %>
20 | <%= hidden_field_tag :scope, @pre_auth.scope %>
21 | <%= submit_tag "Allow", :class => "button alert left" %>
22 | <% end %>
23 | <%= form_tag oauth_authorization_path, :method => :delete do %>
24 | <%= hidden_field_tag :client_id, @pre_auth.client.uid %>
25 | <%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
26 | <%= hidden_field_tag :state, @pre_auth.state %>
27 | <%= hidden_field_tag :response_type, @pre_auth.response_type %>
28 | <%= hidden_field_tag :scope, @pre_auth.scope %>
29 | <%= submit_tag "Deny", :class => "button white left" %>
30 | <% end %>
31 |
32 |
33 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
We're sorry, but something went wrong.
54 |
55 | If you are the application owner check the logs for more information.
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/views/reports/employees_daily.html.erb:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | <%= form_for(:report, :url => {:controller => 'reports', :action => 'employees_daily'},:method=>:get,:remote=>true, :class => 'employee_daily_report_form') do %>
14 |
15 | <%= select_tag 'report[type]', options_for_select(@opts, @report_type), :class => 'report_type_select' %>
16 |
17 |
18 |
19 |
20 |
21 | Go
22 |
23 |
24 | <%= text_field_tag 'report[date]', @date, :class => 'date-only-input' %>
25 |
26 |
27 | Go
28 |
29 | <% end %>
30 |
31 |
32 |
33 | <%= render :partial => 'reports/employee_daily' %>
34 |
35 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | AppConfig = YAML.load_file("#{::Rails.root}/config/app_config.yml")[::Rails.env]
2 | Fluxday::Application.configure do
3 | # Settings specified here will take precedence over those in config/application.rb.
4 |
5 | # In the development environment your application's code is reloaded on
6 | # every request. This slows down response time but is perfect for development
7 | # since you don't have to restart the web server when you make code changes.
8 | config.cache_classes = false
9 |
10 | # Do not eager load code on boot.
11 | config.eager_load = false
12 |
13 | # Show full error reports and disable caching.
14 | config.consider_all_requests_local = true
15 | config.action_controller.perform_caching = false
16 |
17 | # Don't care if the mailer can't send.
18 | config.action_mailer.raise_delivery_errors = false
19 |
20 | # Print deprecation notices to the Rails logger.
21 | config.active_support.deprecation = :log
22 |
23 | # Raise an error on page load if there are pending migrations
24 | config.active_record.migration_error = :page_load
25 |
26 | # Debug mode disables concatenation and preprocessing of assets.
27 | # This option may cause significant delays in view rendering with a large
28 | # number of complex assets.
29 | config.assets.debug = true
30 | config.action_controller.permit_all_parameters = true
31 | config.action_mailer.default_url_options = { host: 'localhost:3000' }
32 |
33 | config.to_prepare do
34 | Devise::SessionsController.layout "login"
35 | end
36 |
37 | end
38 |
--------------------------------------------------------------------------------
/app/views/home/dashboard.html.erb:
--------------------------------------------------------------------------------
1 | <%= content_for :pane2 do %>
2 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | <%= render :partial => 'calendar/week' %>
31 |
32 |
33 |
34 |
37 |
38 | <%= render :partial => 'work_logs/logs' %>
39 |
40 |
41 |
42 |
43 |
44 | <% end %>
45 | <%= render :partial => 'calendar/day', :locals => {:date => @date, :entries => @entries} %>
46 |
--------------------------------------------------------------------------------
/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require jquery
14 | //= require jquery_ujs
15 | //= require foundation
16 | //= require turbolinks
17 | //= require jquery.turbolinks
18 | //= require bootstrap-notify
19 | //= require select2
20 | //= require cocoon
21 | //= require_tree .
22 |
23 | $(function(){ $(document).foundation(); });
24 |
25 |
26 | function infiniteScroll() {
27 | if ($('.scroll-loop').size() > 0) {
28 | return $('.scroll2watch').on('scroll', function (e) {
29 | var load_more_url;
30 | load_more_url = $(e.target).find('a.next_page').attr('href');
31 | if (load_more_url && $(e.target).find('.paginator').height() - $(e.target).closest('.scroll2watch').scrollTop() - 60 < $(e.target).closest('.scroll2watch').height()) {
32 | $(e.target).find('.pagination').html('loading...');
33 | $.getScript(load_more_url);
34 | }
35 | return;
36 | });
37 | }
38 | }
--------------------------------------------------------------------------------
/db/migrate/20140314051737_devise_create_users.rb:
--------------------------------------------------------------------------------
1 | class DeviseCreateUsers < ActiveRecord::Migration
2 | def change
3 | create_table(:users) do |t|
4 | ## Database authenticatable
5 | t.string :email, :null => false, :default => ""
6 | t.string :encrypted_password, :null => false, :default => ""
7 |
8 | ## Recoverable
9 | t.string :reset_password_token
10 | t.datetime :reset_password_sent_at
11 |
12 | ## Rememberable
13 | t.datetime :remember_created_at
14 |
15 | ## Trackable
16 | t.integer :sign_in_count, :default => 0, :null => false
17 | t.datetime :current_sign_in_at
18 | t.datetime :last_sign_in_at
19 | t.string :current_sign_in_ip
20 | t.string :last_sign_in_ip
21 |
22 | ## Confirmable
23 | # t.string :confirmation_token
24 | # t.datetime :confirmed_at
25 | # t.datetime :confirmation_sent_at
26 | # t.string :unconfirmed_email # Only if using reconfirmable
27 |
28 | ## Lockable
29 | # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts
30 | # t.string :unlock_token # Only if unlock strategy is :email or :both
31 | # t.datetime :locked_at
32 |
33 |
34 | t.timestamps
35 | end
36 |
37 | add_index :users, :email, :unique => true
38 | add_index :users, :reset_password_token, :unique => true
39 | # add_index :users, :confirmation_token, :unique => true
40 | # add_index :users, :unlock_token, :unique => true
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
The change you wanted was rejected.
54 |
Maybe you tried to change something you didn't have access to.
55 |
56 | If you are the application owner check the logs for more information.
57 |
58 |
59 |
--------------------------------------------------------------------------------
/test/controllers/objectives_controller_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class ObjectivesControllerTest < ActionController::TestCase
4 | setup do
5 | @objective = objectives(:one)
6 | end
7 |
8 | test "should get index" do
9 | get :index
10 | assert_response :success
11 | assert_not_nil assigns(:objectives)
12 | end
13 |
14 | test "should get new" do
15 | get :new
16 | assert_response :success
17 | end
18 |
19 | test "should create objective" do
20 | assert_difference('Objective.count') do
21 | post :create, objective: { author_id: @objective.author_id, end_date: @objective.end_date, name: @objective.name, start_date: @objective.start_date, user_id: @objective.user_id }
22 | end
23 |
24 | assert_redirected_to objective_path(assigns(:objective))
25 | end
26 |
27 | test "should show objective" do
28 | get :show, id: @objective
29 | assert_response :success
30 | end
31 |
32 | test "should get edit" do
33 | get :edit, id: @objective
34 | assert_response :success
35 | end
36 |
37 | test "should update objective" do
38 | patch :update, id: @objective, objective: { author_id: @objective.author_id, end_date: @objective.end_date, name: @objective.name, start_date: @objective.start_date, user_id: @objective.user_id }
39 | assert_redirected_to objective_path(assigns(:objective))
40 | end
41 |
42 | test "should destroy objective" do
43 | assert_difference('Objective.count', -1) do
44 | delete :destroy, id: @objective
45 | end
46 |
47 | assert_redirected_to objectives_path
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/app/controllers/calendar_controller.rb:
--------------------------------------------------------------------------------
1 | class CalendarController < ApplicationController
2 | def index
3 | end
4 |
5 | def day
6 | unless params[:date].present?
7 | @date = Date.today
8 | else
9 | @date = params[:date].to_date
10 | end
11 | @entries = current_user.assigned_and_written_tasks.where('start_date <= ? && end_date >= ?',@date.end_of_day,@date.beginning_of_day)
12 | @work_logs = current_user.work_logs.find_all_by_date(@date)
13 | end
14 |
15 | def week
16 | unless params[:date].present?
17 | @start_date = Date.today - 6.days#.beginning_of_week
18 | @end_date = @start_date+6.days#.end_of_week
19 | else
20 | date = params[:date].to_date
21 | @start_date = date#.beginning_of_week
22 | @end_date = date+6.days#.end_of_week
23 | end
24 | @entry_hash={}
25 | entries = current_user.work_logs.where('date <= ? && date >= ?', @end_date.end_of_day, @start_date.beginning_of_day)
26 | (@start_date..@end_date).each do |dt|
27 | @entry_hash[dt] = entries.where('date <= ? && date >= ?', dt.end_of_day, dt.beginning_of_day)
28 | end
29 |
30 |
31 | end
32 |
33 | def monthly
34 | unless params[:date].present?
35 | @start_date = Date.today.beginning_of_month
36 | @end_date = Date.today.end_of_month
37 | else
38 | date = params[:date].to_date
39 | @start_date = date.beginning_of_month
40 | @end_date = date.end_of_month
41 | end
42 | @prev_month = @start_date.beginning_of_week..(@start_date-1)
43 | @next_month = (@end_date+1)..@end_date.end_of_week
44 | end
45 | end
46 |
--------------------------------------------------------------------------------
/app/views/reports/_day_log.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= "Worklogs of #{@user.name} for #{@date.strftime("%d %B %Y")}" %>
3 |
4 |
5 |
6 | <%= link_to "PDF", current_url(:format => :pdf), :target => "_blank" %>
7 | <%= link_to "CSV", current_url(:format => :csv), :target => "_blank" %>
8 | <%= link_to "Excel", current_url(:format => :xls), :target => "_blank" %>
9 |
10 |
11 |
12 |
13 | Task
14 | Duration
15 | Description
16 | Actions
17 |
18 |
19 | <% @work_logs.each do |log| %>
20 |
21 | <%= log.task.name %>
22 | <%= log.minutes.to_duration %>
23 | <%= log.description %>
24 | <% if @current_user.id == @user.id and log.delete_request == false and log.date < 4.days.ago%>
25 | <%= link_to 'Reqest Removal', delete_request_work_log_path(log), :method => :post, :confirm => 'Are you sure you want to request for removal of this log?' %>
26 | <%elsif @current_user.manager? and log.delete_request == true%>
27 | <%= link_to 'Delete', work_log_path(log), :method => :delete, :confirm => 'Are you sure you want to remove this log?' %> | <%= link_to 'Ignore', ignore_request_work_log_path(log), :method => :post, :confirm => 'Are you sure you want to ignore this request?' %>
28 | <%else%>
29 | -
30 | <%end%>
31 |
32 | <% end %>
33 |
34 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
48 |
49 |
50 |
51 |
52 |
53 |
The page you were looking for doesn't exist.
54 |
You may have mistyped the address or the page may have moved.
55 |
56 | If you are the application owner check the logs for more information.
57 |
58 |
59 |
--------------------------------------------------------------------------------