tawork 0.0.11 → 0.0.12
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 +8 -8
- data/.gitignore +1 -0
- data/app/assets/javascripts/backbone/views/page.js.coffee +30 -2
- data/app/controllers/home_controller.rb +1 -1
- data/app/controllers/wiki/pages_controller.rb +13 -0
- data/app/models/starred.rb +4 -0
- data/app/models/user.rb +5 -0
- data/app/views/home/index.html.haml +13 -3
- data/app/views/layouts/_spaces.html.haml +8 -3
- data/app/views/public_activity/page/_attachment.html.haml +4 -0
- data/app/views/public_activity/page/_created.html.haml +4 -0
- data/app/views/public_activity/page/_reorder.html.haml +2 -0
- data/app/views/public_activity/page/_update_details.html.haml +4 -0
- data/app/views/wiki/pages/_last_updated.html.haml +1 -1
- data/app/views/wiki/pages/_page_header.html.haml +7 -0
- data/app/views/wiki/pages/index.html.haml +20 -12
- data/config/initializers/config.rb +1 -1
- data/config/locales/en.yml +3 -0
- data/config/routes.rb +2 -1
- data/db/migrate/20140313052226_create_starreds.rb +10 -0
- data/db/schema.rb +11 -1
- data/lib/tawork/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
M2RjYWIzYTExZmMwMTM4YjYzMWNiZTNhZTMxNWM4MjRhMmZmNDJjOA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
OTQ4ODZiNWFlN2I3MDMxMjJmZWUwOGUyMDJhNzdiYTUzZDNjN2IzMA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Mzk2NmU0MzdmMzJhMzk0NGUxODBlMTgyYmNlYTUwZDQ0ZGI4YWVjZjE2MzNk
|
|
10
|
+
MWM1MjJiN2ViYjNhZDNkMWNmYjMyNDRjZDIwZTllMTcyYTUyNmViOTdlM2Qz
|
|
11
|
+
ZmU0OGE5NDIyYzI5OGYwYzhlOTg4ZWNmNzBkMWRiNDI1YWMzZDQ=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
OGUzOTEzYzU2MjJjMGIyZWRhZDc0YzRjZGY5YmJhNGY1ODIzYTRiMzk3NTE0
|
|
14
|
+
N2M5M2NlNTBmYWRiZjI5YmRhNTEzMjZlMDUzYTczODgxYmRiMzFlN2E4MWRm
|
|
15
|
+
NGRhZjQyZjBiMGU4YTg5YThhODczODVhNTkxYjk1ZmE2ODg2ZGY=
|
data/.gitignore
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
class Tawork.Views.PageView extends Backbone.View
|
|
2
|
-
events:
|
|
2
|
+
events:
|
|
3
|
+
'click a.star': 'starred'
|
|
3
4
|
|
|
4
5
|
initialize: (options = {}) ->
|
|
5
6
|
@page_id = @$el.data("page-id")
|
|
@@ -72,5 +73,32 @@ class Tawork.Views.PageView extends Backbone.View
|
|
|
72
73
|
)
|
|
73
74
|
|
|
74
75
|
uploader.init()
|
|
75
|
-
|
|
76
|
+
|
|
77
|
+
starred: (event) ->
|
|
78
|
+
$star = $(event.target).closest("a.star")
|
|
79
|
+
$icon = $star.find("i.fa")
|
|
80
|
+
$.blockUI(message: "")
|
|
81
|
+
|
|
82
|
+
if $icon.hasClass("fa-star-o")
|
|
83
|
+
star = true
|
|
84
|
+
else
|
|
85
|
+
star = false
|
|
86
|
+
|
|
87
|
+
$.ajax
|
|
88
|
+
type: $star.data("type")
|
|
89
|
+
url: $star.data("url")
|
|
90
|
+
data:
|
|
91
|
+
to_star: star
|
|
92
|
+
success: (data) ->
|
|
93
|
+
if $icon.hasClass("fa-star-o")
|
|
94
|
+
$icon.removeClass("fa-star-o")
|
|
95
|
+
$icon.addClass("fa-star")
|
|
96
|
+
else
|
|
97
|
+
$icon.removeClass("fa-star")
|
|
98
|
+
$icon.addClass("fa-star-o")
|
|
99
|
+
complete: ->
|
|
100
|
+
$.unblockUI()
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
false
|
|
76
104
|
|
|
@@ -92,6 +92,19 @@ class Wiki::PagesController < ApplicationController
|
|
|
92
92
|
render partial: 'subpages_dropdown'
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
+
def star
|
|
96
|
+
starred = Starred.where(user_id: current_user.id, starrable_id: @page, starrable_type: @page.class).first
|
|
97
|
+
|
|
98
|
+
if starred && params[:to_star] == "false"
|
|
99
|
+
starred.destroy
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if !starred && params[:to_star] == "true"
|
|
103
|
+
Starred.create(user: current_user, starrable: @page)
|
|
104
|
+
end
|
|
105
|
+
render json: {}
|
|
106
|
+
end
|
|
107
|
+
|
|
95
108
|
protected
|
|
96
109
|
def load_page
|
|
97
110
|
@page = Page.find(params[:id]) if params[:id]
|
data/app/models/user.rb
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
.col-md-9
|
|
2
|
+
%h3 Recent Changes
|
|
3
|
+
%table.table
|
|
4
|
+
- @activities.each do |activity|
|
|
5
|
+
%tr
|
|
6
|
+
%td
|
|
7
|
+
= activity.render(self, layout: :activity_wrapper)
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
%
|
|
9
|
+
.col-md-3
|
|
10
|
+
%h3 Starred Pages
|
|
11
|
+
%ul.list-unstyled
|
|
12
|
+
- Starred.where(user: current_user, starrable_type: 'Page').each do |starred|
|
|
13
|
+
%li
|
|
14
|
+
= link_to starred.starrable.title, wiki_page_path(starred.starrable)
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
= link_to wiki_pages_path, class: "space-link" do
|
|
4
4
|
All Spaces
|
|
5
5
|
%i.fa.fa-arrow-circle-right
|
|
6
|
+
%li.divider
|
|
7
|
+
|
|
6
8
|
- if @space.present? && @space.persisted?
|
|
7
9
|
%li.nav-header
|
|
8
10
|
= @space.title
|
|
@@ -13,9 +15,12 @@
|
|
|
13
15
|
-# - if page.has_children?
|
|
14
16
|
-# %i.fa.fa-plus-square
|
|
15
17
|
-# = page.title
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
- else
|
|
19
|
+
- Page.roots.each do |page|
|
|
20
|
+
= render 'wiki/spaces/page_list_item', page: page, end_page: @page
|
|
21
|
+
-# %li
|
|
22
|
+
-# = link_to new_wiki_space_path do
|
|
23
|
+
-# %i.fa.fa-plus
|
|
19
24
|
|
|
20
25
|
:coffeescript
|
|
21
26
|
$ ->
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
%span Last updated by
|
|
4
4
|
.user= @last_updated.owner.display_name
|
|
5
5
|
\-
|
|
6
|
-
.time{data: {timestamp: @last_updated.created_at}}= timeago_tag @last_updated.created_at, date_only: false
|
|
6
|
+
.time{data: {timestamp: @last_updated.created_at}}= timeago_tag @last_updated.created_at, date_only: false, format: :casual
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
%li
|
|
3
3
|
%a.edit{href: "#", data: {toggle: "tooltip", placement: "top"}, title: "Edit"}
|
|
4
4
|
%i.fa.fa-edit
|
|
5
|
+
|
|
6
|
+
%li
|
|
7
|
+
%a.star{href: "#", data: {type: "POST", url: star_wiki_page_path(@page), toggle: "tooltip", placement: "top"}, title: "Star"}
|
|
8
|
+
- if current_user.starred?(@page)
|
|
9
|
+
%i.fa.fa-star
|
|
10
|
+
- else
|
|
11
|
+
%i.fa.fa-star-o
|
|
5
12
|
%li
|
|
6
13
|
%a.save{href: "#", data: {type: "PUT", url: wiki_page_path(@page), toggle: "tooltip", placement: "top"}, title: "Save", style: "display: none;"}
|
|
7
14
|
%i.fa.fa-save
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
.col-md-9
|
|
2
|
+
%h3 Wiki Sitemap (Two levels)
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
- @roots.each do |node|
|
|
5
|
-
%li
|
|
6
|
-
= link_to node.title, wiki_page_path(node), class: "space-link"
|
|
4
|
+
= link_to "New Space", new_wiki_space_path, class: "btn btn-primary"
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
= child.title
|
|
13
|
-
- if child.has_children?
|
|
14
|
-
%i.fa.fa-arrow-circle-right
|
|
6
|
+
%ul.nav.nav-list
|
|
7
|
+
- @roots.each do |node|
|
|
8
|
+
%li
|
|
9
|
+
= link_to node.title, wiki_page_path(node), class: "space-link"
|
|
15
10
|
|
|
11
|
+
%ul.nav-list-sub
|
|
12
|
+
- node.children.each do |child|
|
|
13
|
+
%li
|
|
14
|
+
= link_to wiki_page_path(child) do
|
|
15
|
+
= child.title
|
|
16
|
+
- if child.has_children?
|
|
17
|
+
%i.fa.fa-arrow-circle-right
|
|
16
18
|
|
|
19
|
+
.col-md-3
|
|
20
|
+
%h3 Starred Pages
|
|
21
|
+
%ul.list-unstyled
|
|
22
|
+
- Starred.where(user: current_user, starrable_type: 'Page').each do |starred|
|
|
23
|
+
%li
|
|
24
|
+
= link_to starred.starrable.title, wiki_page_path(starred.starrable)
|
data/config/locales/en.yml
CHANGED
data/config/routes.rb
CHANGED
|
@@ -4,7 +4,7 @@ Rails.application.class.routes.draw do
|
|
|
4
4
|
devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
root '
|
|
7
|
+
root 'home#index'
|
|
8
8
|
get 'sink/index' #=> "sink#index"
|
|
9
9
|
get 'sink/components' #=> "sink#components"
|
|
10
10
|
|
|
@@ -22,6 +22,7 @@ Rails.application.class.routes.draw do
|
|
|
22
22
|
get :combined
|
|
23
23
|
get :history
|
|
24
24
|
post :reorder
|
|
25
|
+
post :star
|
|
25
26
|
|
|
26
27
|
post :attach
|
|
27
28
|
end
|
data/db/schema.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
|
13
13
|
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
|
14
|
+
ActiveRecord::Schema.define(version: 20140313052226) do
|
|
15
15
|
|
|
16
16
|
create_table "activities", force: true do |t|
|
|
17
17
|
t.integer "trackable_id"
|
|
@@ -77,6 +77,16 @@ ActiveRecord::Schema.define(version: 20140120030547) do
|
|
|
77
77
|
|
|
78
78
|
add_index "pages", ["creator_id"], name: "index_pages_on_creator_id", using: :btree
|
|
79
79
|
|
|
80
|
+
create_table "starreds", force: true do |t|
|
|
81
|
+
t.integer "starrable_id"
|
|
82
|
+
t.string "starrable_type"
|
|
83
|
+
t.integer "user_id"
|
|
84
|
+
t.datetime "created_at"
|
|
85
|
+
t.datetime "updated_at"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
add_index "starreds", ["user_id"], name: "index_starreds_on_user_id", using: :btree
|
|
89
|
+
|
|
80
90
|
create_table "story_details", force: true do |t|
|
|
81
91
|
t.integer "ticket_id"
|
|
82
92
|
t.string "who"
|
data/lib/tawork/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tawork
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adnan Ali
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -86,6 +86,7 @@ files:
|
|
|
86
86
|
- app/models/page.rb
|
|
87
87
|
- app/models/project.rb
|
|
88
88
|
- app/models/space.rb
|
|
89
|
+
- app/models/starred.rb
|
|
89
90
|
- app/models/story.rb
|
|
90
91
|
- app/models/story_detail.rb
|
|
91
92
|
- app/models/task.rb
|
|
@@ -115,6 +116,10 @@ files:
|
|
|
115
116
|
- app/views/layouts/minimal.html.haml
|
|
116
117
|
- app/views/projects/index.html.haml
|
|
117
118
|
- app/views/projects/new.html.haml
|
|
119
|
+
- app/views/public_activity/page/_attachment.html.haml
|
|
120
|
+
- app/views/public_activity/page/_created.html.haml
|
|
121
|
+
- app/views/public_activity/page/_reorder.html.haml
|
|
122
|
+
- app/views/public_activity/page/_update_details.html.haml
|
|
118
123
|
- app/views/public_activity/ticket/_assignment.html.haml
|
|
119
124
|
- app/views/public_activity/ticket/_create_comment.html.haml
|
|
120
125
|
- app/views/public_activity/ticket/_created.html.haml
|
|
@@ -206,6 +211,7 @@ files:
|
|
|
206
211
|
- db/migrate/20140109235844_create_pages.rb
|
|
207
212
|
- db/migrate/20140112004346_create_attachments.rb
|
|
208
213
|
- db/migrate/20140120030547_add_name_to_users.rb
|
|
214
|
+
- db/migrate/20140313052226_create_starreds.rb
|
|
209
215
|
- db/schema.rb
|
|
210
216
|
- db/seeds.rb
|
|
211
217
|
- init.rb
|
|
@@ -298,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
304
|
version: '0'
|
|
299
305
|
requirements: []
|
|
300
306
|
rubyforge_project:
|
|
301
|
-
rubygems_version: 2.
|
|
307
|
+
rubygems_version: 2.2.2
|
|
302
308
|
signing_key:
|
|
303
309
|
specification_version: 4
|
|
304
310
|
summary: Wiki and Tickets
|