houston-core 0.8.4 → 0.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +72 -78
  4. data/app/assets/javascripts/houston/app/models/role.coffee +4 -0
  5. data/app/assets/javascripts/houston/app/views/nested_resources.coffee +44 -0
  6. data/app/assets/javascripts/houston/app/views/team_roles_view.coffee +10 -0
  7. data/app/assets/javascripts/houston/application.js +3 -1
  8. data/app/assets/javascripts/houston/core/ajax_helpers.coffee +26 -0
  9. data/app/assets/javascripts/houston/core/app.coffee +0 -45
  10. data/app/assets/javascripts/houston/core/errors.coffee +1 -12
  11. data/app/assets/javascripts/houston/core/handlebars_helpers.coffee +8 -70
  12. data/app/assets/javascripts/houston/core/jquery_extensions.coffee +0 -138
  13. data/app/assets/javascripts/houston/core/timeline_helpers.coffee +44 -0
  14. data/app/assets/javascripts/houston/core/uploader_helpers.coffee +99 -0
  15. data/app/assets/javascripts/houston/vendor.js +26 -9
  16. data/app/assets/stylesheets/houston/application/actions.scss +22 -0
  17. data/app/assets/stylesheets/houston/application/navigation.scss +2 -2
  18. data/app/assets/stylesheets/houston/application/{freight_train.css.scss → nested_resources.scss} +1 -0
  19. data/app/assets/stylesheets/houston/core/alerts.scss +0 -4
  20. data/app/assets/stylesheets/houston/core/timeline.scss +204 -0
  21. data/app/assets/templates/houston/teams/roles/index.hbs +1 -0
  22. data/app/assets/templates/houston/teams/roles/show.hbs +19 -0
  23. data/app/channels/events_channel.rb +1 -1
  24. data/app/concerns/houston/props.rb +3 -2
  25. data/app/controllers/actions_controller.rb +8 -3
  26. data/app/controllers/application_controller.rb +9 -12
  27. data/app/controllers/authorizations_controller.rb +41 -14
  28. data/app/controllers/errors_controller.rb +3 -3
  29. data/app/controllers/project_follows_controller.rb +23 -0
  30. data/app/controllers/project_options_controller.rb +1 -1
  31. data/app/controllers/user_options_controller.rb +1 -1
  32. data/app/helpers/actions_helper.rb +12 -0
  33. data/app/helpers/application_helper.rb +0 -10
  34. data/app/helpers/layout_helper.rb +20 -0
  35. data/app/helpers/markdown_helper.rb +2 -10
  36. data/app/helpers/navigation_helper.rb +5 -5
  37. data/app/helpers/project_helper.rb +6 -0
  38. data/app/helpers/url_helper.rb +4 -4
  39. data/app/helpers/view_extensions_helper.rb +20 -0
  40. data/app/models/action.rb +61 -44
  41. data/app/models/authorization.rb +55 -10
  42. data/app/models/follow.rb +6 -0
  43. data/app/models/persistent_trigger.rb +11 -1
  44. data/app/models/project.rb +5 -27
  45. data/app/models/user.rb +15 -59
  46. data/app/presenters/project_presenter.rb +2 -2
  47. data/app/views/actions/_actions.html.erb +8 -5
  48. data/app/views/actions/index.html.erb +1 -1
  49. data/app/views/actions/running.html.erb +9 -15
  50. data/app/views/actions/show.html.erb +6 -3
  51. data/app/views/actions/unqueued.html.erb +41 -0
  52. data/app/views/authorizations/_form.html.erb +28 -16
  53. data/app/views/authorizations/index.html.erb +9 -4
  54. data/app/views/{oauth/providers/edit.html.erb → authorizations/oauth2_callback.html.erb} +3 -2
  55. data/app/views/devise/sessions/new.html.erb +0 -8
  56. data/app/views/errors/index.html.erb +9 -5
  57. data/app/views/layouts/_navigation.html.erb +9 -0
  58. data/app/views/layouts/application.html.erb +11 -6
  59. data/app/views/layouts/dashboard.html.erb +9 -0
  60. data/app/views/projects/_form.html.erb +7 -18
  61. data/app/views/projects/_header.html.erb +2 -6
  62. data/app/views/projects/index.html.erb +4 -4
  63. data/app/views/teams/_form.html.erb +7 -17
  64. data/app/views/teams/index.html.erb +1 -1
  65. data/app/views/users/_form.html.erb +1 -38
  66. data/config/application.rb +8 -5
  67. data/config/initializers/devise.rb +0 -14
  68. data/config/initializers/secret_token.rb +8 -13
  69. data/config/routes.rb +12 -28
  70. data/db/migrate/20130706141443_drop_deprecated_project_roles.rb +5 -1
  71. data/db/migrate/20170118005958_remove_antecedents_from_versions_of_tickets.rb +1 -1
  72. data/db/migrate/20170130011016_drop_users_environments_subscribed_to.rb +9 -0
  73. data/db/migrate/20170205004452_drop_settings.rb +12 -0
  74. data/db/migrate/20170206002030_drop_extension_hstore.rb +9 -0
  75. data/db/migrate/20170206002732_drop_legacy_columns_from_users.rb +10 -0
  76. data/db/migrate/20170209022159_rename_projects_color_to_color_name.rb +5 -0
  77. data/db/migrate/20170213001453_change_providers_from_models_to_extensions.rb +27 -0
  78. data/db/migrate/20170215012012_add_props_to_authorizations.rb +5 -0
  79. data/db/migrate/20170216041034_add_user_to_persistent_triggers.rb +5 -0
  80. data/db/migrate/20170226201504_create_follows.rb +20 -0
  81. data/db/migrate/20170301014051_drop_name_from_authorizations.rb +9 -0
  82. data/db/migrate/20170307032041_add_created_at_to_actions.rb +11 -0
  83. data/db/migrate/20170307035755_allow_actions_started_at_to_be_null.rb +5 -0
  84. data/db/migrate/20170310024505_replace_authorizations_provider_name_with_type.rb +12 -0
  85. data/db/migrate/20170329030329_drop_consumer_tokens.rb +9 -0
  86. data/db/structure.sql +187 -212
  87. data/houston-core.gemspec +10 -13
  88. data/lib/houston/boot.rb +1 -4
  89. data/lib/houston/boot/actions.rb +24 -21
  90. data/lib/houston/boot/configuration.rb +46 -113
  91. data/lib/houston/boot/extensions.rb +54 -341
  92. data/lib/houston/boot/extensions/deprecated.rb +194 -0
  93. data/lib/houston/boot/extensions/dsl.rb +99 -0
  94. data/lib/houston/boot/extensions/events.rb +81 -0
  95. data/lib/houston/boot/extensions/features.rb +42 -0
  96. data/lib/houston/boot/extensions/layout.rb +70 -0
  97. data/lib/houston/boot/extensions/navigation.rb +42 -0
  98. data/lib/houston/boot/extensions/oauth.rb +62 -0
  99. data/lib/houston/boot/extensions/serializers.rb +29 -0
  100. data/lib/houston/boot/extensions/view.rb +34 -0
  101. data/lib/houston/boot/observer.rb +10 -5
  102. data/{app/models/oauth → lib/houston/boot}/provider.rb +7 -5
  103. data/lib/houston/boot/running_as.rb +0 -5
  104. data/lib/houston/boot/serializer.rb +12 -6
  105. data/lib/houston/boot/{active_record_serializer.rb → serializers/active_record_serializer.rb} +0 -2
  106. data/lib/houston/boot/{readonly_hash_serializer.rb → serializers/readonly_hash_serializer.rb} +0 -2
  107. data/lib/houston/boot/timer.rb +10 -0
  108. data/lib/houston/boot/triggers.rb +27 -8
  109. data/lib/houston/version.rb +1 -1
  110. data/templates/new-instance/.gitignore +0 -4
  111. data/templates/new-instance/config/main.rb +8 -10
  112. data/templates/new-module/test/dummy/houston.rb +1 -0
  113. data/test/acceptance/layout_test.rb +58 -0
  114. data/test/acceptance/updating_props_test.rb +72 -0
  115. data/test/support/config.rb +1 -0
  116. data/test/unit/extensions/events_extension_test.rb +33 -0
  117. data/test/unit/extensions/layout_extension_test.rb +74 -0
  118. data/test/unit/extensions/navigation_extension_test.rb +62 -0
  119. data/test/unit/extensions/oauth_extension_test.rb +91 -0
  120. data/test/unit/extensions/project_features_extension_test.rb +79 -0
  121. data/test/unit/extensions/serializers_extension_test.rb +47 -0
  122. data/test/unit/extensions/view_extension_test.rb +98 -0
  123. data/test/unit/models/actions_test.rb +11 -5
  124. data/test/unit/models/configuration_test.rb +0 -8
  125. data/test/unit/models/observer_test.rb +16 -0
  126. data/test/unit/models/persistent_trigger_test.rb +29 -2
  127. data/test/unit/models/serializer_test.rb +6 -0
  128. data/test/unit/models/timer_test.rb +88 -0
  129. metadata +87 -168
  130. data/app/assets/font/octicons.eot +0 -0
  131. data/app/assets/font/octicons.svg +0 -198
  132. data/app/assets/font/octicons.ttf +0 -0
  133. data/app/assets/font/octicons.woff +0 -0
  134. data/app/assets/font/roboto-black-webfont.eot +0 -0
  135. data/app/assets/font/roboto-black-webfont.svg +0 -675
  136. data/app/assets/font/roboto-black-webfont.ttf +0 -0
  137. data/app/assets/font/roboto-black-webfont.woff +0 -0
  138. data/app/assets/font/roboto-blackitalic-webfont.eot +0 -0
  139. data/app/assets/font/roboto-blackitalic-webfont.svg +0 -677
  140. data/app/assets/font/roboto-blackitalic-webfont.ttf +0 -0
  141. data/app/assets/font/roboto-blackitalic-webfont.woff +0 -0
  142. data/app/assets/font/roboto-bold-webfont.eot +0 -0
  143. data/app/assets/font/roboto-bold-webfont.svg +0 -675
  144. data/app/assets/font/roboto-bold-webfont.ttf +0 -0
  145. data/app/assets/font/roboto-bold-webfont.woff +0 -0
  146. data/app/assets/font/roboto-bolditalic-webfont.eot +0 -0
  147. data/app/assets/font/roboto-bolditalic-webfont.svg +0 -677
  148. data/app/assets/font/roboto-bolditalic-webfont.ttf +0 -0
  149. data/app/assets/font/roboto-bolditalic-webfont.woff +0 -0
  150. data/app/assets/font/roboto-italic-webfont.eot +0 -0
  151. data/app/assets/font/roboto-italic-webfont.svg +0 -668
  152. data/app/assets/font/roboto-italic-webfont.ttf +0 -0
  153. data/app/assets/font/roboto-italic-webfont.woff +0 -0
  154. data/app/assets/font/roboto-light-webfont.eot +0 -0
  155. data/app/assets/font/roboto-light-webfont.svg +0 -666
  156. data/app/assets/font/roboto-light-webfont.ttf +0 -0
  157. data/app/assets/font/roboto-light-webfont.woff +0 -0
  158. data/app/assets/font/roboto-lightitalic-webfont.eot +0 -0
  159. data/app/assets/font/roboto-lightitalic-webfont.svg +0 -668
  160. data/app/assets/font/roboto-lightitalic-webfont.ttf +0 -0
  161. data/app/assets/font/roboto-lightitalic-webfont.woff +0 -0
  162. data/app/assets/font/roboto-medium-webfont.eot +0 -0
  163. data/app/assets/font/roboto-medium-webfont.svg +0 -675
  164. data/app/assets/font/roboto-medium-webfont.ttf +0 -0
  165. data/app/assets/font/roboto-medium-webfont.woff +0 -0
  166. data/app/assets/font/roboto-mediumitalic-webfont.eot +0 -0
  167. data/app/assets/font/roboto-mediumitalic-webfont.svg +0 -677
  168. data/app/assets/font/roboto-mediumitalic-webfont.ttf +0 -0
  169. data/app/assets/font/roboto-mediumitalic-webfont.woff +0 -0
  170. data/app/assets/font/roboto-regular-webfont.eot +0 -0
  171. data/app/assets/font/roboto-regular-webfont.svg +0 -666
  172. data/app/assets/font/roboto-regular-webfont.ttf +0 -0
  173. data/app/assets/font/roboto-regular-webfont.woff +0 -0
  174. data/app/assets/font/roboto-thin-webfont.eot +0 -0
  175. data/app/assets/font/roboto-thin-webfont.svg +0 -666
  176. data/app/assets/font/roboto-thin-webfont.ttf +0 -0
  177. data/app/assets/font/roboto-thin-webfont.woff +0 -0
  178. data/app/assets/font/roboto-thinitalic-webfont.eot +0 -0
  179. data/app/assets/font/roboto-thinitalic-webfont.svg +0 -668
  180. data/app/assets/font/roboto-thinitalic-webfont.ttf +0 -0
  181. data/app/assets/font/roboto-thinitalic-webfont.woff +0 -0
  182. data/app/assets/images/bug-fixed-128.png +0 -0
  183. data/app/assets/images/bug-fixed-32.png +0 -0
  184. data/app/assets/images/bug-fixed-48.png +0 -0
  185. data/app/assets/images/bug-new-128.png +0 -0
  186. data/app/assets/images/bug-new-32.png +0 -0
  187. data/app/assets/images/bug-new-48.png +0 -0
  188. data/app/assets/images/bug-open-32.png +0 -0
  189. data/app/assets/images/bug-zero-128.png +0 -0
  190. data/app/assets/images/bug-zero-48.png +0 -0
  191. data/app/assets/images/drag-grip.png +0 -0
  192. data/app/assets/javascripts/houston/core/burndown_chart.coffee +0 -111
  193. data/app/assets/javascripts/houston/core/stacked_area_graph.coffee +0 -113
  194. data/app/assets/javascripts/houston/core/stacked_bar_graph.coffee +0 -108
  195. data/app/assets/stylesheets/houston/application/project_tiles.scss +0 -26
  196. data/app/assets/stylesheets/houston/application/tips.scss +0 -5
  197. data/app/assets/stylesheets/houston/core/octicons-icons.scss +0 -221
  198. data/app/assets/stylesheets/houston/core/octicons.scss.erb +0 -9
  199. data/app/assets/stylesheets/houston/core/roboto.scss.erb +0 -131
  200. data/app/concerns/historical_weekly_stats.rb +0 -15
  201. data/app/concerns/nosync.rb +0 -21
  202. data/app/controllers/oauth/providers_controller.rb +0 -45
  203. data/app/controllers/project_roles_controller.rb +0 -22
  204. data/app/controllers/settings_controller.rb +0 -14
  205. data/app/controllers/tester_bar_controller.rb +0 -12
  206. data/app/controllers/user_credentials_controller.rb +0 -24
  207. data/app/models/role.rb +0 -33
  208. data/app/models/setting.rb +0 -10
  209. data/app/models/settings.rb +0 -38
  210. data/app/models/slackdown.rb +0 -23
  211. data/app/models/user_credentials.rb +0 -27
  212. data/app/views/errors/_actions.html.erb +0 -17
  213. data/app/views/layouts/_tester_bar.html.erb +0 -6
  214. data/app/views/layouts/minimal.html.erb +0 -50
  215. data/app/views/layouts/naked.html.erb +0 -47
  216. data/app/views/layouts/naked_dashboard.html.erb +0 -50
  217. data/app/views/oauth/providers/_form.html.erb +0 -54
  218. data/app/views/oauth/providers/index.html.erb +0 -41
  219. data/app/views/oauth/providers/new.html.erb +0 -7
  220. data/config/initializers/add_navigation_renderers.rb +0 -5
  221. data/config/initializers/vestal_versions.rb +0 -9
  222. data/db/migrate/20130519163615_create_user_credentials.rb +0 -18
  223. data/lib/houston/boot/events.rb +0 -10
  224. data/lib/tasks/keypair.rake +0 -17
  225. data/vendor/assets/javascripts/jquery.pjax.js +0 -817
