diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 981b8ea..d56a750 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base helper :document - design :holder => 'virtual_community' + design :holder => 'environment' # Be sure to include AuthenticationSystem in Application Controller instead include AuthenticatedSystem @@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base init_gettext 'noosfero' before_filter :detect_stuff_by_domain - attr_reader :virtual_community + attr_reader :environment protected @@ -20,9 +20,9 @@ class ApplicationController < ActionController::Base def detect_stuff_by_domain @domain = Domain.find_by_name(request.host) if @domain.nil? - @virtual_community = VirtualCommunity.default + @environment = Environment.default else - @virtual_community = @domain.virtual_community + @environment = @domain.environment @profile = @domain.profile end end @@ -38,7 +38,7 @@ class ApplicationController < ActionController::Base @profile end - def self.acts_as_virtual_community_admin_controller + def self.acts_as_environment_admin_controller before_filter :load_admin_controller end def load_admin_controller diff --git a/app/controllers/environment_admin/edit_template_controller.rb b/app/controllers/environment_admin/edit_template_controller.rb index 2bc233b..33a5c29 100644 --- a/app/controllers/environment_admin/edit_template_controller.rb +++ b/app/controllers/environment_admin/edit_template_controller.rb @@ -1,6 +1,6 @@ class EditTemplateController < EnvironmentAdminController - design_editor :holder => 'virtual_community', :autosave => true, :block_types => :block_types + design_editor :holder => 'environment', :autosave => true, :block_types => :block_types def block_types { diff --git a/app/controllers/environment_admin/features_controller.rb b/app/controllers/environment_admin/features_controller.rb index 26c8e59..1ca2db6 100644 --- a/app/controllers/environment_admin/features_controller.rb +++ b/app/controllers/environment_admin/features_controller.rb @@ -1,9 +1,9 @@ class FeaturesController < EnvironmentAdminController - acts_as_virtual_community_admin_controller + acts_as_environment_admin_controller def index - @features = VirtualCommunity.available_features + @features = Environment.available_features end post_only :update @@ -13,8 +13,8 @@ class FeaturesController < EnvironmentAdminController else params[:features].keys end - @virtual_community.enabled_features = features - @virtual_community.save! + @environment.enabled_features = features + @environment.save! flash[:notice] = _('Features updated successfully.') redirect_to :action => 'index' end diff --git a/app/controllers/profile_admin/enterprise_controller.rb b/app/controllers/profile_admin/enterprise_controller.rb index 0ddfebe..82aa0d4 100644 --- a/app/controllers/profile_admin/enterprise_controller.rb +++ b/app/controllers/profile_admin/enterprise_controller.rb @@ -11,7 +11,7 @@ class EnterpriseController < ProfileAdminController else redirect_to :action => 'list' end - @vitual_communities = VirtualCommunity.find(:all) + @vitual_communities = Environment.find(:all) @validation_entities = Organization.find(:all) end @@ -28,7 +28,7 @@ class EnterpriseController < ProfileAdminController # Make a form to the creation of an eterprise def register_form @enterprise = Enterprise.new() - @vitual_communities = VirtualCommunity.find(:all) + @vitual_communities = Environment.find(:all) @validation_entities = Organization.find(:all) end @@ -42,7 +42,7 @@ class EnterpriseController < ProfileAdminController redirect_to :action => 'index' else flash[:notice] = _('Enterprise was not created') - @vitual_communities = VirtualCommunity.find(:all) + @vitual_communities = Environment.find(:all) @validation_entities = Organization.find(:all) render :action => 'register_form' end diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index f855771..c2712e0 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -27,12 +27,12 @@ class AccountController < PublicController def signup begin @user = User.new(params[:user]) - @user.terms_of_use = virtual_community.terms_of_use - @terms_of_use = virtual_community.terms_of_use + @user.terms_of_use = environment.terms_of_use + @terms_of_use = environment.terms_of_use if request.post? @user.save! - @user.person.virtual_community = virtual_community + @user.person.environment = environment @user.person.save! self.current_user = @user redirect_back_or_default(:controller => 'account', :action => 'index') diff --git a/app/controllers/public/home_controller.rb b/app/controllers/public/home_controller.rb index ad7ca17..5f3a84b 100644 --- a/app/controllers/public/home_controller.rb +++ b/app/controllers/public/home_controller.rb @@ -1,5 +1,5 @@ class HomeController < PublicController - design :holder => 'virtual_community' + design :holder => 'environment' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index adcfceb..2398c87 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -73,8 +73,8 @@ module ApplicationHelper # TODO: test this helper # TODO: add an icon? # TODO: the command rake test:rcov didn't works because of this method. See what it's the problem - def virtual_community_identification - content_tag('div', @virtual_community.name, :id => 'virtual_community_identification') + def environment_identification + content_tag('div', @environment.name, :id => 'environment_identification') end def link_to_cms(text, profile = nil, options = {}) diff --git a/app/models/domain.rb b/app/models/domain.rb index a39393b..8c257f2 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -40,15 +40,15 @@ class Domain < ActiveRecord::Base name.downcase.sub(/^www\./, '') end - # detects the VirtualCommunity to which this domain belongs, either if it's + # detects the Environment to which this domain belongs, either if it's # directly owned by one, or through a profile who owns the domain but belongs - # to a VirtualCommunity. - def virtual_community + # to a Environment. + def environment case owner - when VirtualCommunity + when Environment owner when Profile - owner.virtual_community + owner.environment end end @@ -56,7 +56,7 @@ class Domain < ActiveRecord::Base # not directly associated with a profile. def profile case owner - when VirtualCommunity + when Environment nil when Profile owner diff --git a/app/models/profile.rb b/app/models/profile.rb index cdaecf9..93dfe95 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -1,6 +1,6 @@ # A Profile is the representation and web-presence of an individual or an -# organization. Every Profile is attached to its VirtualCommunity of origin, -# which by default is the one returned by VirtualCommunity:default. +# organization. Every Profile is attached to its Environment of origin, +# which by default is the one returned by Environment:default. class Profile < ActiveRecord::Base after_create do |profile| @@ -32,7 +32,7 @@ class Profile < ActiveRecord::Base acts_as_taggable has_many :domains, :as => :owner - belongs_to :virtual_community + belongs_to :environment has_many :role_assignments, :as => :resource has_many :people, :through => :role_assignments @@ -56,11 +56,11 @@ class Profile < ActiveRecord::Base validates_uniqueness_of :user_id, :allow_nil =>true # creates a new Profile. By default, it is attached to the default - # VirtualCommunity (see VirtualCommunity#default), unless you tell it + # Environment (see Environment#default), unless you tell it # otherwise def initialize(*args) super(*args) - self.virtual_community ||= VirtualCommunity.default + self.environment ||= Environment.default end # Searches tags by tag or name diff --git a/app/models/virtual_community.rb b/app/models/virtual_community.rb index 82dfb11..73fe8b3 100644 --- a/app/models/virtual_community.rb +++ b/app/models/virtual_community.rb @@ -1,9 +1,9 @@ -# A VirtualCommunity is like a website to be hosted in the platform. It may +# A Environment is like a website to be hosted in the platform. It may # contain multiple Profile's and can be identified by several different # domains. -class VirtualCommunity < ActiveRecord::Base +class Environment < ActiveRecord::Base - # returns the available features for a VirtualCommunity, in the form of a + # returns the available features for a Environment, in the form of a # hash, with pairs in the form 'feature_name' => 'Feature name'. def self.available_features { @@ -18,7 +18,7 @@ class VirtualCommunity < ActiveRecord::Base acts_as_design - # One VirtualCommunity can be reached by many domains + # One Environment can be reached by many domains has_many :domains, :as => :owner has_many :profiles @@ -26,10 +26,10 @@ class VirtualCommunity < ActiveRecord::Base # Attributes # ################################################# - # store the VirtualCommunity settings as YAML-serialized Hash. + # store the Environment settings as YAML-serialized Hash. serialize :settings - # returns a Hash containing the VirtualCommunity configuration + # returns a Hash containing the Environment configuration def settings self[:settings] ||= {} end @@ -74,7 +74,7 @@ class VirtualCommunity < ActiveRecord::Base self.settings['terms_of_use'] = value end - # returns true if this VirtualCommunity has terms of use to be + # returns true if this Environment has terms of use to be # accepted by users before registration. def has_terms_of_use? ! self.settings['terms_of_use'].nil? @@ -118,13 +118,13 @@ class VirtualCommunity < ActiveRecord::Base validates_presence_of :name # only one virtual community can be the default one - validates_uniqueness_of :is_default, :if => (lambda do |virtual_community| virtual_community.is_default? end), :message => _('Only one Virtual Community can be the default one') + validates_uniqueness_of :is_default, :if => (lambda do |environment| environment.is_default? end), :message => _('Only one Virtual Community can be the default one') # ################################################# # Business logic in general # ################################################# - # the default VirtualCommunity. + # the default Environment. def self.default self.find(:first, :conditions => [ 'is_default = ?', true ] ) end diff --git a/app/views/features/_features_table.rhtml b/app/views/features/_features_table.rhtml index c6b0b0f..3e1175e 100644 --- a/app/views/features/_features_table.rhtml +++ b/app/views/features/_features_table.rhtml @@ -3,7 +3,7 @@ <% @features.each do |feature, text| %> <%= text %> - <%= check_box_tag "features[#{feature}]", '1', @virtual_community.enabled?(feature) %> + <%= check_box_tag "features[#{feature}]", '1', @environment.enabled?(feature) %> <% end %> <%= submit_tag _('Save changes') %> diff --git a/app/views/home/index.rhtml b/app/views/home/index.rhtml index 520c6fb..a4a4948 100644 --- a/app/views/home/index.rhtml +++ b/app/views/home/index.rhtml @@ -1,3 +1,3 @@ <%= flash[:notice] %> -Start page of Virtual Community <%= @virtual_community.name %> +Start page of Virtual Community <%= @environment.name %> diff --git a/config/environment.rb b/config/environment.rb index 2cca8b6..14a6a69 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -82,17 +82,17 @@ Comatose.configure do |config| config.admin_helpers << :application_helper config.admin_helpers << :document_helper end -Comatose::AdminController.design :holder => 'virtual_community' +Comatose::AdminController.design :holder => 'environment' Comatose::AdminController.before_filter do |controller| # TODO: copy/paste; extract this into a method (see # app/controllers/application.rb) domain = Domain.find_by_name(controller.request.host) if domain.nil? - virtual_community = VirtualCommunity.default + environment = Environment.default else - virtual_community = domain.virtual_community + environment = domain.environment profile = domain.profile end - controller.instance_variable_set('@virtual_community', virtual_community) + controller.instance_variable_set('@environment', environment) end diff --git a/db/migrate/002_create_virtual_communities.rb b/db/migrate/002_create_virtual_communities.rb index 5892118..98b2e16 100644 --- a/db/migrate/002_create_virtual_communities.rb +++ b/db/migrate/002_create_virtual_communities.rb @@ -1,12 +1,12 @@ -class CreateVirtualCommunities < ActiveRecord::Migration +class CreateEnvironments < ActiveRecord::Migration def self.up - create_table :virtual_communities do |t| + create_table :environments do |t| t.column :name, :string t.column :is_default, :boolean t.column :settings, :text t.column :design_data, :text end - VirtualCommunity.create!(:name => 'Default Virtual Community', :is_default => true) + Environment.create!(:name => 'Default Environment', :is_default => true) end def self.down diff --git a/db/migrate/003_create_profiles.rb b/db/migrate/003_create_profiles.rb index 061c7b6..c7080b1 100644 --- a/db/migrate/003_create_profiles.rb +++ b/db/migrate/003_create_profiles.rb @@ -4,7 +4,7 @@ class CreateProfiles < ActiveRecord::Migration t.column :name, :string t.column :type, :string t.column :identifier, :string - t.column :virtual_community_id, :integer + t.column :environment_id, :integer t.column :flexible_template_template, :string, :default => "default" t.column :flexible_template_theme, :string, :default => "default" t.column :flexible_template_icon_theme, :string, :default => "default" diff --git a/po/noosfero.pot b/po/noosfero.pot index e518c85..179c8e6 100644 --- a/po/noosfero.pot +++ b/po/noosfero.pot @@ -226,35 +226,35 @@ msgstr "" msgid "PersonInfo|Contact information" msgstr "" -#: app/models/virtual_community.rb:- +#: app/models/environment.rb:- msgid "virtual community" msgstr "" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Name" +#: app/models/environment.rb:- +msgid "Environment|Name" msgstr "" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Is default" +#: app/models/environment.rb:- +msgid "Environment|Is default" msgstr "" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Settings" +#: app/models/environment.rb:- +msgid "Environment|Settings" msgstr "" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Design data" +#: app/models/environment.rb:- +msgid "Environment|Design data" msgstr "" -#: app/models/virtual_community.rb:10 +#: app/models/environment.rb:10 msgid "Some feature" msgstr "" -#: app/models/virtual_community.rb:11 +#: app/models/environment.rb:11 msgid "Other feature" msgstr "" -#: app/models/virtual_community.rb:121 +#: app/models/environment.rb:121 msgid "Only one Virtual Community can be the default one" msgstr "" diff --git a/po/pt_BR/noosfero.po b/po/pt_BR/noosfero.po index 9968f2b..91973f8 100644 --- a/po/pt_BR/noosfero.po +++ b/po/pt_BR/noosfero.po @@ -228,35 +228,35 @@ msgstr "Endereço" msgid "PersonInfo|Contact information" msgstr "Informação de contato" -#: app/models/virtual_community.rb:- +#: app/models/environment.rb:- msgid "virtual community" msgstr "comunidade virtual" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Name" +#: app/models/environment.rb:- +msgid "Environment|Name" msgstr "Nome" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Is default" +#: app/models/environment.rb:- +msgid "Environment|Is default" msgstr "É padrão" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Settings" +#: app/models/environment.rb:- +msgid "Environment|Settings" msgstr "Configurações" -#: app/models/virtual_community.rb:- -msgid "VirtualCommunity|Design data" +#: app/models/environment.rb:- +msgid "Environment|Design data" msgstr "Dados de design" -#: app/models/virtual_community.rb:10 +#: app/models/environment.rb:10 msgid "Some feature" msgstr "Alguma funcionalidade" -#: app/models/virtual_community.rb:11 +#: app/models/environment.rb:11 msgid "Other feature" msgstr "Outra funcionalidade" -#: app/models/virtual_community.rb:121 +#: app/models/environment.rb:121 msgid "Only one Virtual Community can be the default one" msgstr "Apenas uma comunidade virtual pode ser a padrão" diff --git a/public/artwork/newbar/menu.html b/public/artwork/newbar/menu.html index 8953a9c..c9fb581 100644 --- a/public/artwork/newbar/menu.html +++ b/public/artwork/newbar/menu.html @@ -90,7 +90,7 @@
diff --git a/public/artwork/tmp/bar.html b/public/artwork/tmp/bar.html index 737228a..3047274 100644 --- a/public/artwork/tmp/bar.html +++ b/public/artwork/tmp/bar.html @@ -50,7 +50,7 @@