Commit f46898b58dad97bed078f3c5b77ec783f6728388
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'oauth_rails3' into stable
Showing
4 changed files
with
14 additions
and
36 deletions
Show diff stats
plugins/oauth_client/lib/oauth_client_plugin.rb
... | ... | @@ -66,7 +66,7 @@ class OauthClientPlugin < Noosfero::Plugin |
66 | 66 | provider provider, :setup => setup, |
67 | 67 | :path_prefix => '/plugin/oauth_client', |
68 | 68 | :callback_path => "/plugin/oauth_client/public/callback/#{provider}", |
69 | - :client_options => { :connection_opts => { :proxy => ENV["HTTP_PROXY"] || ENV["http_proxy"] || ENV["HTTPS_PROXY"] || ENV["https_proxy"] } } | |
69 | + :client_options => { :connection_opts => { :proxy => ENV["OAUTH_HTTP_PROXY"] } } | |
70 | 70 | end |
71 | 71 | |
72 | 72 | unless Rails.env.production? | ... | ... |
plugins/oauth_client/views/oauth_client_plugin_admin/_noosfero_oauth2.html.erb
1 | 1 | <%= f.fields_for :client_options, OpenStruct.new(provider.options[:client_options]) do |c| %> |
2 | 2 | <div class="client-url"> |
3 | - <span class="label"><%= _('Client Url') %></span> | |
4 | - <span class="value"><%= c.text_field :site %></span> | |
3 | + <%= labelled_form_field _('Client Url'), c.text_field(:site) %> | |
5 | 4 | </div> |
6 | 5 | <% end %> | ... | ... |
plugins/oauth_client/views/oauth_client_plugin_admin/edit.html.erb
... | ... | @@ -4,56 +4,35 @@ |
4 | 4 | <%= form_for @provider, :url => {:action => 'edit'}, :method => 'post' do |f| %> |
5 | 5 | |
6 | 6 | <div class="enabled"> |
7 | - <%= f.check_box :enabled %> | |
8 | - <%= _('Enabled') %> | |
7 | + <%= labelled_form_field f.check_box(:enabled) + _('Enabled'), '' %> | |
9 | 8 | </div> |
10 | 9 | |
11 | 10 | <div class="name"> |
12 | - <span class="label"> | |
13 | - <%= _('Name') %> | |
14 | - </span> | |
15 | - <span class="value"> | |
16 | - <%= f.text_field :name %> | |
17 | - </span> | |
11 | + <%= labelled_form_field _('Name'), f.text_field(:name) %> | |
18 | 12 | </div> |
19 | 13 | |
20 | 14 | <div class="strategy"> |
21 | - <span class="label"> | |
22 | - <%= _('Strategy') %> | |
23 | - </span> | |
24 | - <span class="value"> | |
25 | - <%= f.select :strategy, OauthClientPlugin::PROVIDERS %> | |
26 | - </span> | |
27 | - </div> | |
28 | - | |
29 | - <div class="image-icon"> | |
30 | - <%= f.fields_for :image_builder, @provider.image do |i| %> | |
31 | - <%= file_field_or_thumbnail(_('Image:'), @provider.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> | |
32 | - <% end %> | |
15 | + <%= labelled_form_field _('Strategy'), f.select(:strategy, OauthClientPlugin::PROVIDERS) %> | |
33 | 16 | </div> |
34 | 17 | |
35 | 18 | <div class="client-id"> |
36 | - <span class="label"> | |
37 | - <%= _('Client Id') %> | |
38 | - </span> | |
39 | - <span class="value"> | |
40 | - <%= f.text_field :client_id %> | |
41 | - </span> | |
19 | + <%= labelled_form_field _('Client Id'), f.text_field(:client_id) %> | |
42 | 20 | </div> |
43 | 21 | |
44 | 22 | <div class="client-secret"> |
45 | - <span class="label"> | |
46 | - <%= _('Client Secret') %> | |
47 | - </span> | |
48 | - <span class="value"> | |
49 | - <%= f.text_field :client_secret %> | |
50 | - </span> | |
23 | + <%= labelled_form_field _('Client Secret'), f.text_field(:client_secret) %> | |
51 | 24 | </div> |
52 | 25 | |
53 | 26 | <% if File.exists?(File.join(File.dirname(__FILE__), "_#{@provider.strategy}.html.erb")) %> |
54 | 27 | <%= render :partial => "#{@provider.strategy}", :locals => {:f => f, :provider => @provider} %> |
55 | 28 | <% end %> |
56 | 29 | |
30 | + <div class="image-icon"> | |
31 | + <%= f.fields_for :image_builder, @provider.image do |i| %> | |
32 | + <%= file_field_or_thumbnail(_('Image:'), @provider.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %> | |
33 | + <% end %> | |
34 | + </div> | |
35 | + | |
57 | 36 | <% button_bar do %> |
58 | 37 | <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> |
59 | 38 | <% end %> | ... | ... |
plugins/oauth_client/views/oauth_client_plugin_admin/index.html.erb