@@ -0,0 +1,6 @@
1
+ class Follow < ActiveRecord::Base
2
+
3
+ belongs_to :user
4
+ belongs_to :project
5
+
6
+ end
@@ -4,11 +4,16 @@ class PersistentTrigger < ActiveRecord::Base
4
4
  serialize :value, Houston::Serializer.new
5
5
  serialize :params, Houston::ParamsSerializer.new
6
6
 
7
+ belongs_to :user
8
+
7
9
  TYPES = [:on, :every].freeze
10
+
11
+ validates :user_id, presence: true
8
12
  validates :type, inclusion: { in: TYPES, message: "{value} is not valid Trigger type; use #{TYPES.map(&:inspect).to_sentence(two_words_connector: " or ", last_word_connector: ", or ")}" }
9
13
  validate :action_must_be_defined
10
14
 
11
15
  after_create :register!
16
+ after_destroy :unregister!
12
17
 
13
18
 
14
19
  TYPES.each do |type|
@@ -31,10 +36,15 @@ class PersistentTrigger < ActiveRecord::Base
31
36
 
32
37
 
33
38
  def register!
34
- trigger = Houston.config.triggers.build(type, value, action, params)
39
+ trigger = Houston.config.triggers.build(type, value, action, params.merge(trigger: self), persistent_trigger_id: id)
35
40
  Houston.config.triggers.push(trigger) unless Houston.config.triggers.member?(trigger)
