tawork 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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,257 @@
1
+ require 'openid/store/filesystem'
2
+
3
+ # Use this hook to configure devise mailer, warden hooks and so forth.
4
+ # Many of these configuration options can be set straight in your model.
5
+ Devise.setup do |config|
6
+ # The secret key used by Devise. Devise uses this key to generate
7
+ # random tokens. Changing this key will render invalid all existing
8
+ # confirmation, reset password and unlock tokens in the database.
9
+ config.secret_key = 'e5d412a3ec72a38faa941b628af1faa764d434fee7b11c7512e588c66f7d5122efbb69686a1e97ed888d65780bca4067ddd7fb7949f2a72253856863bc3a4f46'
10
+
11
+ # ==> Mailer Configuration
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16
+
17
+ # Configure the class responsible to send e-mails.
18
+ # config.mailer = 'Devise::Mailer'
19
+
20
+ # ==> ORM configuration
21
+ # Load and configure the ORM. Supports :active_record (default) and
22
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
+ # available as additional gems.
24
+ require 'devise/orm/active_record'
25
+
26
+ # ==> Configuration for any authentication mechanism
27
+ # Configure which keys are used when authenticating a user. The default is
28
+ # just :email. You can configure it to use [:username, :subdomain], so for
29
+ # authenticating a user, both parameters are required. Remember that those
30
+ # parameters are used only when authenticating and not when retrieving from
31
+ # session. If you need permissions, you should implement that in a before filter.
32
+ # You can also supply a hash where the value is a boolean determining whether
33
+ # or not authentication should be aborted when the value is not present.
34
+ # config.authentication_keys = [ :email ]
35
+
36
+ # Configure parameters from the request object used for authentication. Each entry
37
+ # given should be a request method and it will automatically be passed to the
38
+ # find_for_authentication method and considered in your model lookup. For instance,
39
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
41
+ # config.request_keys = []
42
+
43
+ # Configure which authentication keys should be case-insensitive.
44
+ # These keys will be downcased upon creating or modifying a user and when used
45
+ # to authenticate or find a user. Default is :email.
46
+ config.case_insensitive_keys = [ :email ]
47
+
48
+ # Configure which authentication keys should have whitespace stripped.
49
+ # These keys will have whitespace before and after removed upon creating or
50
+ # modifying a user and when used to authenticate or find a user. Default is :email.
51
+ config.strip_whitespace_keys = [ :email ]
52
+
53
+ # Tell if authentication through request.params is enabled. True by default.
54
+ # It can be set to an array that will enable params authentication only for the
55
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
56
+ # enable it only for database (email + password) authentication.
57
+ # config.params_authenticatable = true
58
+
59
+ # Tell if authentication through HTTP Auth is enabled. False by default.
60
+ # It can be set to an array that will enable http authentication only for the
61
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
62
+ # enable it only for database authentication. The supported strategies are:
63
+ # :database = Support basic authentication with authentication key + password
64
+ # config.http_authenticatable = false
65
+
66
+ # If http headers should be returned for AJAX requests. True by default.
67
+ # config.http_authenticatable_on_xhr = true
68
+
69
+ # The realm used in Http Basic Authentication. 'Application' by default.
70
+ # config.http_authentication_realm = 'Application'
71
+
72
+ # It will change confirmation, password recovery and other workflows
73
+ # to behave the same regardless if the e-mail provided was right or wrong.
74
+ # Does not affect registerable.
75
+ # config.paranoid = true
76
+
77
+ # By default Devise will store the user in session. You can skip storage for
78
+ # particular strategies by setting this option.
79
+ # Notice that if you are skipping storage for all authentication paths, you
80
+ # may want to disable generating routes to Devise's sessions controller by
81
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
82
+ config.skip_session_storage = [:http_auth]
83
+
84
+ # By default, Devise cleans up the CSRF token on authentication to
85
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
86
+ # requests for sign in and sign up, you need to get a new CSRF token
87
+ # from the server. You can disable this option at your own risk.
88
+ # config.clean_up_csrf_token_on_authentication = true
89
+
90
+ # ==> Configuration for :database_authenticatable
91
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
92
+ # using other encryptors, it sets how many times you want the password re-encrypted.
93
+ #
94
+ # Limiting the stretches to just one in testing will increase the performance of
95
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
96
+ # a value less than 10 in other environments.
97
+ config.stretches = Rails.env.test? ? 1 : 10
98
+
99
+ # Setup a pepper to generate the encrypted password.
100
+ # config.pepper = '2a4aeeaf3a0cea0ca9d04ddcaef83b9d1ca693e981bff82e07d40a267dbf99d7c48b338a43779f47cbf9aa5571a24ac70fbc13be0084a10fcf32793a19502fc1'
101
+
102
+ # ==> Configuration for :confirmable
103
+ # A period that the user is allowed to access the website even without
104
+ # confirming his account. For instance, if set to 2.days, the user will be
105
+ # able to access the website for two days without confirming his account,
106
+ # access will be blocked just in the third day. Default is 0.days, meaning
107
+ # the user cannot access the website without confirming his account.
108
+ # config.allow_unconfirmed_access_for = 2.days
109
+
110
+ # A period that the user is allowed to confirm their account before their
111
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
112
+ # their account within 3 days after the mail was sent, but on the fourth day
113
+ # their account can't be confirmed with the token any more.
114
+ # Default is nil, meaning there is no restriction on how long a user can take
115
+ # before confirming their account.
116
+ # config.confirm_within = 3.days
117
+
118
+ # If true, requires any email changes to be confirmed (exactly the same way as
119
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
120
+ # db field (see migrations). Until confirmed new email is stored in
121
+ # unconfirmed email column, and copied to email column on successful confirmation.
122
+ config.reconfirmable = true
123
+
124
+ # Defines which key will be used when confirming an account
125
+ # config.confirmation_keys = [ :email ]
126
+
127
+ # ==> Configuration for :rememberable
128
+ # The time the user will be remembered without asking for credentials again.
129
+ # config.remember_for = 2.weeks
130
+
131
+ # If true, extends the user's remember period when remembered via cookie.
132
+ # config.extend_remember_period = false
133
+
134
+ # Options to be passed to the created cookie. For instance, you can set
135
+ # :secure => true in order to force SSL only cookies.
136
+ # config.rememberable_options = {}
137
+
138
+ # ==> Configuration for :validatable
139
+ # Range for password length. Default is 8..128.
140
+ config.password_length = 8..128
141
+
142
+ # Email regex used to validate email formats. It simply asserts that
143
+ # one (and only one) @ exists in the given string. This is mainly
144
+ # to give user feedback and not to assert the e-mail validity.
145
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
146
+
147
+ # ==> Configuration for :timeoutable
148
+ # The time you want to timeout the user session without activity. After this
149
+ # time the user will be asked for credentials again. Default is 30 minutes.
150
+ # config.timeout_in = 30.minutes
151
+
152
+ # If true, expires auth token on session timeout.
153
+ # config.expire_auth_token_on_timeout = false
154
+
155
+ # ==> Configuration for :lockable
156
+ # Defines which strategy will be used to lock an account.
157
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
158
+ # :none = No lock strategy. You should handle locking by yourself.
159
+ # config.lock_strategy = :failed_attempts
160
+
161
+ # Defines which key will be used when locking and unlocking an account
162
+ # config.unlock_keys = [ :email ]
163
+
164
+ # Defines which strategy will be used to unlock an account.
165
+ # :email = Sends an unlock link to the user email
166
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
167
+ # :both = Enables both strategies
168
+ # :none = No unlock strategy. You should handle unlocking by yourself.
169
+ # config.unlock_strategy = :both
170
+
171
+ # Number of authentication tries before locking an account if lock_strategy
172
+ # is failed attempts.
173
+ # config.maximum_attempts = 20
174
+
175
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
176
+ # config.unlock_in = 1.hour
177
+
178
+ # Warn on the last attempt before the account is locked.
179
+ # config.last_attempt_warning = false
180
+
181
+ # ==> Configuration for :recoverable
182
+ #
183
+ # Defines which key will be used when recovering the password for an account
184
+ # config.reset_password_keys = [ :email ]
185
+
186
+ # Time interval you can reset your password with a reset password key.
187
+ # Don't put a too small interval or your users won't have the time to
188
+ # change their passwords.
189
+ config.reset_password_within = 6.hours
190
+
191
+ # ==> Configuration for :encryptable
192
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
193
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
194
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
195
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
196
+ # REST_AUTH_SITE_KEY to pepper).
197
+ #
198
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
199
+ # config.encryptor = :sha512
200
+
201
+ # ==> Scopes configuration
202
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
203
+ # "users/sessions/new". It's turned off by default because it's slower if you
204
+ # are using only default views.
205
+ # config.scoped_views = false
206
+
207
+ # Configure the default scope given to Warden. By default it's the first
208
+ # devise role declared in your routes (usually :user).
209
+ # config.default_scope = :user
210
+
211
+ # Set this configuration to false if you want /users/sign_out to sign out
212
+ # only the current scope. By default, Devise signs out all scopes.
213
+ # config.sign_out_all_scopes = true
214
+
215
+ # ==> Navigation configuration
216
+ # Lists the formats that should be treated as navigational. Formats like
217
+ # :html, should redirect to the sign in page when the user does not have
218
+ # access, but formats like :xml or :json, should return 401.
219
+ #
220
+ # If you have any extra navigational formats, like :iphone or :mobile, you
221
+ # should add them to the navigational formats lists.
222
+ #
223
+ # The "*/*" below is required to match Internet Explorer requests.
224
+ # config.navigational_formats = ['*/*', :html]
225
+
226
+ # The default HTTP method used to sign out a resource. Default is :delete.
227
+ config.sign_out_via = :delete
228
+
229
+ # ==> OmniAuth
230
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
231
+ # up on your models and hooks.
232
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
233
+ config.omniauth :open_id, store: OpenID::Store::Filesystem.new('/tmp'), name: 'google_apps', identifier: 'https://www.google.com/accounts/o8/id', require: 'omniauth-openid'
234
+
235
+ # ==> Warden configuration
236
+ # If you want to use other strategies, that are not supported by Devise, or
237
+ # change the failure app, you can configure them inside the config.warden block.
238
+ #
239
+ # config.warden do |manager|
240
+ # manager.intercept_401 = false
241
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
242
+ # end
243
+
244
+ # ==> Mountable engine configurations
245
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
246
+ # is mountable, there are some extra configurations to be taken into account.
247
+ # The following options are available, assuming the engine is mounted as:
248
+ #
249
+ # mount MyEngine, at: '/my_engine'
250
+ #
251
+ # The router that invoked `devise_for`, in the example above, would be:
252
+ # config.router_name = :my_engine
253
+ #
254
+ # When using omniauth, Devise cannot automatically set Omniauth path,
255
+ # so you need to do it manually. For the users scope, it would be:
256
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
257
+ end
@@ -0,0 +1,9 @@
1
+ # create indices
2
+ User.create_elasticsearch_index
3
+ Project.create_elasticsearch_index
4
+ Story.create_elasticsearch_index
5
+ Task.create_elasticsearch_index
6
+ Bug.create_elasticsearch_index
7
+ Space.create_elasticsearch_index
8
+ Page.create_elasticsearch_index
9
+ Attachment.create_elasticsearch_index
@@ -0,0 +1,4 @@
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]
@@ -0,0 +1,31 @@
1
+ Grit::Repo.init_bare TAWORK_CONFIG["git_repo_path"]
2
+ $wiki = Gollum::Wiki.new(File.join(Rails.root, TAWORK_CONFIG["git_repo_path"]))
3
+
4
+ module Gollum
5
+ class Attachment < Page
6
+ include Pagination
7
+
8
+ def self.format_to_ext(format)
9
+ format.to_s
10
+ end
11
+
12
+ def self.cname(name)
13
+ name
14
+ end
15
+ end
16
+ end
17
+
18
+ module Gollum
19
+ class Wiki
20
+ def normalize(data)
21
+ return data.read if data.respond_to?(:read)
22
+
23
+ Rails.logger.info data
24
+ result = data.try(:gsub, /\r/, '')
25
+ Rails.logger.info "DATA"
26
+ Rails.logger.info data
27
+ result
28
+ end
29
+ end
30
+ end
31
+
@@ -0,0 +1,66 @@
1
+ require 'digest/md5'
2
+ module Haml::Filters
3
+ remove_filter("Markdown")
4
+
5
+ module Markdown
6
+ include Haml::Filters::Base
7
+ # require "rdiscount"
8
+
9
+ def render(text)
10
+ return "" if text.nil?
11
+
12
+ text = text.encode('UTF-8')
13
+ kramdown text
14
+ end
15
+
16
+ def redcarpet(text)
17
+ markdown = Redcarpet::Markdown.new(
18
+ Redcarpet::Render::HTML,
19
+ no_intra_emphasis: true,
20
+ tables: true,
21
+ fenced_code_blocks: true,
22
+ autolink: true,
23
+ disable_indented_code_blocks: true,
24
+ strikethrough: true,
25
+ lax_spacing: true,
26
+ space_after_headers: true,
27
+ superscript: true,
28
+ # underline: true,
29
+ highlight: true,
30
+ quote: true,
31
+ footnotes: true,
32
+ )
33
+ markdown.render text
34
+ end
35
+
36
+ def kramdown(text)
37
+ Kramdown::Document.new(text).to_html
38
+ end
39
+
40
+ # taken from https://help.github.com/articles/github-flavored-markdown
41
+
42
+ def gfm(text)
43
+ # Extract pre blocks
44
+ extractions = {}
45
+ text.gsub!(%r{<pre>.*?</pre>}m) do |match|
46
+ md5 = Digest::MD5.hexdigest(match)
47
+ extractions[md5] = match
48
+ "{gfm-extraction-#{md5}}"
49
+ end
50
+
51
+ # in very clear cases, let newlines become <br /> tags
52
+ text.gsub!(/^[\w\<][^\n]*\n+/) do |x|
53
+ x =~ /\n{2}/ ? x : (x.strip!; x << " \n")
54
+ end
55
+
56
+ # Insert pre block extractions
57
+ text.gsub!(/\{gfm-extraction-([0-9a-f]{32})\}/) do
58
+ "\n\n" + extractions[$1]
59
+ end
60
+
61
+ text
62
+ end
63
+ end
64
+
65
+ end
66
+
@@ -0,0 +1,16 @@
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
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,12 @@
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
+ Rails.application.class.config.secret_key_base = 'cbf3f3ad000d4aa841eebe617f08b4cd615d62e941c5b9f02ac12cbd42c9ff31c99eb1dc448f3af8f3a9cb0dd03280d763d9d857d6a30967faa96743599c853d'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.class.config.session_store :cookie_store, key: '_tawork_session'
@@ -0,0 +1,145 @@
1
+ # Use this setup block to configure all options available in SimpleForm.
2
+ SimpleForm.setup do |config|
3
+ # Wrappers are used by the form builder to generate a
4
+ # complete input. You can remove any component from the
5
+ # wrapper, change the order or even add your own to the
6
+ # stack. The options given below are used to wrap the
7
+ # whole input.
8
+ config.wrappers :default, class: :input,
9
+ hint_class: :field_with_hint, error_class: :field_with_errors do |b|
10
+ ## Extensions enabled by default
11
+ # Any of these extensions can be disabled for a
12
+ # given input by passing: `f.input EXTENSION_NAME => false`.
13
+ # You can make any of these extensions optional by
14
+ # renaming `b.use` to `b.optional`.
15
+
16
+ # Determines whether to use HTML5 (:email, :url, ...)
17
+ # and required attributes
18
+ b.use :html5
19
+
20
+ # Calculates placeholders automatically from I18n
21
+ # You can also pass a string as f.input placeholder: "Placeholder"
22
+ b.use :placeholder
23
+
24
+ ## Optional extensions
25
+ # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
26
+ # to the input. If so, they will retrieve the values from the model
27
+ # if any exists. If you want to enable the lookup for any of those
28
+ # extensions by default, you can change `b.optional` to `b.use`.
29
+
30
+ # Calculates maxlength from length validations for string inputs
31
+ b.optional :maxlength
32
+
33
+ # Calculates pattern from format validations for string inputs
34
+ b.optional :pattern
35
+
36
+ # Calculates min and max from length validations for numeric inputs
37
+ b.optional :min_max
38
+
39
+ # Calculates readonly automatically from readonly attributes
40
+ b.optional :readonly
41
+
42
+ ## Inputs
43
+ b.use :label_input
44
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
45
+ b.use :error, wrap_with: { tag: :span, class: :error }
46
+ end
47
+
48
+ # The default wrapper to be used by the FormBuilder.
49
+ config.default_wrapper = :default
50
+
51
+ # Define the way to render check boxes / radio buttons with labels.
52
+ # Defaults to :nested for bootstrap config.
53
+ # inline: input + label
54
+ # nested: label > input
55
+ config.boolean_style = :nested
56
+
57
+ # Default class for buttons
58
+ config.button_class = 'btn'
59
+
60
+ # Method used to tidy up errors. Specify any Rails Array method.
61
+ # :first lists the first message for each field.
62
+ # Use :to_sentence to list all errors for each field.
63
+ # config.error_method = :first
64
+
65
+ # Default tag used for error notification helper.
66
+ config.error_notification_tag = :div
67
+
68
+ # CSS class to add for error notification helper.
69
+ config.error_notification_class = 'alert alert-error'
70
+
71
+ # ID to add for error notification helper.
72
+ # config.error_notification_id = nil
73
+
74
+ # Series of attempts to detect a default label method for collection.
75
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
76
+
77
+ # Series of attempts to detect a default value method for collection.
78
+ # config.collection_value_methods = [ :id, :to_s ]
79
+
80
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
81
+ # config.collection_wrapper_tag = nil
82
+
83
+ # You can define the class to use on all collection wrappers. Defaulting to none.
84
+ # config.collection_wrapper_class = nil
85
+
86
+ # You can wrap each item in a collection of radio/check boxes with a tag,
87
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
88
+ # SimpleForm will force this option to be a label.
89
+ # config.item_wrapper_tag = :span
90
+
91
+ # You can define a class to use in all item wrappers. Defaulting to none.
92
+ # config.item_wrapper_class = nil
93
+
94
+ # How the label text should be generated altogether with the required text.
95
+ # config.label_text = lambda { |label, required| "#{required} #{label}" }
96
+
97
+ # You can define the class to use on all labels. Default is nil.
98
+ config.label_class = 'control-label'
99
+
100
+ # You can define the class to use on all forms. Default is simple_form.
101
+ # config.form_class = :simple_form
102
+
103
+ # You can define which elements should obtain additional classes
104
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
105
+
106
+ # Whether attributes are required by default (or not). Default is true.
107
+ # config.required_by_default = true
108
+
109
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
110
+ # These validations are enabled in SimpleForm's internal config but disabled by default
111
+ # in this configuration, which is recommended due to some quirks from different browsers.
112
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
113
+ # change this configuration to true.
114
+ config.browser_validations = false
115
+
116
+ # Collection of methods to detect if a file type was given.
117
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
118
+
119
+ # Custom mappings for input types. This should be a hash containing a regexp
120
+ # to match as key, and the input type that will be used when the field name
121
+ # matches the regexp as value.
122
+ # config.input_mappings = { /count/ => :integer }
123
+
124
+ # Custom wrappers for input types. This should be a hash containing an input
125
+ # type as key and the wrapper that will be used for all inputs with specified type.
126
+ # config.wrapper_mappings = { string: :prepend }
127
+
128
+ # Default priority for time_zone inputs.
129
+ # config.time_zone_priority = nil
130
+
131
+ # Default priority for country inputs.
132
+ # config.country_priority = nil
133
+
134
+ # When false, do not use translations for labels.
135
+ # config.translate_labels = true
136
+
137
+ # Automatically discover new inputs in Rails' autoload path.
138
+ # config.inputs_discovery = true
139
+
140
+ # Cache SimpleForm inputs discovery
141
+ # config.cache_discovery = !Rails.env.development?
142
+
143
+ # Default class for inputs
144
+ # config.input_class = nil
145
+ end
@@ -0,0 +1,73 @@
1
+ inputs = %w[
2
+ CollectionSelectInput
3
+ DateTimeInput
4
+ FileInput
5
+ GroupedCollectionSelectInput
6
+ NumericInput
7
+ PasswordInput
8
+ RangeInput
9
+ StringInput
10
+ TextInput
11
+ ]
12
+
13
+ inputs.each do |input_type|
14
+ superclass = "SimpleForm::Inputs::#{input_type}".constantize
15
+
16
+ new_class = Class.new(superclass) do
17
+ def input_html_classes
18
+ super.push('form-control')
19
+ end
20
+ end
21
+
22
+ Object.const_set(input_type, new_class)
23
+ end
24
+
25
+ # Use this setup block to configure all options available in SimpleForm.
26
+ SimpleForm.setup do |config|
27
+ config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'has-error', defaults: { input_html: { class: 'default_class' } } do |b|
28
+
29
+ b.use :html5
30
+ b.use :min_max
31
+ b.use :maxlength
32
+ b.use :placeholder
33
+ b.optional :pattern
34
+ b.optional :readonly
35
+
36
+ b.use :label_input
37
+ b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
38
+ b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
39
+ end
40
+
41
+ config.wrappers :prepend, tag: 'div', class: "form-group", error_class: 'has-error' do |b|
42
+ b.use :html5
43
+ b.use :placeholder
44
+ b.use :label
45
+
46
+ b.wrapper tag: 'div', class: 'controls' do |input|
47
+ input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
48
+ prepend.use :input
49
+ end
50
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
51
+ input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
52
+ end
53
+ end
54
+
55
+ config.wrappers :append, tag: 'div', class: "form-group", error_class: 'has-error' do |b|
56
+ b.use :html5
57
+ b.use :placeholder
58
+ b.use :label
59
+ b.wrapper tag: 'div', class: 'controls' do |input|
60
+ input.wrapper tag: 'div', class: 'input-append' do |append|
61
+ append.use :input
62
+ end
63
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
64
+ input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
65
+ end
66
+ end
67
+
68
+ # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
69
+ # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
70
+ # to learn about the different styles for forms and inputs,
71
+ # buttons and other elements.
72
+ config.default_wrapper = :bootstrap
73
+ end
@@ -0,0 +1,14 @@
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