tawork 0.0.1

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.
Files changed (239) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.gitignore +16 -0
  4. data/Gemfile +91 -0
  5. data/Gemfile.lock +295 -0
  6. data/MIT-LICENSE +20 -0
  7. data/Procfile +2 -0
  8. data/README.md +1 -0
  9. data/Rakefile +6 -0
  10. data/app/assets/images/.keep +0 -0
  11. data/app/assets/javascripts/application.js +31 -0
  12. data/app/assets/javascripts/backbone/models/.gitkeep +0 -0
  13. data/app/assets/javascripts/backbone/routers/.gitkeep +0 -0
  14. data/app/assets/javascripts/backbone/tawork.js.coffee +11 -0
  15. data/app/assets/javascripts/backbone/templates/.gitkeep +0 -0
  16. data/app/assets/javascripts/backbone/views/.gitkeep +0 -0
  17. data/app/assets/javascripts/backbone/views/page.js.coffee +75 -0
  18. data/app/assets/javascripts/backbone/views/ticket.js.coffee +110 -0
  19. data/app/assets/javascripts/backbone/views/tree_node_page.js.coffee +16 -0
  20. data/app/assets/javascripts/backbone/views/tree_node_ticket.js.coffee +14 -0
  21. data/app/assets/javascripts/wiki/pages.js.coffee +3 -0
  22. data/app/assets/stylesheets/application.css +22 -0
  23. data/app/assets/stylesheets/bootstrap_and_overrides.sass +208 -0
  24. data/app/assets/stylesheets/diff.css +14 -0
  25. data/app/assets/stylesheets/wiki/pages.css.scss +3 -0
  26. data/app/controllers/application_controller.rb +15 -0
  27. data/app/controllers/assignments_controller.rb +30 -0
  28. data/app/controllers/attachments_controller.rb +10 -0
  29. data/app/controllers/comments_controller.rb +24 -0
  30. data/app/controllers/concerns/.keep +0 -0
  31. data/app/controllers/home_controller.rb +7 -0
  32. data/app/controllers/projects_controller.rb +31 -0
  33. data/app/controllers/search_controller.rb +49 -0
  34. data/app/controllers/sink_controller.rb +10 -0
  35. data/app/controllers/tickets_controller.rb +147 -0
  36. data/app/controllers/users/omniauth_callbacks_controller.rb +23 -0
  37. data/app/controllers/wiki/pages_controller.rb +115 -0
  38. data/app/controllers/wiki/spaces_controller.rb +37 -0
  39. data/app/helpers/application_helper.rb +20 -0
  40. data/app/helpers/wiki/pages_helper.rb +2 -0
  41. data/app/inputs/fake_input.rb +6 -0
  42. data/app/mailers/.keep +0 -0
  43. data/app/models/.keep +0 -0
  44. data/app/models/assignment.rb +5 -0
  45. data/app/models/attachment.rb +54 -0
  46. data/app/models/bug.rb +2 -0
  47. data/app/models/comment.rb +6 -0
  48. data/app/models/concerns/.keep +0 -0
  49. data/app/models/page.rb +68 -0
  50. data/app/models/project.rb +2 -0
  51. data/app/models/space.rb +2 -0
  52. data/app/models/story.rb +29 -0
  53. data/app/models/story_detail.rb +3 -0
  54. data/app/models/task.rb +2 -0
  55. data/app/models/ticket.rb +127 -0
  56. data/app/models/user.rb +36 -0
  57. data/app/models/user_verifier.rb +2 -0
  58. data/app/views/comments/_comment.html.haml +6 -0
  59. data/app/views/comments/_form.html.haml +4 -0
  60. data/app/views/comments/create.js.coffee +7 -0
  61. data/app/views/devise/confirmations/new.html.erb +12 -0
  62. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  63. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  64. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  65. data/app/views/devise/passwords/edit.html.erb +16 -0
  66. data/app/views/devise/passwords/new.html.erb +12 -0
  67. data/app/views/devise/registrations/edit.html.erb +29 -0
  68. data/app/views/devise/registrations/new.html.erb +18 -0
  69. data/app/views/devise/sessions/new.html.erb +17 -0
  70. data/app/views/devise/shared/_links.erb +25 -0
  71. data/app/views/devise/unlocks/new.html.erb +12 -0
  72. data/app/views/home/index.html.haml +4 -0
  73. data/app/views/layouts/_activity_wrapper.html.haml +17 -0
  74. data/app/views/layouts/_nav_header.html.haml +26 -0
  75. data/app/views/layouts/_spaces.html.haml +34 -0
  76. data/app/views/layouts/application.html.haml +39 -0
  77. data/app/views/layouts/minimal.html.haml +22 -0
  78. data/app/views/projects/index.html.haml +16 -0
  79. data/app/views/projects/new.html.haml +6 -0
  80. data/app/views/public_activity/ticket/_assignment.html.haml +14 -0
  81. data/app/views/public_activity/ticket/_create_comment.html.haml +10 -0
  82. data/app/views/public_activity/ticket/_created.html.haml +3 -0
  83. data/app/views/public_activity/ticket/_reorder.html.haml +2 -0
  84. data/app/views/public_activity/ticket/_state_change.html.haml +2 -0
  85. data/app/views/public_activity/ticket/_update_details.html.haml +13 -0
  86. data/app/views/tickets/_activity.html.haml +3 -0
  87. data/app/views/tickets/_breadcrumb.html.haml +7 -0
  88. data/app/views/tickets/_bug_form.html.haml +1 -0
  89. data/app/views/tickets/_events_dropdown.html.haml +4 -0
  90. data/app/views/tickets/_form.html.haml +28 -0
  91. data/app/views/tickets/_project_form.html.haml +1 -0
  92. data/app/views/tickets/_story_form.html.haml +15 -0
  93. data/app/views/tickets/_task_form.html.haml +8 -0
  94. data/app/views/tickets/_tickets_listing.html.haml +5 -0
  95. data/app/views/tickets/_title_and_description.html.haml +8 -0
  96. data/app/views/tickets/_tree_node.html.haml +28 -0
  97. data/app/views/tickets/assignment.js.coffee +3 -0
  98. data/app/views/tickets/create.js.coffee +7 -0
  99. data/app/views/tickets/new.html.haml +1 -0
  100. data/app/views/tickets/show.html.haml +64 -0
  101. data/app/views/tickets/trigger_event.js.coffee +12 -0
  102. data/app/views/tickets/update.js.coffee +12 -0
  103. data/app/views/wiki/pages/_attachment.html.haml +5 -0
  104. data/app/views/wiki/pages/_attachments.html.haml +22 -0
  105. data/app/views/wiki/pages/_breadcrumb.html.haml +9 -0
  106. data/app/views/wiki/pages/_child_menu.html.haml +9 -0
  107. data/app/views/wiki/pages/_display.html.haml +138 -0
  108. data/app/views/wiki/pages/_page_header.html.haml +13 -0
  109. data/app/views/wiki/pages/_subpages_dropdown.html.haml +6 -0
  110. data/app/views/wiki/pages/_subtree.html.haml +7 -0
  111. data/app/views/wiki/pages/_tree_node.html.haml +21 -0
  112. data/app/views/wiki/pages/attach.js.coffee +2 -0
  113. data/app/views/wiki/pages/combined.html.haml +8 -0
  114. data/app/views/wiki/pages/create.js.coffee +5 -0
  115. data/app/views/wiki/pages/edit.html.haml +2 -0
  116. data/app/views/wiki/pages/history.html.haml +13 -0
  117. data/app/views/wiki/pages/index.html.haml +2 -0
  118. data/app/views/wiki/pages/new.html.haml +13 -0
  119. data/app/views/wiki/pages/show.html.haml +14 -0
  120. data/app/views/wiki/pages/update.html.haml +2 -0
  121. data/app/views/wiki/spaces/_page_list_item.html.haml +11 -0
  122. data/app/views/wiki/spaces/_space_list.html.haml +4 -0
  123. data/app/views/wiki/spaces/new.html.haml +5 -0
  124. data/app/views/wiki/spaces/space_list.html.haml +1 -0
  125. data/bin/bundle +3 -0
  126. data/bin/rails +4 -0
  127. data/bin/rake +4 -0
  128. data/config/application.rb +30 -0
  129. data/config/boot.rb +4 -0
  130. data/config/database.yml +39 -0
  131. data/config/environment.rb +5 -0
  132. data/config/environments/development.rb +35 -0
  133. data/config/environments/production.rb +80 -0
  134. data/config/environments/test.rb +36 -0
  135. data/config/initializers/backtrace_silencers.rb +7 -0
  136. data/config/initializers/config.rb +4 -0
  137. data/config/initializers/devise.rb +257 -0
  138. data/config/initializers/elasticsearch.rb +9 -0
  139. data/config/initializers/filter_parameter_logging.rb +4 -0
  140. data/config/initializers/gollum.rb +31 -0
  141. data/config/initializers/haml_gfm.rb +66 -0
  142. data/config/initializers/inflections.rb +16 -0
  143. data/config/initializers/mime_types.rb +5 -0
  144. data/config/initializers/secret_token.rb +12 -0
  145. data/config/initializers/session_store.rb +3 -0
  146. data/config/initializers/simple_form.rb +145 -0
  147. data/config/initializers/simple_form_bootstrap.rb +73 -0
  148. data/config/initializers/wrap_parameters.rb +14 -0
  149. data/config/locales/devise.en.yml +59 -0
  150. data/config/locales/en.yml +23 -0
  151. data/config/locales/simple_form.en.yml +26 -0
  152. data/config/routes.rb +101 -0
  153. data/config/tinymce.yml +10 -0
  154. data/config.ru +4 -0
  155. data/db/migrate/20131209041251_create_tickets.rb +13 -0
  156. data/db/migrate/20131210041050_devise_create_users.rb +42 -0
  157. data/db/migrate/20131210043014_add_username_to_users.rb +5 -0
  158. data/db/migrate/20131210045348_add_creator_to_ticket.rb +5 -0
  159. data/db/migrate/20131211034104_create_comments.rb +11 -0
  160. data/db/migrate/20131212073014_create_assignments.rb +12 -0
  161. data/db/migrate/20131215220825_add_position_to_ticket.rb +5 -0
  162. data/db/migrate/20131216044331_create_story_details.rb +12 -0
  163. data/db/migrate/20131218060557_create_activities.rb +23 -0
  164. data/db/migrate/20140109235844_create_pages.rb +14 -0
  165. data/db/migrate/20140112004346_create_attachments.rb +13 -0
  166. data/db/migrate/20140120030547_add_name_to_users.rb +5 -0
  167. data/db/schema.rb +125 -0
  168. data/db/seeds.rb +7 -0
  169. data/init.rb +1 -0
  170. data/lib/assets/.keep +0 -0
  171. data/lib/tasks/.keep +0 -0
  172. data/lib/tawork/engine.rb +13 -0
  173. data/lib/tawork/version.rb +3 -0
  174. data/lib/tawork.rb +4 -0
  175. data/lib/templates/haml/scaffold/_form.html.haml +10 -0
  176. data/lib/ticket_assignment.rb +25 -0
  177. data/log/.keep +0 -0
  178. data/public/401.html +57 -0
  179. data/public/404.html +58 -0
  180. data/public/422.html +58 -0
  181. data/public/500.html +57 -0
  182. data/public/favicon.ico +0 -0
  183. data/public/robots.txt +5 -0
  184. data/tags +279 -0
  185. data/tawork.gemspec +24 -0
  186. data/vendor/.DS_Store +0 -0
  187. data/vendor/assets/.DS_Store +0 -0
  188. data/vendor/assets/javascripts/.keep +0 -0
  189. data/vendor/assets/javascripts/bootstrap-tagsinput.js +503 -0
  190. data/vendor/assets/javascripts/bootstrap-tree.js +15 -0
  191. data/vendor/assets/javascripts/bootstrap-typeahead.js +335 -0
  192. data/vendor/assets/javascripts/hallo.js +2949 -0
  193. data/vendor/assets/javascripts/highlight.pack.js +1 -0
  194. data/vendor/assets/javascripts/jquery.autosize.js +250 -0
  195. data/vendor/assets/javascripts/jquery.mjs.nestedSortable.js +613 -0
  196. data/vendor/assets/javascripts/rangy-core.js +94 -0
  197. data/vendor/assets/javascripts/tinymce/mention/plugin.js +358 -0
  198. data/vendor/assets/stylesheets/.keep +0 -0
  199. data/vendor/assets/stylesheets/bootflat-extensions.css +356 -0
  200. data/vendor/assets/stylesheets/bootflat-square.css +69 -0
  201. data/vendor/assets/stylesheets/bootflat.css +1556 -0
  202. data/vendor/assets/stylesheets/bootstrap-tagsinput.css +45 -0
  203. data/vendor/assets/stylesheets/bootstrap-tree.sass +82 -0
  204. data/vendor/assets/stylesheets/highlight/arta.css +160 -0
  205. data/vendor/assets/stylesheets/highlight/ascetic.css +50 -0
  206. data/vendor/assets/stylesheets/highlight/brown_paper.css +105 -0
  207. data/vendor/assets/stylesheets/highlight/brown_papersq.png +0 -0
  208. data/vendor/assets/stylesheets/highlight/dark.css +105 -0
  209. data/vendor/assets/stylesheets/highlight/default.css +153 -0
  210. data/vendor/assets/stylesheets/highlight/docco.css +132 -0
  211. data/vendor/assets/stylesheets/highlight/far.css +113 -0
  212. data/vendor/assets/stylesheets/highlight/foundation.css +133 -0
  213. data/vendor/assets/stylesheets/highlight/github.css +130 -0
  214. data/vendor/assets/stylesheets/highlight/googlecode.css +146 -0
  215. data/vendor/assets/stylesheets/highlight/idea.css +122 -0
  216. data/vendor/assets/stylesheets/highlight/ir_black.css +105 -0
  217. data/vendor/assets/stylesheets/highlight/magula.css +123 -0
  218. data/vendor/assets/stylesheets/highlight/mono-blue.css +62 -0
  219. data/vendor/assets/stylesheets/highlight/monokai.css +127 -0
  220. data/vendor/assets/stylesheets/highlight/monokai_sublime.css +102 -0
  221. data/vendor/assets/stylesheets/highlight/obsidian.css +154 -0
  222. data/vendor/assets/stylesheets/highlight/pojoaque.css +105 -0
  223. data/vendor/assets/stylesheets/highlight/pojoaque.jpg +0 -0
  224. data/vendor/assets/stylesheets/highlight/railscasts.css +182 -0
  225. data/vendor/assets/stylesheets/highlight/rainbow.css +115 -0
  226. data/vendor/assets/stylesheets/highlight/school_book.css +113 -0
  227. data/vendor/assets/stylesheets/highlight/school_book.png +0 -0
  228. data/vendor/assets/stylesheets/highlight/solarized_dark.css +92 -0
  229. data/vendor/assets/stylesheets/highlight/solarized_light.css +92 -0
  230. data/vendor/assets/stylesheets/highlight/sunburst.css +160 -0
  231. data/vendor/assets/stylesheets/highlight/tomorrow-night-blue.css +52 -0
  232. data/vendor/assets/stylesheets/highlight/tomorrow-night-bright.css +51 -0
  233. data/vendor/assets/stylesheets/highlight/tomorrow-night-eighties.css +51 -0
  234. data/vendor/assets/stylesheets/highlight/tomorrow-night.css +52 -0
  235. data/vendor/assets/stylesheets/highlight/tomorrow.css +49 -0
  236. data/vendor/assets/stylesheets/highlight/vs.css +89 -0
  237. data/vendor/assets/stylesheets/highlight/xcode.css +157 -0
  238. data/vendor/assets/stylesheets/highlight/zenburn.css +117 -0
  239. metadata +299 -0