36
41
  end
37
42
 
43
+ def unregister!
44
+ trigger = Houston.config.triggers.detect { |trigger| trigger.persistent_trigger_id == id }
45
+ Houston.config.triggers.delete(trigger) if trigger
46
+ end
47
+
38
48
 
39
49
  private
40
50
 
@@ -4,9 +4,10 @@ class Project < ActiveRecord::Base
4
4
  include Houston::Props
5
5
 
6
6
  belongs_to :team
7
+ has_and_belongs_to_many :followers, join_table: "follows", class_name: "User"
7
8
 
8
9
  before_validation :generate_default_slug, :set_default_color
9
- validates_presence_of :name, :slug, :color
10
+ validates_presence_of :name, :slug, :color_name
10
11
 
11
12
  validates :slug, format: { with: /\A[a-z0-9_\-]+\z/ }
12
13
 
@@ -16,26 +17,8 @@ class Project < ActiveRecord::Base
16
17
  slug
17
18
  end
18
19
 
19
- def color_value
20
- Houston.config.project_colors[color]
21
- end
22
-
23
-
24
-
25
- def extended_attributes
26
- raise NotImplementedError, "This feature has been deprecated; use props"
27
- end
28
-
29
- def extended_attributes=(value)
30
- raise NotImplementedError, "This feature has been deprecated; use props"
31
- end
32
-
33
- def view_options
34
- raise NotImplementedError, "This feature has been deprecated; use props"
35
- end
36
-
37
- def view_options=(value)
38
- raise NotImplementedError, "This feature has been deprecated; use props"
20
+ def color
21
+ Houston.config.project_colors[color_name]
39
22
  end
40
23
 
41
24
 
@@ -88,11 +71,6 @@ class Project < ActiveRecord::Base
88
71
  team.users
89
72
  end
90
73
 
91
- def followers # <-- redefine followers to be everyone who participates in or follows the project
92
- puts "DEPRECATED: Project#followers is deprecated; use Project#teammates instead"
93
- teammates
94
- end
95
-
96
74
  # ------------------------------------------------------------------------- #
97
75
 
98
76
 
@@ -104,7 +82,7 @@ private
104
82
  end
105
83
 
106
84
  def set_default_color
107
- self.color = "default" unless color
85
+ self.color_name = "default" unless color_name
108
86
  end
109
87
 
110
88
  end
data/app/models/user.rb CHANGED
@@ -6,10 +6,17 @@ class User < ActiveRecord::Base
6
6
 
7
7
  has_many :roles, class_name: "TeamUser", dependent: :destroy
8
8
  has_and_belongs_to_many :teams
9
- has_many :credentials, :class_name => "UserCredentials", dependent: :destroy
9
+ has_many :authorizations, dependent: :destroy
10
+ has_many :triggers, class_name: "PersistentTrigger", dependent: :destroy
11
+ has_and_belongs_to_many :followed_projects, -> { unretired }, join_table: "follows", class_name: "Project"
10
12
  belongs_to :current_project, class_name: "Project"
