platform 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (480) hide show
  1. data/.gitignore +21 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +14 -0
  4. data/Gemfile.lock +191 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +5 -0
  7. data/Rakefile +37 -0
  8. data/app/assets/images/platform/.gitkeep +0 -0
  9. data/app/assets/images/platform/accept.png +0 -0
  10. data/app/assets/images/platform/action_tab_bkgd.gif +0 -0
  11. data/app/assets/images/platform/action_tab_white_bkgd.gif +0 -0
  12. data/app/assets/images/platform/add.png +0 -0
  13. data/app/assets/images/platform/apps/app_icon.gif +0 -0
  14. data/app/assets/images/platform/apps/app_logo.gif +0 -0
  15. data/app/assets/images/platform/arrow_down.gif +0 -0
  16. data/app/assets/images/platform/arrow_down.png +0 -0
  17. data/app/assets/images/platform/arrow_down_grey.png +0 -0
  18. data/app/assets/images/platform/arrow_right.gif +0 -0
  19. data/app/assets/images/platform/arrow_up.png +0 -0
  20. data/app/assets/images/platform/arrow_up_grey.png +0 -0
  21. data/app/assets/images/platform/bullet_go.png +0 -0
  22. data/app/assets/images/platform/buttons.png +0 -0
  23. data/app/assets/images/platform/cancel.png +0 -0
  24. data/app/assets/images/platform/clipboard_icon.gif +0 -0
  25. data/app/assets/images/platform/close.gif +0 -0
  26. data/app/assets/images/platform/cross.png +0 -0
  27. data/app/assets/images/platform/default_app_icon.gif +0 -0
  28. data/app/assets/images/platform/default_app_logo.gif +0 -0
  29. data/app/assets/images/platform/delete.png +0 -0
  30. data/app/assets/images/platform/disk.png +0 -0
  31. data/app/assets/images/platform/exclamation.png +0 -0
  32. data/app/assets/images/platform/eye.png +0 -0
  33. data/app/assets/images/platform/eye_not.png +0 -0
  34. data/app/assets/images/platform/field_sprite.gif +0 -0
  35. data/app/assets/images/platform/find.png +0 -0
  36. data/app/assets/images/platform/globe.gif +0 -0
  37. data/app/assets/images/platform/help.png +0 -0
  38. data/app/assets/images/platform/help/app_reg.png +0 -0
  39. data/app/assets/images/platform/help/app_reg_ext.png +0 -0
  40. data/app/assets/images/platform/help/app_reg_web.png +0 -0
  41. data/app/assets/images/platform/help/auth_desktop.png +0 -0
  42. data/app/assets/images/platform/help/auth_iframe.png +0 -0
  43. data/app/assets/images/platform/help/auth_iphone.png +0 -0
  44. data/app/assets/images/platform/help/auth_web.png +0 -0
  45. data/app/assets/images/platform/help/authorize.png +0 -0
  46. data/app/assets/images/platform/help/ext.png +0 -0
  47. data/app/assets/images/platform/help/login.png +0 -0
  48. data/app/assets/images/platform/help/login_desktop.png +0 -0
  49. data/app/assets/images/platform/help/login_iphone.png +0 -0
  50. data/app/assets/images/platform/help/login_web.png +0 -0
  51. data/app/assets/images/platform/help2.png +0 -0
  52. data/app/assets/images/platform/information.png +0 -0
  53. data/app/assets/images/platform/keyboard.png +0 -0
  54. data/app/assets/images/platform/language_selector_arrow.gif +0 -0
  55. data/app/assets/images/platform/left_quote.png +0 -0
  56. data/app/assets/images/platform/lightning.png +0 -0
  57. data/app/assets/images/platform/loading.gif +0 -0
  58. data/app/assets/images/platform/loading2.gif +0 -0
  59. data/app/assets/images/platform/loading3.gif +0 -0
  60. data/app/assets/images/platform/loading_animation.gif +0 -0
  61. data/app/assets/images/platform/loading_large.gif +0 -0
  62. data/app/assets/images/platform/lock.png +0 -0
  63. data/app/assets/images/platform/lock_add.png +0 -0
  64. data/app/assets/images/platform/lock_delete.png +0 -0
  65. data/app/assets/images/platform/lock_open.png +0 -0
  66. data/app/assets/images/platform/medals/bronze.png +0 -0
  67. data/app/assets/images/platform/medals/gold.png +0 -0
  68. data/app/assets/images/platform/medals/runner.png +0 -0
  69. data/app/assets/images/platform/medals/silver.png +0 -0
  70. data/app/assets/images/platform/minus_node.png +0 -0
  71. data/app/assets/images/platform/oauth/perm_tile.gif +0 -0
  72. data/app/assets/images/platform/oauth/right_grey.png +0 -0
  73. data/app/assets/images/platform/pencil.png +0 -0
  74. data/app/assets/images/platform/photo_silhouette.gif +0 -0
  75. data/app/assets/images/platform/pixel.gif +0 -0
  76. data/app/assets/images/platform/platform.png +0 -0
  77. data/app/assets/images/platform/platform2.png +0 -0
  78. data/app/assets/images/platform/platform3.png +0 -0
  79. data/app/assets/images/platform/platform4.png +0 -0
  80. data/app/assets/images/platform/platform5.png +0 -0
  81. data/app/assets/images/platform/plus.png +0 -0
  82. data/app/assets/images/platform/plus_node.png +0 -0
  83. data/app/assets/images/platform/random.png +0 -0
  84. data/app/assets/images/platform/random2.png +0 -0
  85. data/app/assets/images/platform/rating_star0.png +0 -0
  86. data/app/assets/images/platform/rating_star05.png +0 -0
  87. data/app/assets/images/platform/rating_star1.png +0 -0
  88. data/app/assets/images/platform/rating_stars.gif +0 -0
  89. data/app/assets/images/platform/rating_stars.psd +0 -0
  90. data/app/assets/images/platform/reply.png +0 -0
  91. data/app/assets/images/platform/right_quote.png +0 -0
  92. data/app/assets/images/platform/rotating_world.gif +0 -0
  93. data/app/assets/images/platform/script.png +0 -0
  94. data/app/assets/images/platform/script_edit.png +0 -0
  95. data/app/assets/images/platform/script_gear.png +0 -0
  96. data/app/assets/images/platform/site_sprite.gif +0 -0
  97. data/app/assets/images/platform/spinner.gif +0 -0
  98. data/app/assets/images/platform/star.png +0 -0
  99. data/app/assets/images/platform/table_edit.png +0 -0
  100. data/app/assets/images/platform/table_gear.png +0 -0
  101. data/app/assets/images/platform/table_multiple.png +0 -0
  102. data/app/assets/images/platform/thumb_down.png +0 -0
  103. data/app/assets/images/platform/thumb_up.png +0 -0
  104. data/app/assets/images/platform/top_left_stem.png +0 -0
  105. data/app/assets/images/platform/top_right_stem.png +0 -0
  106. data/app/assets/images/platform/translate_icn.gif +0 -0
  107. data/app/assets/images/platform/treeview/diffDoc.gif +0 -0
  108. data/app/assets/images/platform/treeview/diffFolder.gif +0 -0
  109. data/app/assets/images/platform/treeview/ftv2blank.gif +0 -0
  110. data/app/assets/images/platform/treeview/ftv2doc.gif +0 -0
  111. data/app/assets/images/platform/treeview/ftv2folderclosed.gif +0 -0
  112. data/app/assets/images/platform/treeview/ftv2folderopen.gif +0 -0
  113. data/app/assets/images/platform/treeview/ftv2lastnode.gif +0 -0
  114. data/app/assets/images/platform/treeview/ftv2link.gif +0 -0
  115. data/app/assets/images/platform/treeview/ftv2mlastnode.gif +0 -0
  116. data/app/assets/images/platform/treeview/ftv2mnode.gif +0 -0
  117. data/app/assets/images/platform/treeview/ftv2node.gif +0 -0
  118. data/app/assets/images/platform/treeview/ftv2plastnode.gif +0 -0
  119. data/app/assets/images/platform/treeview/ftv2pnode.gif +0 -0
  120. data/app/assets/images/platform/treeview/ftv2vertline.gif +0 -0
  121. data/app/assets/images/platform/wizard.png +0 -0
  122. data/app/assets/images/platform/world_link.png +0 -0
  123. data/app/assets/javascripts/platform/api_explorer.js +628 -0
  124. data/app/assets/javascripts/platform/application.js +9 -0
  125. data/app/assets/javascripts/platform/ftiens4.js +1197 -0
  126. data/app/assets/javascripts/platform/jsdk.js +539 -0
  127. data/app/assets/javascripts/platform/platform.js +447 -0
  128. data/app/assets/javascripts/platform/shortcut.js +223 -0
  129. data/app/assets/javascripts/platform/ua.js +147 -0
  130. data/app/assets/stylesheets/platform/api_explorer.css.scss +140 -0
  131. data/app/assets/stylesheets/platform/application.css.scss +6 -0
  132. data/app/assets/stylesheets/platform/components.css.scss +208 -0
  133. data/app/assets/stylesheets/platform/layout.css.scss +119 -0
  134. data/app/assets/stylesheets/platform/oauth.css +51 -0
  135. data/app/assets/stylesheets/platform/platform.css.scss +311 -0
  136. data/app/controllers/platform/admin/apps_controller.rb +99 -0
  137. data/app/controllers/platform/admin/base_controller.rb +60 -0
  138. data/app/controllers/platform/admin/categories_controller.rb +132 -0
  139. data/app/controllers/platform/admin/clientsdk_controller.rb +30 -0
  140. data/app/controllers/platform/admin/developers_controller.rb +30 -0
  141. data/app/controllers/platform/admin/exceptions_controller.rb +30 -0
  142. data/app/controllers/platform/admin/forum_controller.rb +34 -0
  143. data/app/controllers/platform/admin/metrics_controller.rb +42 -0
  144. data/app/controllers/platform/api/apps_controller.rb +40 -0
  145. data/app/controllers/platform/api/base_controller.rb +541 -0
  146. data/app/controllers/platform/apps_controller.rb +142 -0
  147. data/app/controllers/platform/base_controller.rb +127 -0
  148. data/app/controllers/platform/developer/api_explorer_controller.rb +56 -0
  149. data/app/controllers/platform/developer/apps_controller.rb +161 -0
  150. data/app/controllers/platform/developer/base_controller.rb +51 -0
  151. data/app/controllers/platform/developer/blog_controller.rb +29 -0
  152. data/app/controllers/platform/developer/dashboard_controller.rb +63 -0
  153. data/app/controllers/platform/developer/forum_controller.rb +85 -0
  154. data/app/controllers/platform/developer/help_controller.rb +113 -0
  155. data/app/controllers/platform/developer/info_controller.rb +41 -0
  156. data/app/controllers/platform/developer/registration_controller.rb +39 -0
  157. data/app/controllers/platform/developer/resources_controller.rb +30 -0
  158. data/app/controllers/platform/forum_controller.rb +74 -0
  159. data/app/controllers/platform/oauth_controller.rb +421 -0
  160. data/app/controllers/platform/ratings_controller.rb +61 -0
  161. data/app/helpers/platform/admin/categories_helper.rb +54 -0
  162. data/app/helpers/platform/apps_helper.rb +26 -0
  163. data/app/helpers/platform/developer/dashboard_helper.rb +42 -0
  164. data/app/helpers/platform/developer/help_helper.rb +45 -0
  165. data/app/helpers/platform_helper.rb +26 -0
  166. data/app/models/platform/application.rb +394 -0
  167. data/app/models/platform/application_category.rb +34 -0
  168. data/app/models/platform/application_developer.rb +30 -0
  169. data/app/models/platform/application_filter.rb +30 -0
  170. data/app/models/platform/application_log.rb +32 -0
  171. data/app/models/platform/application_log_filter.rb +34 -0
  172. data/app/models/platform/application_metric.rb +58 -0
  173. data/app/models/platform/application_metric_filter.rb +34 -0
  174. data/app/models/platform/application_permission.rb +30 -0
  175. data/app/models/platform/application_permission_filter.rb +30 -0
  176. data/app/models/platform/application_usage_metric.rb +58 -0
  177. data/app/models/platform/application_usage_metric_filter.rb +34 -0
  178. data/app/models/platform/application_user.rb +45 -0
  179. data/app/models/platform/application_user_filter.rb +34 -0
  180. data/app/models/platform/base_filter.rb +46 -0
  181. data/app/models/platform/category.rb +64 -0
  182. data/app/models/platform/daily_application_metric.rb +31 -0
  183. data/app/models/platform/developer.rb +45 -0
  184. data/app/models/platform/developer_filter.rb +26 -0
  185. data/app/models/platform/forum_message.rb +35 -0
  186. data/app/models/platform/forum_message_filter.rb +26 -0
  187. data/app/models/platform/forum_topic.rb +38 -0
  188. data/app/models/platform/forum_topic_filter.rb +26 -0
  189. data/app/models/platform/logged_exception.rb +290 -0
  190. data/app/models/platform/logged_exception_filter.rb +58 -0
  191. data/app/models/platform/media/image.rb +26 -0
  192. data/app/models/platform/media/media.rb +58 -0
  193. data/app/models/platform/monthly_application_metric.rb +31 -0
  194. data/app/models/platform/oauth/access_token.rb +57 -0
  195. data/app/models/platform/oauth/client_token.rb +38 -0
  196. data/app/models/platform/oauth/oauth_model_methods.rb +41 -0
  197. data/app/models/platform/oauth/oauth_token.rb +57 -0
  198. data/app/models/platform/oauth/oauth_token_filter.rb +34 -0
  199. data/app/models/platform/oauth/refresh_token.rb +47 -0
  200. data/app/models/platform/oauth/request_token.rb +50 -0
  201. data/app/models/platform/permission.rb +27 -0
  202. data/app/models/platform/rating.rb +43 -0
  203. data/app/models/platform/rating_filter.rb +30 -0
  204. data/app/models/platform/rollup_log.rb +27 -0
  205. data/app/models/platform/rollup_log_filter.rb +30 -0
  206. data/app/models/platform/total_application_metric.rb +40 -0
  207. data/app/models/platform/weekly_application_metric.rb +31 -0
  208. data/app/views/platform/admin/apps/_categories.html.erb +17 -0
  209. data/app/views/platform/admin/apps/_categories_scripts.html.erb +17 -0
  210. data/app/views/platform/admin/apps/_tabs.html.erb +25 -0
  211. data/app/views/platform/admin/apps/index.html.erb +32 -0
  212. data/app/views/platform/admin/apps/permissions.html.erb +7 -0
  213. data/app/views/platform/admin/apps/ratings.html.erb +7 -0
  214. data/app/views/platform/admin/apps/tokens.html.erb +18 -0
  215. data/app/views/platform/admin/apps/users.html.erb +7 -0
  216. data/app/views/platform/admin/apps/view.html.erb +170 -0
  217. data/app/views/platform/admin/categories/_tabs.html.erb +22 -0
  218. data/app/views/platform/admin/categories/category_assigner.html.erb +9 -0
  219. data/app/views/platform/admin/categories/category_assigner_tree.html.erb +81 -0
  220. data/app/views/platform/admin/categories/index.html.erb +106 -0
  221. data/app/views/platform/admin/categories/items.html.erb +153 -0
  222. data/app/views/platform/admin/categories/lb_update_application_category.html.erb +54 -0
  223. data/app/views/platform/admin/categories/lb_update_category.html.erb +64 -0
  224. data/app/views/platform/admin/categories/tree.html.erb +64 -0
  225. data/app/views/platform/admin/clientsdk/index.html.erb +89 -0
  226. data/app/views/platform/admin/common/_footer.html.erb +1 -0
  227. data/app/views/platform/admin/common/_header.html.erb +32 -0
  228. data/app/views/platform/admin/common/_lightbox_buttons.html.erb +5 -0
  229. data/app/views/platform/admin/common/_paginator.html.erb +20 -0
  230. data/app/views/platform/admin/developers/_tabs.html.erb +22 -0
  231. data/app/views/platform/admin/developers/index.html.erb +7 -0
  232. data/app/views/platform/admin/exceptions/_tabs.html.erb +22 -0
  233. data/app/views/platform/admin/exceptions/index.html.erb +7 -0
  234. data/app/views/platform/admin/forum/_tabs.html.erb +22 -0
  235. data/app/views/platform/admin/forum/index.html.erb +7 -0
  236. data/app/views/platform/admin/forum/messages.html.erb +7 -0
  237. data/app/views/platform/admin/metrics/_tabs.html.erb +25 -0
  238. data/app/views/platform/admin/metrics/application_log.html.erb +7 -0
  239. data/app/views/platform/admin/metrics/index.html.erb +9 -0
  240. data/app/views/platform/admin/metrics/rollup_log.html.erb +7 -0
  241. data/app/views/platform/admin/metrics/usage.html.erb +7 -0
  242. data/app/views/platform/apps/_actions_module.html.erb +3 -0
  243. data/app/views/platform/apps/_app_footer.html.erb +8 -0
  244. data/app/views/platform/apps/_app_header.html.erb +25 -0
  245. data/app/views/platform/apps/_apps_module.html.erb +42 -0
  246. data/app/views/platform/apps/_authorize_form.html.erb +11 -0
  247. data/app/views/platform/apps/_categories_module.html.erb +11 -0
  248. data/app/views/platform/apps/_featured_apps_module.html.erb +40 -0
  249. data/app/views/platform/apps/_left.html.erb +20 -0
  250. data/app/views/platform/apps/_monthly_users_module.html.erb +8 -0
  251. data/app/views/platform/apps/_paginator.html.erb +13 -0
  252. data/app/views/platform/apps/_rank_module.html.erb +18 -0
  253. data/app/views/platform/apps/_search_apps_module.html.erb +35 -0
  254. data/app/views/platform/apps/canvas_app.html.erb +15 -0
  255. data/app/views/platform/apps/index.html.erb +86 -0
  256. data/app/views/platform/apps/view.html.erb +71 -0
  257. data/app/views/platform/apps/xd.html.erb +11 -0
  258. data/app/views/platform/common/_footer.html.erb +1 -0
  259. data/app/views/platform/common/_header.html.erb +4 -0
  260. data/app/views/platform/common/_paginator.html.erb +32 -0
  261. data/app/views/platform/common/_scripts.html.erb +7 -0
  262. data/app/views/platform/common/_user_login.html.erb +11 -0
  263. data/app/views/platform/developer/api_explorer/history.html.erb +31 -0
  264. data/app/views/platform/developer/api_explorer/index.html.erb +134 -0
  265. data/app/views/platform/developer/api_explorer/oauth_lander.html.erb +4 -0
  266. data/app/views/platform/developer/api_explorer/options.html.erb +44 -0
  267. data/app/views/platform/developer/apps/_form.html.erb +340 -0
  268. data/app/views/platform/developer/apps/create_version.html.erb +19 -0
  269. data/app/views/platform/developer/apps/edit.html.erb +21 -0
  270. data/app/views/platform/developer/apps/index.html.erb +375 -0
  271. data/app/views/platform/developer/apps/new.html.erb +20 -0
  272. data/app/views/platform/developer/blog/index.html.erb +7 -0
  273. data/app/views/platform/developer/common/_footer.html.erb +1 -0
  274. data/app/views/platform/developer/common/_header.html.erb +34 -0
  275. data/app/views/platform/developer/dashboard/_apps_info.html.erb +84 -0
  276. data/app/views/platform/developer/dashboard/_discussions.html.erb +68 -0
  277. data/app/views/platform/developer/dashboard/_header.html.erb +12 -0
  278. data/app/views/platform/developer/dashboard/_reviews.html.erb +53 -0
  279. data/app/views/platform/developer/dashboard/_statistics.html.erb +105 -0
  280. data/app/views/platform/developer/dashboard/index.html.erb +85 -0
  281. data/app/views/platform/developer/dashboard/settings.html.erb +23 -0
  282. data/app/views/platform/developer/forum/_message.html.erb +17 -0
  283. data/app/views/platform/developer/forum/_messages.html.erb +14 -0
  284. data/app/views/platform/developer/forum/_new_message.html.erb +28 -0
  285. data/app/views/platform/developer/forum/_new_topic.html.erb +39 -0
  286. data/app/views/platform/developer/forum/index.html.erb +89 -0
  287. data/app/views/platform/developer/forum/topic.html.erb +28 -0
  288. data/app/views/platform/developer/help/_footer.html.erb +4 -0
  289. data/app/views/platform/developer/help/_header.html.erb +95 -0
  290. data/app/views/platform/developer/help/_navigation.html.erb +99 -0
  291. data/app/views/platform/developer/help/api.html.erb +120 -0
  292. data/app/views/platform/developer/help/credits.html.erb +77 -0
  293. data/app/views/platform/developer/help/index.html.erb +19 -0
  294. data/app/views/platform/developer/help/license.html.erb +586 -0
  295. data/app/views/platform/developer/help/oauth_app_login.html.erb +177 -0
  296. data/app/views/platform/developer/help/oauth_client_side.html.erb +264 -0
  297. data/app/views/platform/developer/help/oauth_desktop.html.erb +191 -0
  298. data/app/views/platform/developer/help/oauth_extensions.html.erb +342 -0
  299. data/app/views/platform/developer/help/oauth_intro.html.erb +371 -0
  300. data/app/views/platform/developer/help/oauth_mobile.html.erb +292 -0
  301. data/app/views/platform/developer/help/oauth_server_side.html.erb +603 -0
  302. data/app/views/platform/developer/help/oauth_trusted_client.html.erb +202 -0
  303. data/app/views/platform/developer/help/reference.html.erb +42 -0
  304. data/app/views/platform/developer/help/sdk_ios.html.erb +31 -0
  305. data/app/views/platform/developer/help/sdk_js.html.erb +202 -0
  306. data/app/views/platform/developer/info/_basic_info.html.erb +74 -0
  307. data/app/views/platform/developer/info/_header.html.erb +12 -0
  308. data/app/views/platform/developer/info/index.html.erb +23 -0
  309. data/app/views/platform/developer/registration/index.html.erb +134 -0
  310. data/app/views/platform/developer/resources/index.html.erb +23 -0
  311. data/app/views/platform/forum/_message.html.erb +17 -0
  312. data/app/views/platform/forum/_messages.html.erb +14 -0
  313. data/app/views/platform/forum/_new_message.html.erb +26 -0
  314. data/app/views/platform/forum/_new_topic.html.erb +38 -0
  315. data/app/views/platform/forum/_topic.html.erb +18 -0
  316. data/app/views/platform/forum/_topics.html.erb +74 -0
  317. data/app/views/platform/login/index.html.erb +31 -0
  318. data/app/views/platform/login/register.html.erb +55 -0
  319. data/app/views/platform/oauth/_authorization_box.html.erb +75 -0
  320. data/app/views/platform/oauth/_authorization_popup.html.erb +38 -0
  321. data/app/views/platform/oauth/_authorize_form.html.erb +11 -0
  322. data/app/views/platform/oauth/auth_failed.html.erb +0 -0
  323. data/app/views/platform/oauth/auth_success.html.erb +0 -0
  324. data/app/views/platform/oauth/authorize_desktop.html.erb +76 -0
  325. data/app/views/platform/oauth/authorize_failure_iframe.html.erb +1 -0
  326. data/app/views/platform/oauth/authorize_failure_mobile.html.erb +24 -0
  327. data/app/views/platform/oauth/authorize_failure_popup.html.erb +24 -0
  328. data/app/views/platform/oauth/authorize_failure_web.html.erb +1 -0
  329. data/app/views/platform/oauth/authorize_iframe.html.erb +16 -0
  330. data/app/views/platform/oauth/authorize_mobile.html.erb +1 -0
  331. data/app/views/platform/oauth/authorize_popup.html.erb +1 -0
  332. data/app/views/platform/oauth/authorize_success_iframe.html.erb +1 -0
  333. data/app/views/platform/oauth/authorize_success_mobile.html.erb +24 -0
  334. data/app/views/platform/oauth/authorize_success_popup.html.erb +24 -0
  335. data/app/views/platform/oauth/authorize_success_web.html.erb +1 -0
  336. data/app/views/platform/oauth/authorize_web.html.erb +3 -0
  337. data/app/views/platform/oauth/xd.html.erb +13 -0
  338. data/app/views/platform/ratings/_list.html.erb +30 -0
  339. data/app/views/platform/ratings/_new.html.erb +70 -0
  340. data/app/views/platform/ratings/_rating.html.erb +17 -0
  341. data/config/platform/config.yml +133 -0
  342. data/config/platform/data/default_applications.yml +39 -0
  343. data/config/platform/data/default_categories.yml +56 -0
  344. data/config/platform/data/default_permissions.yml +0 -0
  345. data/config/platform/site/features.yml +66 -0
  346. data/config/routes.rb +59 -0
  347. data/db/migrate/20110602232141_create_platform_tables.rb +262 -0
  348. data/docs/Classes.graffle +7315 -0
  349. data/docs/Classes.pdf +0 -0
  350. data/lib/generators/platform/platform_generator.rb +56 -0
  351. data/lib/generators/platform/templates/db/create_platform_tables.rb +262 -0
  352. data/lib/generators/platform/templates/layouts/platform.html.erb +49 -0
  353. data/lib/generators/platform/templates/layouts/platform_admin.html.erb +60 -0
  354. data/lib/platform.rb +6 -0
  355. data/lib/platform/api/already_jsoned_string.rb +9 -0
  356. data/lib/platform/api/proxy.rb +45 -0
  357. data/lib/platform/api/proxy/base.rb +62 -0
  358. data/lib/platform/cache.rb +78 -0
  359. data/lib/platform/config.rb +666 -0
  360. data/lib/platform/engine.rb +5 -0
  361. data/lib/platform/exception.rb +27 -0
  362. data/lib/platform/extensions/action_controller_extension.rb +65 -0
  363. data/lib/platform/extensions/action_view_extension.rb +168 -0
  364. data/lib/platform/extensions/object_extension.rb +51 -0
  365. data/lib/platform/helper.rb +33 -0
  366. data/lib/platform/logger.rb +62 -0
  367. data/lib/platform/railtie.rb +52 -0
  368. data/lib/platform/random_password_generator.rb +76 -0
  369. data/lib/platform/simple_string_permissions.rb +40 -0
  370. data/lib/platform/version.rb +3 -0
  371. data/lib/tasks/platform.rake +119 -0
  372. data/platform.gemspec +45 -0
  373. data/script/rails +6 -0
  374. data/spec/config/config_spec.rb +10 -0
  375. data/spec/dummy_app.rb +52 -0
  376. data/spec/models/application_spec.rb +53 -0
  377. data/spec/models/developer_spec.rb +23 -0
  378. data/spec/spec_helper.rb +29 -0
  379. data/test/dummy/Rakefile +7 -0
  380. data/test/dummy/app/assets/javascripts/application.js +7 -0
  381. data/test/dummy/app/assets/stylesheets/admin.css +200 -0
  382. data/test/dummy/app/assets/stylesheets/application.css +47 -0
  383. data/test/dummy/app/assets/stylesheets/components.css.scss +211 -0
  384. data/test/dummy/app/assets/stylesheets/layout.css.scss +143 -0
  385. data/test/dummy/app/controllers/admin/admins_controller.rb +7 -0
  386. data/test/dummy/app/controllers/admin/base_controller.rb +12 -0
  387. data/test/dummy/app/controllers/admin/bookmarks_controller.rb +7 -0
  388. data/test/dummy/app/controllers/admin/users_controller.rb +19 -0
  389. data/test/dummy/app/controllers/api/base_controller.rb +5 -0
  390. data/test/dummy/app/controllers/api/bookmarks_controller.rb +35 -0
  391. data/test/dummy/app/controllers/api/users_controller.rb +19 -0
  392. data/test/dummy/app/controllers/application_controller.rb +31 -0
  393. data/test/dummy/app/controllers/home_controller.rb +7 -0
  394. data/test/dummy/app/controllers/login_controller.rb +65 -0
  395. data/test/dummy/app/helpers/application_helper.rb +9 -0
  396. data/test/dummy/app/helpers/home_helper.rb +2 -0
  397. data/test/dummy/app/mailers/.gitkeep +0 -0
  398. data/test/dummy/app/models/.gitkeep +0 -0
  399. data/test/dummy/app/models/admin.rb +4 -0
  400. data/test/dummy/app/models/admin_filter.rb +7 -0
  401. data/test/dummy/app/models/bookmark.rb +7 -0
  402. data/test/dummy/app/models/user.rb +34 -0
  403. data/test/dummy/app/views/admin/admins/index.html.erb +7 -0
  404. data/test/dummy/app/views/admin/bookmarks/index.html.erb +5 -0
  405. data/test/dummy/app/views/admin/users/index.html.erb +10 -0
  406. data/test/dummy/app/views/demo/index.rhtml +108 -0
  407. data/test/dummy/app/views/demo/tokens.rhtml +35 -0
  408. data/test/dummy/app/views/home/index.html.erb +43 -0
  409. data/test/dummy/app/views/layouts/_footer.html.erb +16 -0
  410. data/test/dummy/app/views/layouts/_header.html.erb +22 -0
  411. data/test/dummy/app/views/layouts/admin.html.erb +97 -0
  412. data/test/dummy/app/views/layouts/application.html.erb +25 -0
  413. data/test/dummy/app/views/layouts/minimal.html.erb +37 -0
  414. data/test/dummy/app/views/layouts/popup.html.erb +43 -0
  415. data/test/dummy/app/views/login/index.html.erb +34 -0
  416. data/test/dummy/app/views/login/register.html.erb +51 -0
  417. data/test/dummy/config.ru +4 -0
  418. data/test/dummy/config/application.rb +51 -0
  419. data/test/dummy/config/boot.rb +10 -0
  420. data/test/dummy/config/database.yml +25 -0
  421. data/test/dummy/config/environment.rb +5 -0
  422. data/test/dummy/config/environments/development.rb +30 -0
  423. data/test/dummy/config/environments/production.rb +60 -0
  424. data/test/dummy/config/environments/test.rb +42 -0
  425. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  426. data/test/dummy/config/initializers/inflections.rb +10 -0
  427. data/test/dummy/config/initializers/mime_types.rb +5 -0
  428. data/test/dummy/config/initializers/secret_token.rb +7 -0
  429. data/test/dummy/config/initializers/session_store.rb +8 -0
  430. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  431. data/test/dummy/config/locales/en.yml +5 -0
  432. data/test/dummy/config/platform/api/0/bookmark.yml +18 -0
  433. data/test/dummy/config/platform/api/0/user.yml +17 -0
  434. data/test/dummy/config/platform/api/1/bookmark.yml +58 -0
  435. data/test/dummy/config/platform/api/1/user.yml +36 -0
  436. data/test/dummy/config/platform/config.yml +135 -0
  437. data/test/dummy/config/platform/data/default_applications.yml +39 -0
  438. data/test/dummy/config/platform/data/default_categories.yml +56 -0
  439. data/test/dummy/config/platform/data/default_permissions.yml +0 -0
  440. data/test/dummy/config/platform/site/features.yml +66 -0
  441. data/test/dummy/config/platform/site/sample_apps.yml +100 -0
  442. data/test/dummy/config/routes.rb +30 -0
  443. data/test/dummy/config/tr8n/config.yml +247 -0
  444. data/test/dummy/config/tr8n/data/ip_locations.csv +93460 -0
  445. data/test/dummy/config/tr8n/rules/default_date_rules.yml +20 -0
  446. data/test/dummy/config/tr8n/rules/default_gender_list_rules.yml +82 -0
  447. data/test/dummy/config/tr8n/rules/default_gender_rules.yml +20 -0
  448. data/test/dummy/config/tr8n/rules/default_language_cases.yml +272 -0
  449. data/test/dummy/config/tr8n/rules/default_list_rules.yml +19 -0
  450. data/test/dummy/config/tr8n/rules/default_numeric_rules.yml +42 -0
  451. data/test/dummy/config/tr8n/rules/default_value_rules.yml +18 -0
  452. data/test/dummy/config/tr8n/site/default_glossary.yml +18 -0
  453. data/test/dummy/config/tr8n/site/default_languages.yml +1591 -0
  454. data/test/dummy/config/tr8n/site/features.yml +111 -0
  455. data/test/dummy/config/tr8n/site/shortcuts.yml +55 -0
  456. data/test/dummy/config/tr8n/site/sitemap.json +42 -0
  457. data/test/dummy/config/tr8n/tokens/data.yml +19 -0
  458. data/test/dummy/config/tr8n/tokens/decorations.yml +19 -0
  459. data/test/dummy/config/will_filter/config.yml +99 -0
  460. data/test/dummy/db/migrate/20101207014543_create_users.rb +23 -0
  461. data/test/dummy/db/migrate/20110113223509_create_admins.rb +15 -0
  462. data/test/dummy/db/migrate/20110930041143_create_will_filter_filters.rb +15 -0
  463. data/test/dummy/db/migrate/20110930041150_create_tr8n_tables.rb +350 -0
  464. data/test/dummy/db/migrate/20111004075531_create_platform_tables.rb +262 -0
  465. data/test/dummy/db/migrate/20111012055603_create_bookmarks.rb +10 -0
  466. data/test/dummy/db/schema.rb +683 -0
  467. data/test/dummy/lib/assets/.gitkeep +0 -0
  468. data/test/dummy/lib/platform/api/bookmark_proxy_0.rb +12 -0
  469. data/test/dummy/lib/platform/api/bookmark_proxy_1.rb +12 -0
  470. data/test/dummy/lib/platform/api/user_proxy_0.rb +12 -0
  471. data/test/dummy/lib/platform/api/user_proxy_1.rb +12 -0
  472. data/test/dummy/log/.gitkeep +0 -0
  473. data/test/dummy/public/404.html +26 -0
  474. data/test/dummy/public/422.html +26 -0
  475. data/test/dummy/public/500.html +26 -0
  476. data/test/dummy/public/favicon.ico +0 -0
  477. data/test/dummy/script/rails +6 -0
  478. data/test/dummy/test/fixtures/documents.yml +11 -0
  479. data/test/dummy/test/unit/document_test.rb +7 -0
  480. metadata +886 -0
