Skip to content

Commit

Permalink
Application renamed to TravelSupport (just for sanity)
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jan 10, 2014
1 parent e1c38bd commit bde6e66
Show file tree
Hide file tree
Showing 37 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require File.expand_path('../config/application', __FILE__)

TravelSupportProgram::Application.load_tasks
TravelSupport::Application.load_tasks
2 changes: 1 addition & 1 deletion app/controllers/payments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def file
protected

def load_methods
@methods = TravelSupportProgram::Config.setting :payment_methods
@methods = TravelSupport::Config.setting :payment_methods
end

def set_breadcrumbs
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/reimbursements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def check_request
authorize! :read, @reimbursement
authorize! :create, @reimbursement.payments.build

c_template = TravelSupportProgram::Config.setting(:check_request_template)
c_layout = TravelSupportProgram::Config.setting(:check_request_layout)
c_template = TravelSupport::Config.setting(:check_request_template)
c_layout = TravelSupport::Config.setting(:check_request_layout)
if c_template.blank? or c_layout.blank?
redirect_to request_reimbursement_path(@reimbursement.request)
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def request_states_collection
end

def load_subjects
@subjects = TravelSupportProgram::Config.setting :request_expense_subjects
@subjects = TravelSupport::Config.setting :request_expense_subjects
end

end
6 changes: 3 additions & 3 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,20 @@ def bootstrap_flash_messages
# going to be defined. Only relevant if budget_limits are enabled.
# @return [Array] Array with the currency codes
def currencies_for_select(field, event = nil)
if TravelSupportProgram::Config.setting(:budget_limits) &&
if TravelSupport::Config.setting(:budget_limits) &&
event && event.budget && event.budget.currency &&
%w(approved authorized).include?(field.to_s)
currencies = [event.budget.currency]
end
currencies ||= TravelSupportProgram::Config.setting("currencies_for_#{field}")
currencies ||= TravelSupport::Config.setting("currencies_for_#{field}")
currencies ||= I18n.translate(:currencies).keys.sort
end

# Image to be used as header in pdf files
#
# @return [String] local path of the image
def pdf_header_image
if theme = TravelSupportProgram::Config.setting(:theme)
if theme = TravelSupport::Config.setting(:theme)
path = File.join(Rails.root.to_s, 'app', 'themes', theme, 'assets', 'images', 'pdf', 'header.png')
return path if File.exists?(path)
end
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/reimbursements_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def reimbursement_payments(reimbursement)
# @param [Reimbursement] reimbursement
# @return [String] HTML output
def check_request_link(reimbursement)
return "" if TravelSupportProgram::Config.setting(:check_request_layout).blank?
return "" if TravelSupportProgram::Config.setting(:check_request_template).blank?
return "" if TravelSupport::Config.setting(:check_request_layout).blank?
return "" if TravelSupport::Config.setting(:check_request_template).blank?
url = check_request_request_reimbursement_path(reimbursement.request)
link_to t(:check_request), url, :class => "btn"
end
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/user_profiles_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module UserProfilesHelper
#
# @return [String] HTML output
def profile_info
if TravelSupportProgram::Config.setting :opensuse_connect, :enabled
if TravelSupport::Config.setting :opensuse_connect, :enabled
content_tag(:div,
t(:opensuse_profile_info, :url => ConnectUser.profile_url_for(current_user.nickname)).html_safe,
:class => "alert alert-info")
Expand Down
4 changes: 2 additions & 2 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ApplicationMailer < ActionMailer::Base
helper ApplicationHelper
default :from => Proc.new { TravelSupportProgram::Config.setting(:email_from) }
default :from => Proc.new { TravelSupport::Config.setting(:email_from) }

# This method assumes that the first parameter of the mailer method is the
# recipient address (:to)
Expand All @@ -20,7 +20,7 @@ def self.notify_to(targets, method, *args)
end

def self.notify(method, *args)
if TravelSupportProgram::Config.setting(:async_emails)
if TravelSupport::Config.setting(:async_emails)
delay.send(method, *args)
else
send(method, *args).deliver
Expand Down
4 changes: 2 additions & 2 deletions app/models/connect_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ConnectUser
# @return [ConnectUser]
def initialize(login)
begin
api_conf = TravelSupportProgram::Config.setting(:opensuse_connect)
api_conf = TravelSupport::Config.setting(:opensuse_connect)
api_key = api_conf["api_key"]
url = api_conf["base_url"] + "/services/api/rest/json"
method = "connect.user.attribute.get"
Expand Down Expand Up @@ -40,7 +40,7 @@ def respond_to?(meth, include_private = false)
end