11
13
 
12
- devise *Houston.config.devise_configuration
14
+ devise :database_authenticatable,
15
+ :recoverable,
16
+ :rememberable,
17
+ :trackable,
18
+ :validatable,
19
+ :invitable
13
20
 
14
21
  default_scope { order("last_name, first_name") }
15
22
 
@@ -35,17 +42,6 @@ class User < ActiveRecord::Base
35
42
  end
36
43
 
37
44
 
38
- def developer?
39
- puts "DEPRECATED: User#developer? will be removed"
40
- legacy_role == "Developer"
41
- end
42
-
43
- def tester?
44
- puts "DEPRECATED: User#tester? will be removed"
45
- legacy_role == "Tester"
46
- end
47
-
48
-
49
45
 
50
46
  def self.with_primary_email(email)
51
47
  email = email.downcase if email
@@ -86,60 +82,20 @@ class User < ActiveRecord::Base
86
82
  "#{first_name} #{last_name}"
87
83
  end
88
84
 
89
- def follows?(project)
90
- Role.where(user: self).to_projects.member?(project)
91
- end
92
-
93
- def followed_projects
94
- Role.where(user: self).to_projects.unretired
95
- end
96
-
97
- def view_options
98
- raise NotImplementedError, "This feature has been deprecated; use props"
99
- end
100
-
101
- def view_options=(value)
102
- raise NotImplementedError, "This feature has been deprecated; use props"
103
- end
104
85
 
