Commit 785b56adcdd6b0a026d4c734063d4705054b0e2f
Exists in
staging
and in
22 other branches
Merge branch 'master' into field-of-interest
Showing
310 changed files
with
2575 additions
and
1519 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 310 files displayed.
app/api/entities.rb
@@ -93,7 +93,9 @@ module Api | @@ -93,7 +93,9 @@ module Api | ||
93 | class Box < Entity | 93 | class Box < Entity |
94 | root 'boxes', 'box' | 94 | root 'boxes', 'box' |
95 | expose :id, :position | 95 | expose :id, :position |
96 | - expose :blocks, :using => Block | 96 | + expose :blocks, :using => Block do |box, options| |
97 | + box.blocks.select {|block| block.visible_to_user?(options[:current_person]) } | ||
98 | + end | ||
97 | end | 99 | end |
98 | 100 | ||
99 | class Profile < Entity | 101 | class Profile < Entity |
@@ -200,12 +202,21 @@ module Api | @@ -200,12 +202,21 @@ module Api | ||
200 | expose :accept_comments?, as: :accept_comments | 202 | expose :accept_comments?, as: :accept_comments |
201 | end | 203 | end |
202 | 204 | ||
205 | + def self.permissions_for_entity(entity, current_person, *method_names) | ||
206 | + method_names.map { |method| entity.send(method, current_person) ? method.to_s.gsub(/\?/,'') : nil }.compact | ||
207 | + end | ||
208 | + | ||
203 | class Article < ArticleBase | 209 | class Article < ArticleBase |
204 | root 'articles', 'article' | 210 | root 'articles', 'article' |
205 | expose :parent, :using => ArticleBase | 211 | expose :parent, :using => ArticleBase |
206 | expose :children, :using => ArticleBase do |article, options| | 212 | expose :children, :using => ArticleBase do |article, options| |
207 | article.children.published.limit(V1::Articles::MAX_PER_PAGE) | 213 | article.children.published.limit(V1::Articles::MAX_PER_PAGE) |
208 | end | 214 | end |
215 | + expose :permissions do |article, options| | ||
216 | + Entities.permissions_for_entity(article, options[:current_person], | ||
217 | + :allow_edit?, :allow_post_content?, :allow_delete?, :allow_create?, | ||
218 | + :allow_publish_content?) | ||
219 | + end | ||
209 | end | 220 | end |
210 | 221 | ||
211 | class User < Entity | 222 | class User < Entity |
app/api/helpers.rb
@@ -121,7 +121,7 @@ module Api | @@ -121,7 +121,7 @@ module Api | ||
121 | 121 | ||
122 | def present_article(asset) | 122 | def present_article(asset) |
123 | article = find_article(asset.articles, params[:id]) | 123 | article = find_article(asset.articles, params[:id]) |
124 | - present_partial article, :with => Entities::Article, :params => params | 124 | + present_partial article, with: Entities::Article, params: params, current_person: current_person |
125 | end | 125 | end |
126 | 126 | ||
127 | def present_articles_for_asset(asset, method = 'articles') | 127 | def present_articles_for_asset(asset, method = 'articles') |
@@ -130,7 +130,7 @@ module Api | @@ -130,7 +130,7 @@ module Api | ||
130 | end | 130 | end |
131 | 131 | ||
132 | def present_articles(articles) | 132 | def present_articles(articles) |
133 | - present_partial paginate(articles), :with => Entities::Article, :params => params | 133 | + present_partial paginate(articles), :with => Entities::Article, :params => params, current_person: current_person |
134 | end | 134 | end |
135 | 135 | ||
136 | def find_articles(asset, method = 'articles') | 136 | def find_articles(asset, method = 'articles') |
@@ -407,9 +407,11 @@ module Api | @@ -407,9 +407,11 @@ module Api | ||
407 | 407 | ||
408 | def parse_content_type(content_type) | 408 | def parse_content_type(content_type) |
409 | return nil if content_type.blank? | 409 | return nil if content_type.blank? |
410 | - content_type.split(',').map do |content_type| | ||
411 | - content_type.camelcase | 410 | + content_types = content_type.split(',').map do |content_type| |
411 | + content_type = content_type.camelcase | ||
412 | + content_type == 'TextArticle' ? Article.text_article_types : content_type | ||
412 | end | 413 | end |
414 | + content_types.flatten.uniq | ||
413 | end | 415 | end |
414 | 416 | ||
415 | def period(from_date, until_date) | 417 | def period(from_date, until_date) |
app/api/v1/activities.rb
1 | module Api | 1 | module Api |
2 | module V1 | 2 | module V1 |
3 | class Activities < Grape::API | 3 | class Activities < Grape::API |
4 | - before { authenticate! } | ||
5 | 4 | ||
6 | resource :profiles do | 5 | resource :profiles do |
7 | 6 | ||
@@ -9,7 +8,7 @@ module Api | @@ -9,7 +8,7 @@ module Api | ||
9 | profile = Profile.find_by id: params[:id] | 8 | profile = Profile.find_by id: params[:id] |
10 | 9 | ||
11 | not_found! if profile.blank? || profile.secret || !profile.visible | 10 | not_found! if profile.blank? || profile.secret || !profile.visible |
12 | - forbidden! if !profile.secret && profile.visible && !profile.display_private_info_to?(current_person) | 11 | + forbidden! if !profile.display_private_info_to?(current_person) |
13 | 12 | ||
14 | activities = profile.activities.map(&:activity) | 13 | activities = profile.activities.map(&:activity) |
15 | present activities, :with => Entities::Activity, :current_person => current_person | 14 | present activities, :with => Entities::Activity, :current_person => current_person |
app/api/v1/articles.rb
@@ -54,6 +54,17 @@ module Api | @@ -54,6 +54,17 @@ module Api | ||
54 | present_partial article, :with => Entities::Article | 54 | present_partial article, :with => Entities::Article |
55 | end | 55 | end |
56 | 56 | ||
57 | + delete ':id' do | ||
58 | + article = environment.articles.find(params[:id]) | ||
59 | + return forbidden! unless article.allow_delete?(current_person) | ||
60 | + begin | ||
61 | + article.destroy | ||
62 | + { :success => true } | ||
63 | + rescue Exception => exception | ||
64 | + render_api_error!(_('The article couldn\'t be removed due to some problem. Please contact the administrator.'), 400) | ||
65 | + end | ||
66 | + end | ||
67 | + | ||
57 | desc 'Report a abuse and/or violent content in a article by id' do | 68 | desc 'Report a abuse and/or violent content in a article by id' do |
58 | detail 'Submit a abuse (in general, a content violation) report about a specific article' | 69 | detail 'Submit a abuse (in general, a content violation) report about a specific article' |
59 | params Entities::Article.documentation | 70 | params Entities::Article.documentation |
@@ -262,7 +273,7 @@ module Api | @@ -262,7 +273,7 @@ module Api | ||
262 | article = forbidden! | 273 | article = forbidden! |
263 | end | 274 | end |
264 | 275 | ||
265 | - present_partial article, :with => Entities::Article | 276 | + present_partial article, :with => Entities::Article, current_person: current_person |
266 | else | 277 | else |
267 | 278 | ||
268 | present_articles_for_asset(profile) | 279 | present_articles_for_asset(profile) |
app/api/v1/boxes.rb
@@ -12,7 +12,8 @@ module Api | @@ -12,7 +12,8 @@ module Api | ||
12 | resource :boxes do | 12 | resource :boxes do |
13 | get do | 13 | get do |
14 | profile = environment.send(kind.pluralize).find(params["#{kind}_id"]) | 14 | profile = environment.send(kind.pluralize).find(params["#{kind}_id"]) |
15 | - present profile.boxes, :with => Entities::Box | 15 | + return forbidden! unless profile.display_info_to?(current_person) |
16 | + present profile.boxes, with: Entities::Box, current_person: current_person | ||
16 | end | 17 | end |
17 | end | 18 | end |
18 | end | 19 | end |
@@ -32,7 +33,7 @@ module Api | @@ -32,7 +33,7 @@ module Api | ||
32 | else | 33 | else |
33 | env = Environment.find(params[:environment_id]) | 34 | env = Environment.find(params[:environment_id]) |
34 | end | 35 | end |
35 | - present env.boxes, :with => Entities::Box | 36 | + present env.boxes, with: Entities::Box, current_person: current_person |
36 | end | 37 | end |
37 | end | 38 | end |
38 | end | 39 | end |
app/api/v1/comments.rb
@@ -34,6 +34,7 @@ module Api | @@ -34,6 +34,7 @@ module Api | ||
34 | post ":id/comments" do | 34 | post ":id/comments" do |
35 | authenticate! | 35 | authenticate! |
36 | article = find_article(environment.articles, params[:id]) | 36 | article = find_article(environment.articles, params[:id]) |
37 | + return forbidden! unless article.accept_comments? | ||
37 | options = params.select { |key,v| !['id','private_token'].include?(key) }.merge(:author => current_person, :source => article) | 38 | options = params.select { |key,v| !['id','private_token'].include?(key) }.merge(:author => current_person, :source => article) |
38 | begin | 39 | begin |
39 | comment = Comment.create!(options) | 40 | comment = Comment.create!(options) |
@@ -42,6 +43,19 @@ module Api | @@ -42,6 +43,19 @@ module Api | ||
42 | end | 43 | end |
43 | present comment, :with => Entities::Comment, :current_person => current_person | 44 | present comment, :with => Entities::Comment, :current_person => current_person |
44 | end | 45 | end |
46 | + | ||
47 | + delete ":id/comments/:comment_id" do | ||
48 | + article = find_article(environment.articles, params[:id]) | ||
49 | + comment = article.comments.find_by_id(params[:comment_id]) | ||
50 | + return not_found! if comment.nil? | ||
51 | + return forbidden! unless comment.can_be_destroyed_by?(current_person) | ||
52 | + begin | ||
53 | + comment.destroy | ||
54 | + present comment, with: Entities::Comment, :current_person => current_person | ||
55 | + rescue => e | ||
56 | + render_api_error!(e.message, 500) | ||
57 | + end | ||
58 | + end | ||
45 | end | 59 | end |
46 | 60 | ||
47 | end | 61 | end |
app/api/v1/profiles.rb
@@ -22,6 +22,15 @@ module Api | @@ -22,6 +22,15 @@ module Api | ||
22 | not_found! | 22 | not_found! |
23 | end | 23 | end |
24 | end | 24 | end |
25 | + | ||
26 | + desc "Update profile information" | ||
27 | + post ':id' do | ||
28 | + authenticate! | ||
29 | + profile = environment.profiles.find_by(id: params[:id]) | ||
30 | + return forbidden! unless current_person.has_permission?(:edit_profile, profile) | ||
31 | + profile.update_attributes!(params[:profile]) | ||
32 | + present profile, :with => Entities::Profile, :current_person => current_person | ||
33 | + end | ||
25 | 34 | ||
26 | delete ':id' do | 35 | delete ':id' do |
27 | authenticate! | 36 | authenticate! |
@@ -0,0 +1,169 @@ | @@ -0,0 +1,169 @@ | ||
1 | +module AuthenticatedSystem | ||
2 | + | ||
3 | + protected | ||
4 | + | ||
5 | + extend ActiveSupport::Concern | ||
6 | + | ||
7 | + included do | ||
8 | + if self < ActionController::Base | ||
9 | + around_filter :user_set_current | ||
10 | + before_filter :override_user | ||
11 | + before_filter :login_from_cookie | ||
12 | + end | ||
13 | + | ||
14 | + # Inclusion hook to make #current_user and #logged_in? | ||
15 | + # available as ActionView helper methods. | ||
16 | + helper_method :current_user, :logged_in? | ||
17 | + end | ||
18 | + | ||
19 | + # Returns true or false if the user is logged in. | ||
20 | + # Preloads @current_user with the user model if they're logged in. | ||
21 | + def logged_in? | ||
22 | + current_user != nil | ||
23 | + end | ||
24 | + | ||
25 | + # Accesses the current user from the session. | ||
26 | + def current_user user_id = session[:user] | ||
27 | + @current_user ||= begin | ||
28 | + user = User.find_by id: user_id if user_id | ||
29 | + user.session = session if user | ||
30 | + User.current = user | ||
31 | + user | ||
32 | + end | ||
33 | + end | ||
34 | + | ||
35 | + # Store the given user in the session. | ||
36 | + def current_user=(new_user) | ||
37 | + if new_user.nil? | ||
38 | + session.delete(:user) | ||
39 | + else | ||
40 | + session[:user] = new_user.id | ||
41 | + new_user.session = session | ||
42 | + new_user.register_login | ||
43 | + end | ||
44 | + @current_user = User.current = new_user | ||
45 | + end | ||
46 | + | ||
47 | + # See impl. from http://stackoverflow.com/a/2513456/670229 | ||
48 | + def user_set_current | ||
49 | + User.current = current_user | ||
50 | + yield | ||
51 | + ensure | ||
52 | + # to address the thread variable leak issues in Puma/Thin webserver | ||
53 | + User.current = nil | ||
54 | + end | ||
55 | + | ||
56 | + # Check if the user is authorized. | ||
57 | + # | ||
58 | + # Override this method in your controllers if you want to restrict access | ||
59 | + # to only a few actions or if you want to check if the user | ||
60 | + # has the correct rights. | ||
61 | + # | ||
62 | + # Example: | ||
63 | + # | ||
64 | + # # only allow nonbobs | ||
65 | + # def authorize? | ||
66 | + # current_user.login != "bob" | ||
67 | + # end | ||
68 | + def authorized? | ||
69 | + true | ||
70 | + end | ||
71 | + | ||
72 | + # Filter method to enforce a login requirement. | ||
73 | + # | ||
74 | + # To require logins for all actions, use this in your controllers: | ||
75 | + # | ||
76 | + # before_filter :login_required | ||
77 | + # | ||
78 | + # To require logins for specific actions, use this in your controllers: | ||
79 | + # | ||
80 | + # before_filter :login_required, :only => [ :edit, :update ] | ||
81 | + # | ||
82 | + # To skip this in a subclassed controller: | ||
83 | + # | ||
84 | + # skip_before_filter :login_required | ||
85 | + # | ||
86 | + def login_required | ||
87 | + username, passwd = get_auth_data | ||
88 | + if username && passwd | ||
89 | + self.current_user ||= User.authenticate(username, passwd) || nil | ||
90 | + end | ||
91 | + if logged_in? && authorized? | ||
92 | + true | ||
93 | + else | ||
94 | + if params[:require_login_popup] | ||
95 | + render :json => { :require_login_popup => true } | ||
96 | + else | ||
97 | + access_denied | ||
98 | + end | ||
99 | + end | ||
100 | + end | ||
101 | + | ||
102 | + # Redirect as appropriate when an access request fails. | ||
103 | + # | ||
104 | + # The default action is to redirect to the login screen. | ||
105 | + # | ||
106 | + # Override this method in your controllers if you want to have special | ||
107 | + # behavior in case the user is not authorized | ||
108 | + # to access the requested action. For example, a popup window might | ||
109 | + # simply close itself. | ||
110 | + def access_denied | ||
111 | + respond_to do |accepts| | ||
112 | + accepts.html do | ||
113 | + if request.xhr? | ||
114 | + render :text => _('Access denied'), :status => 401 | ||
115 | + else | ||
116 | + store_location | ||
117 | + redirect_to :controller => '/account', :action => 'login' | ||
118 | + end | ||
119 | + end | ||
120 | + accepts.xml do | ||
121 | + headers["Status"] = "Unauthorized" | ||
122 | + headers["WWW-Authenticate"] = %(Basic realm="Web Password") | ||
123 | + render :text => "Could't authenticate you", :status => '401 Unauthorized' | ||
124 | + end | ||
125 | + end | ||
126 | + false | ||
127 | + end | ||
128 | + | ||
129 | + # Store the URI of the current request in the session. | ||
130 | + # | ||
131 | + # We can return to this location by calling #redirect_back_or_default. | ||
132 | + def store_location(location = request.url) | ||
133 | + session[:return_to] = location | ||
134 | + end | ||
135 | + | ||
136 | + # Redirect to the URI stored by the most recent store_location call or | ||
137 | + # to the passed default. | ||
138 | + def redirect_back_or_default(default) | ||
139 | + if session[:return_to] | ||
140 | + redirect_to(session.delete(:return_to)) | ||
141 | + else | ||
142 | + redirect_to(default) | ||
143 | + end | ||
144 | + end | ||
145 | + | ||
146 | + def override_user | ||
147 | + return if params[:override_user].blank? | ||
148 | + return unless logged_in? and user.is_admin? environment | ||
149 | + @current_user = nil | ||
150 | + current_user params[:override_user] | ||
151 | + end | ||
152 | + | ||
153 | + # When called with before_filter :login_from_cookie will check for an :auth_token | ||
154 | + # cookie and log the user back in if apropriate | ||
155 | + def login_from_cookie | ||
156 | + return if cookies[:auth_token].blank? or logged_in? | ||
157 | + user = User.where(remember_token: cookies[:auth_token]).first | ||
158 | + self.current_user = user if user and user.remember_token? | ||
159 | + end | ||
160 | + | ||
161 | + private | ||
162 | + @@http_auth_headers = %w(X-HTTP_AUTHORIZATION HTTP_AUTHORIZATION Authorization) | ||
163 | + # gets BASIC auth info | ||
164 | + def get_auth_data | ||
165 | + auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) } | ||
166 | + auth_data = request.env[auth_key].to_s.split unless auth_key.blank? | ||
167 | + return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] | ||
168 | + end | ||
169 | +end |
app/controllers/application_controller.rb
@@ -13,6 +13,13 @@ class ApplicationController < ActionController::Base | @@ -13,6 +13,13 @@ class ApplicationController < ActionController::Base | ||
13 | before_filter :verify_members_whitelist, :if => [:private_environment?, :user] | 13 | before_filter :verify_members_whitelist, :if => [:private_environment?, :user] |
14 | before_filter :redirect_to_current_user | 14 | before_filter :redirect_to_current_user |
15 | 15 | ||
16 | + before_filter :set_session_theme | ||
17 | + def set_session_theme | ||
18 | + if params[:theme] | ||
19 | + session[:theme] = environment.theme_ids.include?(params[:theme]) ? params[:theme] : nil | ||
20 | + end | ||
21 | + end | ||
22 | + | ||
16 | def require_login_for_environment | 23 | def require_login_for_environment |
17 | login_required | 24 | login_required |
18 | end | 25 | end |
app/controllers/my_profile/profile_themes_controller.rb
@@ -63,12 +63,12 @@ class ProfileThemesController < ThemesController | @@ -63,12 +63,12 @@ class ProfileThemesController < ThemesController | ||
63 | end | 63 | end |
64 | 64 | ||
65 | def start_test | 65 | def start_test |
66 | - session[:theme] = params[:id] | 66 | + session[:user_theme] = params[:id] |
67 | redirect_to :controller => 'content_viewer', :profile => profile.identifier, :action => 'view_page' | 67 | redirect_to :controller => 'content_viewer', :profile => profile.identifier, :action => 'view_page' |
68 | end | 68 | end |
69 | 69 | ||
70 | def stop_test | 70 | def stop_test |
71 | - session[:theme] = nil | 71 | + session[:user_theme] = nil |
72 | redirect_to :action => 'index' | 72 | redirect_to :action => 'index' |
73 | end | 73 | end |
74 | 74 |
app/controllers/public/content_viewer_controller.rb
@@ -209,7 +209,7 @@ class ContentViewerController < ApplicationController | @@ -209,7 +209,7 @@ class ContentViewerController < ApplicationController | ||
209 | end | 209 | end |
210 | 210 | ||
211 | if @page.published && @page.uploaded_file? | 211 | if @page.published && @page.uploaded_file? |
212 | - redirect_to @page.public_filename | 212 | + redirect_to "#{Noosfero.root}#{@page.public_filename}" |
213 | else | 213 | else |
214 | send_data data, @page.download_headers | 214 | send_data data, @page.download_headers |
215 | end | 215 | end |
app/helpers/application_helper.rb
@@ -233,13 +233,6 @@ module ApplicationHelper | @@ -233,13 +233,6 @@ module ApplicationHelper | ||
233 | link_to(content_tag('span', text), url, html_options.merge(:class => the_class, :title => text)) | 233 | link_to(content_tag('span', text), url, html_options.merge(:class => the_class, :title => text)) |
234 | end | 234 | end |
235 | 235 | ||
236 | - def button_bar(options = {}, &block) | ||
237 | - options[:class].nil? ? | ||
238 | - options[:class]='button-bar' : | ||
239 | - options[:class]+=' button-bar' | ||
240 | - concat(content_tag('div', capture(&block).to_s + tag('br', :style => 'clear: left;'), options)) | ||
241 | - end | ||
242 | - | ||
243 | def render_profile_actions klass | 236 | def render_profile_actions klass |
244 | name = klass.to_s.underscore | 237 | name = klass.to_s.underscore |
245 | begin | 238 | begin |
@@ -351,7 +344,7 @@ module ApplicationHelper | @@ -351,7 +344,7 @@ module ApplicationHelper | ||
351 | end | 344 | end |
352 | 345 | ||
353 | def is_testing_theme | 346 | def is_testing_theme |
354 | - !controller.session[:theme].nil? | 347 | + !controller.session[:user_theme].nil? |
355 | end | 348 | end |
356 | 349 | ||
357 | def theme_owner | 350 | def theme_owner |
@@ -600,8 +593,8 @@ module ApplicationHelper | @@ -600,8 +593,8 @@ module ApplicationHelper | ||
600 | end | 593 | end |
601 | 594 | ||
602 | if block | 595 | if block |
603 | - field_html ||= '' | ||
604 | - field_html += capture(&block) | 596 | + field_html ||= ''.html_safe |
597 | + field_html = [field_html, capture(&block)].safe_join | ||
605 | end | 598 | end |
606 | 599 | ||
607 | if controller.action_name == 'signup' || controller.action_name == 'new_community' || (controller.controller_name == "enterprise_registration" && controller.action_name == 'index') || (controller.controller_name == 'home' && controller.action_name == 'index' && user.nil?) | 600 | if controller.action_name == 'signup' || controller.action_name == 'new_community' || (controller.controller_name == "enterprise_registration" && controller.action_name == 'index') || (controller.controller_name == 'home' && controller.action_name == 'index' && user.nil?) |
@@ -610,7 +603,9 @@ module ApplicationHelper | @@ -610,7 +603,9 @@ module ApplicationHelper | ||
610 | end | 603 | end |
611 | else | 604 | else |
612 | if profile.active_fields.include?(name) | 605 | if profile.active_fields.include?(name) |
613 | - result = content_tag('div', field_html + profile_field_privacy_selector(profile, name), :class => 'field-with-privacy-selector') | 606 | + result = content_tag :div, class: 'field-with-privacy-selector' do |
607 | + [field_html, profile_field_privacy_selector(profile, name)].safe_join | ||
608 | + end | ||
614 | end | 609 | end |
615 | end | 610 | end |
616 | 611 | ||
@@ -618,10 +613,6 @@ module ApplicationHelper | @@ -618,10 +613,6 @@ module ApplicationHelper | ||
618 | result = required(result) | 613 | result = required(result) |
619 | end | 614 | end |
620 | 615 | ||
621 | - if block | ||
622 | - concat(result) | ||
623 | - end | ||
624 | - | ||
625 | result | 616 | result |
626 | end | 617 | end |
627 | 618 | ||
@@ -866,7 +857,7 @@ module ApplicationHelper | @@ -866,7 +857,7 @@ module ApplicationHelper | ||
866 | alias :browse_communities_menu :search_communities_menu | 857 | alias :browse_communities_menu :search_communities_menu |
867 | 858 | ||
868 | def pagination_links(collection, options={}) | 859 | def pagination_links(collection, options={}) |
869 | - options = {:previous_label => content_tag(:span, '« ', :class => 'previous-arrow') + _('Previous'), :next_label => _('Next') + content_tag(:span, ' »', :class => 'next-arrow'), :inner_window => 1, :outer_window => 0 }.merge(options) | 860 | + options = {:previous_label => content_tag(:span, '« '.html_safe, :class => 'previous-arrow') + _('Previous'), :next_label => _('Next') + content_tag(:span, ' »'.html_safe, :class => 'next-arrow'), :inner_window => 1, :outer_window => 0 }.merge(options) |
870 | will_paginate(collection, options) | 861 | will_paginate(collection, options) |
871 | end | 862 | end |
872 | 863 | ||
@@ -988,6 +979,7 @@ module ApplicationHelper | @@ -988,6 +979,7 @@ module ApplicationHelper | ||
988 | values = {} | 979 | values = {} |
989 | values.merge!(task.information[:variables]) if task.information[:variables] | 980 | values.merge!(task.information[:variables]) if task.information[:variables] |
990 | values.merge!({:requestor => link_to(task.requestor.name, task.requestor.url)}) if task.requestor | 981 | values.merge!({:requestor => link_to(task.requestor.name, task.requestor.url)}) if task.requestor |
982 | + values.merge!({:target => link_to(task.target.name, task.target.url)}) if (task.target && task.target.respond_to?(:url)) | ||
991 | values.merge!({:subject => content_tag('span', task.subject, :class=>'task_target')}) if task.subject | 983 | values.merge!({:subject => content_tag('span', task.subject, :class=>'task_target')}) if task.subject |
992 | values.merge!({:linked_subject => link_to(content_tag('span', task.linked_subject[:text], :class => 'task_target'), task.linked_subject[:url])}) if task.linked_subject | 984 | values.merge!({:linked_subject => link_to(content_tag('span', task.linked_subject[:text], :class => 'task_target'), task.linked_subject[:url])}) if task.linked_subject |
993 | (task.information[:message] % values).html_safe | 985 | (task.information[:message] % values).html_safe |
@@ -1138,7 +1130,7 @@ module ApplicationHelper | @@ -1138,7 +1130,7 @@ module ApplicationHelper | ||
1138 | content_tag(:div, :class => 'errorExplanation', :id => 'errorExplanation') do | 1130 | content_tag(:div, :class => 'errorExplanation', :id => 'errorExplanation') do |
1139 | content_tag(:h2, _('Errors while saving')) + | 1131 | content_tag(:h2, _('Errors while saving')) + |
1140 | content_tag(:ul) do | 1132 | content_tag(:ul) do |
1141 | - safe_join(errors.map { |err| content_tag(:li, err) }) | 1133 | + safe_join(errors.map { |err| content_tag(:li, err.html_safe) }) |
1142 | end | 1134 | end |
1143 | end | 1135 | end |
1144 | end | 1136 | end |
app/helpers/article_helper.rb
@@ -187,9 +187,9 @@ module ArticleHelper | @@ -187,9 +187,9 @@ module ArticleHelper | ||
187 | def following_button(page, user) | 187 | def following_button(page, user) |
188 | if !user.blank? and user != page.author | 188 | if !user.blank? and user != page.author |
189 | if page.is_followed_by? user | 189 | if page.is_followed_by? user |
190 | - button :cancel, unfollow_button_text(page), {:controller => 'profile', :action => 'unfollow_article', :article_id => page.id, :profile => page.profile.identifier} | 190 | + button :cancel, unfollow_button_text(page), {controller: :profile, profile: page.profile.identifier, action: :unfollow_article, article_id: page.id} |
191 | else | 191 | else |
192 | - button :add, follow_button_text(page), {:controller => 'profile', :action => 'follow_article', :article_id => page.id, :profile => page.profile.identifier} | 192 | + button :add, follow_button_text(page), {controller: :profile, profile: page.profile.identifier, action: :follow_article, article_id: page.id} |
193 | end | 193 | end |
194 | end | 194 | end |
195 | end | 195 | end |
app/helpers/boxes_helper.rb
@@ -99,15 +99,10 @@ module BoxesHelper | @@ -99,15 +99,10 @@ module BoxesHelper | ||
99 | end | 99 | end |
100 | 100 | ||
101 | def render_block_content block | 101 | def render_block_content block |
102 | - # FIXME: this conditional should be removed after all | ||
103 | - # block footer from plugins methods get refactored into helpers and views. | ||
104 | - # They are a failsafe until all of them are done. | ||
105 | - return block.content if block.method(:content).owner != Block | ||
106 | render_block block | 102 | render_block block |
107 | end | 103 | end |
108 | 104 | ||
109 | def render_block_footer block | 105 | def render_block_footer block |
110 | - return block.footer if block.method(:footer).owner != Block | ||
111 | render_block block, 'footers/' | 106 | render_block block, 'footers/' |
112 | end | 107 | end |
113 | 108 |
app/helpers/buttons_helper.rb
1 | module ButtonsHelper | 1 | module ButtonsHelper |
2 | + | ||
3 | + def button_bar(options = {}, &block) | ||
4 | + options[:class] ||= '' | ||
5 | + options[:class] << ' button-bar' | ||
6 | + | ||
7 | + content_tag :div, options do | ||
8 | + [ | ||
9 | + capture(&block).to_s, | ||
10 | + tag(:br, style: 'clear: left;'), | ||
11 | + ].safe_join | ||
12 | + end | ||
13 | + end | ||
14 | + | ||
2 | def button(type, label, url, html_options = {}) | 15 | def button(type, label, url, html_options = {}) |
3 | html_options ||= {} | 16 | html_options ||= {} |
4 | the_class = 'with-text' | 17 | the_class = 'with-text' |
app/helpers/custom_fields_helper.rb
@@ -61,6 +61,6 @@ module CustomFieldsHelper | @@ -61,6 +61,6 @@ module CustomFieldsHelper | ||
61 | 61 | ||
62 | def form_for_format(customized_type, format) | 62 | def form_for_format(customized_type, format) |
63 | field = CustomField.new(:format => format, :customized_type => customized_type, :environment => environment) | 63 | field = CustomField.new(:format => format, :customized_type => customized_type, :environment => environment) |
64 | - CGI::escapeHTML((render(:partial => 'features/custom_fields/form', :locals => {:field => field}))) | 64 | + CGI::escapeHTML((render(:partial => 'features/custom_fields/form', :locals => {:field => field}))).html_safe |
65 | end | 65 | end |
66 | end | 66 | end |
app/helpers/theme_loader_helper.rb
@@ -2,8 +2,8 @@ module ThemeLoaderHelper | @@ -2,8 +2,8 @@ module ThemeLoaderHelper | ||
2 | def current_theme | 2 | def current_theme |
3 | @current_theme ||= | 3 | @current_theme ||= |
4 | begin | 4 | begin |
5 | - if session[:theme] | ||
6 | - session[:theme] | 5 | + if session[:user_theme] |
6 | + session[:user_theme] | ||
7 | else | 7 | else |
8 | # utility for developers: set the theme to 'random' in development mode and | 8 | # utility for developers: set the theme to 'random' in development mode and |
9 | # you will get a different theme every request. This is interesting for | 9 | # you will get a different theme every request. This is interesting for |
@@ -11,8 +11,8 @@ module ThemeLoaderHelper | @@ -11,8 +11,8 @@ module ThemeLoaderHelper | ||
11 | if Rails.env.development? && environment.theme == 'random' | 11 | if Rails.env.development? && environment.theme == 'random' |
12 | @random_theme ||= Dir.glob('public/designs/themes/*').map { |f| File.basename(f) }.rand | 12 | @random_theme ||= Dir.glob('public/designs/themes/*').map { |f| File.basename(f) }.rand |
13 | @random_theme | 13 | @random_theme |
14 | - elsif Rails.env.development? && respond_to?(:params) && params[:theme] && File.exists?(Rails.root.join('public/designs/themes', params[:theme])) | ||
15 | - params[:theme] | 14 | + elsif Rails.env.development? && respond_to?(:params) && params[:user_theme] && File.exists?(Rails.root.join('public/designs/themes', params[:user_theme])) |
15 | + params[:user_theme] | ||
16 | else | 16 | else |
17 | if profile && !profile.theme.nil? | 17 | if profile && !profile.theme.nil? |
18 | profile.theme | 18 | profile.theme |
@@ -34,8 +34,10 @@ module ThemeLoaderHelper | @@ -34,8 +34,10 @@ module ThemeLoaderHelper | ||
34 | end | 34 | end |
35 | 35 | ||
36 | def theme_path | 36 | def theme_path |
37 | - if session[:theme] | 37 | + if session[:user_theme] |
38 | '/user_themes/' + current_theme | 38 | '/user_themes/' + current_theme |
39 | + elsif session[:theme] | ||
40 | + '/designs/themes/' + session[:theme] | ||
39 | else | 41 | else |
40 | '/designs/themes/' + current_theme | 42 | '/designs/themes/' + current_theme |
41 | end | 43 | end |
app/helpers/url_helper.rb
@@ -4,4 +4,12 @@ module UrlHelper | @@ -4,4 +4,12 @@ module UrlHelper | ||
4 | 'javascript:history.back()' | 4 | 'javascript:history.back()' |
5 | end | 5 | end |
6 | 6 | ||
7 | + def default_url_options | ||
8 | + options = {} | ||
9 | + | ||
10 | + options[:override_user] = params[:override_user] if params[:override_user].present? | ||
11 | + | ||
12 | + options | ||
13 | + end | ||
14 | + | ||
7 | end | 15 | end |
app/helpers/users_helper.rb
1 | module UsersHelper | 1 | module UsersHelper |
2 | 2 | ||
3 | - FILTER_TRANSLATION = { | 3 | + def filter_translation |
4 | + { | ||
4 | 'all_users' => _('All users'), | 5 | 'all_users' => _('All users'), |
5 | 'admin_users' => _('Admin users'), | 6 | 'admin_users' => _('Admin users'), |
6 | 'activated_users' => _('Activated users'), | 7 | 'activated_users' => _('Activated users'), |
7 | 'deactivated_users' => _('Deativated users'), | 8 | 'deactivated_users' => _('Deativated users'), |
8 | - } | 9 | + } |
10 | + end | ||
9 | 11 | ||
10 | def filter_selector(filter, float = 'right') | 12 | def filter_selector(filter, float = 'right') |
11 | - options = options_for_select(FILTER_TRANSLATION.map {|key, name| [name, key]}, :selected => filter) | 13 | + options = options_for_select(filter_translation.map {|key, name| [name, key]}, :selected => filter) |
12 | url_params = url_for(params.merge(:filter => 'FILTER')) | 14 | url_params = url_for(params.merge(:filter => 'FILTER')) |
13 | onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)" | 15 | onchange = "document.location.href = '#{url_params}'.replace('FILTER', this.value)" |
14 | select_field = select_tag(:filter, options, :onchange => onchange) | 16 | select_field = select_tag(:filter, options, :onchange => onchange) |
@@ -19,7 +21,7 @@ module UsersHelper | @@ -19,7 +21,7 @@ module UsersHelper | ||
19 | end | 21 | end |
20 | 22 | ||
21 | def users_filter_title(filter) | 23 | def users_filter_title(filter) |
22 | - FILTER_TRANSLATION[filter] | 24 | + filter_translation[filter] |
23 | end | 25 | end |
24 | 26 | ||
25 | end | 27 | end |
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +class DownloadReportedImagesJob < Struct.new(:abuse_report, :article) | ||
2 | + def perform | ||
3 | + images_paths = article.image? ? [File.join(article.profile.environment.top_url, article.public_filename(:display))] : article.body_images_paths | ||
4 | + images_paths.each do |image_path| | ||
5 | + image = get_image(image_path) | ||
6 | + reported_image = ReportedImage.create!( :abuse_report => abuse_report, | ||
7 | + :uploaded_data => image, | ||
8 | + :filename => File.basename(image_path), | ||
9 | + :size => image.size ) | ||
10 | + abuse_report.content = parse_content(abuse_report, image_path, reported_image) | ||
11 | + end | ||
12 | + abuse_report.save! | ||
13 | + end | ||
14 | + | ||
15 | + def get_image(image_path) | ||
16 | + image = ActionController::UploadedTempfile.new('reported_image') | ||
17 | + image.write(Net::HTTP.get(URI.parse(image_path))) | ||
18 | + image.original_path = 'tmp/' + File.basename(image_path) | ||
19 | + image.content_type = 'image/' + File.extname(image_path).gsub('.','') | ||
20 | + image | ||
21 | + end | ||
22 | + | ||
23 | + def parse_content(report, old_path, image) | ||
24 | + old_path = old_path.gsub(report.reporter.environment.top_url, '') | ||
25 | + report.content.gsub(/#{old_path}/, image.public_filename) | ||
26 | + end | ||
27 | +end |
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +class GetEmailContactsJob < Struct.new(:import_from, :login, :password, :contact_list_id) | ||
2 | + def perform | ||
3 | + begin | ||
4 | + Invitation.get_contacts(import_from, login, password, contact_list_id) | ||
5 | + rescue Contacts::AuthenticationError => ex | ||
6 | + ContactList.exists?(contact_list_id) && ContactList.find(contact_list_id).register_auth_error | ||
7 | + rescue Exception => ex | ||
8 | + ContactList.exists?(contact_list_id) && ContactList.find(contact_list_id).register_error | ||
9 | + end | ||
10 | + end | ||
11 | +end |
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +class InvitationJob < Struct.new(:person_id, :contacts_to_invite, :message, :profile_id, :contact_list_id, :locale) | ||
2 | + def perform | ||
3 | + Noosfero.with_locale(locale) do | ||
4 | + person = Person.find(person_id) | ||
5 | + profile = Profile.find(profile_id) | ||
6 | + Invitation.invite(person, contacts_to_invite, message, profile) | ||
7 | + ContactList.exists?(contact_list_id) && ContactList.find(contact_list_id).destroy | ||
8 | + end | ||
9 | + end | ||
10 | +end |
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +class LogMemoryConsumptionJob < Struct.new(:last_stat) | ||
2 | + # Number of entries do display | ||
3 | + N = 20 | ||
4 | + | ||
5 | + def perform | ||
6 | + logpath = File.join(Rails.root, 'log', "#{ENV['RAILS_ENV']}_memory_consumption.log") | ||
7 | + logger = Logger.new(logpath) | ||
8 | + stats = Hash.new(0) | ||
9 | + ObjectSpace.each_object {|o| stats[o.class.to_s] += 1} | ||
10 | + i = 1 | ||
11 | + | ||
12 | + logger << "[#{Time.now.strftime('%F %T %z')}]\n" | ||
13 | + stats.sort {|(k1,v1),(k2,v2)| v2 <=> v1}.each do |k,v| | ||
14 | + logger << (sprintf "%-60s %10d", k, v) | ||
15 | + logger << (sprintf " | delta %10d", (v - last_stat[k])) if last_stat && last_stat[k] | ||
16 | + logger << "\n" | ||
17 | + break if i > N | ||
18 | + i += 1 | ||
19 | + end | ||
20 | + logger << "\n" | ||
21 | + end | ||
22 | +end |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +class NotifyActivityToProfilesJob < Struct.new(:tracked_action_id) | ||
2 | + NOTIFY_ONLY_COMMUNITY = [ | ||
3 | + 'add_member_in_community' | ||
4 | + ] | ||
5 | + | ||
6 | + NOT_NOTIFY_COMMUNITY = [ | ||
7 | + 'join_community' | ||
8 | + ] | ||
9 | + def perform | ||
10 | + return unless ActionTracker::Record.exists?(tracked_action_id) | ||
11 | + tracked_action = ActionTracker::Record.find(tracked_action_id) | ||
12 | + return unless tracked_action.user.present? | ||
13 | + target = tracked_action.target | ||
14 | + if target.is_a?(Community) && ( NOTIFY_ONLY_COMMUNITY.include?(tracked_action.verb) || ! target.public_profile ) | ||
15 | + ActionTrackerNotification.create(:profile_id => target.id, :action_tracker_id => tracked_action.id) | ||
16 | + return | ||
17 | + end | ||
18 | + | ||
19 | + # Notify the user | ||
20 | + ActionTrackerNotification.create(:profile_id => tracked_action.user.id, :action_tracker_id => tracked_action.id) | ||
21 | + | ||
22 | + # Notify all friends | ||
23 | + ActionTrackerNotification.connection.execute("insert into action_tracker_notifications(profile_id, action_tracker_id) select f.friend_id, #{tracked_action.id} from friendships as f where person_id=#{tracked_action.user.id} and f.friend_id not in (select atn.profile_id from action_tracker_notifications as atn where atn.action_tracker_id = #{tracked_action.id})") | ||
24 | + | ||
25 | + if tracked_action.user.is_a? Organization | ||
26 | + ActionTrackerNotification.connection.execute "insert into action_tracker_notifications(profile_id, action_tracker_id) " + | ||
27 | + "select distinct accessor_id, #{tracked_action.id} from role_assignments where resource_id = #{tracked_action.user.id} and resource_type='Profile' " + | ||
28 | + if tracked_action.user.is_a? Enterprise then "union select distinct person_id, #{tracked_action.id} from favorite_enterprise_people where enterprise_id = #{tracked_action.user.id}" else "" end | ||
29 | + end | ||
30 | + | ||
31 | + if target.is_a?(Community) | ||
32 | + ActionTrackerNotification.create(:profile_id => target.id, :action_tracker_id => tracked_action.id) unless NOT_NOTIFY_COMMUNITY.include?(tracked_action.verb) | ||
33 | + | ||
34 | + ActionTrackerNotification.connection.execute("insert into action_tracker_notifications(profile_id, action_tracker_id) select distinct profiles.id, #{tracked_action.id} from role_assignments, profiles where profiles.type = 'Person' and profiles.id = role_assignments.accessor_id and profiles.id != #{tracked_action.user.id} and profiles.id not in (select atn.profile_id from action_tracker_notifications as atn where atn.action_tracker_id = #{tracked_action.id}) and role_assignments.resource_type = 'Profile' and role_assignments.resource_id = #{target.id}") | ||
35 | + end | ||
36 | + | ||
37 | + if target.is_a?(Article) && target.profile.is_a?(Community) | ||
38 | + ActionTrackerNotification.create(:profile_id => target.profile.id, :action_tracker_id => tracked_action.id) unless NOT_NOTIFY_COMMUNITY.include?(tracked_action.verb) | ||
39 | + | ||
40 | + ActionTrackerNotification.connection.execute("insert into action_tracker_notifications(profile_id, action_tracker_id) select distinct profiles.id, #{tracked_action.id} from role_assignments, profiles where profiles.type = 'Person' and profiles.id = role_assignments.accessor_id and profiles.id != #{tracked_action.user.id} and profiles.id not in (select atn.profile_id from action_tracker_notifications as atn where atn.action_tracker_id = #{tracked_action.id}) and role_assignments.resource_type = 'Profile' and role_assignments.resource_id = #{target.profile.id}") | ||
41 | + end | ||
42 | + | ||
43 | + end | ||
44 | +end |
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +class ProfileSuggestionsJob < Struct.new(:person_id) | ||
2 | + | ||
3 | + def self.exists?(person_id) | ||
4 | + !find(person_id).empty? | ||
5 | + end | ||
6 | + | ||
7 | + def self.find(person_id) | ||
8 | + Delayed::Job.by_handler("--- !ruby/struct:ProfileSuggestionsJob\nperson_id: #{person_id}\n") | ||
9 | + end | ||
10 | + | ||
11 | + def perform | ||
12 | + logger = Delayed::Worker.logger | ||
13 | + begin | ||
14 | + person = Person.find(person_id) | ||
15 | + ProfileSuggestion.calculate_suggestions(person) | ||
16 | + UserMailer.profiles_suggestions_email(person).deliver if person.email_suggestions | ||
17 | + rescue Exception => exception | ||
18 | + logger.error("Error with suggestions for person ID %d: %s" % [person_id, exception.to_s]) | ||
19 | + end | ||
20 | + end | ||
21 | + | ||
22 | +end |
app/models/add_member.rb
@@ -37,6 +37,10 @@ class AddMember < Task | @@ -37,6 +37,10 @@ class AddMember < Task | ||
37 | true | 37 | true |
38 | end | 38 | end |
39 | 39 | ||
40 | + def reject_details | ||
41 | + true | ||
42 | + end | ||
43 | + | ||
40 | def footer | 44 | def footer |
41 | true | 45 | true |
42 | end | 46 | end |
@@ -72,8 +76,9 @@ class AddMember < Task | @@ -72,8 +76,9 @@ class AddMember < Task | ||
72 | end | 76 | end |
73 | 77 | ||
74 | def task_cancelled_message | 78 | def task_cancelled_message |
75 | - _("Your request to enter community \"%{target} with the profile \"%{requestor}\" was not accepted. Please contact any profile admin from %{url} for more information.") % | ||
76 | - {:target => self.target.name, :url => self.target.url, | ||
77 | - :requestor => self.requestor.name} | 79 | + _("Your request to enter community \"%{target}\" with the profile \"%{requestor}\" was not accepted. Please contact any profile admin from %{target} for more information. The following explanation was given: \n\n\"%{explanation}\"") % |
80 | + {:target => self.target.name, | ||
81 | + :requestor => self.requestor.name, | ||
82 | + :explanation => self.reject_explanation} | ||
78 | end | 83 | end |
79 | end | 84 | end |
app/models/article.rb
@@ -29,6 +29,8 @@ class Article < ApplicationRecord | @@ -29,6 +29,8 @@ class Article < ApplicationRecord | ||
29 | :display => %w[full] | 29 | :display => %w[full] |
30 | } | 30 | } |
31 | 31 | ||
32 | + N_('article') | ||
33 | + | ||
32 | def initialize(*params) | 34 | def initialize(*params) |
33 | super | 35 | super |
34 | if params.present? && params.first.present? | 36 | if params.present? && params.first.present? |
app/models/block.rb
@@ -181,30 +181,6 @@ class Block < ApplicationRecord | @@ -181,30 +181,6 @@ class Block < ApplicationRecord | ||
181 | "/images/block_preview.png" | 181 | "/images/block_preview.png" |
182 | end | 182 | end |
183 | 183 | ||
184 | - # Returns the content to be used for this block. | ||
185 | - # | ||
186 | - # This method can return several types of objects: | ||
187 | - # | ||
188 | - # * <tt>String</tt>: if the string starts with <tt>http://</tt> or <tt>https://</tt>, then it is assumed to be address of an IFRAME. Otherwise it's is used as regular HTML. | ||
189 | - # * <tt>Hash</tt>: the hash is used to build an URL that is used as the address for a IFRAME. | ||
190 | - # * <tt>Proc</tt>: the Proc is evaluated in the scope of BoxesHelper. The | ||
191 | - # block can then use <tt>render</tt>, <tt>link_to</tt>, etc. | ||
192 | - # | ||
193 | - # The method can also return <tt>nil</tt>, which means "no content". | ||
194 | - # | ||
195 | - # See BoxesHelper#extract_block_content for implementation details. | ||
196 | - def content(args={}) | ||
197 | - "This is block number %d" % self.id | ||
198 | - end | ||
199 | - | ||
200 | - # A footer to be appended to the end of the block. Returns <tt>nil</tt>. | ||
201 | - # | ||
202 | - # Override in your subclasses. You can return the same types supported by | ||
203 | - # #content. | ||
204 | - def footer | ||
205 | - nil | ||
206 | - end | ||
207 | - | ||
208 | # Is this block editable? (Default to <tt>true</tt>) | 184 | # Is this block editable? (Default to <tt>true</tt>) |
209 | def editable?(user=nil) | 185 | def editable?(user=nil) |
210 | self.edit_modes == "all" | 186 | self.edit_modes == "all" |
app/models/comment_handler.rb
1 | -class CommentHandler < Struct.new(:comment_id, :method) | 1 | +class CommentHandler < Struct.new(:comment_id, :method, :locale) |
2 | + def initialize(*args) | ||
3 | + super | ||
4 | + self.locale ||= FastGettext.locale | ||
5 | + end | ||
2 | 6 | ||
3 | def perform | 7 | def perform |
8 | + saved_locale = FastGettext.locale | ||
9 | + FastGettext.locale = locale | ||
10 | + | ||
4 | comment = Comment.find(comment_id) | 11 | comment = Comment.find(comment_id) |
5 | comment.send(method) | 12 | comment.send(method) |
13 | + FastGettext.locale = saved_locale | ||
6 | rescue ActiveRecord::RecordNotFound | 14 | rescue ActiveRecord::RecordNotFound |
7 | # just ignore non-existing comments | 15 | # just ignore non-existing comments |
8 | end | 16 | end |
app/models/community.rb
app/models/enterprise.rb
@@ -12,7 +12,7 @@ class Enterprise < Organization | @@ -12,7 +12,7 @@ class Enterprise < Organization | ||
12 | _('Enterprise') | 12 | _('Enterprise') |
13 | end | 13 | end |
14 | 14 | ||
15 | - N_('Enterprise') | 15 | + N_('enterprise') |
16 | 16 | ||
17 | acts_as_trackable after_add: proc{ |p, t| notify_activity t } | 17 | acts_as_trackable after_add: proc{ |p, t| notify_activity t } |
18 | 18 |
app/models/environment.rb
@@ -750,6 +750,10 @@ class Environment < ApplicationRecord | @@ -750,6 +750,10 @@ class Environment < ApplicationRecord | ||
750 | end | 750 | end |
751 | end | 751 | end |
752 | 752 | ||
753 | + def theme_ids | ||
754 | + settings[:themes] || [] | ||
755 | + end | ||
756 | + | ||
753 | def themes=(values) | 757 | def themes=(values) |
754 | settings[:themes] = values | 758 | settings[:themes] = values |
755 | end | 759 | end |
app/models/link_list_block.rb
@@ -81,10 +81,8 @@ class LinkListBlock < Block | @@ -81,10 +81,8 @@ class LinkListBlock < Block | ||
81 | end | 81 | end |
82 | end | 82 | end |
83 | 83 | ||
84 | - def icons_options | ||
85 | - ICONS.map do |i| | ||
86 | - "<span title=\"#{i[1]}\" class=\"icon-#{i[0]}\" onclick=\"changeIcon(this, '#{i[0]}')\"></span>".html_safe | ||
87 | - end | 84 | + def icons |
85 | + ICONS | ||
88 | end | 86 | end |
89 | 87 | ||
90 | end | 88 | end |
app/models/organization.rb
@@ -234,4 +234,7 @@ class Organization < Profile | @@ -234,4 +234,7 @@ class Organization < Profile | ||
234 | self.admins.where(:id => user.id).exists? | 234 | self.admins.where(:id => user.id).exists? |
235 | end | 235 | end |
236 | 236 | ||
237 | + def display_private_info_to?(user) | ||
238 | + (public_profile && visible && !secret) || super | ||
239 | + end | ||
237 | end | 240 | end |
app/models/person.rb
@@ -13,6 +13,8 @@ class Person < Profile | @@ -13,6 +13,8 @@ class Person < Profile | ||
13 | _('Person') | 13 | _('Person') |
14 | end | 14 | end |
15 | 15 | ||
16 | + N_('person') | ||
17 | + | ||
16 | acts_as_trackable :after_add => Proc.new {|p,t| notify_activity(t)} | 18 | acts_as_trackable :after_add => Proc.new {|p,t| notify_activity(t)} |
17 | acts_as_accessor | 19 | acts_as_accessor |
18 | 20 |
app/models/person_notifier.rb
@@ -82,7 +82,7 @@ class PersonNotifier | @@ -82,7 +82,7 @@ class PersonNotifier | ||
82 | helper ActionTrackerHelper | 82 | helper ActionTrackerHelper |
83 | 83 | ||
84 | def session | 84 | def session |
85 | - {:theme => nil} | 85 | + {:user_theme => nil} |
86 | end | 86 | end |
87 | 87 | ||
88 | def content_summary(person, notifications, tasks) | 88 | def content_summary(person, notifications, tasks) |
app/views/account/_login_form.html.erb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %> | 11 | <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %> |
12 | <% end %> | 12 | <% end %> |
13 | 13 | ||
14 | -<% button_bar do %> | 14 | +<%= button_bar do %> |
15 | <%= submit_button( 'login', _('Log in') )%> | 15 | <%= submit_button( 'login', _('Log in') )%> |
16 | <%= modal_close_button _('Cancel') if request.xhr? %> | 16 | <%= modal_close_button _('Cancel') if request.xhr? %> |
17 | <% end %> | 17 | <% end %> |
app/views/account/accept_terms.html.erb
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <%= hidden_field_tag :answer, params[:answer] %> | 20 | <%= hidden_field_tag :answer, params[:answer] %> |
21 | 21 | ||
22 | <%= labelled_check_box(environment.terms_of_use_acceptance_text.blank? ? _('I read the terms of use and accepted them') : environment.terms_of_use_acceptance_text, :terms_accepted, '1', false, :id => 'accept-terms') %> | 22 | <%= labelled_check_box(environment.terms_of_use_acceptance_text.blank? ? _('I read the terms of use and accepted them') : environment.terms_of_use_acceptance_text, :terms_accepted, '1', false, :id => 'accept-terms') %> |
23 | - <% button_bar do %> | 23 | + <%= button_bar do %> |
24 | <%= button 'cancel', _('Cancel'), :controller => 'home', :action => 'index' %> | 24 | <%= button 'cancel', _('Cancel'), :controller => 'home', :action => 'index' %> |
25 | <%= submit_button 'forward', _('Continue'), {:disabled => true, :class => 'disabled', :id => 'submit-accept-terms'} %> | 25 | <%= submit_button 'forward', _('Continue'), {:disabled => true, :class => 'disabled', :id => 'submit-accept-terms'} %> |
26 | <% end %> | 26 | <% end %> |
app/views/account/activation_question.html.erb
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | 24 | ||
25 | <div class='activation-box'> | 25 | <div class='activation-box'> |
26 | <h2><%= _('Enterprise activation') + ' - ' + (logged_in? ? _('part 1 of 2') : _('part 1 of 3')) %></h2> | 26 | <h2><%= _('Enterprise activation') + ' - ' + (logged_in? ? _('part 1 of 2') : _('part 1 of 3')) %></h2> |
27 | - <%= form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %> | 27 | + <%= form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %> |
28 | 28 | ||
29 | <p> <strong><%= _('Pay atention! You have only one chance!') %></strong> </p> | 29 | <p> <strong><%= _('Pay atention! You have only one chance!') %></strong> </p> |
30 | 30 | ||
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | 34 | ||
35 | <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %> | 35 | <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %> |
36 | 36 | ||
37 | - <% button_bar do %> | 37 | + <%= button_bar do %> |
38 | <%= button 'cancel', _('Cancel'), :action => 'index' %> | 38 | <%= button 'cancel', _('Cancel'), :action => 'index' %> |
39 | <%= submit_button 'forward', _('Continue') %> | 39 | <%= submit_button 'forward', _('Continue') %> |
40 | <% end %> | 40 | <% end %> |
app/views/account/forgot_password.html.erb
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> | 9 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> |
10 | 10 | ||
11 | <div> | 11 | <div> |
12 | - <% button_bar do %> | 12 | + <%= button_bar do %> |
13 | <%= submit_button('send', _('Send instructions')) %> | 13 | <%= submit_button('send', _('Send instructions')) %> |
14 | <% end %> | 14 | <% end %> |
15 | </div> | 15 | </div> |
app/views/account/login.html.erb
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | 22 | ||
23 | <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_exec(&content) }, "") %> | 23 | <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_exec(&content) }, "") %> |
24 | 24 | ||
25 | - <% button_bar do %> | 25 | + <%= button_bar do %> |
26 | <%= submit_button( 'login', _('Log in') )%> | 26 | <%= submit_button( 'login', _('Log in') )%> |
27 | <% if is_popin %> | 27 | <% if is_popin %> |
28 | <%= modal_close_button(_('Cancel')) %> | 28 | <%= modal_close_button(_('Cancel')) %> |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | 31 | ||
32 | <% end %> | 32 | <% end %> |
33 | 33 | ||
34 | -<% button_bar do %> | 34 | +<%= button_bar do %> |
35 | <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> | 35 | <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> |
36 | <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %> | 36 | <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %> |
37 | <% end %> | 37 | <% end %> |
app/views/account/login_block.html.erb
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | 17 | ||
18 | <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }, "") %> | 18 | <%= safe_join(@plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }, "") %> |
19 | 19 | ||
20 | - <% button_bar do %> | 20 | + <%= button_bar do %> |
21 | <%= submit_button( 'login', _('Log in') )%> | 21 | <%= submit_button( 'login', _('Log in') )%> |
22 | <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> | 22 | <% unless @plugins.dispatch(:allow_user_registration).include?(false) %> |
23 | <%= button(:add, _('New user'), { :controller => 'account', :action => 'signup' }) %> | 23 | <%= button(:add, _('New user'), { :controller => 'account', :action => 'signup' }) %> |
app/views/account/logout_popup.html.erb
1 | <h2><%= _('Are you sure you want to get out?') %></h2> | 1 | <h2><%= _('Are you sure you want to get out?') %></h2> |
2 | <p> | 2 | <p> |
3 | -<% button_bar do %> | 3 | +<%= button_bar do %> |
4 | <%= button :ok, _('Yes'), { :controller => 'account', :action => 'logout' } %> | 4 | <%= button :ok, _('Yes'), { :controller => 'account', :action => 'logout' } %> |
5 | <%= modal_close_button _('No, I want to stay.') %> | 5 | <%= modal_close_button _('No, I want to stay.') %> |
6 | <% end %> | 6 | <% end %> |
app/views/account/new_password.html.erb
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | 10 | ||
11 | <%= labelled_form_field(_('Enter new password'), (f.password_field :password)) %> | 11 | <%= labelled_form_field(_('Enter new password'), (f.password_field :password)) %> |
12 | <%= labelled_form_field(_('Confirm the new password'), (f.password_field :password_confirmation)) %> | 12 | <%= labelled_form_field(_('Confirm the new password'), (f.password_field :password_confirmation)) %> |
13 | - <% button_bar do %> | 13 | + <%= button_bar do %> |
14 | <%= submit_button(:ok, _('Change password')) %> | 14 | <%= submit_button(:ok, _('Change password')) %> |
15 | <% end %> | 15 | <% end %> |
16 | 16 |
app/views/account/welcome.html.erb
@@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
3 | 3 | ||
4 | <%= _('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %> | 4 | <%= _('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %> |
5 | 5 | ||
6 | - <% button_bar do %> | ||
7 | - <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %> | 6 | + <%= button_bar do %> |
7 | + <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %> | ||
8 | <%= button 'forward', _('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %> | 8 | <%= button 'forward', _('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %> |
9 | <% end %> | 9 | <% end %> |
10 | <% end %> | 10 | <% end %> |
app/views/admin_panel/message_for_disabled_enterprise.html.erb
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %> | 7 | <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %> |
8 | 8 | ||
9 | - <% button_bar do %> | 9 | + <%= button_bar do %> |
10 | <%= submit_button(:save, _('Save')) %> | 10 | <%= submit_button(:save, _('Save')) %> |
11 | <%= button(:cancel, _('Cancel'), :action => 'index') %> | 11 | <%= button(:cancel, _('Cancel'), :action => 'index') %> |
12 | <% end %> | 12 | <% end %> |
app/views/admin_panel/set_portal_community.html.erb
@@ -4,14 +4,14 @@ | @@ -4,14 +4,14 @@ | ||
4 | <%= form_tag do %> | 4 | <%= form_tag do %> |
5 | <%= labelled_form_field(_('Portal identifier'), text_field_tag('portal_community_identifier', @portal_community.identifier, :size => 40) ) %> | 5 | <%= labelled_form_field(_('Portal identifier'), text_field_tag('portal_community_identifier', @portal_community.identifier, :size => 40) ) %> |
6 | 6 | ||
7 | - <% button_bar do %> | 7 | + <%= button_bar do %> |
8 | <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %> | 8 | <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %> |
9 | <% end %> | 9 | <% end %> |
10 | <% end %> | 10 | <% end %> |
11 | <% else %> | 11 | <% else %> |
12 | <%= _('Portal identifier: %s').html_safe % link_to(@portal_community.identifier, @portal_community.url) %> | 12 | <%= _('Portal identifier: %s').html_safe % link_to(@portal_community.identifier, @portal_community.url) %> |
13 | 13 | ||
14 | - <% button_bar do %> | 14 | + <%= button_bar do %> |
15 | <%if @portal_community.environment.enabled?('use_portal_community') %> | 15 | <%if @portal_community.environment.enabled?('use_portal_community') %> |
16 | <%= button 'cancel', _('Disable'), {:action => 'manage_portal_community', :activate => 0} %> | 16 | <%= button 'cancel', _('Disable'), {:action => 'manage_portal_community', :activate => 0} %> |
17 | <% else %> | 17 | <% else %> |
app/views/admin_panel/set_portal_folders.html.erb
@@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
37 | <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %> | 37 | <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %> |
38 | </p> | 38 | </p> |
39 | 39 | ||
40 | - <% button_bar do %> | 40 | + <%= button_bar do %> |
41 | <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %> | 41 | <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %> |
42 | <% end %> | 42 | <% end %> |
43 | <% end %> | 43 | <% end %> |
app/views/admin_panel/set_portal_news_amount.html.erb
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <%= labelled_form_field _('Number of portal news'), select(:environment, :portal_news_amount, (0..10).to_a) %> | 6 | <%= labelled_form_field _('Number of portal news'), select(:environment, :portal_news_amount, (0..10).to_a) %> |
7 | <%= labelled_form_field _('Number of news by folder'), select(:environment, :news_amount_by_folder, (1..10).to_a) %> | 7 | <%= labelled_form_field _('Number of news by folder'), select(:environment, :news_amount_by_folder, (1..10).to_a) %> |
8 | 8 | ||
9 | - <% button_bar do %> | 9 | + <%= button_bar do %> |
10 | <%= submit_button(:save, _('Save')) %> | 10 | <%= submit_button(:save, _('Save')) %> |
11 | <%= button(:cancel, _('Cancel'), :action => 'index') %> | 11 | <%= button(:cancel, _('Cancel'), :action => 'index') %> |
12 | <% end %> | 12 | <% end %> |
app/views/admin_panel/site_info.html.erb
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | <% tabs << {:title => _('Signup introduction text'), :id => 'signup-intro', | 20 | <% tabs << {:title => _('Signup introduction text'), :id => 'signup-intro', |
21 | :content => (render :partial => 'signup_intro', :locals => {:f => f})} %> | 21 | :content => (render :partial => 'signup_intro', :locals => {:f => f})} %> |
22 | <%= render_tabs(tabs) %> | 22 | <%= render_tabs(tabs) %> |
23 | - <% button_bar do %> | 23 | + <%= button_bar do %> |
24 | <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> | 24 | <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> |
25 | <% end %> | 25 | <% end %> |
26 | <% end %> | 26 | <% end %> |
app/views/box_organizer/_icon_selector.html.erb
@@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
2 | <%= hidden_field_tag 'block[links][][icon]', icon %> | 2 | <%= hidden_field_tag 'block[links][][icon]', icon %> |
3 | <span class='icon-<%= icon %>' style='display:block; width:16px; height:16px;'></span> | 3 | <span class='icon-<%= icon %>' style='display:block; width:16px; height:16px;'></span> |
4 | <div class="icon-selector" style='display:none;'> | 4 | <div class="icon-selector" style='display:none;'> |
5 | - <%= @block.icons_options.join %> | 5 | + <% @block.icons.map do |i| %> |
6 | + <%= content_tag('span', '', :title => i[1], :class => "icon-#{i[0]}", :onclick => "changeIcon(this, '#{i[0]}')") %> | ||
7 | + <% end %> | ||
6 | </div> | 8 | </div> |
7 | </div> | 9 | </div> |
app/views/box_organizer/edit.html.erb
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | </div> | 35 | </div> |
36 | <% end %> | 36 | <% end %> |
37 | 37 | ||
38 | - <% button_bar do %> | 38 | + <%= button_bar do %> |
39 | <%= submit_button(:save, _('Save')) %> | 39 | <%= submit_button(:save, _('Save')) %> |
40 | <%= modal_close_button(_('Cancel')) %> | 40 | <%= modal_close_button(_('Cancel')) %> |
41 | <% end %> | 41 | <% end %> |
app/views/box_organizer/index.html.erb
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | <h1><%= _('Editing sideboxes')%></h1> | 4 | <h1><%= _('Editing sideboxes')%></h1> |
5 | 5 | ||
6 | -<% button_bar :class=>'design-menu' do %> | 6 | +<%= button_bar :class=>'design-menu' do %> |
7 | <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %> | 7 | <%= button(:back, _('Back to control panel'), :controller => (profile.nil? ? 'admin_panel': 'profile_editor')) %> |
8 | <% end %> | 8 | <% end %> |
9 | 9 |
app/views/categories/_form.html.erb
@@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
28 | <%= file_field_or_thumbnail(_('Image:'), @category.image, i) %> | 28 | <%= file_field_or_thumbnail(_('Image:'), @category.image, i) %> |
29 | <% end %> | 29 | <% end %> |
30 | 30 | ||
31 | - <% button_bar do %> | 31 | + <%= button_bar do %> |
32 | <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> | 32 | <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> |
33 | <% end%> | 33 | <% end%> |
34 | <% end %> | 34 | <% end %> |
app/views/cms/_media_new_folder.html.erb
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <%= labelled_radio_button _('Folder'), :folder_type, 'Folder', false %> | 9 | <%= labelled_radio_button _('Folder'), :folder_type, 'Folder', false %> |
10 | 10 | ||
11 | <%= labelled_form_field _('Name:'), text_field_tag(:new_folder, nil, 'data-url' => url_for({:action => 'new', :profile => profile.identifier})) %> | 11 | <%= labelled_form_field _('Name:'), text_field_tag(:new_folder, nil, 'data-url' => url_for({:action => 'new', :profile => profile.identifier})) %> |
12 | - <% button_bar do %> | 12 | + <%= button_bar do %> |
13 | <%= submit_button(:newfolder, _('Create')) %> | 13 | <%= submit_button(:newfolder, _('Create')) %> |
14 | <% end %> | 14 | <% end %> |
15 | <% end %> | 15 | <% end %> |
app/views/cms/_text_fields.html.erb
1 | -<%= labelled_form_field(_('Publish date'), date_field('article[published_at]', @article.published_at || DateTime.current, {:max_date => '+0d', :date_format => 'yy-mm-dd'}, {:id => "article_published_at"})) %> | 1 | +<%= labelled_form_field(_('Publish date'), date_field('article[published_at]', @article.published_at || DateTime.current, {:max_date => '+0d', :time => true}, {:id => "article_published_at"})) %> |
app/views/cms/_upload_file_form.html.erb
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | 12 | ||
13 | <%= hidden_field_tag('back_to', @back_to) %> | 13 | <%= hidden_field_tag('back_to', @back_to) %> |
14 | 14 | ||
15 | -<% button_bar do %> | 15 | +<%= button_bar do %> |
16 | <%= button_to_function :add, _('More files'), "add_new_file_fields()" %> | 16 | <%= button_to_function :add, _('More files'), "add_new_file_fields()" %> |
17 | <% if @back_to %> | 17 | <% if @back_to %> |
18 | <%= submit_button :save, _('Upload'), :cancel => @back_to %> | 18 | <%= submit_button :save, _('Upload'), :cancel => @back_to %> |
app/views/cms/destroy.html.erb
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <% end %> | 12 | <% end %> |
13 | </strong> | 13 | </strong> |
14 | 14 | ||
15 | - <% button_bar do %> | 15 | + <%= button_bar do %> |
16 | <%= submit_button :save, _('Yes, I want.') %> | 16 | <%= submit_button :save, _('Yes, I want.') %> |
17 | <%= button :cancel, _("No, I don't want."), @article.url %> | 17 | <%= button :cancel, _("No, I don't want."), @article.url %> |
18 | <% end %> | 18 | <% end %> |
app/views/cms/edit.html.erb
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | </div> | 21 | </div> |
22 | <% end %> | 22 | <% end %> |
23 | 23 | ||
24 | - <% button_bar do %> | 24 | + <%= button_bar do %> |
25 | <%= submit_button :save, _('Save') %> | 25 | <%= submit_button :save, _('Save') %> |
26 | <%= submit_button :save, _('Save and continue'), :name => "continue" %> | 26 | <%= submit_button :save, _('Save and continue'), :name => "continue" %> |
27 | <% end %> | 27 | <% end %> |
@@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
48 | <%= options_for_article(@article, @tokenized_children) %> | 48 | <%= options_for_article(@article, @tokenized_children) %> |
49 | </div> | 49 | </div> |
50 | 50 | ||
51 | - <% button_bar do %> | 51 | + <%= button_bar do %> |
52 | <%= submit_button :save, _('Save') %> | 52 | <%= submit_button :save, _('Save') %> |
53 | 53 | ||
54 | <% if @back_to %> | 54 | <% if @back_to %> |
app/views/cms/publish.html.erb
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | <%= hidden_field_tag :back_to, @back_to %> | 25 | <%= hidden_field_tag :back_to, @back_to %> |
26 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> | 26 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> |
27 | 27 | ||
28 | - <% button_bar do %> | 28 | + <%= button_bar do %> |
29 | <%= submit_button 'spread', _('Spread this') %> | 29 | <%= submit_button 'spread', _('Spread this') %> |
30 | <% end %> | 30 | <% end %> |
31 | <% end %> | 31 | <% end %> |
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | <% search_action = url_for(:action => 'search_communities_to_publish') %> | 41 | <% search_action = url_for(:action => 'search_communities_to_publish') %> |
42 | <%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %> | 42 | <%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %> |
43 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> | 43 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> |
44 | - <% button_bar do %> | 44 | + <%= button_bar do %> |
45 | <%= submit_button 'spread', _('Spread this') %> | 45 | <%= submit_button 'spread', _('Spread this') %> |
46 | <% end %> | 46 | <% end %> |
47 | <% end %> | 47 | <% end %> |
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | <%= hidden_field_tag :back_to, @back_to %> | 58 | <%= hidden_field_tag :back_to, @back_to %> |
59 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> | 59 | <%= labelled_form_field _('Title'), text_field_tag('name', @article.name) %> |
60 | 60 | ||
61 | - <% button_bar do %> | 61 | + <%= button_bar do %> |
62 | <%= submit_button 'spread', _('Spread this') %> | 62 | <%= submit_button 'spread', _('Spread this') %> |
63 | <% end %> | 63 | <% end %> |
64 | <% end %> | 64 | <% end %> |
app/views/cms/publish_on_portal_community.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <%= hidden_field_tag :back_to, @back_to %> | 5 | <%= hidden_field_tag :back_to, @back_to %> |
6 | <%= labelled_text_field _('Title') + ': ', :name, @article.name, :style => 'width: 100%' %> | 6 | <%= labelled_text_field _('Title') + ': ', :name, @article.name, :style => 'width: 100%' %> |
7 | 7 | ||
8 | - <% button_bar do %> | 8 | + <%= button_bar do %> |
9 | <%= submit_button 'spread', _('Spread this'), :cancel => @back_to %> | 9 | <%= submit_button 'spread', _('Spread this'), :cancel => @back_to %> |
10 | <% end %> | 10 | <% end %> |
11 | <% end %> | 11 | <% end %> |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | <%= _("There is no portal community in this environment.") %> | 14 | <%= _("There is no portal community in this environment.") %> |
15 | </div> | 15 | </div> |
16 | 16 | ||
17 | - <% button_bar do %> | 17 | + <%= button_bar do %> |
18 | <%= button :back, _('Back'), :controller => 'cms' %> | 18 | <%= button :back, _('Back'), :controller => 'cms' %> |
19 | <% end %> | 19 | <% end %> |
20 | <% end %> | 20 | <% end %> |
app/views/cms/suggest_an_article.html.erb
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | 23 | ||
24 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) unless logged_in? %> | 24 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) unless logged_in? %> |
25 | 25 | ||
26 | - <% button_bar do %> | 26 | + <%= button_bar do %> |
27 | <%= submit_button :save, _('Save') %> | 27 | <%= submit_button :save, _('Save') %> |
28 | <%= button :cancel, _('Cancel'), @back_to %> | 28 | <%= button :cancel, _('Cancel'), @back_to %> |
29 | <% end %> | 29 | <% end %> |
app/views/cms/view.html.erb
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | </div> | 14 | </div> |
15 | <% end %> | 15 | <% end %> |
16 | 16 | ||
17 | -<% button_bar(:style => 'margin-bottom: 1em;') do %> | 17 | +<%= button_bar(:style => 'margin-bottom: 1em;') do %> |
18 | <% parent_id = ((@article && @article.allow_children?) ? @article : nil) %> | 18 | <% parent_id = ((@article && @article.allow_children?) ? @article : nil) %> |
19 | 19 | ||
20 | <%= modal_button('new', _('New content'), url_for({:action => 'new', :parent_id => parent_id, :cms => true}).html_safe) %> | 20 | <%= modal_button('new', _('New content'), url_for({:action => 'new', :parent_id => parent_id, :cms => true}).html_safe) %> |
app/views/cms/why_categorize.html.erb
@@ -4,6 +4,6 @@ | @@ -4,6 +4,6 @@ | ||
4 | <%= _('By categorizing your content, you increase the possibility that other people access it. When they are looking for, say, articles about Bahia and you categorize your article in "Regions/Bahia", then there is a good change that your article is going to be found.') %> | 4 | <%= _('By categorizing your content, you increase the possibility that other people access it. When they are looking for, say, articles about Bahia and you categorize your article in "Regions/Bahia", then there is a good change that your article is going to be found.') %> |
5 | </p> | 5 | </p> |
6 | 6 | ||
7 | -<% button_bar do %> | 7 | +<%= button_bar do %> |
8 | <%= modal_close_button _('Close') %> | 8 | <%= modal_close_button _('Close') %> |
9 | <% end %> | 9 | <% end %> |
app/views/comment/_comment_form.html.erb
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <div id="recaptcha-container" style="display: none"> | 8 | <div id="recaptcha-container" style="display: none"> |
9 | <h3><%= _('Please type the two words below') %></h3> | 9 | <h3><%= _('Please type the two words below') %></h3> |
10 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> | 10 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> |
11 | - <% button_bar do %> | 11 | + <%= button_bar do %> |
12 | <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> | 12 | <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> |
13 | <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> | 13 | <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> |
14 | <% end %> | 14 | <% end %> |
@@ -87,7 +87,7 @@ function check_captcha(button, confirm_action) { | @@ -87,7 +87,7 @@ function check_captcha(button, confirm_action) { | ||
87 | 87 | ||
88 | <%= safe_join(@plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }, "") %> | 88 | <%= safe_join(@plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }, "") %> |
89 | 89 | ||
90 | - <% button_bar do %> | 90 | + <%= button_bar do %> |
91 | <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> | 91 | <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> |
92 | <% if !edition_mode %> | 92 | <% if !edition_mode %> |
93 | <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %> | 93 | <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %> |
app/views/content_viewer/_comment_form.html.erb
@@ -36,7 +36,7 @@ function submit_comment_form(button) { | @@ -36,7 +36,7 @@ function submit_comment_form(button) { | ||
36 | <div id="recaptcha-container" style="display: none"> | 36 | <div id="recaptcha-container" style="display: none"> |
37 | <h3><%= _('Please type the two words below') %></h3> | 37 | <h3><%= _('Please type the two words below') %></h3> |
38 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> | 38 | <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %> |
39 | - <% button_bar do %> | 39 | + <%= button_bar do %> |
40 | <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> | 40 | <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> |
41 | <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> | 41 | <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> |
42 | <% end %> | 42 | <% end %> |
@@ -73,7 +73,7 @@ function submit_comment_form(button) { | @@ -73,7 +73,7 @@ function submit_comment_form(button) { | ||
73 | <%= hidden_field_tag(:confirm, 'false') %> | 73 | <%= hidden_field_tag(:confirm, 'false') %> |
74 | <%= hidden_field_tag(:view, params[:view])%> | 74 | <%= hidden_field_tag(:view, params[:view])%> |
75 | 75 | ||
76 | - <% button_bar do %> | 76 | + <%= button_bar do %> |
77 | <%= submit_button('add', _('Post comment'), :onclick => "submit_comment_form(this); return false") %> | 77 | <%= submit_button('add', _('Post comment'), :onclick => "submit_comment_form(this); return false") %> |
78 | <% if cancel_triggers_hide %> | 78 | <% if cancel_triggers_hide %> |
79 | <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %> | 79 | <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %> |
app/views/content_viewer/_confirm_unfollow.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <%= form_tag(@page.view_url.merge({:only_path => true}), {:method => 'post', :class => 'comment_form'}) do %> | 5 | <%= form_tag(@page.view_url.merge({:only_path => true}), {:method => 'post', :class => 'comment_form'}) do %> |
6 | <%= hidden_field_tag(:unfollow, 'commit') %> | 6 | <%= hidden_field_tag(:unfollow, 'commit') %> |
7 | <%= labelled_form_field(_('Enter your e-Mail'), text_field_tag(:email, nil, {:size => 40})) %> | 7 | <%= labelled_form_field(_('Enter your e-Mail'), text_field_tag(:email, nil, {:size => 40})) %> |
8 | - <% button_bar do %> | 8 | + <%= button_bar do %> |
9 | <%= submit_button(:ok, _('Cancel notifications for e-mail above') ) %> | 9 | <%= submit_button(:ok, _('Cancel notifications for e-mail above') ) %> |
10 | <% end %> | 10 | <% end %> |
11 | <% end %> | 11 | <% end %> |
app/views/content_viewer/blog_page.html.erb
app/views/content_viewer/forum_page.html.erb
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | <p><%= @page.terms_of_use %></p> | 16 | <p><%= @page.terms_of_use %></p> |
17 | 17 | ||
18 | <%= form_tag @page.url.merge(:terms_accepted => true) do %> | 18 | <%= form_tag @page.url.merge(:terms_accepted => true) do %> |
19 | - <% button_bar do %> | 19 | + <%= button_bar do %> |
20 | <% if user %> | 20 | <% if user %> |
21 | <%= submit_button :save, _("Accept") %> | 21 | <%= submit_button :save, _("Accept") %> |
22 | <% else %> | 22 | <% else %> |
app/views/enterprise_registration/basic_information.html.erb
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | <%= _('There are no validators to validate the registration of this new enterprise. Contact your administrator for instructions.') %> | 8 | <%= _('There are no validators to validate the registration of this new enterprise. Contact your administrator for instructions.') %> |
9 | </div> | 9 | </div> |
10 | 10 | ||
11 | - <% button_bar do %> | 11 | + <%= button_bar do %> |
12 | <%= button :back, _('Go back'), { :profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile" }%> | 12 | <%= button :back, _('Go back'), { :profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile" }%> |
13 | <% end %> | 13 | <% end %> |
14 | <% else %> | 14 | <% else %> |
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | 36 | ||
37 | <%= template_options(:enterprises, 'create_enterprise')%> | 37 | <%= template_options(:enterprises, 'create_enterprise')%> |
38 | 38 | ||
39 | - <% button_bar do %> | 39 | + <%= button_bar do %> |
40 | <%= submit_button('next', _('Next'), :cancel => {:profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile"}) %> | 40 | <%= submit_button('next', _('Next'), :cancel => {:profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile"}) %> |
41 | <% end %> | 41 | <% end %> |
42 | <% end %> | 42 | <% end %> |
app/views/enterprise_registration/creation.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <%= render :partial => 'shared/template_welcome_page', :locals => {:template => @enterprise.template, :header => _("What can I do with a %s?")} %> | 5 | <%= render :partial => 'shared/template_welcome_page', :locals => {:template => @enterprise.template, :header => _("What can I do with a %s?")} %> |
6 | 6 | ||
7 | -<% button_bar do %> | 7 | +<%= button_bar do %> |
8 | <%= button :back, _('Back'), {:controller => 'memberships', :action => 'index', :profile => user.identifier} %> | 8 | <%= button :back, _('Back'), {:controller => 'memberships', :action => 'index', :profile => user.identifier} %> |
9 | <% end %> | 9 | <% end %> |
10 | 10 |
app/views/enterprise_registration/select_validator.html.erb
app/views/enterprise_validation/details.html.erb
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <p><%= _('If this enterprise passes the criteria to be considered an solidarity enconomy enterprise, you can approve it by click the button below.') %></p> | 15 | <p><%= _('If this enterprise passes the criteria to be considered an solidarity enconomy enterprise, you can approve it by click the button below.') %></p> |
16 | 16 | ||
17 | <%= form_tag :action => 'approve', :id => @pending.code do %> | 17 | <%= form_tag :action => 'approve', :id => @pending.code do %> |
18 | - <% button_bar do %> | 18 | + <%= button_bar do %> |
19 | <%= submit_button('approve', _('Approve')) %> | 19 | <%= submit_button('approve', _('Approve')) %> |
20 | <% end %> | 20 | <% end %> |
21 | <% end %> | 21 | <% end %> |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | <%= form_tag :action => 'reject', :id => @pending.code do %> | 27 | <%= form_tag :action => 'reject', :id => @pending.code do %> |
28 | <%= labelled_form_field(_('Please provide an explanation for the rejection. This explanation will be sent to the requestor (required).'), text_area_tag('reject_explanation'))%> | 28 | <%= labelled_form_field(_('Please provide an explanation for the rejection. This explanation will be sent to the requestor (required).'), text_area_tag('reject_explanation'))%> |
29 | <div> | 29 | <div> |
30 | - <% button_bar do %> | 30 | + <%= button_bar do %> |
31 | <%= submit_button('reject', _('Reject')) %> | 31 | <%= submit_button('reject', _('Reject')) %> |
32 | <% end %> | 32 | <% end %> |
33 | </div> | 33 | </div> |
app/views/enterprise_validation/edit_validation_info.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <%= labelled_form_for :info do |f| %> | 5 | <%= labelled_form_for :info do |f| %> |
6 | <%= f.text_area(:validation_methodology, :cols => 50, :rows => 10) %> | 6 | <%= f.text_area(:validation_methodology, :cols => 50, :rows => 10) %> |
7 | <%= f.text_area(:restrictions, :cols => 50, :rows => 7) %> | 7 | <%= f.text_area(:restrictions, :cols => 50, :rows => 7) %> |
8 | - <% button_bar do %> | 8 | + <%= button_bar do %> |
9 | <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> | 9 | <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %> |
10 | <% end %> | 10 | <% end %> |
11 | <% end %> | 11 | <% end %> |
app/views/enterprise_validation/index.html.erb
1 | <h1><%= _('Enterprise validations') %></h1> | 1 | <h1><%= _('Enterprise validations') %></h1> |
2 | 2 | ||
3 | -<% button_bar do %> | 3 | +<%= button_bar do %> |
4 | <%= button(:edit, _('Edit validation info'), { :action => 'edit_validation_info' }) %> | 4 | <%= button(:edit, _('Edit validation info'), { :action => 'edit_validation_info' }) %> |
5 | <%= button(:back, _('Go Back'), { :controller => 'profile_editor' }) %> | 5 | <%= button(:back, _('Go Back'), { :controller => 'profile_editor' }) %> |
6 | <% end %> | 6 | <% end %> |
app/views/environment_role_manager/affiliate.html.erb
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <%= form_tag( {:action => 'give_role'}, {:method => :post}) do %> | 3 | <%= form_tag( {:action => 'give_role'}, {:method => :post}) do %> |
4 | <%= select_tag 'role', options_for_select(@roles.map{|r|[r.name,r.id]}) %> | 4 | <%= select_tag 'role', options_for_select(@roles.map{|r|[r.name,r.id]}) %> |
5 | <%= hidden_field_tag 'person', current_user.person.id %> | 5 | <%= hidden_field_tag 'person', current_user.person.id %> |
6 | - <% button_bar do %> | 6 | + <%= button_bar do %> |
7 | <%= submit_button('affiliate', _('Affiliate', :cancel => {:action => 'index'}) %> | 7 | <%= submit_button('affiliate', _('Affiliate', :cancel => {:action => 'index'}) %> |
8 | <% end %> | 8 | <% end %> |
9 | <% end %> | 9 | <% end %> |
app/views/environment_role_manager/change_role.html.erb
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <% end %> | 7 | <% end %> |
8 | <%= hidden_field_tag 'person', @admin.id %> | 8 | <%= hidden_field_tag 'person', @admin.id %> |
9 | 9 | ||
10 | - <% button_bar do %> | 10 | + <%= button_bar do %> |
11 | <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'}) %> | 11 | <%= submit_button('save', _('Save changes'), :cancel => {:action => 'index'}) %> |
12 | <% end %> | 12 | <% end %> |
13 | <% end %> | 13 | <% end %> |
app/views/environment_role_manager/make_admin.html.erb
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <% @roles.each do |r| %> | 9 | <% @roles.each do |r| %> |
10 | <%= labelled_form_field(r.name, (check_box_tag "roles[]", r.id)) %> | 10 | <%= labelled_form_field(r.name, (check_box_tag "roles[]", r.id)) %> |
11 | <% end %> | 11 | <% end %> |
12 | - <% button_bar do %> | 12 | + <%= button_bar do %> |
13 | <%= submit_button( 'save', _('Make'), :cancel => {:action => 'index'} ) %> | 13 | <%= submit_button( 'save', _('Make'), :cancel => {:action => 'index'} ) %> |
14 | <% end %> | 14 | <% end %> |
15 | <% end %> | 15 | <% end %> |
app/views/environment_themes/index.html.erb
@@ -3,6 +3,6 @@ | @@ -3,6 +3,6 @@ | ||
3 | 3 | ||
4 | <br style="clear:both" /> | 4 | <br style="clear:both" /> |
5 | 5 | ||
6 | -<% button_bar do %> | 6 | +<%= button_bar do %> |
7 | <%= button(:back, _('Back'), :controller => 'admin_panel', :action => 'index') %> | 7 | <%= button(:back, _('Back'), :controller => 'admin_panel', :action => 'index') %> |
8 | <% end %> | 8 | <% end %> |
app/views/favorite_enterprises/index.html.erb
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | </p> | 23 | </p> |
24 | <% end %> | 24 | <% end %> |
25 | 25 | ||
26 | -<% button_bar do %> | 26 | +<%= button_bar do %> |
27 | <%= button(:back, _('Go back'), :controller => 'profile_editor') %> | 27 | <%= button(:back, _('Go back'), :controller => 'profile_editor') %> |
28 | <% end %> | 28 | <% end %> |
29 | 29 |
app/views/features/_manage_community_fields.html.erb
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | </script> | 55 | </script> |
56 | 56 | ||
57 | <div> | 57 | <div> |
58 | - <% button_bar do %> | 58 | + <%= button_bar do %> |
59 | <%= submit_button('save', _('Save changes'), :id=>"save_community_fields") %> | 59 | <%= submit_button('save', _('Save changes'), :id=>"save_community_fields") %> |
60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> | 60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> |
61 | <% end %> | 61 | <% end %> |
app/views/features/_manage_custom_fields.html.erb
@@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
22 | </fieldset> | 22 | </fieldset> |
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | -<% button_bar do %> | 25 | +<%= button_bar do %> |
26 | <%= button(:save, _('Save'), 'javascript: void()', :onClick => "submit_custom_field_form('##{format_values_id}', '##{form_id}');") %> | 26 | <%= button(:save, _('Save'), 'javascript: void()', :onClick => "submit_custom_field_form('##{format_values_id}', '##{form_id}');") %> |
27 | <% end %> | 27 | <% end %> |
28 | 28 |
app/views/features/_manage_enterprise_fields.html.erb
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | </script> | 55 | </script> |
56 | 56 | ||
57 | <div> | 57 | <div> |
58 | - <% button_bar do %> | 58 | + <%= button_bar do %> |
59 | <%= submit_button('save', _('Save changes'), :id=>"save_enterprise_fields") %> | 59 | <%= submit_button('save', _('Save changes'), :id=>"save_enterprise_fields") %> |
60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> | 60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> |
61 | <% end %> | 61 | <% end %> |
app/views/features/_manage_person_fields.html.erb
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | </script> | 55 | </script> |
56 | 56 | ||
57 | <div> | 57 | <div> |
58 | - <% button_bar do %> | 58 | + <%= button_bar do %> |
59 | <%= submit_button('save', _('Save changes'), :id=>"save_person_fields") %> | 59 | <%= submit_button('save', _('Save changes'), :id=>"save_person_fields") %> |
60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> | 60 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> |
61 | <% end %> | 61 | <% end %> |
app/views/features/custom_fields/_form.html.erb
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | </tr> | 29 | </tr> |
30 | </thead> | 30 | </thead> |
31 | <tfoot> | 31 | <tfoot> |
32 | - <tr><td colspan=3><%= button(:add, _('Add option'), 'javascript: void()', :id => "btn_opt_#{id}", :onclick => "add_content('##{id} .custom-field-extras', $('#btn_opt_#{id}').attr('value'), 'EXTRAS_ID');", :value => "#{render_extras_field(id)}") %></td></tr> | 32 | + <tr><td colspan=3><%= button(:add, _('Add option'), 'javascript: void()', :id => "btn_opt_#{id}", :onclick => "add_content('##{id} .custom-field-extras', $('#btn_opt_#{id}').attr('value'), 'EXTRAS_ID');", :value => "#{render_extras_field(id)}".html_safe) %></td></tr> |
33 | </tfoot> | 33 | </tfoot> |
34 | <tbody class="custom-field-extras"> | 34 | <tbody class="custom-field-extras"> |
35 | <% if !field.extras.blank?%> | 35 | <% if !field.extras.blank?%> |
app/views/features/index.html.erb
@@ -69,7 +69,7 @@ Check all the features you want to enable for your environment, uncheck all the | @@ -69,7 +69,7 @@ Check all the features you want to enable for your environment, uncheck all the | ||
69 | <hr/> | 69 | <hr/> |
70 | 70 | ||
71 | <div> | 71 | <div> |
72 | - <% button_bar do %> | 72 | + <%= button_bar do %> |
73 | <%= submit_button('save', _('Save changes')) %> | 73 | <%= submit_button('save', _('Save changes')) %> |
74 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> | 74 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %> |
75 | <% end %> | 75 | <% end %> |
app/views/friends/connections.html.erb
1 | <h1><%= _("Connections with %s") % @suggestion.suggestion.name %></h1> | 1 | <h1><%= _("Connections with %s") % @suggestion.suggestion.name %></h1> |
2 | 2 | ||
3 | -<% button_bar do %> | 3 | +<%= button_bar do %> |
4 | <%= button(:back, _('Go to friends list'), :controller => 'friends') %> | 4 | <%= button(:back, _('Go to friends list'), :controller => 'friends') %> |
5 | <% end %> | 5 | <% end %> |
6 | 6 |
app/views/friends/index.html.erb
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | </p> | 12 | </p> |
13 | <% end %> | 13 | <% end %> |
14 | 14 | ||
15 | - <% button_bar do %> | 15 | + <%= button_bar do %> |
16 | <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> | 16 | <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> |
17 | <%= button(:search, _('Find people'), :controller => 'search', :action => 'assets', :asset => 'people') %> | 17 | <%= button(:search, _('Find people'), :controller => 'search', :action => 'assets', :asset => 'people') %> |
18 | <% unless @plugins.dispatch(:remove_invite_friends_button).include?(true) %> | 18 | <% unless @plugins.dispatch(:remove_invite_friends_button).include?(true) %> |
app/views/friends/suggest.html.erb
1 | <h1><%= _("Friends suggestions for %s") % profile.name %></h1> | 1 | <h1><%= _("Friends suggestions for %s") % profile.name %></h1> |
2 | 2 | ||
3 | -<% button_bar do %> | 3 | +<%= button_bar do %> |
4 | <%= button(:back, _('Go to friends list'), :controller => 'friends') %> | 4 | <%= button(:back, _('Go to friends list'), :controller => 'friends') %> |
5 | <% end %> | 5 | <% end %> |
6 | 6 |
app/views/invite/_select_address_book.html.erb
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | <%= labelled_form_field(_("Password") + ":", password_field_tag(:password)) %> | 34 | <%= labelled_form_field(_("Password") + ":", password_field_tag(:password)) %> |
35 | </div> | 35 | </div> |
36 | 36 | ||
37 | - <% button_bar do %> | 37 | + <%= button_bar do %> |
38 | <%= submit_button(:forward, _("Next")) %> | 38 | <%= submit_button(:forward, _("Next")) %> |
39 | <% end %> | 39 | <% end %> |
40 | <p><%= _("We won't store your password or contact anyone without your permission.") %></p> | 40 | <p><%= _("We won't store your password or contact anyone without your permission.") %></p> |
app/views/invite/invite_friends.html.erb
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | { :hint_text => _('Type in the person\'s %{search_fields}') % {:search_fields => @search_fields}, | 24 | { :hint_text => _('Type in the person\'s %{search_fields}') % {:search_fields => @search_fields}, |
25 | :focus => false }) %> | 25 | :focus => false }) %> |
26 | 26 | ||
27 | - <% button_bar do %> | 27 | + <%= button_bar do %> |
28 | <%= submit_button('save', _('Invite'))%> | 28 | <%= submit_button('save', _('Invite'))%> |
29 | <%= button('cancel', _('Cancel'), profile.url)%> | 29 | <%= button('cancel', _('Cancel'), profile.url)%> |
30 | <% end %> | 30 | <% end %> |
app/views/invite/select_friends.html.erb
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | 32 | ||
33 | <%= render :partial => 'invite/personalize_invitation_mail', :locals => {:mail_template => @mail_template } %> | 33 | <%= render :partial => 'invite/personalize_invitation_mail', :locals => {:mail_template => @mail_template } %> |
34 | 34 | ||
35 | - <% button_bar do %> | 35 | + <%= button_bar do %> |
36 | <%= submit_button(:ok, _("Invite!")) %> | 36 | <%= submit_button(:ok, _("Invite!")) %> |
37 | <% end %> | 37 | <% end %> |
38 | <% end %> | 38 | <% end %> |
app/views/licenses/_form.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <%= required labelled_form_field(_('Name'), f.text_field(:name)) %> | 5 | <%= required labelled_form_field(_('Name'), f.text_field(:name)) %> |
6 | <%= labelled_form_field(_('License url'), f.text_field(:url)) %> | 6 | <%= labelled_form_field(_('License url'), f.text_field(:url)) %> |
7 | 7 | ||
8 | - <% button_bar do %> | 8 | + <%= button_bar do %> |
9 | <%= submit_button('save', _('Save'))%> | 9 | <%= submit_button('save', _('Save'))%> |
10 | <%= button('cancel', _('Cancel'), {:action => 'index'})%> | 10 | <%= button('cancel', _('Cancel'), {:action => 'index'})%> |
11 | <% end %> | 11 | <% end %> |
app/views/licenses/index.html.erb
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | <% end %> | 16 | <% end %> |
17 | </table> | 17 | </table> |
18 | 18 | ||
19 | -<% button_bar do %> | 19 | +<%= button_bar do %> |
20 | <%= button(:add, _('Add a new license'), :action => 'create')%> | 20 | <%= button(:add, _('Add a new license'), :action => 'create')%> |
21 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> | 21 | <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %> |
22 | <% end %> | 22 | <% end %> |
app/views/mailconf/index.html.erb
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | <p><%= _('You already request activation of your mailbox. Please wait until an administrator approves your request.') %></p> | 7 | <p><%= _('You already request activation of your mailbox. Please wait until an administrator approves your request.') %></p> |
8 | 8 | ||
9 | - <% button_bar do %> | 9 | + <%= button_bar do %> |
10 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> | 10 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> |
11 | <% end %> | 11 | <% end %> |
12 | 12 | ||
@@ -21,10 +21,10 @@ | @@ -21,10 +21,10 @@ | ||
21 | <h2><%= _('Configuration') %></h2> | 21 | <h2><%= _('Configuration') %></h2> |
22 | <ul> | 22 | <ul> |
23 | <li> | 23 | <li> |
24 | - <%= link_to _('Mail configuration for POP and IMAP'), 'http://www.ynternet.org/move/infos-technique-pour-utiliser-multypass-pop3-smtp-imap-ftp-quotas...' %> | 24 | + <%= link_to _('Mail configuration for POP and IMAP'), 'http://www.ynternet.org/move/infos-technique-pour-utiliser-multypass-pop3-smtp-imap-ftp-quotas...' %> |
25 | </li> | 25 | </li> |
26 | </ul> | 26 | </ul> |
27 | - <% button_bar do %> | 27 | + <%= button_bar do %> |
28 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> | 28 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> |
29 | <% end %> | 29 | <% end %> |
30 | 30 | ||
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | <h2><%= _("Enable e-Mail account below:") %></h2> | 33 | <h2><%= _("Enable e-Mail account below:") %></h2> |
34 | <ul><%= safe_join(profile.email_addresses.map{|i| content_tag('li', i)}, "\n") %></ul> | 34 | <ul><%= safe_join(profile.email_addresses.map{|i| content_tag('li', i)}, "\n") %></ul> |
35 | <blockquote><%= _("You'll be able to access a webmail from your user menu.") %></blockquote> | 35 | <blockquote><%= _("You'll be able to access a webmail from your user menu.") %></blockquote> |
36 | - <% button_bar do %> | 36 | + <%= button_bar do %> |
37 | <%= button(:ok, _('Enable e-Mail'), { :action => 'enable' }, :method => 'post') %> | 37 | <%= button(:ok, _('Enable e-Mail'), { :action => 'enable' }, :method => 'post') %> |
38 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> | 38 | <%= button :back, _('Back to control panel'), :controller => 'profile_editor' %> |
39 | <% end %> | 39 | <% end %> |
app/views/maps/edit_location.html.erb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <%= labelled_form_field _('City'), f.text_field(:city) %> | 11 | <%= labelled_form_field _('City'), f.text_field(:city) %> |
12 | <%= labelled_form_field _('ZIP code'), text_field(:profile_data, :zip_code) %> | 12 | <%= labelled_form_field _('ZIP code'), text_field(:profile_data, :zip_code) %> |
13 | <%= labelled_form_field _('Address (street and number)'), text_field(:profile_data, :address) %> | 13 | <%= labelled_form_field _('Address (street and number)'), text_field(:profile_data, :address) %> |
14 | - <% button_bar do %> | 14 | + <%= button_bar do %> |
15 | <%= button_to_function :search, _('Locate in the map'), "addressToPoint()", :title => _("Locate the address informed above in the map below (note that you'll probably need to adjust the marker to get a precise position)") %> | 15 | <%= button_to_function :search, _('Locate in the map'), "addressToPoint()", :title => _("Locate the address informed above in the map below (note that you'll probably need to adjust the marker to get a precise position)") %> |
16 | <%= submit_button 'save', _('Save') %> | 16 | <%= submit_button 'save', _('Save') %> |
17 | <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> | 17 | <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %> |
app/views/memberships/connections.html.erb
1 | <h1><%= _("Connections with %s") % @suggestion.suggestion.name %></h1> | 1 | <h1><%= _("Connections with %s") % @suggestion.suggestion.name %></h1> |
2 | 2 | ||
3 | -<% button_bar do %> | 3 | +<%= button_bar do %> |
4 | <%= button(:back, _('Go to groups list'), :controller => 'memberships') %> | 4 | <%= button(:back, _('Go to groups list'), :controller => 'memberships') %> |
5 | <% end %> | 5 | <% end %> |
6 | 6 |
app/views/memberships/index.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <h1><%= _('Manage my groups') %></h1> | 3 | <h1><%= _('Manage my groups') %></h1> |
4 | 4 | ||
5 | -<% button_bar do %> | 5 | +<%= button_bar do %> |
6 | <%= button(:add, _('Create a new community'), :controller => 'memberships', :action => 'new_community') %> | 6 | <%= button(:add, _('Create a new community'), :controller => 'memberships', :action => 'new_community') %> |
7 | <%= button :add, _('Register a new enterprise'), :controller => 'enterprise_registration' if environment.enabled?('enterprise_registration') %> | 7 | <%= button :add, _('Register a new enterprise'), :controller => 'enterprise_registration' if environment.enabled?('enterprise_registration') %> |
8 | <%= button :back, _('Go back'), :controller => 'profile_editor' %> | 8 | <%= button :back, _('Go back'), :controller => 'profile_editor' %> |