def self.profile_url_for(login)
TravelSupportProgram::Config.setting(:opensuse_connect, :base_url) + "/pg/profile/#{login}"
TravelSupport::Config.setting(:opensuse_connect, :base_url) + "/pg/profile/#{login}"
end

end
2 changes: 1 addition & 1 deletion app/models/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def only_one_active_request
# Validates that the approved amount doesn't exceed the total of the budgets
# associated to the event.
def dont_exceed_budget
if TravelSupportProgram::Config.setting :budget_limits
if TravelSupport::Config.setting :budget_limits
budget = event.budget
currency = budget ? budget.currency : nil

Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class User < ActiveRecord::Base
extend ActiveHash::Associations::ActiveRecordExtensions

devise_modules = []
if TravelSupportProgram::Config.setting(:authentication, :ichain, :enabled)
if TravelSupport::Config.setting(:authentication, :ichain, :enabled)
devise_modules += [:ichain_authenticatable, :ichain_registerable]
end
if TravelSupportProgram::Config.setting(:authentication, :database, :enabled)
if TravelSupport::Config.setting(:authentication, :database, :enabled)
devise_modules += [:database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable]

Expand Down
8 changes: 4 additions & 4 deletions app/models/user_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def set_default_attrs
#
# @return [Boolean] true if the information is correctly updated
def refresh
if TravelSupportProgram::Config.setting :opensuse_connect, :enabled
if TravelSupport::Config.setting :opensuse_connect, :enabled
update_attributes(connect_attrib_values)
else
true
Expand All @@ -71,7 +71,7 @@ def refresh
# @return [Boolean] true unless the attributes is mean to be fetched from an
# external source (openSUSE Connect at this moment)
def have_editable?(attrib)
return true unless TravelSupportProgram::Config.setting :opensuse_connect, :enabled
return true unless TravelSupport::Config.setting :opensuse_connect, :enabled
not UserProfile::FROM_OPENSUSE_CONNECT.keys.include?(attrib.to_sym)
end

Expand All @@ -81,7 +81,7 @@ def have_editable?(attrib)
#
# @return [Boolean] true unless some of the required attributes is missing
def complete?
fields = TravelSupportProgram::Config.setting(:relevant_profile_fields)
fields = TravelSupport::Config.setting(:relevant_profile_fields)
return true if fields.blank?
fields.each do |f|
return false if send(f.to_sym).blank?
Expand All @@ -92,7 +92,7 @@ def complete?
protected

def connect_attrib_values
return {} unless TravelSupportProgram::Config.setting :opensuse_connect, :enabled
return {} unless TravelSupport::Config.setting :opensuse_connect, :enabled
new_values = {}
connect = ConnectUser.new(user.nickname)
UserProfile::FROM_OPENSUSE_CONNECT.each_pair do |k,v|
Expand Down
2 changes: 1 addition & 1 deletion app/themes/bento/views/layouts/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
.container-fluid
#footer-content
#footer-legal
= t(:version, :version => TravelSupportProgram::VERSION)
= t(:version, :version => TravelSupport::VERSION)
&mdash; &#169; All content is made available under the terms of the GNU Free Documentation License version 1.2 ("GFDL") unless expressly indicated otherwise.
4 changes: 2 additions & 2 deletions app/themes/bento/views/layouts/_subheader.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
- else
= link_to t(:logout), destroy_user_session_path, :method => :delete
- else
- if TravelSupportProgram::Config.setting :authentication, :database, :enabled
- if TravelSupport::Config.setting :authentication, :database, :enabled
= link_to t(:sign_up), new_registration_path(User)
|
= link_to t(:login), new_user_session_path
- if TravelSupportProgram::Config.setting :authentication, :ichain, :enabled
- if TravelSupport::Config.setting :authentication, :ichain, :enabled
= link_to t(:sign_up), new_ichain_registration_path(User)
|
= link_to t(:login), new_user_ichain_session_path, :id => "login-trigger"
Expand Down
2 changes: 1 addition & 1 deletion app/views/final_note_mailer/creation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<p><%= t(:visit_machine) %><br/><%= link_to(*[machine_url(@machine)]*2) %></p>