105
- def unfuddle_id
106
- raise NotImplementedError, "This feature has been deprecated; use props[\"unfuddle.id\"]"
107
- end
108
86
 
109
- def unfuddle_id=(value)
110
- raise NotImplementedError, "This feature has been deprecated; use props[\"unfuddle.id\"]"
87
+ def follow!(project)
88
+ followed_projects << project
111
89
  end
112
90
 
113
-
114
-
115
- # LDAP Overrides
116
- # ------------------------------------------------------------------------- #
117
-
118
- def self.find_ldap_entry(ldap_connection, auth_key_value)
119
- filter = Net::LDAP::Filter.eq(Houston.config.authentication_strategy_configuration[:field], auth_key_value)
120
- ldap_connection.ldap.search(filter: filter).first
91
+ def unfollow!(project)
92
+ followed_projects.delete project
121
93
  end
122
94
 
123
- def self.find_for_ldap_authentication(attributes, entry)
124
- email = entry.mail.first.downcase
125
- user = where(email: email).first
126
- if user && user.username.nil?
127
- user.update_column :username, entry[Houston.config.authentication_strategy_configuration[:field]][0].to_s
128
- end
129
- user
130
- end
131
-
132
- def self.create_from_ldap_entry(attributes, entry)
133
- create!(
134
- email: entry.mail.first.downcase,
135
- username: entry[Houston.config.authentication_strategy_configuration[:field]][0].to_s,
136
- password: attributes[:password],
137
- first_name: entry.givenname.first,
138
- last_name: entry.sn.first )
95
+ def follows?(project)
96
+ followed_projects.member?(project)
139
97
  end
140
98
 
141
- # ------------------------------------------------------------------------- #
142
-
143
99
 
144
100
 
145
101
  private
@@ -20,8 +20,8 @@ class ProjectPresenter
20
20
  name: project.name,
21
21
  slug: project.slug,
22
22
  color: {
23
- name: project.color,
24
- hex: project.color_value.hex },
23
+ name: project.color.name,
24
+ hex: project.color.hex },
25
25
  props: project.props.to_h }
26
26
  end
27
27
 
@@ -1,11 +1,14 @@
1
1
  <% @actions.each do |action| %>
2
- <tr class="action" data-timestamp="<%= action.started_at.iso8601 %>">
2
+ <tr class="action" data-timestamp="<%= action.created_at.iso8601 %>">
3
3
  <td class="table-margin"></td>
4
- <td class="action-time"><%= format_time action.started_at %></td>
5
- <td class="action-duration"><%= format_duration action.duration %></td>
4
+ <td class="action-created"><%= format_time action.created_at %></td>
5
+ <td class="action-name"><%= link_to action[:name], action_path(slug: action[:name]) %></td>
6
+ <td class="action-started"><%= format_time action.started_at %></td>
7
+ <td class="action-finished"><%= format_time action.finished_at %></td>
8
+ <td class="action-duration"><%= format_duration action.duration || (action.started? ? Time.now - action.started_at : nil) %></td>
6
9
  <td class="action-trigger"><%= action.trigger %></td>
7
10
  <td class="action-params"><%= format_action_params action.params %></td>
8
- <td class="action-succeded"><%= format_action_state action %></td>
11
+ <td class="action-succeeded"><%= format_action_state action %></td>
9
12
  <td class="action-exception">
10
13
  <% if action.error %>
11
14
  <% unless action.error.type.blank? %>
@@ -13,7 +16,7 @@
13
16
  <% end %>
14
17
  <%= action.error.message %>
15
18
  <% end %>
16
- <td>
19
+ </td>
17
20
  <td class="action-retry"><%= button_to "Retry", retry_action_path(action), class: "btn-retry btn btn-mini btn-default" %></td>
18
21
  <td class="table-margin"></td>
19
22
  </tr>
@@ -5,7 +5,7 @@
5
5
  <% end %>
6
6
 
7
7
  <% if $scheduler %>
8
- <p><b>Status:</b> <%= $scheduler.up? ? "Up (Started #{format_time $scheduler.started_at})".html_safe : "Down" %></p>
8
+ <p><b>Status:</b> <%= $scheduler.up? ? "Up (Started #{format_time $scheduler.started_at.to_time})".html_safe : "Down" %></p>
9
9
  <% else %>
