caboose-cms 0.3.85 → 0.3.86

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDU1MDBlNzlkMzA1OTAyYTUzZGZmM2QwNGU3ZTg3ZTlkZWJjZTJiZg==
4
+ YTFiZmFkNWM5MDk2ZTIwOTk5MjMwNWJmMDYxZWEzZjVlNTU5OThmZA==
5
5
  data.tar.gz: !binary |-
6
- YWE0MzMyMWRiZWUwZWNkOWEzNmEzMzMyNzExYjlmMTVmZmEwYWVjNA==
6
+ YjQ0NDAzNjc0YmE0ZjQ5ODUxYmQ5NWRiMDk3YTQ5ZDBjZTI3OTFmNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzdiMjZhOTY4MTE4NzI3OTE5YTQyY2FkY2NmODEwNjZiYTJhZjgzNDg1Mjhm
10
- MmM2NWViNDRmZWVmOGJmODEyYmU0NDk5MDM1MDNiY2ZiNTM2MjVhNTVhZmVh
11
- ZWRhNjVhNDZmZjVkZmM0Mjc2Nzc3MDYwMDZiMGJiNDZlYjU4NWI=
9
+ YzNmN2Y5NTdlMjMyNjNjYTYwZTRmODM1OTc4ZTM4NDhmYzc5YjI0YjQxZThh
10
+ OWM1OGM4ZGRhNTg3ZWNlOTdlZThmNGM1OWU5ZmU5MWFhNThhOGVlM2M4N2Jl
11
+ ODQ2NWYwMzJiZTUzZTczZDdjMDUzNDZlOGE0MGU5YmM2MzY4Zjg=
12
12
  data.tar.gz: !binary |-
13
- ODZkODRjMWYxNDNmNTVjODY5Y2E3ZThmNjBhZjliNDhlNWEzNjJhMThmYjkx
14
- ZGM5YWNhNmExN2IzOGY1YTEwZTRhNDQ0ZTRlMjI4ZmE5YzQ2MTJkOWNjMjhh
15
- NjQzZGJlZjlkZjNjMTgwZGRhMjY2NWZkMGNhMjM2OGE2NGVjNTQ=
13
+ Y2IyMmY5MGEyNzBmMzk5YzU0MGM1NjBmYzk3MmUxMGQzMGM0ZWJmN2QxMTIx
14
+ Y2JjZDlhODA0ZGZhMjIyMWQwYzRhMmM3NTU1ZTE1MzQ0NjZkNGMzZTA2YjFi
15
+ ODQ5YTkyYzU0NGI1MmI3OGE1OTdlYzlmZGUwN2JlNzI2NTVhZmU=
@@ -31,9 +31,10 @@ module Caboose
31
31
  if login_resp.error
32
32
  resp.error = login_resp.error
33
33
  else
34
- remember = params[:remember] && (params[:remember] == 1 || params[:remember] == "1")
35
- login_user(login_resp.user, remember)
34
+ remember = params[:remember] && (params[:remember] == 1 || params[:remember] == "1")
35
+ login_user(login_resp.user, remember)
36
36
  resp.redirect = return_url
37
+ Caboose.plugin_hook('login_success')
37
38
  end
38
39
  end
39
40
  end
@@ -1,3 +1,4 @@
1
+ require 'csv'
1
2
 
2
3
  module Caboose
3
4
  class UsersController < ApplicationController
@@ -71,6 +72,25 @@ module Caboose
71
72
  @users = @gen.items
72
73
  end
73
74
 
75
+ # GET /admin/users
76
+ def index
77
+ return if !user_is_allowed('users', 'view')
78
+
79
+ @gen = PageBarGenerator.new(params, {
80
+ 'first_name_like' => '',
81
+ 'last_name_like' => '',
82
+ 'username_like' => '',
83
+ 'email_like' => '',
84
+ },{
85
+ 'model' => 'Caboose::User',
86
+ 'sort' => 'last_name, first_name',
87
+ 'desc' => false,
88
+ 'base_url' => '/admin/users',
89
+ 'use_url_params' => false
90
+ })
91
+ @users = @gen.items
92
+ end
93
+
74
94
  # GET /admin/users/new
75
95
  def new
76
96
  return if !user_is_allowed('users', 'add')
@@ -91,6 +111,79 @@ module Caboose
91
111
  @edituser = User.find(params[:id])