<p>--<br>
<%= TravelSupportProgram::Config.setting :email_footer %></p>
<%= TravelSupport::Config.setting :email_footer %></p>
2 changes: 1 addition & 1 deletion app/views/has_state_mailer/state.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<p><%= t(:visit_machine) %><br/><%= link_to(*[machine_url(@machine)]*2) %></p>

<p>--<br>
<%= TravelSupportProgram::Config.setting :email_footer %></p>
<%= TravelSupport::Config.setting :email_footer %></p>
2 changes: 1 addition & 1 deletion app/views/has_state_mailer/state.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
<%= machine_url(@machine) %>

--
<%= TravelSupportProgram::Config.setting :email_footer %>
<%= TravelSupport::Config.setting :email_footer %>
2 changes: 1 addition & 1 deletion app/views/layouts/_external_links.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- elinks = TravelSupportProgram::Config.setting :external_links
- elinks = TravelSupport::Config.setting :external_links
- if elinks && !elinks.empty?
.well.sidebar-nav
%ul.nav.nav-list
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/_footer.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
%footer#footer
.container-fluid
%span.pull-right= t(:version, :version => TravelSupportProgram::VERSION)
%span.pull-right= t(:version, :version => TravelSupport::VERSION)
6 changes: 3 additions & 3 deletions app/views/layouts/_navbar_top.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=link_to TravelSupportProgram::Config.setting(:program_name), root_path, :class => "brand"
=link_to TravelSupport::Config.setting(:program_name), root_path, :class => "brand"
.container.nav-collapse
%ul.nav
- if user_signed_in?
Expand All @@ -8,9 +8,9 @@
- else
%li= link_to t(:logout), destroy_user_session_path, :method => :delete
- else
- if TravelSupportProgram::Config.setting :authentication, :database, :enabled
- if TravelSupport::Config.setting :authentication, :database, :enabled
%li= link_to t(:login), new_user_session_path
%li= link_to t(:sign_up), new_registration_path(User)
- if TravelSupportProgram::Config.setting :authentication, :ichain, :enabled
- if TravelSupport::Config.setting :authentication, :ichain, :enabled
%li= link_to t(:ichain_login), new_user_ichain_session_path
%li= link_to t(:ichain_sign_up), new_ichain_registration_path(User)
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%meta(charset="utf-8")
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
%title= content_for?(:title) ? yield(:title) : TravelSupportProgram::Config.setting(:program_name)
%title= content_for?(:title) ? yield(:title) : TravelSupport::Config.setting(:program_name)
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
Expand Down
4 changes: 2 additions & 2 deletions app/views/pages/userguide.en.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
on your username, in the top right corner of the page, next to the &#39;log out&#39;
link.

- if TravelSupportProgram::Config.setting :opensuse_connect, :enabled
- if TravelSupport::Config.setting :opensuse_connect, :enabled
%p
Some of the information in the profile cannot be entered directly in the
application. That information is read from
= link_to "openSUSE Connect", TravelSupportProgram::Config.setting(:opensuse_connect, :base_url)
= link_to "openSUSE Connect", TravelSupport::Config.setting(:opensuse_connect, :base_url)
and should be updated in the Connect profile of the user.

%p
Expand Down
2 changes: 1 addition & 1 deletion app/views/reimbursements/show.pdf.prawn
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ prawn_document :page_size => "A4" do |pdf|
pdf.fill_and_stroke
pdf.move_down(20)
pdf.bounding_box [ pdf.bounds.left, pdf.cursor ], :width => 550, :height => 650 do
pdf.text TravelSupportProgram::Config.setting(:program_name), :size => 16, :style => :bold
pdf.text TravelSupport::Config.setting(:program_name), :size => 16, :style => :bold
pdf.move_down(10)
pdf.text "#{Reimbursement.model_name.human.titleize} ##{resource.id} (#{resource.human_state_name}) - #{profile.full_name}", :size => 14, :style => :bold
# Requester
Expand Down
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

require ::File.expand_path('../config/environment', __FILE__)
map (ENV['RAILS_RELATIVE_URL_ROOT'] || '/') do
run TravelSupportProgram::Application
run TravelSupport::Application
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