@@ -0,0 +1,138 @@
1
+ %h1#wiki-title.wiki-title= @page.title
2
+
3
+ #wiki-content.wiki-content.ticket-description
4
+ ~raw @page.body
5
+
6
+ - if params[:markdown].present?
7
+ %textarea#markdown_body{rows: 10, cols: 60}
8
+
9
+ .wiki-actions
10
+
11
+ :coffeescript
12
+ $ ->
13
+ window.enable_edit = enable_edit = ->
14
+ tinymce.init
15
+ selector: "h1.wiki-title"
16
+ inline: true
17
+ toolbar: "undo redo"
18
+ menubar: false
19
+
20
+ tinymce.init
21
+ selector: "div.wiki-content"
22
+ inline: true
23
+ plugins: [
24
+ "autosave advlist autolink lists link image charmap"
25
+ "searchreplace code fullscreen mention"
26
+ "insertdatetime media table contextmenu paste textcolor hr"
27
+ ]
28
+ tools: "inserttable"
29
+ menubar: "edit insert format table tools"
30
+ toolbar: "undo redo | styleselect forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | hr bullist numlist outdent indent | link image"
31
+ style_formats: [
32
+ {title: 'Headers', items: [
33
+ {title: 'Header 1', format: 'h1'},
34
+ {title: 'Header 2', format: 'h2'},
35
+ {title: 'Header 3', format: 'h3'},
36
+ {title: 'Header 4', format: 'h4'},
37
+ {title: 'Header 5', format: 'h5'},
38
+ {title: 'Header 6', format: 'h6'}
39
+ ]},
40
+
41
+ {title: 'Inline', items: [
42
+ {title: 'Bold', icon: 'bold', format: 'bold'},
43
+ {title: 'Italic', icon: 'italic', format: 'italic'},
44
+ {title: 'Underline', icon: 'underline', format: 'underline'},
45
+ {title: 'Strikethrough', icon: 'strikethrough', format: 'strikethrough'},
46
+ {title: 'Superscript', icon: 'superscript', format: 'superscript'},
47
+ {title: 'Subscript', icon: 'subscript', format: 'subscript'},
48
+ {title: 'Code', icon: 'code', format: 'code'}
49
+ ]},
50
+
51
+ {title: 'Blocks', items: [
52
+ {title: 'Paragraph', format: 'p'},
53
+ {title: 'Blockquote', format: 'blockquote'},
54
+ {title: 'Div', format: 'div'},
55
+ {title: 'Pre', format: 'pre'}
56
+ ]},
57
+
58
+ {title: 'Alignment', items: [
59
+ {title: 'Left', icon: 'alignleft', format: 'alignleft'},
60
+ {title: 'Center', icon: 'aligncenter', format: 'aligncenter'},
61
+ {title: 'Right', icon: 'alignright', format: 'alignright'},
62
+ {title: 'Justify', icon: 'alignjustify', format: 'alignjustify'}
63
+ ]},
64
+
65
+ {title: 'Table', items: [
66
+ {title: 'Bordered', selector: 'table', classes: 'table-bordered'}
67
+ {title: 'Striped', selector: 'table', classes: 'table-striped'}
68
+ {title: 'Hover', selector: 'table', classes: 'table-hover'}
69
+ ]},
70
+
71
+ {title: 'Table Row', items: [
72
+ {title: 'Green', selector: 'tr', classes: 'success'}
73
+ {title: 'Yellow', selector: 'tr', classes: 'warning'}
74
+ {title: 'Red', selector: 'tr', classes: 'danger'}
75
+ {title: 'Blue', selector: 'tr', classes: 'active'}
76
+ ]},
77
+
78
+ {title: 'Table Cell', items: [
79
+ {title: 'Green', selector: 'td, th', classes: 'success'}
80
+ {title: 'Yellow', selector: 'td, th', classes: 'warning'}
81
+ {title: 'Red', selector: 'td, th', classes: 'danger'}
82
+ {title: 'Gray', selector: 'td, th', classes: 'active'}
83
+ ]}
84
+
85
+ ]
86
+
87
+ mentions:
88
+ source: (query, delimiter, process) ->
89
+ $.getJSON '/search/mentions?query=' + query + "&delimiter=" + delimiter, (data) ->
90
+ process(data)
91
+ render: (item) ->
92
+ text = item.type + ": " + item.name
93
+ if item.type == "page"
94
+ text = item.type + ": " + item.space + " -> " + item.name
95
+ if item.type == "ticket"
96
+ text = item.type + ": " + item.project + " -> " + item.name
97
+
98
+ return '<li>' +
99
+ '<a href="javascript:;"><span>' + text + '</span></a>' +
100
+ '</li>'
101
+ insert: (item, delimiter) ->
102
+ $html = $("<span>").text(item.name)
103
+ if item.url
104
+ if delimiter == "!"
105
+ $html = $("<img>", "data-mention": item.type, src: item.url)
106
+ else
107
+ $html = $("<a>", "data-mention": item.type, href: item.url).text(item.name)
108
+
109
+ return $html.get(0).outerHTML
110
+ false
111
+
112
+ $(".edit").click ->
113
+ enable_edit()
114
+ $(".save").show()
115
+ $(".edit").hide()
116
+ false
117
+
118
+ $(".save").click ->
119
+ title = tinyMCE.get("wiki-title").getContent()
120
+ body = tinyMCE.get("wiki-content").getContent()
121
+ markdown_body = $("#markdown_body").val()
122
+
123
+ $.ajax
124
+ type: $(this).data("type")
125
+ url: $(this).data("url")
126
+ success: ->
127
+ $(".save").hide()
128
+ $(".edit").show()
129
+ tinyMCE.remove('div');
130
+ data:
131
+ markdown_body: markdown_body
132
+ type: #{@page.type.parameterize.to_json}
133
+ parent_id: #{params[:parent_id].to_json}
134
+ #{@page.type.parameterize}:
135
+ title: title
136
+ body: body
137
+
138
+ false
@@ -0,0 +1,13 @@
1
+ %ul.nav.affix{data: {spy: "affix"}}
2
+ %li
3
+ %a.edit{href: "#", data: {toggle: "tooltip", placement: "top"}, title: "Edit"}
4
+ %i.fa.fa-edit
5
+ %li
6
+ %a.save{href: "#", data: {type: "PUT", url: wiki_page_path(@page), toggle: "tooltip", placement: "top"}, title: "Save", style: "display: none;"}
7
+ %i.fa.fa-save
8
+ %li
9
+ = link_to history_wiki_page_path(@page), data: {toggle: "tooltip", placement: "top"}, title: "History" do
10
+ %i.fa.fa-backward
11
+ %li
12
+ = link_to new_wiki_page_path(parent_id: @page.id), data: {toggle: "tooltip", placement: "top"}, title: "New Subpage" do
13
+ %i.fa.fa-file-text-o
@@ -0,0 +1,6 @@
1
+ %ul.dropdown-menu.subpages-dropdown
2
+ - @page.children.order("position asc").each do |child|
3
+ = render "child_menu", node: child
4
+ %li.divider
5
+ %li
6
+ = link_to "New Page", new_wiki_page_path(parent_id: @page.id)
@@ -0,0 +1,7 @@
1
+ - if @subtree[@page.id].try(:any?)
2
+ %h3 Subpages
3
+ .well{style: "position: relative;"}
4
+ .tree
5
+ %ol{id: "sortable_#{@page.id}"}
6
+ - @subtree[@page.id].sort_by(&:position).each do |page|
7
+ = render 'tree_node', page: page
@@ -0,0 +1,21 @@
1
+ - cache ["tree_node", page] do
2
+ %li.page.tree-node{id: "page_#{page.id}",
3
+ class: "tree-node-#{page.type.underscore}",
4
+ data: {page_id: page.id}}
5
+ .panel.panel-default
6
+ .panel-body{style: "position: relative;"}
7
+ .node-handle.panel-group{class: "node-#{page.type.underscore}"}
8
+ %span.node-toggle
9
+ %i.fa
10
+ -# = page.type
11
+ .node-title
12
+ = link_to page.title, wiki_page_path(page)
13
+
14
+ - if @subtree.present? && @subtree[page.id].try(:any?)
15
+ %ol
16
+ - @subtree[page.id].sort_by(&:position).each do |child|
17
+ = render 'tree_node', page: child
18
+
19
+ :coffeescript
20
+ $ ->
21
+ page_view = new Tawork.Views.TreeNodePageView el: $("#page_#{page.id}").get(0)
@@ -0,0 +1,2 @@
1
+ $(".page[data-page-id=<%= @page.id %>] .attachments").append('<%=j render 'attachment', attachment: @attachment %>')
2
+
@@ -0,0 +1,8 @@
1
+ - @subtree.each do |key, pages|
2
+ - pages.each do |page|
3
+ .page{data: {page_id: page.id}}
4
+ %h1#wiki-title.wiki-title= page.title
5
+
6
+ #wiki-content.wiki-content.ticket-description
7
+ :textile
8
+ #{page.body}
@@ -0,0 +1,5 @@
1
+ <% if @page.errors.any? %>
2
+ console.log <%=raw @page.errors.to_hash.to_json %>
3
+ <% else %>
4
+ window.location = <%=raw wiki_page_path(@page).to_json %>
5
+ <% end %>
@@ -0,0 +1,2 @@
1
+ %h1 Wiki::Pages#edit
2
+ %p Find me in app/views/wiki/pages/edit.html.haml
@@ -0,0 +1,13 @@
1
+ = render 'breadcrumb', link_last: true
2
+
3
+ %h2 History
4
+ - @page.versions.each do |version|
5
+ .media
6
+ - version.diffs.each do |diff|
7
+ %a.pull-left{:href => "#"}
8
+ .media-body
9
+ %h4.media-heading Date: #{version.authored_date}
10
+
11
+ - diffy = Diffy::Diff.new("", "")
12
+ - diffy.instance_variable_set(:@diff, diff.diff)
13
+ =raw Diffy::HtmlFormatter.new(diffy, highlight_words: true, include_plus_and_minus_in_html: true).to_s
@@ -0,0 +1,2 @@
1
+ %h1 Wiki::Pages#index
2
+ %p Find me in app/views/wiki/pages/index.html.haml
@@ -0,0 +1,13 @@
1
+ = render 'breadcrumb', link_last: true, page: Page.find(params[:parent_id])
2
+
3
+ .navbar.navbar-default
4
+ .collapse.navbar-collapse
5
+ %ul.nav.navbar-nav
6
+ %li
7
+ %a.save{href: "#", data: {type: "POST", url: wiki_pages_path}} Save
8
+
9
+ = render 'display'
10
+
11
+ :coffeescript
12
+ $ ->
13
+ window.enable_edit()
@@ -0,0 +1,14 @@
1
+ .page{id: "page_#{@page.id}", data: {page_id: @page.id}}
2
+ = render 'breadcrumb'
3
+ .row
4
+ .col-md-1
5
+ = render 'page_header'
6
+ .col-md-11
7
+ = render 'display'
8
+ = render 'subtree'
9
+ = render 'attachments'
10
+
11
+ :coffeescript
12
+ $ ->
13
+ page_view = new Tawork.Views.PageView el: $("#page_#{@page.id}").get(0)
14
+
@@ -0,0 +1,2 @@
1
+ %h1 Wiki::Pages#update
2
+ %p Find me in app/views/wiki/pages/update.html.haml
@@ -0,0 +1,11 @@
1
+ - end_page ||= Struct.new(:id, :ancestor_ids).new("", [])
2
+ %li.page-list-item{data: {page_id: page.id}, class: "#{'selected' if end_page.id == page.id}"}
3
+ = link_to wiki_page_path(page) do
4
+ - if page.has_children?
5
+ - if end_page.ancestor_ids.include?(page.id)
6
+ %i.fa.fa-minus-square
7
+ - else
8
+ %i.fa.fa-plus-square
9
+ = page.title
10
+ - if end_page.ancestor_ids.include?(page.id)
11
+ = render 'wiki/spaces/space_list', page: page, end_page: end_page
@@ -0,0 +1,4 @@
1
+ - end_page ||= nil
2
+ %ul{class: "#{page.has_children? ? 'nav-list-sub' : 'nav-list'}"}
3
+ - page.children.order("position asc").each do |child|
4
+ = render 'wiki/spaces/page_list_item', page: child, end_page: end_page
@@ -0,0 +1,5 @@
1
+ %h2 New Space
2
+
3
+ = simple_form_for [:wiki, @space] do |f|
4
+ = f.input :title, placeholder: "Title", label: false
5
+ = f.submit class: "btn btn-primary"
@@ -0,0 +1 @@
1
+ = render 'space_list', page: @page
data/bin/bundle ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
data/bin/rails ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
data/bin/rake ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,30 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ # Require the gems listed in Gemfile, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env)
13
+
14
+ module Tawork
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+ config.assets.paths << Rails.root.join("app", "assets", "fonts")
28
+ config.assets.precompile += %w( .svg .eot .woff .ttf )
29
+ end
30
+ end
data/config/boot.rb ADDED
@@ -0,0 +1,4 @@
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'])
@@ -0,0 +1,39 @@
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
+ development:
12
+ adapter: mysql2
13
+ encoding: utf8
14
+ database: tawork_development
15
+ pool: 5
16
+ username: root
17
+ password:
18
+ socket: /tmp/mysql.sock
19
+
20
+ # Warning: The database defined as "test" will be erased and
21
+ # re-generated from your development database when you run "rake".
22
+ # Do not set this db to the same as development or production.
23
+ test:
24
+ adapter: mysql2
25
+ encoding: utf8
26
+ database: tawork_test
27
+ pool: 5
28
+ username: root
29
+ password:
30
+ socket: /tmp/mysql.sock
31
+
32
+ production:
33
+ adapter: mysql2
34
+ encoding: utf8
35
+ database: tawork_production
36
+ pool: 5
37
+ username: root
38
+ password:
39
+ socket: /tmp/mysql.sock
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.class.initialize!
@@ -0,0 +1,35 @@
1
+ Rails.application.class.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+
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
+ config.action_controller.perform_caching = true
17
+
18
+ # Don't care if the mailer can't send.
19
+ config.action_mailer.raise_delivery_errors = false
20
+
21
+ # Print deprecation notices to the Rails logger.
22
+ config.active_support.deprecation = :log
23
+
24
+ # Raise an error on page load if there are pending migrations
25
+ config.active_record.migration_error = :page_load
26
+
27
+ # Debug mode disables concatenation and preprocessing of assets.
28
+ # This option may cause significant delays in view rendering with a large
29
+ # number of complex assets.
30
+ config.assets.debug = false
31
+ config.assets.compress = false
32
+
33
+ # for devise
34
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
35
+ end
@@ -0,0 +1,80 @@
1
+ Rails.application.class.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
37
+
38
+ # Specifies the header that your server uses for sending files.
39
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
+
42
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
+ # config.force_ssl = true
44
+
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
47
+
48
+ # Prepend all log lines with the following tags.
49
+ # config.log_tags = [ :subdomain, :uuid ]
50
+
51
+ # Use a different logger for distributed setups.
52
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53
+
54
+ # Use a different cache store in production.
55
+ # config.cache_store = :mem_cache_store
56
+
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
+ # config.action_controller.asset_host = "http://assets.example.com"
59
+
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
+ # config.assets.precompile += %w( search.js )
63
+
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
+ # config.action_mailer.raise_delivery_errors = false
67
+
68
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
+ # the I18n.default_locale when a translation can not be found).
70
+ config.i18n.fallbacks = true
71
+
72
+ # Send deprecation notices to registered listeners.
73
+ config.active_support.deprecation = :notify
74
+
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
80
+ end
@@ -0,0 +1,36 @@
1
+ Rails.application.class.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ end
@@ -0,0 +1,7 @@
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!
@@ -0,0 +1,4 @@
1
+ config_file = File.join(Rails.root, "config", "tawork.yml")
2
+ TAWORK_CONFIG = File.exist?(config_file) ? YAML.load_file(config_file) : {}
3
+
4
+ TAWORK_CONFIG["git_repo_path"] ||= "./tmp/tawork.git"