20180220000001_setting_attachment_preview.rb 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. class SettingAttachmentPreview < ActiveRecord::Migration[5.1]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'Sidebar Attachments',
  7. name: 'ui_ticket_zoom_attachments_preview',
  8. area: 'UI::TicketZoom::Preview',
  9. description: 'Enables preview of attachments.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: true,
  15. name: 'ui_ticket_zoom_attachments_preview',
  16. tag: 'boolean',
  17. translate: true,
  18. options: {
  19. true => 'yes',
  20. false => 'no',
  21. },
  22. },
  23. ],
  24. },
  25. state: false,
  26. preferences: {
  27. prio: 400,
  28. permission: ['admin.ui'],
  29. },
  30. frontend: true
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'Sidebar Attachments',
  34. name: 'ui_ticket_zoom_sidebar_article_attachments',
  35. area: 'UI::TicketZoom::Preview',
  36. description: 'Enables a sidebar to show an overview of all attachments.',
  37. options: {
  38. form: [
  39. {
  40. display: '',
  41. null: true,
  42. name: 'ui_ticket_zoom_sidebar_article_attachments',
  43. tag: 'boolean',
  44. translate: true,
  45. options: {
  46. true => 'yes',
  47. false => 'no',
  48. },
  49. },
  50. ],
  51. },
  52. state: false,
  53. preferences: {
  54. prio: 500,
  55. permission: ['admin.ui'],
  56. },
  57. frontend: true
  58. )
  59. end
  60. end