92
112
  end
93
113
 
114
+ # GET /admin/users/import
115
+ def import_form
116
+ return if !user_is_allowed('users', 'edit')
117
+ end
118
+
119
+ def random_string(length)
120
+ o = [('a'..'z'),('A'..'Z'),('0'..'9')].map { |i| i.to_a }.flatten
121
+ return (0...length).map { o[rand(o.length)] }.join
122
+ end
123
+
124
+ # POST /admin/users/import
125
+ def import
126
+ return if !user_is_allowed('users', 'add')
127
+
128
+ resp = StdClass.new
129
+ csv_data = params[:csv_data]
130
+ arr = []
131
+ good_count = 0
132
+ bad_count = 0
133
+ csv_data.strip.split("\n").each do |line|
134
+ data = CSV.parse_line(line)
135
+
136
+ if data.count < 3
137
+ arr << [line, true, "Too few columns"]
138
+ bad_count = bad_count + 1
139
+ next
140
+ end
141
+
142
+ first_name = data[0].nil? ? nil : data[0].strip
143
+ last_name = data[1].nil? ? nil : data[1].strip
144
+ email = data[2].nil? ? nil : data[2].strip.downcase
145
+ username = data.count >= 4 && !data[3].nil? ? data[3].strip.downcase : nil
146
+ password = data.count >= 5 && !data[4].nil? ? data[4].strip : random_string(8)
147
+
148
+ first_name = data[0]
149
+ last_name = data[1]
150
+ email = data[2]
151
+ username = data.count >= 4 ? data[3] : nil
152
+ password = data.count >= 5 ? data[4] : random_string(8)
153
+
154
+ if first_name.nil? || first_name.length == 0
155
+ arr << [line, false, "Missing first name."]
156
+ bad_count = bad_count + 1
157
+ elsif last_name.nil? || last_name.length == 0
158
+ arr << [line, false, "Missing last name."]
159
+ bad_count = bad_count + 1
160
+ elsif email.nil? || email.length == 0 || !email.include?('@')
161
+ arr << [line, false, "Email is invalid."]
162
+ bad_count = bad_count + 1
163
+ elsif Caboose::User.where(:email => email).exists?
164
+ arr << [line, false, "Email already exists."]
165
+ bad_count = bad_count + 1
166
+ else
167
+ Caboose::User.create(
168
+ :first_name => first_name,
169
+ :last_name => last_name,
170
+ :email => email,
171
+ :username => username,
172
+ :password => Digest::SHA1.hexdigest(Caboose::salt + password)
173
+ )
174
+ good_count = good_count + 1
175
+ end
176
+ end
177
+
178
+ resp.success = "#{good_count} user#{good_count == 1 ? '' : 's'} were added successfully."
179
+ if bad_count > 0
180
+ resp.success << "<br />#{bad_count} user#{bad_count == 1 ? '' : 's'} were skipped."
181
+ resp.success << "<br /><br />Please check the log below for more details."
182
+ resp.log = arr
183
+ end
184
+ render :json => resp
185
+ end
186
+
94
187
  # POST /admin/users
95
188
  def create
96
189
  return if !user_is_allowed('users', 'add')
@@ -14,7 +14,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
14
14
  Caboose::PageBlock => [:block_type, :value, :name],
15
15
  Caboose::PageBlockField => [:model_binder_options],
16
16
  Caboose::AbValue => [:i, :text],
17
- Caboose::AbOption => [:text]
17
+ Caboose::AbOption => [:text],
18
+ Caboose::User => [:utc_offset, :timezone]
18
19
  }
19
20
  end
20
21
 
@@ -44,7 +45,9 @@ class Caboose::Schema < Caboose::Utilities::Schema
44
45
  [ :zip , :string ],
45
46
  [ :phone , :string ],
46
47
  [ :fax , :string ],
47
- [ :utc_offset , :float , { :default => -5 }],
48
+ #[ :utc_offset , :float , { :default => -5 }],
49
+ #[ :timezone , :string , { :default => 'America/Chicago' }],
50
+ [ :timezone_id , :integer , { :defualt => 381 }], # Defaults to 'America/Chicago'
48
51
  [ :password , :string ],
49
52
  [ :password_reset_id , :string ],
50
53
  [ :password_reset_sent , :datetime ],
