diff options
Diffstat (limited to 'app/views/auth_sources')
-rw-r--r-- | app/views/auth_sources/_form.html.erb | 13 | ||||
-rw-r--r-- | app/views/auth_sources/_form_auth_source_ldap.html.erb | 64 | ||||
-rw-r--r-- | app/views/auth_sources/edit.html.erb | 4 | ||||
-rw-r--r-- | app/views/auth_sources/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/auth_sources/new.html.erb | 4 |
5 files changed, 27 insertions, 60 deletions
diff --git a/app/views/auth_sources/_form.html.erb b/app/views/auth_sources/_form.html.erb index 79abae7d8..05c6ca9e9 100644 --- a/app/views/auth_sources/_form.html.erb +++ b/app/views/auth_sources/_form.html.erb @@ -1,13 +1,6 @@ <%= error_messages_for 'auth_source' %> -<div class="box"> -<!--[form:auth_source]--> -<p><label for="auth_source_name"><%=l(:field_name)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'name' %></p> - -<p><label for="auth_source_onthefly_register"><%=l(:field_onthefly)%></label> -<%= check_box 'auth_source', 'onthefly_register' %></p> +<div class="box tabular"> + <p><%= f.text_field :name, :required => true %></p> + <p><%= f.check_box :onthefly_register, :label => :field_onthefly %></p> </div> - -<!--[eoform:auth_source]--> - diff --git a/app/views/auth_sources/_form_auth_source_ldap.html.erb b/app/views/auth_sources/_form_auth_source_ldap.html.erb index 2f6d0b0ce..2ffd4d43e 100644 --- a/app/views/auth_sources/_form_auth_source_ldap.html.erb +++ b/app/views/auth_sources/_form_auth_source_ldap.html.erb @@ -1,50 +1,24 @@ <%= error_messages_for 'auth_source' %> -<div class="box"> -<!--[form:auth_source]--> -<p><label for="auth_source_name"><%=l(:field_name)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'name' %></p> - -<p><label for="auth_source_host"><%=l(:field_host)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'host' %></p> - -<p><label for="auth_source_port"><%=l(:field_port)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'port', :size => 6 %> <%= check_box 'auth_source', 'tls' %> LDAPS</p> - -<p><label for="auth_source_account"><%=l(:field_account)%></label> -<%= text_field 'auth_source', 'account' %></p> - -<p><label for="auth_source_account_password"><%=l(:field_password)%></label> -<%= password_field 'auth_source', 'account_password', :name => 'ignore', - :value => ((@auth_source.new_record? || @auth_source.account_password.blank?) ? '' : ('x'*15)), - :onfocus => "this.value=''; this.name='auth_source[account_password]';", - :onchange => "this.name='auth_source[account_password]';" %></p> - -<p><label for="auth_source_base_dn"><%=l(:field_base_dn)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'base_dn', :size => 60 %></p> - -<p><label for="auth_source_custom_filter"><%=l(:field_auth_source_ldap_filter)%></label> -<%= text_field 'auth_source', 'filter', :size => 60 %></p> - -<p><label for="auth_source_timeout"><%=l(:field_timeout)%></label> -<%= text_field 'auth_source', 'timeout', :size => 4 %></p> - -<p><label for="auth_source_onthefly_register"><%=l(:field_onthefly)%></label> -<%= check_box 'auth_source', 'onthefly_register' %></p> +<div class="box tabular"> + <p><%= f.text_field :name, :required => true %></p> + <p><%= f.text_field :host, :required => true %></p> + <p><%= f.text_field :port, :required => true, :size => 6 %> <%= f.check_box :tls, :no_label => true %> LDAPS</p> + <p><%= f.text_field :account %></p> + <p><%= f.password_field :account_password, :label => :field_password, + :name => 'dummy_password', + :value => ((@auth_source.new_record? || @auth_source.account_password.blank?) ? '' : ('x'*15)), + :onfocus => "this.value=''; this.name='auth_source[account_password]';", + :onchange => "this.name='auth_source[account_password]';" %></p> + <p><%= f.text_field :base_dn, :required => true, :size => 60 %></p> + <p><%= f.text_field :filter, :size => 60, :label => :field_auth_source_ldap_filter %></p> + <p><%= f.text_field :timeout, :size => 4 %></p> + <p><%= f.check_box :onthefly_register, :label => :field_onthefly %></p> </div> -<fieldset class="box"><legend><%=l(:label_attribute_plural)%></legend> -<p><label for="auth_source_attr_login"><%=l(:field_login)%> <span class="required">*</span></label> -<%= text_field 'auth_source', 'attr_login', :size => 20 %></p> - -<p><label for="auth_source_attr_firstname"><%=l(:field_firstname)%></label> -<%= text_field 'auth_source', 'attr_firstname', :size => 20 %></p> - -<p><label for="auth_source_attr_lastname"><%=l(:field_lastname)%></label> -<%= text_field 'auth_source', 'attr_lastname', :size => 20 %></p> - -<p><label for="auth_source_attr_mail"><%=l(:field_mail)%></label> -<%= text_field 'auth_source', 'attr_mail', :size => 20 %></p> +<fieldset class="box tabular"><legend><%=l(:label_attribute_plural)%></legend> + <p><%= f.text_field :attr_login, :required => true, :size => 20 %></p> + <p><%= f.text_field :attr_firstname, :size => 20 %></p> + <p><%= f.text_field :attr_lastname, :size => 20 %></p> + <p><%= f.text_field :attr_mail, :size => 20 %></p> </fieldset> -<!--[eoform:auth_source]--> - diff --git a/app/views/auth_sources/edit.html.erb b/app/views/auth_sources/edit.html.erb index 1673d8336..b84d60053 100644 --- a/app/views/auth_sources/edit.html.erb +++ b/app/views/auth_sources/edit.html.erb @@ -1,6 +1,6 @@ <h2><%=l(:label_auth_source)%> (<%= h(@auth_source.auth_method_name) %>)</h2> -<%= form_tag({:action => 'update', :id => @auth_source}, :method => :put, :class => "tabular") do %> - <%= render :partial => auth_source_partial_name(@auth_source) %> +<%= form_for @auth_source, :as => :auth_source, :url => auth_source_path(@auth_source), :html => {:id => 'auth_source_form'} do |f| %> + <%= render :partial => auth_source_partial_name(@auth_source), :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index 045207a28..3d7fa8ff6 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -20,7 +20,7 @@ <td align="center"><%= h source.host %></td> <td align="center"><%= h source.users.count %></td> <td class="buttons"> - <%= link_to l(:button_test), {:action => 'test_connection', :id => source}, :class => 'icon icon-test' %> + <%= link_to l(:button_test), try_connection_auth_source_path(source), :class => 'icon icon-test' %> <%= delete_link auth_source_path(source) %> </td> </tr> diff --git a/app/views/auth_sources/new.html.erb b/app/views/auth_sources/new.html.erb index b585c0aa0..d6d6bc5b3 100644 --- a/app/views/auth_sources/new.html.erb +++ b/app/views/auth_sources/new.html.erb @@ -1,7 +1,7 @@ <h2><%=l(:label_auth_source_new)%> (<%= h(@auth_source.auth_method_name) %>)</h2> -<%= form_tag({:action => 'create'}, :class => "tabular") do %> +<%= labelled_form_for @auth_source, :as => :auth_source, :url => auth_sources_path, :html => {:id => 'auth_source_form'} do |f| %> <%= hidden_field_tag 'type', @auth_source.type %> - <%= render :partial => auth_source_partial_name(@auth_source) %> + <%= render :partial => auth_source_partial_name(@auth_source), :locals => { :f => f } %> <%= submit_tag l(:button_create) %> <% end %> |