10
10
  <p><b>Status:</b> Unavailable</p>
11
11
  <% end %>
@@ -4,36 +4,30 @@
4
4
  </h1>
5
5
  <% end %>
6
6
 
7
- <div class="nomargin">
7
+ <div class="nomargin action-running">
8
8
  <table id="actions" class="table table-sortable table-striped">
9
9
  <thead>
10
10
  <tr>
11
11
  <td class="table-margin"></td>
12
- <th class="action-time">Started</th>
13
- <th class="action-duration">Duration</th>
12
+ <th class="action-created">Queued</th>
14
13
  <th class="action-name">Action</th>
14
+ <th class="action-started">Started</th>
15
+ <th class="action-finished">Finished</th>
16
+ <th class="action-duration">Duration</th>
15
17
  <th class="action-trigger">Trigger</th>
16
18
  <th class="action-params">Params</th>
19
+ <th class="action-succeeded">Succeeded</th>
20
+ <th class="action-exception">Exception</th>
21
+ <th class="action-retry">Retry</th>
17
22
  <td class="table-margin"></td>
18
23
  </tr>
19
24
  </thead>
20
25
  <tbody>
21
- <% @actions.each do |action| %>
22
- <tr class="action">
23
- <td class="table-margin"></td>
24
- <td class="action-time"><%= format_time action.started_at %></td>
25
- <td class="action-duration"><%= format_time_ago action.started_at %></td>
26
- <td class="action-name"><%= link_to action[:name], action_path(slug: action[:name]) %></td>
27
- <td class="action-trigger"><%= action.trigger %></td>
28
- <td class="action-params"><%= format_action_params action.params %></td>
29
- <td class="table-margin"></td>
30
- </tr>
31
- <% end %>
26
+ <%= render "actions/actions" %>
32
27
  </tbody>
33
28
  </table>
34
29
  </div>
35
30
 
36
-
37
31
  <% content_for :javascripts do %>
38
32
  <script type="text/javascript">