@@ -0,0 +1,134 @@
1
+ <%= render :partial => "/platform/developer/common/header" %>
2
+ <%= javascript_include_tag("platform/api_explorer.js") %>
3
+ <%= stylesheet_link_tag("platform/api_explorer.css") %>
4
+
5
+ <div class="section_title">
6
+ <div style="float:right; padding-top:6px; font-size:12px; color: #ccc;">
7
+ </div>
8
+
9
+ <%=tr("#{Platform::Config.site_info[:title]} API Explorer", nil) %>
10
+ </div>
11
+
12
+ <div class="section">
13
+ <% if Platform::Config.api_explorer_app? %>
14
+ <div class="section grey" style="margin-top:5px;margin-bottom:0px;">
15
+ <table style="width:100%">
16
+ <tr>
17
+ <td style="width:100px; vertical-align:middle"><%=tr("Access Token:")%></td>
18
+ <td style="vertical-align:middle">
19
+ <%=text_field_tag(:access_token, "", :style=>"width:600px;")%> &nbsp;
20
+ <%=link_to_function("X", "Platform.element('access_token').value = '';")%>
21
+ </td>
22
+ <td style="width:150px; text-align:right;">
23
+ <button class="platform_btn platform_submit_btn" onClick="getAccessToken(); return false;">
24
+ <span><%=tr("Get Access Token")%></span>
25
+ </button>
26
+ </td>
27
+ </tr>
28
+ </table>
29
+ </div>
30
+ <% end %>
31
+
32
+ <div class="section blue" style="margin-top:10px;">
33
+ <table>
34
+ <tr>
35
+ <td style="width:50px;">
36
+ <%=select_tag("api_version", options_for_select(Platform::Config.api_supported_version_options, @api_version), :onChange=>"switchApiVersion()")%>
37
+ </td>
38
+ <td style="width:80px;">
39
+ <%=select_tag("request_method", options_for_select(['GET', 'POST', 'PUT', 'DELETE'], params[:method] || 'GET'), :style=>"", :onChange=>"switchRequestMethod()")%>
40
+ </td>
41
+ <td>
42
+ <table style="border:1px solid #ccc;padding:0px;margin:0px;font-size:12px;color:#888;vertical-align:middle; background-color:white;height:23px;">
43
+ <tr>
44
+ <td><span style="padding-left:5px;vertical-align:middle;white-space:nowrap;">http://<%=Platform::Config.api_base_url%>/</span></td>
45
+ <td><%=text_field_tag(:api_path, params[:path], :style=>"width:500px;border:0px;padding:0px;margin:0px;font-size:12px;vertical-align:middle;", :onKeyUp=>"if (event.keyCode == 13) {api_history_index=-1; submitRequest();}")%></td>
46
+ <td><span style="float:right;padding-right:5px;"><%=link_to_function(image_tag("platform/arrow_down.gif"), "toggleApiOptions(this)")%></span></td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ <td style="padding-left:5px;text-align:right;">
51
+ <button class="platform_btn platform_submit_btn" onClick="api_history_index=-1; submitRequest(); return false;">
52
+ <span><%=tr("Submit")%></span>
53
+ </button>
54
+ </td>
55
+ </tr>
56
+ <tr>
57
+ <td></td><td></td>
58
+ <td style="border:0px;">
59
+ <div style="padding-top:5px;" id="post_params">
60
+ <div id="post_fields">
61
+ </div>
62
+ <div style="padding-top:5px;">
63
+ <%=link_to_function(tr("+ add a param"), "addPostField('', '')")%>
64
+ <span id="remove_all_params_link" style="display:none">
65
+ |
66
+ <%=link_to_function(tr("remove all"), "removeAllPostFields()")%>
67
+ </span>
68
+ </div>
69
+ </div>
70
+ </td>
71
+ <td></td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+
76
+ <div class="section grey" style="margin-bottom:0px;background-color:#EEEEEE">
77
+ <div style="float:right;">
78
+ <%=link_to_function('<<', "makePreviousCall()", :class=>"button super gray small", :id => "history_previous") %>
79
+ <%=link_to_function('>>', "makeNextCall()", :class=>"button super gray small", :id => "history_next") %>
80
+ <%=link_to_function(image_tag("platform/arrow_down.gif", :style=>"vertical-align:middle"), "toggleApiHistory(this)", :class=>"button super gray small")%>
81
+ </div>
82
+
83
+ <%=link_to_function(image_tag("platform/clipboard_icon.gif", :style=>"height:14px;"), "copyToClipboard(this)", :class=>"button super gray small", :id => "") %>
84
+ <%=link_to_function(image_tag("platform/world_link.png", :style=>"height:14px;"), "copyUrlToClipboard(this)", :class=>"button super gray small", :id => "") %>
85
+ <%=link_to_function(image_tag("platform/minus_node.png", :style=>"height:14px;"), "expandAllResultObjects(false)", :class=>"button super gray small", :id => "") %>
86
+ <%=link_to_function(image_tag("platform/plus_node.png", :style=>"height:14px;"), "expandAllResultObjects(true)", :class=>"button super gray small", :id => "") %>
87
+ </div>
88
+
89
+ <div class="section grey response_data" id="response_data" style="margin-top:5px;background-color:#F2F2F2">
90
+
91
+ </div>
92
+
93
+ <div class="section blue status" id="status" style="margin-bottom:0px;">
94
+
95
+ </div>
96
+
97
+ </div>
98
+
99
+ <div id="api_options" class="api_options" style="display:none;">
100
+ <div id="api_options_container" class="inner">
101
+ </div>
102
+ </div>
103
+
104
+ <div id="api_history" class="api_options" style="display:none;">
105
+ <div id="api_history_container" class="inner">
106
+ </div>
107
+ </div>
108
+
109
+ <div id="api_clipboard" class="api_options" style="display:none;">
110
+ <div id="api_clipboard_container" class="inner">
111
+ <%=text_area_tag("api_clipboard_text", "", :style => "width:745px;height:300px;")%>
112
+ <div style="padding-top:5px;color:#444;">
113
+ <%=tr("Use ctrl+c to copy the contents of the text area to your clipboard.")%>
114
+ </div>
115
+ </div>
116
+ </div>
117
+
118
+ <script>
119
+
120
+ Platform.Utils.addEvent(window, 'load', function() {
121
+ initApiExplorer('<%=Platform::Config.api_explorer_app_id%>', '<%=Platform::Config.site_base_url%>', '<%=Platform::Config.api_base_url%>', '<%=@api_history%>');
122
+ <% params.each do |key, value| %>
123
+ <% next if ['controller', 'action', 'access_token', 'method', 'path', 'api_version'].include?(key) %>
124
+ addPostField('<%=key%>', '<%=value%>');
125
+ <% end %>
126
+
127
+ <% if params['api_version'] %>
128
+ Platform.element("api_version").value = "<%=params['api_version']%>";
129
+ <% end %>
130
+ });
131
+
132
+ </script>
133
+
134
+ <%= render :partial => "/platform/developer/common/footer" %>
@@ -0,0 +1,4 @@
1
+ <script>
2
+ window.opener.updateAccessToken("<%=params[:access_token]%>");
3
+ window.close();
4
+ </script>
@@ -0,0 +1,44 @@
1
+ <% doc_server = "http://api-preview.geni.com" %>
2
+
3
+ <div style="border-bottom: 1px solid #ccc; margin:10px; font-weight:bold;">
4
+ <div style="float:right">Version <%=@api_version%></div>
5
+ <%=tr("#{Platform::Config.site_title} API List")%>
6
+ </div>
7
+
8
+ <%
9
+ ref = Platform::Config.api_reference(@api_version)
10
+ columns = Platform::Config.api_explorer_groups(@api_version)
11
+ col_size = 100 / columns.size
12
+ %>
13
+
14
+ <table style="width:100%">
15
+ <tr>
16
+ <% columns.each do |objects| %>
17
+ <td style="width:<%=col_size%>%">
18
+ <% objects.each do |object_key| %>
19
+ <% object = ref[object_key] %>
20
+ <% next unless object %>
21
+ <div class="api_list">
22
+ <%=platform_toggler_tag("#{object_key}_api")%>
23
+ <%=link_to_function(object_key.titleize, "updateApi('#{object_key}', '#{object[:method] || 'GET'}', {})")%>
24
+ <%=platform_documentation_tag(:path => object[:path], :version => @api_version)%>
25
+ </div>
26
+ <div id="<%=object_key%>_api" class="api_method_list">
27
+ <% if object[:actions] %>
28
+ <ul>
29
+ <% object[:actions].keys.sort.each do |action_key| %>
30
+ <% object_action = object[:actions][action_key] %>
31
+ <li>
32
+ <%=link_to_function(action_key, "updateApi('#{object_action[:path]}', '#{object_action[:method] || 'GET'}', {})")%>
33
+ <%=platform_documentation_tag(:path => object_action[:path], :version => @api_version)%>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ <% end %>
38
+ </div>
39
+ <% end %>
40
+ </td>
41
+ <% end %>
42
+ </tr>
43
+ </table>
44
+
@@ -0,0 +1,340 @@
1
+ <style>
2
+ .xxlong_input {
3
+ width:450px;
4
+ }
5
+ </style>
6
+ <table style="width:100%;margin-bottom:20px;">
7
+ <tr>
8
+ <td colspan="3">
9
+ <div class="edit_section_header">
10
+ <%=tr('Basic Information', 'Client application section') %>
11
+ </div>
12
+ </td>
13
+ </tr>
14
+ <% if @current_app || @app.version %>
15
+ <tr>
16
+ <th>
17
+ <%=tr('Version:', 'Client application field label')%>
18
+ </td>
19
+ <td>
20
+ <%=form.text_field :version, :class=>'xxlong_input'%>
21
+ </td>
22
+ <td class="comments">
23
+ <%=tr("Required.")%>
24
+ <%=tr("New version of your application.", 'Client application field comment')%>
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ <tr>
29
+ <th>
30
+ <%=tr('Application Name:', 'Client application field label')%>
31
+ </td>
32
+ <td>
33
+ <%=form.text_field :name, :class=>'xxlong_input'%>
34
+ </td>
35
+ <td class="comments">
36
+ <%=tr("Required.")%>
37
+ <%=tr("Name of your application.", 'Client application field comment')%>
38
+ </td>
39
+ </tr>
40
+ <tr>
41
+ <th>
42
+ <%=tr('Description:', 'Client application field label')%>
43
+ </td>
44
+ <td>
45
+ <%=form.text_area :description, :class=>'xxlong_input', :style=>"height:150px;"%>
46
+ </td>
47
+ <td class="comments">
48
+ <%=tr("Description of your application.", 'Client application field comment')%>
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <th>
53
+ <%=tr('Icon:', 'Client application field label')%>
54
+ </th>
55
+ <td>
56
+ <div id="icon_field" style="display:none">
57
+ <%= file_field_tag "new_icon", :size=>"45", :accept => 'image/png,image/gif,image/jpeg', :id => 'new_icon' %>
58
+ </div>
59
+ <div id="icon_preview">
60
+ <span style="float:right; font-size:10px;">
61
+ <%=link_to_function(tr("Change your icon", 'Client application field action'), "Platform.Effects.hide('icon_preview');Platform.Effects.show('icon_field');")%>
62
+ </span>
63
+ <%=image_tag(@app.icon_url, :style => "width:16px;height:16px;")%>
64
+ </div>
65
+ </td>
66
+ <td class="comments">
67
+ <%=tr("Appears next to your app name throughout the site (16x16)", 'Client application field comment')%>
68
+ </td>
69
+ </tr>
70
+
71
+ <tr>
72
+ <th>
73
+ <%=tr('Logo:', 'Client application field label')%>
74
+ </th>
75
+ <td>
76
+ <div id="logo_field" style="display:none">
77
+ <%= file_field_tag "new_logo", :size=>"45", :accept => 'image/png,image/gif,image/jpeg', :id => 'new_logo' %>
78
+ </div>
79
+ <div id="logo_preview">
80
+ <span style="float:right; font-size:10px;">
81
+ <%=link_to_function(tr("Change your logo", 'Client application field action'), "Platform.Effects.hide('logo_preview');Platform.Effects.show('logo_field');")%>
82
+ </span>
83
+ <%=image_tag(@app.logo_url, :style => "width:75px;height:75px;")%>
84
+ </div>
85
+ </td>
86
+ <td class="comments">
87
+ <%=tr("Appears in the app directory (75x75)", 'Client application field comment')%>
88
+ </td>
89
+ </tr>
90
+
91
+ <tr>
92
+ <th>
93
+ <%=tr('Language:', 'Client application field label')%>
94
+ </th>
95
+ <td>
96
+ <%=select_tag("application[locale]", options_for_select(@languages, @app.locale || Tr8n::Config.default_locale)) %>
97
+ </td>
98
+ <td class="comments">
99
+ <%=tr("The native language of your app.", 'Client application field comment')%>
100
+ </td>
101
+ </tr>
102
+
103
+ <tr>
104
+ <th>
105
+ <%=tr('Contact Email:', 'Client application field label')%>
106
+ </th>
107
+ <td>
108
+ <%=form.text_field :contact_email, :class=>'xxlong_input'%>
109
+ </td>
110
+ <td class="comments">
111
+ <%=tr("The email address where we can contact you or your company", 'Client application field comment')%>
112
+ </td>
113
+ </tr>
114
+
115
+ <tr>
116
+ <th>
117
+ <%=tr('Support URL:', 'Client application field label')%>
118
+ </th>
119
+ <td>
120
+ <%=form.text_field :support_url, :class=>'xxlong_input'%>
121
+ </td>
122
+ <td class="comments">
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <th>
127
+ <%=tr('Privacy Policy URL:', 'Client application field label')%>
128
+ </th>
129
+ <td>
130
+ <%=form.text_field :privacy_policy_url, :class=>'xxlong_input'%>
131
+ </td>
132
+ <td class="comments">
133
+ <%=tr("All apps must have and display a Privacy Policy.", 'Client application field comment')%>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <th>
138
+ <%=tr('Terms of Service URL:', 'Client application field label')%>
139
+ </th>
140
+ <td>
141
+ <%=form.text_field :terms_of_service_url, :class=>'xxlong_input'%>
142
+ </td>
143
+ <td class="comments">
144
+ <%=tr("The URL to your app's Terms of Service.", 'Client application field comment')%>
145
+ </td>
146
+ </tr>
147
+
148
+ <tr>
149
+ <td colspan="3">
150
+ <div class="edit_section_header" style="margin-top:10px;">
151
+ <%=tr('Website Settings', 'Client application section') %>
152
+ </div>
153
+ </td>
154
+ </tr>
155
+
156
+ <tr>
157
+ <th>
158
+ <%=tr('Site URL:', 'Client application field label')%>
159
+ </th>
160
+ <td>
161
+ <%=form.text_field :url, :class=>'xxlong_input'%>
162
+ </td>
163
+ <td class="comments">
164
+ <%=tr("Required: URL of your site.", 'Client application field comment')%>
165
+ </td>
166
+ </tr>
167
+
168
+ <tr>
169
+ <th>
170
+ <%=tr('Site Domain:', 'Client application field label')%>
171
+ </th>
172
+ <td>
173
+ <%=form.text_field :site_domain, :class=>'xxlong_input'%>
174
+ </td>
175
+ <td class="comments">
176
+ <%=tr("Required: Domain to enable authentication (subdomains included).", 'Client application field comment')%>
177
+ </td>
178
+ </tr>
179
+
180
+ <tr>
181
+ <td colspan="3">
182
+ <div class="edit_section_header" style="margin-top:10px;">
183
+ <%=tr('Authentication', 'Client application section') %>
184
+ </div>
185
+ </td>
186
+ </tr>
187
+
188
+ <tr>
189
+ <th>
190
+ <%=tr('Application Type:','Client application field label')%>
191
+ </th>
192
+ <td style="height:30px;">
193
+ <label for="option1" style="vertical-align: middle"><%=form.radio_button :mobile_application_type, 'web', :id => "option1", :style=>"vertical-align: top;" %> Web</label>
194
+ &nbsp;
195
+ <label for="option2" style="vertical-align: middle"><%=form.radio_button :mobile_application_type, 'native', :id => "option2", :style=>"vertical-align: top;" %> Native/Desktop</label>
196
+ </td>
197
+ <td class="comments">
198
+ <%=tr("Choose your application type.", 'Client application field comment')%>
199
+ </td>
200
+ </tr>
201
+
202
+ <tr>
203
+ <th>
204
+ <%=tr("{site_title} API Version:", 'Client application field label', :site_title => Platform::Config.site_title)%>
205
+ </td>
206
+ <td>
207
+ <%=select_tag("application[api_version]", options_for_select(Platform::Config.api_supported_version_options, @app.api_version)) %>
208
+ </td>
209
+ <td class="comments">
210
+ <%=tr("Required.")%>
211
+ <%=tr("API version your application is using.", 'Client application field comment')%>
212
+ </td>
213
+ </tr>
214
+
215
+ <tr>
216
+ <th>
217
+ <%=tr('Callback URL:','Client application field label')%>
218
+ </th>
219
+ <td>
220
+ <%=form.text_field :callback_url, :class=>'xxlong_input'%>
221
+ </td>
222
+ <td class="comments">
223
+ <%=tr("We'll direct users to this URL when they authorize your application.", 'Client application field comment')%>
224
+ </td>
225
+ </tr>
226
+
227
+ <tr>
228
+ <th>
229
+ <%=tr('Deauthorize Callback URL:','Client application field label')%>
230
+ </th>
231
+ <td>
232
+ <%=form.text_field :deauthorize_callback_url, :class=>'xxlong_input'%>
233
+ </td>
234
+ <td class="comments">
235
+ <%=tr("We will post to this URL when user removes the application.", 'Client application field comment')%>
236
+ </td>
237
+ </tr>
238
+
239
+ <% if Platform::Config.enable_embedded_applications? %>
240
+ <tr>
241
+ <td colspan="3">
242
+ <div class="edit_section_header" style="margin-top:10px;">
243
+ <%=tr('On {site_title}', 'Client application section', :site_title => Platform::Config.site_title) %>
244
+ </div>
245
+ </td>
246
+ </tr>
247
+
248
+ <tr>
249
+ <th>
250
+ <%=tr('Canvas Page:','Client application field label')%>
251
+ </th>
252
+ <td>
253
+ http://<%=Platform::Config.site_base_url %>/platform/apps/<%=form.text_field :canvas_name, :class=>'long_input'%>/
254
+ </td>
255
+ <td class="comments">
256
+ <%=tr("The base URL of your app on the site.", 'Client application field comment')%>
257
+ </td>
258
+ </tr>
259
+ <tr>
260
+ <th>
261
+ <%=tr('Canvas URL:','Client application field label')%>
262
+ </th>
263
+ <td style="height:30px;">
264
+ <%=form.text_field :canvas_url, :class=>'xxlong_input'%>
265
+ </td>
266
+ <td class="comments">
267
+ <%=tr("We will pull the content for your app's canvas pages from this base URL.", 'Client application field comment')%>
268
+ </td>
269
+ </tr>
270
+ <tr>
271
+ <th>
272
+ <%=tr('IFrame Size:','Client application field label')%>
273
+ </th>
274
+ <td style="height:30px;">
275
+ <label for="resize_option1" style="vertical-align: middle"><%=form.radio_button :auto_resize, false, :id => "resize_option1", :style=>"vertical-align: top;" %> <%=tr("Show scrollbars")%> </label>
276
+ <label for="resize_option2" style="vertical-align: middle"><%=form.radio_button :auto_resize, true, :id => "resize_option2", :style=>"vertical-align: top;" %> <%=tr("Auto-resize")%></label>
277
+ </td>
278
+ <td class="comments">
279
+ <%=tr("Choose \"Auto-resize\" if you are going to make the iFrame grow to the height of your app's content", 'Client application field comment')%>
280
+ </td>
281
+ </tr>
282
+ <tr>
283
+ <th>
284
+ <%=tr('Authorization:','Client application field label')%>
285
+ </th>
286
+ <td style="height:30px;">
287
+ <label for="signin_option1" style="vertical-align: middle"><%=form.radio_button :auto_signin, true, :id => "signin_option1", :style=>"vertical-align: top;" %> <%=tr("Platform will handle authorization")%></label>
288
+ <label for="signin_option2" style="vertical-align: middle"><%=form.radio_button :auto_signin, false, :id => "signin_option2", :style=>"vertical-align: top;" %> <%=tr("App will handle authorization") %></label>
289
+ </td>
290
+ <td class="comments">
291
+ <%=tr("Choose \"App will handle authorization\" if your application will handle the authorization. Otherwise we will make sure the user has authorized your application and will pass you an access token as a parameter.", 'Client application field comment')%>
292
+ </td>
293
+ </tr>
294
+ <% end %>
295
+
296
+ <% if Platform::Config.enable_mobile_applications? %>
297
+ <tr>
298
+ <td colspan="3">
299
+ <div class="edit_section_header" style="margin-top:10px;">
300
+ <%=tr('Mobile Application', 'Client application section') %>
301
+ </div>
302
+ </td>
303
+ </tr>
304
+ <tr>
305
+ <th>
306
+ <%=tr('iOS Bundle ID:','Client application field label')%>
307
+ </th>
308
+ <td>
309
+ <%=form.text_field :ios_bundle_id, :class=>'xxlong_input'%>
310
+ </td>
311
+ <td class="comments">
312
+ <%=tr("Required.")%>
313
+ <%=tr("iOS Bundle ID for iOS native app.", 'Client application field comment')%>
314
+ </td>
315
+ </tr>
316
+ <tr>
317
+ <th>
318
+ <%=tr('iTunes App Store ID:','Client application field label')%>
319
+ </th>
320
+ <td>
321
+ <%=form.text_field :itunes_app_store_id, :class=>'xxlong_input'%>
322
+ </td>
323
+ <td class="comments">
324
+ <%=tr("We will use it for linking to your application on the App Store.", 'Client application field comment')%>
325
+ </td>
326
+ </tr>
327
+ <tr>
328
+ <th>
329
+ <%=tr('Android Key Hash:','Client application field label')%>
330
+ </th>
331
+ <td>
332
+ <%=form.text_field :android_key_hash, :class=>'xxlong_input'%>
333
+ </td>
334
+ <td class="comments">
335
+ <%=tr("We will use it for extra security during authentication.", 'Client application field comment')%>
336
+ </td>
337
+ </tr>
338
+ <% end %>
339
+
340
+ </table>