@@ -178,7 +181,22 @@ class Caboose::Schema < Caboose::Utilities::Schema
178
181
  Caboose::Setting => [
179
182
  [ :name , :string ],
180
183
  [ :value , :text ]
181
- ]
184
+ ],
185
+ Caboose::Timezone => [
186
+ [ :country_code , :string ],
187
+ [ :name , :string ]
188
+ ],
189
+ Caboose::TimezoneAbbreviation => [
190
+ [ :abbreviation , :string ],
191
+ [ :name , :string ]
192
+ ],
193
+ Caboose::TimezoneOffset => [
194
+ [ :timezone_id , :integer ],
195
+ [ :abbreviation , :string ],
196
+ [ :time_start , :integer ],
197
+ [ :gmt_offset , :integer ],
198
+ [ :dst , :boolean ]
199
+ ]
182
200
  }
183
201
 
184
202
  end
@@ -0,0 +1,75 @@
1
+ require 'httparty'
2
+
3
+ class Caboose::Timezone < ActiveRecord::Base
4
+ self.table_name = "timezones"
5
+
6
+ has_many :timezone_offsets, :class_name => 'Caboose::TimezoneOffset'
7
+ attr_accessible :id, :country_code, :name
8
+
9
+ def self.load_zones(temp_dir = '/tmp', country_codes = ['US'])
10
+ `curl -o #{temp_dir}/timezones.csv.zip http://timezonedb.com/files/timezonedb.csv.zip`
11
+ `unzip #{temp_dir}/timezones.csv.zip -d #{temp_dir}/timezones`
12
+
13
+ #Caboose::Timezone.destroy_all
14
+ #Caboose::TimezoneOffset.destroy_all
15
+
16
+ File.foreach("#{temp_dir}/timezones/zone.csv") do |line|
17
+ data = CSV.parse_line(line)
18
+ next if !country_codes.include?(data[1])
19
+ next if Caboose::Timezone.where(:id => data[0].to_i).exists?
20
+ Caboose::Timezone.create(
21
+ :id => data[0].to_i,
22
+ :country_code => data[1],
23
+ :name => data[2]
24
+ )
25
+ end
26
+
27
+ File.foreach("#{temp_dir}/timezones/timezone.csv") do |line|
28
+ data = CSV.parse_line(line)
29
+ tz_id = data[0].to_i
30
+ next if !Caboose::Timezone.where(:id => tz_id).exists?
31
+ next if Caboose::TimezoneOffset.where(:timezone_id => tz_id, :time_start => data[2].to_i).exists?
32
+ Caboose::TimezoneOffset.create(
33
+ :timezone_id => data[0].to_i,
34
+ :abbreviation => data[1],
35
+ :time_start => data[2],
36
+ :gmt_offset => data[3],
37
+ :dst => data[4]
38
+ )
39
+ end
40
+
41
+ spec = Gem::Specification.find_by_name("caboose-cms")
42
+ gem_root = spec.gem_dir
43
+
44
+ File.foreach(gem_root + '/lib/sample_files/timezone_abbreviations.csv') do |line|
45
+ data = CSV.parse_line(line)
46
+ next if Caboose::TimezoneAbbreviation.where(:abbreviation => data[0]).exists?
47
+ Caboose::TimezoneAbbreviation.create(
48
+ :abbreviation => data[0],
49
+ :name => data[1]
50
+ )
51
+ end
52
+
53
+ `rm -rf #{temp_dir}/timezones`
54
+ `rm -rf #{temp_dir}/timezones.csv.zip`
55
+
56
+ end
57
+
58
+ def local(utc_datetime)
59
+ tzo = self.timezone_offsets.where('time_start < ?', utc_datetime.to_i).reorder('time_start desc').first
60
+ return utc_datetime + tzo.gmt_offset.seconds
61
+ end
62
+
63
+ def string_format(d = DateTime.now.utc)
64
+ tzo = self.timezone_offsets.where('time_start < ?', d.to_i).reorder('time_start desc').first
65
+ total = tzo.gmt_offset.abs
66
+ hours = (total/3600).floor
67
+ x = total - (hours*3600)
68
+ minutes = x > 0 ? (x/60).floor : 0
69
+ seconds = total - (hours*3600) - (minutes*60)
70
+ sign = tzo.gmt_offset >= 0 ? '+' : '-'
71
+ hours = hours.to_s.rjust(2, '0')
72
+ return "#{sign}#{hours}#{minutes}"
73
+ end
74
+
75
+ end
@@ -0,0 +1,5 @@
1
+
2
+ class Caboose::TimezoneAbbreviation < ActiveRecord::Base
3
+ self.table_name = "timezone_abbreviations"
4
+ attr_accessible :id, :abbreviation, :name
5
+ end
@@ -0,0 +1,5 @@
1
+ class Caboose::TimezoneOffset < ActiveRecord::Base
2
+ self.table_name = "timezone_offsets"
3
+ belongs_to :timezone
4
+ attr_accessible :id, :timezone_id, :abbreviation, :time_start, :gmt_offset, :dst
5
+ end
@@ -0,0 +1,54 @@
1
+ <h1>Import Users</h1>
2
+
3
+ <p>In the box below, paste CSV data in the following format:
4
+ <p>"First Name","Last Name","Email","Username","Password"</p>
5
+
6
+ <form action='/admin/users/import' method='post' id='csv_form'>
7
+ <p><textarea name='csv_data' style='width: 100%; height: 200px'></textarea></p>
8
+ <div id='message'></div>
9
+ <p><input type='submit' value='Add Users' onclick="add_users(); return false;" /></p>
10
+ </form>
11
+
12
+ <% content_for :caboose_css do %>
13
+ <style type='text/css'>
14
+
15
+ table.logs { margin: 0; padding: 0; border: 0; border-collapse: collapse; }
16
+ table.logs td { margin: 0; padding: 4px; border: #fff 1px solid; }
17
+ tr.good td { background: #009900; color: #fff; }
18
+ tr.bad td { background: #990000; color: #fff; }
19
+
20
+ </style>
21
+ <% end %>
22
+ <% content_for :caboose_js do %>
23
+ <script type='text/javascript'>
24
+
25
+ function add_users()
26
+ {
27
+ $('#message').html("<p class='loading'>Adding users...</p>");
28
+ $.ajax({
29
+ url: '/admin/users/import',
30
+ type: 'post',
31
+ data: $('#csv_form').serialize(),
32
+ success: function(resp) {
33
+ $('#message').empty();
34
+ if (resp.error) $('#message').append("<p class='note error'>" + resp.error + "</p>");
35
+ if (resp.success) $('#message').append("<p class='note success'>" + resp.success + "</p>");
36
+ if (resp.log)
37
+ {
38
+ var tbody = $('<tbody/>');
39
+ $(resp.log).each(function(i, arr) {
40
+ tbody.append(
41
+ $('<tr/>').addClass(arr[1] == true ? 'good' : 'bad')
42
+ .append($('<td/>').html(arr[2]))
43
+ .append($('<td/>').html(arr[0]))
44
+ );
45
+ });
46
+ $('#message').append($('<table/>').addClass('logs').append(tbody));
47
+ }
48
+ if (resp.redirect) window.location = resp.redirect;
49
+ }
50
+ });
51
+ }
52
+
53
+ </script>
54
+ <% end %>
@@ -7,6 +7,11 @@
7
7
  <input type='submit' value='Search' />
8
8
  </form>
9
9
 
10
+ <p>
11
+ <a href='/admin/users/new'>New User</a> |
12
+ <a href='/admin/users/import'>Import CSV</a>
13
+ </p>
14
+
10
15
  <table class='data' id='users_table'>
11
16
  <tr>
12
17
  <%= raw @gen.sortable_table_headings({
@@ -23,10 +23,12 @@ Caboose::Engine.routes.draw do
23
23
 
24
24
  get "admin/users" => "users#index"
25
25
  get "admin/users/options" => "users#options"
26
- get "admin/users/new" => "users#new"
26
+ get "admin/users/new" => "users#new"
27
+ get "admin/users/import" => "users#import_form"
28
+ post "admin/users/import" => "users#import"
27
29
  get "admin/users/:id/su" => "users#admin_su"
28
30
  get "admin/users/:id/edit-password" => "users#edit_password"
29
- get "admin/users/:id/edit" => "users#edit"
31
+ get "admin/users/:id/edit" => "users#edit"
30
32
  put "admin/users/:id" => "users#update"
31
33
  post "admin/users" => "users#create"
32
34
  delete "admin/users/:id" => "users#destroy"
@@ -55,4 +55,8 @@ module Caboose
55
55
  @@javascripts = []
56
56
  @@stylesheets = []
57
57
 
58
+ # API key for timezonedb.com/api
59
+ mattr_accessor :timezonedb_api_key
60
+ @@timezonedb_api_key = ''
61
+
58
62
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.3.85'
2
+ VERSION = '0.3.86'
3
3
  end
@@ -0,0 +1,197 @@
1
+ "ACDT","Australian Central Daylight Time"
2
+ "ACST","Australian Central Standard Time"
3
+ "ACT","ASEAN Common Time"
4
+ "ADT","Atlantic Daylight Time"
5
+ "AEDT","Australian Eastern Daylight Time"
6
+ "AEST","Australian Eastern Standard Time"
7
+ "AFT","Afghanistan Time"
8
+ "AKDT","Alaska Daylight Time"
9
+ "AKST","Alaska Standard Time"
10
+ "AMST","Amazon Summer Time (Brazil)[1]"
11
+ "AMST","Armenia Summer Time"
12
+ "AMT","Amazon Time (Brazil)[2]"
13
+ "AMT","Armenia Time"
14
+ "ART","Argentina Time"
15
+ "AST","Arabia Standard Time"
16
+ "AST","Atlantic Standard Time"
17
+ "AWDT","Australian Western Daylight Time"
18
+ "AWST","Australian Western Standard Time"
19
+ "AZOST","Azores Standard Time"
20
+ "AZT","Azerbaijan Time"
21
+ "BDT","Brunei Time"
22
+ "BIOT","British Indian Ocean Time"
23
+ "BIT","Baker Island Time"
24
+ "BOT","Bolivia Time"
25
+ "BRT","Brasilia Time"
26
+ "BST","Bangladesh Standard Time"
27
+ "BST","British Summer Time (British Standard Time from Feb 1968 to Oct 1971)"
28
+ "BTT","Bhutan Time"
29
+ "CAT","Central Africa Time"
30
+ "CCT","Cocos Islands Time"
31
+ "CDT","Central Daylight Time (North America)"
32
+ "CDT","Cuba Daylight Time[3]"
33
+ "CEDT","Central European Daylight Time"
34
+ "CEST","Central European Summer Time (Cf. HAEC)"
35
+ "CET","Central European Time"
36
+ "CHADT","Chatham Daylight Time"
37
+ "CHAST","Chatham Standard Time"
38
+ "CHOT","Choibalsan"
39
+ "ChST","Chamorro Standard Time"
40
+ "CHUT","Chuuk Time"
41
+ "CIST","Clipperton Island Standard Time"
42
+ "CIT","Central Indonesia Time"
43
+ "CKT","Cook Island Time"
44
+ "CLST","Chile Summer Time"
45
+ "CLT","Chile Standard Time"
46
+ "COST","Colombia Summer Time"
47
+ "COT","Colombia Time"
48
+ "CST","Central Standard Time (North America)"
49
+ "CST","China Standard Time"
50
+ "CST","Central Standard Time (Australia)"
51
+ "CST","Central Summer Time (Australia)"
52
+ "CST","Cuba Standard Time"
53
+ "CT","China time"
54
+ "CVT","Cape Verde Time"
55
+ "CWST","Central Western Standard Time (Australia) unofficial"
56
+ "CXT","Christmas Island Time"
57
+ "DAVT","Davis Time"
58
+ "DDUT","Dumont d'Urville Time"
59
+ "DFT","AIX specific equivalent of Central European Time[4]"
60
+ "EASST","Easter Island Standard Summer Time"
61
+ "EAST","Easter Island Standard Time"
62
+ "EAT","East Africa Time"
63
+ "ECT","Eastern Caribbean Time (does not recognise DST)"
64
+ "ECT","Ecuador Time"
65
+ "EDT","Eastern Daylight Time (North America)"
66
+ "EEDT","Eastern European Daylight Time"
67
+ "EEST","Eastern European Summer Time"
68
+ "EET","Eastern European Time"
69
+ "EGST","Eastern Greenland Summer Time"
70
+ "EGT","Eastern Greenland Time"
71
+ "EIT","Eastern Indonesian Time"
72
+ "EST","Eastern Standard Time (North America)"
73
+ "EST","Eastern Standard Time (Australia)"
74
+ "FET","Further-eastern European Time"
75
+ "FJT","Fiji Time"
76
+ "FKST","Falkland Islands Standard Time"
77
+ "FKST","Falkland Islands Summer Time"
78
+ "FKT","Falkland Islands Time"
79
+ "FNT","Fernando de Noronha Time"
80
+ "GALT","Galapagos Time"
81
+ "GAMT","Gambier Islands"
82
+ "GET","Georgia Standard Time"
83
+ "GFT","French Guiana Time"
84
+ "GILT","Gilbert Island Time"
85
+ "GIT","Gambier Island Time"
86
+ "GMT","Greenwich Mean Time"
87
+ "GST","South Georgia and the South Sandwich Islands"
88
+ "GST","Gulf Standard Time"
89
+ "GYT","Guyana Time"
90
+ "HADT","Hawaii-Aleutian Daylight Time"
91
+ "HAEC","Heure Avancée d'Europe Centrale francised name for CEST"
92
+ "HAST","Hawaii-Aleutian Standard Time"
93
+ "HKT","Hong Kong Time"
94
+ "HMT","Heard and McDonald Islands Time"
95
+ "HOVT","Khovd Time"
96
+ "HST","Hawaii Standard Time"
97
+ "ICT","Indochina Time"
98
+ "IDT","Israel Daylight Time"
99
+ "IOT","Indian Ocean Time"
100
+ "IRDT","Iran Daylight Time"
101
+ "IRKT","Irkutsk Time"
102
+ "IRST","Iran Standard Time"
103
+ "IST","Indian Standard Time"
104
+ "IST","Irish Standard Time[5]"
105
+ "IST","Israel Standard Time"
106
+ "JST","Japan Standard Time"
107
+ "KGT","Kyrgyzstan time"
108
+ "KOST","Kosrae Time"
109
+ "KRAT","Krasnoyarsk Time"
110
+ "KST","Korea Standard Time"
111
+ "LHST","Lord Howe Standard Time"
112
+ "LHST","Lord Howe Summer Time"
113
+ "LINT","Line Islands Time"
114
+ "MAGT","Magadan Time"
115
+ "MART","Marquesas Islands Time"
116
+ "MAWT","Mawson Station Time"
117
+ "MDT","Mountain Daylight Time (North America)"
118
+ "MET","Middle European Time Same zone as CET"
119
+ "MEST","Middle European Saving Time Same zone as CEST"
120
+ "MHT","Marshall Islands"
121
+ "MIST","Macquarie Island Station Time"
122
+ "MIT","Marquesas Islands Time"
123
+ "MMT","Myanmar Time"
124
+ "MSK","Moscow Time"
125
+ "MST","Malaysia Standard Time"
126
+ "MST","Mountain Standard Time (North America)"
127
+ "MST","Myanmar Standard Time"
128
+ "MUT","Mauritius Time"
129
+ "MVT","Maldives Time"
130
+ "MYT","Malaysia Time"
131
+ "NCT","New Caledonia Time"
132
+ "NDT","Newfoundland Daylight Time"
133
+ "NFT","Norfolk Time"
134
+ "NPT","Nepal Time"
135
+ "NST","Newfoundland Standard Time"
136
+ "NT","Newfoundland Time"
137
+ "NUT","Niue Time"
138
+ "NZDT","New Zealand Daylight Time"
139
+ "NZST","New Zealand Standard Time"
140
+ "OMST","Omsk Time"
141
+ "ORAT","Oral Time"
142
+ "PDT","Pacific Daylight Time (North America)"
143
+ "PET","Peru Time"
144
+ "PETT","Kamchatka Time"
145
+ "PGT","Papua New Guinea Time"
146
+ "PHOT","Phoenix Island Time"
147
+ "PHT","Philippine Time"
148
+ "PKT","Pakistan Standard Time"
149
+ "PMDT","Saint Pierre and Miquelon Daylight time"
150
+ "PMST","Saint Pierre and Miquelon Standard Time"
151
+ "PONT","Pohnpei Standard Time"
152
+ "PST","Pacific Standard Time (North America)"
153
+ "PYST","Paraguay Summer Time (South America)[6]"
154
+ "PYT","Paraguay Time (South America)[7]"
155
+ "RET","Réunion Time"
156
+ "ROTT","Rothera Research Station Time"
157
+ "SAKT","Sakhalin Island time"
158
+ "SAMT","Samara Time"
159
+ "SAST","South African Standard Time"
160
+ "SBT","Solomon Islands Time"
161
+ "SCT","Seychelles Time"
162
+ "SGT","Singapore Time"
163
+ "SLST","Sri Lanka Time"
164
+ "SRT","Suriname Time"
165
+ "SST","Samoa Standard Time"
166
+ "SST","Singapore Standard Time"
167
+ "SYOT","Showa Station Time"
168
+ "TAHT","Tahiti Time"
169
+ "THA","Thailand Standard Time"
170
+ "TFT","Indian/Kerguelen"
171
+ "TJT","Tajikistan Time"
172
+ "TKT","Tokelau Time"
173
+ "TLT","Timor Leste Time"
174
+ "TMT","Turkmenistan Time"
175
+ "TOT","Tonga Time"
176
+ "TVT","Tuvalu Time"
177
+ "UCT","Coordinated Universal Time"
178
+ "ULAT","Ulaanbaatar Time"
179
+ "UTC","Coordinated Universal Time"
180
+ "UYST","Uruguay Summer Time"
181
+ "UYT","Uruguay Standard Time"
182
+ "UZT","Uzbekistan Time"
183
+ "VET","Venezuelan Standard Time"
184
+ "VLAT","Vladivostok Time"
185
+ "VOLT","Volgograd Time"
186
+ "VOST","Vostok Station Time"
187
+ "VUT","Vanuatu Time"
188
+ "WAKT","Wake Island Time"
189
+ "WAST","West Africa Summer Time"
190
+ "WAT","West Africa Time"
191
+ "WEDT","Western European Daylight Time"
192
+ "WEST","Western European Summer Time"
193
+ "WET","Western European Time"
194
+ "WST","Western Standard Time"
195
+ "YAKT","Yakutsk Time"
196
+ "YEKT","Yekaterinburg Time"
197
+ "Z","Zulu Time (Coordinated Universal Time)"
@@ -56,6 +56,20 @@ namespace :caboose do
56
56
  `pg_restore --verbose --clean --no-acl --no-owner -h #{ddb['host']} -U #{ddb['username']} -d #{ddb['database']} #{dump_file}`
57
57
 
58
58
  end
59
+
60
+ desc "Loads and refreshes the timezones from timezonedb.com"
61
+ task :load_timezones => :environment do
62
+ Caboose::Timezone.load_zones('/Users/william/Sites/repconnex/tmp/timezones')
63
+ end
64
+
65
+ desc "Loads and refreshes the timezones from timezonedb.com"
66
+ task :test_timezones => :environment do
67
+
68
+ d = DateTime.strptime("04/01/2014 10:00 am -0500", "%m/%d/%Y %I:%M %P %Z")
69
+ puts d
70
+ d = DateTime.strptime("04/01/2014 10:00 am -0700", "%m/%d/%Y %I:%M %P %Z")
71
+ puts d
72
+ end
59
73
 
60
74
  end
61
75
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.85
4
+ version: 0.3.86
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2014-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -279,6 +279,9 @@ files:
279
279
  - app/models/caboose/setting.rb
280
280
  - app/models/caboose/states.rb
281
281
  - app/models/caboose/std_class.rb
282
+ - app/models/caboose/timezone.rb
283
+ - app/models/caboose/timezone_abbreviation.rb
284
+ - app/models/caboose/timezone_offset.rb
282
285
  - app/models/caboose/user.rb
283
286
  - app/models/caboose/utilities/schema.rb
284
287
  - app/views/caboose/ab_variants/admin_edit.html.erb
@@ -350,6 +353,7 @@ files:
350
353
  - app/views/caboose/station/index.html.erb
351
354
  - app/views/caboose/users/edit.html.erb
352
355
  - app/views/caboose/users/edit_password.html.erb
356
+ - app/views/caboose/users/import_form.html.erb
353
357
  - app/views/caboose/users/index.html.erb
354
358
  - app/views/caboose/users/my_account.html.erb
355
359
  - app/views/caboose/users/new.html.erb
@@ -374,6 +378,7 @@ files:
374
378
  - lib/caboose.rb
375
379
  - lib/sample_files/layout_default.html.erb
376
380
  - lib/sample_files/login.css
381
+ - lib/sample_files/timezone_abbreviations.csv
377
382
  - lib/sample_files/tinymce.yml
378
383
  - lib/tasks/caboose.rake
379
384
  - lib/tasks/sequences.rake