lib/chook/server/views/handlers.haml in chook-1.1.2 vs lib/chook/server/views/handlers.haml in chook-1.1.5b1
- old
+ new
@@ -3,46 +3,61 @@
View
%button#hide_handlers_btn{ type: 'button', onClick: 'hide_handlers();', title: 'hide the handler list' }
Hide
- Current Webhook Handlers (#{@handlers_for_admin_page.size})
+ Current Webhook Handlers (#{@handlers_for_admin_page.size + @named_handlers_for_admin_page.size})
-#handlers_div
-
- Handler Directory:
- %span.monospaced= Chook.config.handler_dir.to_s
-
-
%button#reload_all_handlers_btn{ type: 'button', onClick: 'reload_handlers();', title: 'reload all handlers' }
- Reload
+ Reload All
%span#reloaded_notification
+#handlers_div
+ General Handler Directory:
+ %span.monospaced= Chook.config.handler_dir.to_s
+
+
%table#handlers_table
%tr#handlers_table_header_row
- %th.handlers_table_cell Event
- %th.handlers_table_cell{ width: '10%' } Handler Type
%th.handlers_table_cell File Name
+ %th.handlers_table_cell{ width: '10%' } Handler Type
%th.handlers_table_cell Actions
- @handlers_for_admin_page.each do |hndlr_info|
%tr
- %td.handlers_table_cell= hndlr_info[:event]
+ %td.handlers_table_cell= hndlr_info[:file].basename.to_s
%td.handlers_table_cell= hndlr_info[:type].to_s
+ %td.handlers_table_cell
+ %button.edit_handler_btn{ type: 'button', onClick: "view_handler_code('#{hndlr_info[:file]}', '#{hndlr_info[:type]}');", title: 'View this handler' }
+ View
+ %br
+ %br
+ Named Handler Directory:
+ %span.monospaced= Chook.config.handler_dir.to_s + "/#{Chook::HandledEvent::Handlers::NAMED_HANDLER_SUBDIR}"
+
+
+ %table#handlers_table
+ %tr#handlers_table_header_row
+ %th.handlers_table_cell File Name
+ %th.handlers_table_cell{ width: '10%' } Handler Type
+ %th.handlers_table_cell Actions
+
+ - @named_handlers_for_admin_page.each do |hndlr_info|
+ %tr
%td.handlers_table_cell= hndlr_info[:file].basename.to_s
+ %td.handlers_table_cell= hndlr_info[:type].to_s
%td.handlers_table_cell
- %button.edit_handler_btn{ type: 'button', onClick: "edit_handler('#{hndlr_info[:file].basename}', '#{hndlr_info[:type]}');", title: 'View this handler' }
+ %button.edit_handler_btn{ type: 'button', onClick: "view_handler_code('#{hndlr_info[:file]}', '#{hndlr_info[:type]}');", title: 'View this handler' }
View
#handler_viewer_div
%input#currently_viewing_handler_file{ name: 'currently_viewing_handler_file', type: :hidden }
%input#currently_editing_handler_type{ name: 'currently_editing_handler_type', type: :hidden }
#currently_viewing_handler_label
%button#hide_handler_viewer_btn{ type: 'button', onClick: 'hide_handler_viewer();', title: 'hide the handler editor' }
Hide
- Viewing handler:
%span.monospaced#currently_viewing_filename -nothing-
%textarea.monospaced#handler_viewer{ rows: 35 , readonly: true }