module TravelSupportProgram
module TravelSupport
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down
2 changes: 1 addition & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)

# Initialize the rails application
TravelSupportProgram::Application.initialize!
TravelSupport::Application.initialize!
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TravelSupportProgram::Application.configure do
TravelSupport::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# In the development environment your application's code is reloaded on
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TravelSupportProgram::Application.configure do
TravelSupport::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# Code is not reloaded between requests
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TravelSupportProgram::Application.configure do
TravelSupport::Application.configure do
# Settings specified here will take precedence over those in config/application.rb

# The test environment is used exclusively to run your application's
Expand Down
6 changes: 3 additions & 3 deletions config/initializers/config.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
TravelSupportProgram::Config.init(Rails.env)
TravelSupport::Config.init(Rails.env)

ActionMailer::Base.default_url_options = TravelSupportProgram::Config.setting(:email_default_url_options).symbolize_keys
ActionMailer::Base.default_url_options = TravelSupport::Config.setting(:email_default_url_options).symbolize_keys

if theme = TravelSupportProgram::Config.setting("theme")
if theme = TravelSupport::Config.setting("theme")
path = "#{Rails.root}/app/themes/#{theme}/"
ActionController::Base.prepend_view_path "#{path}views"
Rails.application.config.assets.paths.unshift "#{path}assets/images", "#{path}assets/javascripts", "#{path}assets/stylesheets"
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = TravelSupportProgram::Config.setting(:email_from)
config.mailer_sender = TravelSupport::Config.setting(:email_from)

# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
Expand Down Expand Up @@ -242,5 +242,5 @@

# ==> iChain authenticatable configuration
# config.ichain_test_mode = true
config.ichain_base_url = TravelSupportProgram::Config.setting(:authentication, :ichain, :base_url)
config.ichain_base_url = TravelSupport::Config.setting(:authentication, :ichain, :base_url)
end
4 changes: 2 additions & 2 deletions config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
TravelSupportProgram::Application.config.secret_token = '814559f18a98c99b92689e04a22283698e25334cb99f0652842ca0eeab0a8b7c7c9af593ac7c8aea451db5f794f68ba2dad5ec9b38587446cf56f3869bc01122'
TravelSupportProgram::Application.config.secret_key_base = 'd60bee54c6e45a4ddf6f86748433c16518f25a41df253df66044519b75c58d710a7c93d8175602a2f435a9cef61aede4e1dc5c9db1fe3bc3dcf3dcd4b899682c'
TravelSupport::Application.config.secret_token = '814559f18a98c99b92689e04a22283698e25334cb99f0652842ca0eeab0a8b7c7c9af593ac7c8aea451db5f794f68ba2dad5ec9b38587446cf56f3869bc01122'
TravelSupport::Application.config.secret_key_base = 'd60bee54c6e45a4ddf6f86748433c16518f25a41df253df66044519b75c58d710a7c93d8175602a2f435a9cef61aede4e1dc5c9db1fe3bc3dcf3dcd4b899682c'
4 changes: 2 additions & 2 deletions config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.

TravelSupportProgram::Application.config.session_store :cookie_store, key: '_travel_sp_session'
TravelSupport::Application.config.session_store :cookie_store, key: '_travel_sp_session'

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# TravelSupportProgram::Application.config.session_store :active_record_store
# TravelSupport::Application.config.session_store :active_record_store
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TravelSupportProgram::Application.routes.draw do
TravelSupport::Application.routes.draw do
devise_for :users,
:controllers => { :registrations => 'registrations',
:ichain_registrations => "ichain_registrations"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Module for application-wide code
#
module TravelSupportProgram
module TravelSupport
#
# Facility class for system configuration
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Module for application-wide code
#
module TravelSupportProgram
module TravelSupport
# Current version of the application
VERSION = "0.8.0"
end
2 changes: 1 addition & 1 deletion script/clockwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Clockwork
every(1.day, 'notify.pending') do
date = TravelSupportProgram::Config.setting(:days_for_reminder)
date = TravelSupport::Config.setting(:days_for_reminder)
unless date.blank?
date = date.to_i.days.ago
Request.notify_inactive_since date
Expand Down

0 comments on commit bde6e66

Please sign in to comment.