tawork 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45af95907997c67f6e436f28a3bb42dba5354d73
4
- data.tar.gz: d00e4a3fef3933d9505834240327800fafeba2aa
3
+ metadata.gz: d20bcb5f3caf86bf4454ac63953b9eae81ab8440
4
+ data.tar.gz: 145edd2aa7872a0e3af18c559531608ea2d26180
5
5
  SHA512:
6
- metadata.gz: 97d83c2a41e1ed1d413f1e1f9f1ee0e566708ce5ccabe9b6a35e63624d9ef7f76d61123504a4f294a253881222e17993e01113a805b4e7c2a721f09f7b169556
7
- data.tar.gz: 204dd559fe16ca45c6c77fc0a8857efc4c79bfa9689ceaeed5651c9bec6315e4dc8549ccd8589ecce6e293c37265523873c21d391e3d6c1adfd17f6860ce4818
6
+ metadata.gz: 0d61ca1bafb6ec81663a7f51a1c5cc50e63de49d95d32a42121aa60500d276e13715f44e3a10682d5bf25f0fdebc156b35715aabf09182f9d9169f4ad8753f84
7
+ data.tar.gz: 144f59ea3d405793093e83f77adaf74920fa72aeb80df0a1f61cab8431c46914f32aefc17a70b4c1cbcb05905fbf4879f5d2e08e27a83f1d8d36907d0f778bc6
data/Gemfile CHANGED
@@ -22,6 +22,7 @@ gem 'public_activity'
22
22
  gem 'diffy'
23
23
  gem 'gollum-lib'
24
24
  gem 'tire'
25
+ gem 'kaminari'
25
26
 
26
27
  gem 'RedCloth'
27
28
  gem 'github-markdown'
data/Gemfile.lock CHANGED
@@ -118,6 +118,9 @@ GEM
118
118
  railties (>= 3.0, < 5.0)
119
119
  thor (>= 0.14, < 2.0)
120
120
  json (1.8.1)
121
+ kaminari (0.15.0)
122
+ actionpack (>= 3.0.0)
123
+ activesupport (>= 3.0.0)
121
124
  kramdown (1.3.1)
122
125
  mail (2.5.4)
123
126
  mime-types (~> 1.16)
@@ -271,6 +274,7 @@ DEPENDENCIES
271
274
  haml-rails
272
275
  jbuilder (~> 1.2)
273
276
  jquery-rails
277
+ kaminari
274
278
  kramdown
275
279
  mysql2
276
280
  omniauth-openid
@@ -0,0 +1,21 @@
1
+ class Work::UsersController < ApplicationController
2
+ before_filter :authenticate_user!
3
+
4
+ def index
5
+ @users = User.all
6
+ end
7
+
8
+ def new
9
+ @user = User.new
10
+ end
11
+
12
+ def create
13
+ @user = User.create(params.require(:user).permit(:name, :email, :password))
14
+
15
+ if @user.errors.any?
16
+ render :new
17
+ else
18
+ redirect_to work_users_path
19
+ end
20
+ end
21
+ end
data/app/models/user.rb CHANGED
@@ -11,6 +11,8 @@ class User < ActiveRecord::Base
11
11
  has_many :tickets, foreign_key: 'creator_id'
12
12
  has_many :projects, foreign_key: 'creator_id', class_name: "Project"
13
13
 
14
+ validates :name, presence: true
15
+
14
16
  def self.find_for_open_id(access_token, signed_in_resource = nil)
15
17
  data = access_token.info
16
18
  name = data["name"]
@@ -23,17 +23,18 @@
23
23
  .container
24
24
  .row
25
25
  .col-md-3
26
- = render 'layouts/spaces'
26
+ - if current_user.present?
27
+ = render 'layouts/spaces'
27
28
 
28
- - if TAWORK_CONFIG["show_projects"].nil? || TAWORK_CONFIG["show_projects"]
29
- %ul.nav.nav-list.nav-list-panel
30
- %li.nav-header
31
- Projects
32
- - Project.all.each do |project|
33
- %li
34
- = link_to project.title, project_path(project)
35
- %li
36
- = link_to new_project_path do
37
- %i.fa.fa-plus
29
+ - if TAWORK_CONFIG["show_projects"].nil? || TAWORK_CONFIG["show_projects"]
30
+ %ul.nav.nav-list.nav-list-panel
31
+ %li.nav-header
32
+ Projects
33
+ - Project.all.each do |project|
34
+ %li
35
+ = link_to project.title, project_path(project)
36
+ %li
37
+ = link_to new_project_path do
38
+ %i.fa.fa-plus
38
39
  .col-md-9
39
40
  = yield
@@ -0,0 +1,12 @@
1
+ %h1 Users
2
+
3
+ %table.table
4
+ %tr
5
+ %th Name
6
+ %th Email
7
+ - @users.each do |user|
8
+ %tr
9
+ %td= user.name
10
+ %td= user.email
11
+
12
+ = link_to "Add User", new_work_user_path, class: 'btn btn-primary'
@@ -0,0 +1,9 @@
1
+ %h1 Create User
2
+
3
+ .col-md-4
4
+ = simple_form_for [:work, @user] do |f|
5
+ = f.input :name
6
+ = f.input :email
7
+ = f.input :password
8
+
9
+ = f.submit nil, class: 'btn btn-primary'
data/config/routes.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  Rails.application.class.routes.draw do
2
2
  # Mercury::Engine.routes
3
- devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
3
+ if !TAWORK_CONFIG['custom_devise_routes']
4
+ devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
5
+ end
4
6
 
5
7
  root 'wiki/pages#index'
6
8
  get 'sink/index' #=> "sink#index"
@@ -9,6 +11,10 @@ Rails.application.class.routes.draw do
9
11
  get 'search/mentions' => "search#mentions"
10
12
 
11
13
  get 'wiki' => "wiki/pages#index"
14
+ namespace :work do
15
+ resources :users, only: [:index, :new, :create]
16
+ end
17
+
12
18
  namespace :wiki do
13
19
  resources :pages do
14
20
  member do
@@ -1,3 +1,3 @@
1
1
  module Tawork
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tawork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adnan Ali
@@ -72,6 +72,7 @@ files:
72
72
  - app/controllers/users/omniauth_callbacks_controller.rb
73
73
  - app/controllers/wiki/pages_controller.rb
74
74
  - app/controllers/wiki/spaces_controller.rb
75
+ - app/controllers/work/users_controller.rb
75
76
  - app/helpers/application_helper.rb
76
77
  - app/helpers/wiki/pages_helper.rb
77
78
  - app/inputs/fake_input.rb
@@ -161,6 +162,8 @@ files:
161
162
  - app/views/wiki/spaces/_space_list.html.haml
162
163
  - app/views/wiki/spaces/new.html.haml
163
164
  - app/views/wiki/spaces/space_list.html.haml
165
+ - app/views/work/users/index.html.haml
166
+ - app/views/work/users/new.html.haml
164
167
  - bin/bundle
165
168
  - bin/rails
166
169
  - bin/rake