diff --git a/app/assets/stylesheets/custom.css.erb b/app/assets/stylesheets/custom.css.erb index c1a2f55..bd19019 100644 --- a/app/assets/stylesheets/custom.css.erb +++ b/app/assets/stylesheets/custom.css.erb @@ -27,6 +27,7 @@ body { padding-top: 70px; } .col-pad { padding: 0 15px; } .dismiss { float: right; cursor: pointer; position: relative; top: -12px; left: 7px; } .link-no-hover:hover { text-decoration: none; } +.timecontrol-time { width: 65px; margin-right: 20px; text-align: right; display: inline-block; } /* contact form */ #contact_form { display: none; } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 85964fb..9dbd910 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -319,7 +319,7 @@ class ApplicationController < ActionController::Base elsif params[:offset].present? Time.zone = set_timezone_from_offset(params[:offset]) elsif current_user.present? - Time.zone = current_user.time_zone + Time.zone = current_user.time_zone_or_utc else Time.zone = 'UTC' end diff --git a/app/controllers/docs_controller.rb b/app/controllers/docs_controller.rb index e8a67b7..6495498 100644 --- a/app/controllers/docs_controller.rb +++ b/app/controllers/docs_controller.rb @@ -23,6 +23,7 @@ class DocsController < ApplicationController def errors; ; end def tweetcontrol; ; end + def timecontrol; ; end def plugins; ; end def importer; ; end def charts; ; end diff --git a/app/models/user.rb b/app/models/user.rb index b3b4cd9..e051000 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -56,6 +56,9 @@ class User < ActiveRecord::Base cattr_reader :per_page @@per_page = 50 + # get the user's time zone or UTC time + def time_zone_or_utc; time_zone || 'UTC'; end + # true if the user has used the maximum number of available timecontrols def max_timecontrols? self.timecontrols.roots.count >= Timecontrol::MAX_PER_USER diff --git a/app/views/apps/index.html.erb b/app/views/apps/index.html.erb index 85d4b7e..6184166 100644 --- a/app/views/apps/index.html.erb +++ b/app/views/apps/index.html.erb @@ -45,15 +45,13 @@ <% end %> - <% if current_admin_user.present? %> -
- <%= link_to timecontrols_path do %> - <%= image_tag 'timecontrol.png', :size => '104x104' %> -
- <%= t(:timecontrol) %> - <% end %> -
- <% end %> +
+ <%= link_to timecontrols_path do %> + <%= image_tag 'timecontrol.png', :size => '104x104' %> +
+ <%= t(:timecontrol) %> + <% end %> +
diff --git a/app/views/docs/channels/_update_feed.html.erb b/app/views/docs/channels/_update_feed.html.erb index 7aff3a7..a165887 100644 --- a/app/views/docs/channels/_update_feed.html.erb +++ b/app/views/docs/channels/_update_feed.html.erb @@ -10,7 +10,7 @@ To update a Channel feed, send an HTTP GET or POST to


Valid parameters: