20170421000001_pretty_date_options_added.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class PrettyDateOptionsAdded < ActiveRecord::Migration[4.2]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.create_or_update(
  7. title: 'Pretty Date',
  8. name: 'pretty_date_format',
  9. area: 'System::Branding',
  10. description: 'Defines pretty date format.',
  11. options: {
  12. form: [
  13. {
  14. display: '',
  15. null: false,
  16. name: 'pretty_date_format',
  17. tag: 'select',
  18. options: {
  19. relative: 'relative - e. g. "2 hours ago" or "2 days and 15 minutes ago"',
  20. absolute: 'absolute - e. g. "Monday 09:30" or "Tuesday 23. Feb 14:20"',
  21. },
  22. },
  23. ],
  24. },
  25. preferences: {
  26. render: true,
  27. prio: 10,
  28. permission: ['admin.branding'],
  29. },
  30. state: 'relative',
  31. frontend: true
  32. )
  33. Scheduler.create_or_update(
  34. name: 'Import Jobs',
  35. method: 'ImportJob.start_registered',
  36. period: 1.hour,
  37. prio: 1,
  38. active: true,
  39. updated_by_id: 1,
  40. created_by_id: 1
  41. )
  42. end
  43. end