39
33
  $(function() {
@@ -5,16 +5,19 @@
5
5
  </h1>
6
6
  <% end %>
7
7
 
8
- <div class="nomargin">
8
+ <div class="nomargin action-show">
9
9
  <table id="actions" class="table table-sortable table-striped">
10
10
  <thead>
11
11
  <tr>
12
12
  <td class="table-margin"></td>
13
- <th class="action-time">Time</th>
13
+ <th class="action-created">Queued</th>
14
+ <th class="action-name">Action</th>
15
+ <th class="action-started">Started</th>
16
+ <th class="action-finished">Finished</th>
14
17
  <th class="action-duration">Duration</th>
15
18
  <th class="action-trigger">Trigger</th>
16
19
  <th class="action-params">Params</th>
17
- <th class="action-succeded">Succeeded</th>
20
+ <th class="action-succeeded">Succeeded</th>
18
21
  <th class="action-exception">Exception</th>
19
22
  <th class="action-retry">Retry</th>
20
23
  <td class="table-margin"></td>
@@ -0,0 +1,41 @@
1
+ <% content_for :title do %>
2
+ <h1 class="project-banner space-below">
3
+ Unqueued Actions
4
+ </h1>
5
+ <% end %>
6
+
7
+ <div class="nomargin action-unqueued">
8
+ <table id="actions" class="table table-sortable table-striped">
9
+ <thead>
10
+ <tr>
11
+ <td class="table-margin"></td>
12
+ <th class="action-created">Queued</th>
13
+ <th class="action-name">Action</th>
14
+ <th class="action-started">Started</th>
15
+ <th class="action-finished">Finished</th>
16
+ <th class="action-duration">Duration</th>
17
+ <th class="action-trigger">Trigger</th>
18
+ <th class="action-params">Params</th>
19
+ <th class="action-succeeded">Succeeded</th>
20
+ <th class="action-exception">Exception</th>
21
+ <th class="action-retry">Retry</th>
22
+ <td class="table-margin"></td>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <%= render "actions/actions" %>
27
+ </tbody>
28
+ </table>
29
+ </div>
30
+
31
+ <% content_for :javascripts do %>
32
+ <script type="text/javascript">
33
+ $(function() {
34
+ $('#actions')
35
+ .tablesorter()
36
+ .on('click', '.action-params-short', function() {
37
+ $(this).next().modal();
38
+ });
39
+ });
40
+ </script>
41
+ <% end %>
@@ -1,33 +1,45 @@
1
- <%= form_for @authorization, html: {class: "form-horizontal"} do |f| %>
1
+ <%= form_for @authorization, url: {controller: "authorizations"}, html: {class: "form-horizontal"} do |f| %>
2
2
  <fieldset>
3
3
  <div class="control-group">
4
- <%= f.label :name, class: "control-label" %>
4
+ <%= f.label :type, "Provider", class: "control-label" %>
5
5
  <div class="controls">
6
- <%= f.text_field :name, class: "text_field" %>
7
- </div>
8
- </div>
9
- </fieldset>
10
-
11
- <hr />
12
-
13
- <fieldset>
14
- <div class="control-group">
15
- <%= f.label :provider_id, class: "control-label" %>
16
- <div class="controls">
17
- <%= f.collection_select :provider_id, Oauth::Provider.all, :id, :name %>
6
+ <%= f.select :type, Authorization.providers, {}, disabled: @authorization.persisted? %>
18
7
  </div>
19
8
  </div>
20
9
 
21
10
  <div class="control-group">
22
11
  <%= f.label :scope, class: "control-label" %>
23
12
  <div class="controls">
24
- <%= f.text_field :scope, class: "text_field" %>
13
+ <%= f.text_field :scope, class: "text_field", readonly: @authorization.persisted? %>
25
14
  </div>
26
15
  </div>
27
16
  </fieldset>
28
17
 
29
18
  <div class="form-actions">
30
19
  <%= f.submit nil, class: "btn btn-primary" %>
31
- <%= link_to "Cancel", authorizations_path, class: "btn" %>
20
+ <%= link_to "Cancel", my_authorizations_path, class: "btn" %>
21
+
22
+ <% if @authorization.persisted? && can?(:destroy, @authorization) %>
23
+ <button class="btn btn-delete btn-danger" id="delete_authorization_button">Revoke</button>
24
+ <% end %>
32
25
  </div>
33
26
  <% end %>
27
+
28
+ <% content_for :javascripts do %>
29
+ <script type="text/javascript">
30
+ $(function() {
31
+ <% if @authorization.persisted? && can?(:destroy, @authorization) %>
32
+ $('#delete_authorization_button').click(function(e) {
33
+ e.preventDefault();
34
+ App.confirmDelete({
35
+ resource: 'Authorization',
36
+ message: 'This will revoke authorization for "<%= @authorization.provider.name %>".',
37
+ url: <%=raw authorization_path(@authorization).to_json %>
38
+ });
39
+ });
40
+ <% end %>
41
+
42
+ $('#authorization_name').select();
43
+ });
44
+ </script>
45
+ <% end %>
@@ -1,6 +1,6 @@
1
1
  <% content_for :title do %>
2
2
  <h1 class="project-banner space-below">
3
- Authorizations
3
+ <%= @title %>
4
4
 
5
5
  <%= link_to "New Authorization", new_authorization_path, class: "btn btn-primary" if can?(:create, Authorization) %>
6
6
  </h1>
@@ -11,7 +11,8 @@
11
11
  <thead>
12
12
  <tr>
13
13
  <td class="table-margin"></td>
14
- <th class="authorization-name">Name</th>
14
+ <td class="user-avatar"></td>
15
+ <th class="user-name sort-desc">User</th>
15
16
  <th class="authorization-name">Provider</th>
16
17
  <th class="authorization-status">Satus</th>
17
18
  <td class="table-margin"></td>
@@ -21,8 +22,12 @@
21
22
  <% @authorizations.each do |authorization| %>
22
23
  <tr class="authorization">
23
24
  <td class="table-margin"></td>
24
- <td class="authorization-name"><%= link_to authorization.name, edit_authorization_path(authorization) %></td>
25
- <td class="authorization-provider"><%= authorization.provider.name %></td>
25
+ <td class="user-avatar"><%= avatar_for(authorization.user, size: 32) %></td>
26
+ <td class="user-name">
27
+ <span class="first-name"><%= authorization.user.first_name %></span>
28
+ <span class="last-name"><%= authorization.user.last_name %></span>
29
+ </td>
30
+ <td class="authorization-provider"><%= link_to authorization.provider.name, edit_authorization_path(authorization) %></td>
26
31
  <td class="authorization-status">
27
32
  <% if authorization.granted? %>
28
33
  Granted