-		<%= link_to t("new.#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
-	
-	| <%= t("#{@attribute_type}") %>- | <%= t(:action) %>- | |||
| <%= attribute.title %> - | - - <%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %> - <%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %> - <%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %> - <% if !attribute.is_built_in? %> - <%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %> - <% end %> -- | |||
| - | ||||
-		<%= link_to t("new.#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
+
+
+
+	
+		
+
+	
+
+		
 
+			
 	
+				
+					
+						
+			
 
+		| <%= t("#{@attribute_type}") %>+ | 
|---|
| + | 
|---|
| +				<%= attribute.title %>
+ +
+					+ 
 | 
+	<%= link_to content_tag(:i,t("new.#{@attribute_type}"),:class=>"icon-plus icon-white"),eval("new_admin_#{@attribute_type}_path"),:class=>"btn btn-primary pull-right"%>
+	
+
+		
\ No newline at end of file
diff --git a/app/views/admin/attributes/new.html.erb b/app/views/admin/attributes/new.html.erb
index 8cafdb59..99b526ff 100644
--- a/app/views/admin/attributes/new.html.erb
+++ b/app/views/admin/attributes/new.html.erb
@@ -1,14 +1,51 @@
-<% content_for :secondary do %>
-	<%= render 'admin/users_new_interface/side_bar' %>
-<% end %>
+            <%= form_for @attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
+            
+                
+			
+            
+                    
+			<%= t(eval(":#{@attribute_type}"))%>
+
+                        
+                
+						
+							<% if @attribute._type == "Role" %>
+                            
+                    
+                                
+                                
+							<% end %>
+							
+                            
+									
+									 
+                                
+                            
+                                
+                                
+                            <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"#{@attribute_type}[title_translations]"}%>
+                        
+                                    <% if @attribute.new_record? %>
+                                        <%= f.text_field :key, :placeholder => t(:key) %>
+                                    <% else %>
+                                        
+                            <%= @attribute.key%>
+                                    <% end %>
+                                
+				<%= f.submit t('submit'), :class=>'btn btn-primary' %>
+				<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
+            
+			
+			<% end %>
+			
 
-
-	<%= form_for @attribute, :url => eval("admin_#{@attribute_type}s_path") do |f| %>
-    <%= f.error_messages %>
-    <%= render :partial => "admin/#{@attribute_type}s/form", :locals => { :f => f, :is_new => true } %>
-	  
\ No newline at end of file
+<% content_for :page_specific_css do -%>
+    <%= stylesheet_link_tag "member" %>
+    <%= stylesheet_link_tag "site-map" %>
+<% end %>			
\ No newline at end of file
diff --git a/app/views/admin/roles/_attribute_field.html.erb b/app/views/admin/roles/_attribute_field.html.erb
new file mode 100644
index 00000000..240a8c18
--- /dev/null
+++ b/app/views/admin/roles/_attribute_field.html.erb
@@ -0,0 +1,121 @@
+  
-    	<%= link_back %>
-			<%= link_to t('create'), "#", :onclick=>"$('#new_#{@attribute_type}').submit()" %>
-    
-  <% end -%>
-
+  <%
+	attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
+  %>
+  <%= @af_counter %>
+  <%#= attribute_field_counter %>
+      
+      
diff --git a/app/views/admin/roles/add_attribute_field.js.erb b/app/views/admin/roles/add_attribute_field.js.erb
new file mode 100644
index 00000000..7b678b99
--- /dev/null
+++ b/app/views/admin/roles/add_attribute_field.js.erb
@@ -0,0 +1 @@
+$('<%= j render :partial => 'attribute_field', :collection => [@attribute_field] %>').appendTo('#attribute_field_list').hide().fadeIn();
diff --git a/app/views/admin/roles/add_sub_role.html.erb b/app/views/admin/roles/add_sub_role.html.erb
new file mode 100644
index 00000000..bf4bf1e9
--- /dev/null
+++ b/app/views/admin/roles/add_sub_role.html.erb
@@ -0,0 +1,36 @@
+            <%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
+            
+          <%= content_tag :div,:class=>show_type_panel(attribute_field,"typeA") do%>
+              
+      <%= hidden_field "#{@field_name}[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
+  
+                  
+                  
+              <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
+          <% end %>
+
+          <%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
+              <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeB][initial]"}%>
+
+              <% if attribute_field.self_defined_markup_options?%>
+                <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
+              <%else #normal list%>
+                  <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "#{@field_name}[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
+              <% end #of self_defined_markup_options?%>
+              
+          <% end %>
+          <%= content_tag :div,:class=>show_type_panel(attribute_field,"typeC") do %>
+              
+                      
+                      
+                  
+              
+                  
+                  
+              
+                        <%= select "#{@field_name}[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
+                  
+              
+                  
+                  
+              
+                      
+                      
+                  
+              
+                  
+                  
+          <% end %>
+          <%= content_tag :div,:class=>show_type_panel(attribute_field,"typeD") do%>
+              
+                      
+                      
+                  
+              
+                  
+                  
+              <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
+          <% end %>
+          <%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
+              <%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"#{@field_name}[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
+          <% end %>
+      
+                      
+                  
+              
+                
+			
+            
+                    
+			<%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %>
+
+                        
+                
+                            
+                    
+                                
+                                
+                            <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
+                        
+                                    <% if @sub_attribute.new_record? %>
+                                        <%= f.text_field :key, :placeholder => t(:key) %>
+                                    <% else %>
+                                        
+                            <%= @sub_attribute.key%>
+                                    <% end %>
+                                
+				<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
+				<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
+				<%= f.submit t('submit'), :class=>'btn btn-primary' %>
+				<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
+            
+			
+			<% end %>
+			
+
+<% content_for :page_specific_css do -%>
+    <%= stylesheet_link_tag "member" %>
+    <%= stylesheet_link_tag "site-map" %>
+<% end %>			
\ No newline at end of file
diff --git a/app/views/admin/roles/edit_sub_role.html.erb b/app/views/admin/roles/edit_sub_role.html.erb
new file mode 100644
index 00000000..b4848fd4
--- /dev/null
+++ b/app/views/admin/roles/edit_sub_role.html.erb
@@ -0,0 +1,37 @@
+            <%= form_for @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+            
+                
+			
+            
+                    
+			<%= t(eval(":#{@attribute_type}"))%>:<%= @attribute.title %>
+
+                        
+                
+                            
+                    
+                                
+                                
+                            <%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>@sub_attribute.title_translations,:class_ext=>"pull-left",:label_ext=>t(:item_name),:field_name=>"sub_role[title_translations]"}%>
+                        
+                                    <% if @sub_attribute.new_record? %>
+                                        <%= f.text_field :key, :placeholder => t(:key) %>
+                                    <% else %>
+                                        
+                            <%= @sub_attribute.key%>
+                                    <% end %>
+                                
+				<%#= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
+				<%= f.hidden_field :id %>
+				<%#= f.hidden_field :role_id, :value => @attribute.id if !params[:role_id].blank? %>
+				<%= f.submit t('submit'), :class=>'btn btn-primary' %>
+				<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
+            
+			
+			<% end %>
+			
+
+<% content_for :page_specific_css do -%>
+    <%= stylesheet_link_tag "member" %>
+    <%= stylesheet_link_tag "site-map" %>
+<% end %>			
\ No newline at end of file
diff --git a/app/views/admin/roles/new.html.erb b/app/views/admin/roles/new.html.erb
new file mode 100644
index 00000000..9d07aa0d
--- /dev/null
+++ b/app/views/admin/roles/new.html.erb
@@ -0,0 +1 @@
+111
\ No newline at end of file
diff --git a/app/views/admin/roles/role_field.html.erb b/app/views/admin/roles/role_field.html.erb
new file mode 100644
index 00000000..43880fac
--- /dev/null
+++ b/app/views/admin/roles/role_field.html.erb
@@ -0,0 +1,128 @@
+<% content_for :side_bar do %>
+  <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
+<% end %>
+			
+		<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+            
+                
+				
+			
+            
+					
+				
+				<%= @attribute.title+ t(:attributes)%>
+
+					<%= render :partial=>"attribute_field",:collection=>@attribute.attribute_fields%>
+					
+				
+					<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true%>
+				
+					
+			
+				<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
+				<%= hidden_field_tag 'id', params[:role_id] if !params[:role_id].blank? %>
+                <%= f.submit t(:save),:class=>"btn btn-primary"%>  
+				<%= link_to t('cancel'), get_go_back, :class=>"btn" %>				
+            
+			
+        <% end %>
+		
+<% content_for :page_specific_css do -%>
+    <%= stylesheet_link_tag "member" %>
+    <%= stylesheet_link_tag "site-map" %>
+<% end %>
+
+<% content_for :page_specific_javascript do -%>
+    
+<% end -%>
diff --git a/app/views/admin/roles/sub_role.html.erb b/app/views/admin/roles/sub_role.html.erb
new file mode 100644
index 00000000..9dc8892e
--- /dev/null
+++ b/app/views/admin/roles/sub_role.html.erb
@@ -0,0 +1,41 @@
+<% content_for :side_bar do %>
+  <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
+<% end %>
+
+
+	
+		
+		
+	
diff --git a/app/views/admin/roles/sub_role_field.html.erb b/app/views/admin/roles/sub_role_field.html.erb
new file mode 100644
index 00000000..ed71f8b7
--- /dev/null
+++ b/app/views/admin/roles/sub_role_field.html.erb
@@ -0,0 +1,125 @@
+<% content_for :side_bar do %>
+  <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
+<% end %>
+
+		<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+            
+		<%= link_to t(:new_sub_role), eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"), :class => 'new' %>
+	
+	| <%= t("#{@attribute_type}") %>:<%= @attribute.title %>+ | <%= t(:action) %>+ | |||
| <%= attribute.title %> + | + + <%= link_to t(:edit), eval("admin_#{@attribute_type}_edit_sub_role_path(attribute)"), :class => 'edit' %> + <%= link_to t(:sub_role_field), eval("admin_#{@attribute_type}_sub_role_field_path(attribute)"), :class => 'edit' %> + <%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => true, :id => attribute })"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %> + <%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :sub_role => {:disabled => false, :id => attribute })"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %> + + <% if !attribute.is_built_in? %> + <%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute, :sub_role => {:id => attribute })"), :class => 'delete', :confirm => t('sure?'), :method => :delete %> + <% end %> ++ | |||
| + | ||||
+		<%= link_to t(:new_sub_role), eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"), :class => 'new' %>
+	
+
+                
+				
+			
+            
+					
+					
+			<%= @attribute.title+ t(:attributes)%> - <%= @sub_attribute.title %>
+
+					<%= render :partial=>"attribute_field",:collection=>@sub_attribute.attribute_fields%>
+					
+				
+                <%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_role_add_attribute_field_path(@sub_attribute, :sub_role => {:id => @sub_attribute }),:class=>"btn btn-primary",:remote => true%>
+				<%#= f.hidden_field :id, :value => params[:role_id] if !params[:role_id].blank? %>
+				<%= hidden_field_tag 'sub_role[id]', params[:role_id] if !params[:role_id].blank? %>
+                <%= f.submit t(:save),:class=>"btn btn-primary"%>  
+				<%= link_to t('cancel'), get_go_back, :class=>"btn" %>				
+            
+			
+        <% end %>
+		
+<% content_for :page_specific_css do -%>
+    <%= stylesheet_link_tag "member" %>
+    <%= stylesheet_link_tag "site-map" %>
+<% end %>
+
+<% content_for :page_specific_javascript do -%>
+    
+<% end -%>
diff --git a/app/views/admin/roles/toggle_enable.js.erb b/app/views/admin/roles/toggle_enable.js.erb
new file mode 100644
index 00000000..3d42caab
--- /dev/null
+++ b/app/views/admin/roles/toggle_enable.js.erb
@@ -0,0 +1,3 @@
+$("#enable_<%= @sub_role.id %>").toggle();
+$("#disable_<%= @sub_role.id %>").toggle();
+$("#attribute_<%= @sub_role.id %>").toggleClass('disable');
\ No newline at end of file
diff --git a/app/views/admin/users_new_interface/_role.html.erb b/app/views/admin/users_new_interface/_role.html.erb
index 7d5f174c..ac04809f 100644
--- a/app/views/admin/users_new_interface/_role.html.erb
+++ b/app/views/admin/users_new_interface/_role.html.erb
@@ -2,10 +2,17 @@
   <%= role.title %>
 
+ 
+  <% role.attribute_fields.each  do |rf|%>
+  
+	<%= rf.block_helper(@user,@form_index)%>
+	<% @form_index = @form_index +1 %>
+  
+  <% end %>
 
-
-  <% role.sub_roles.each do |sub_role| %>  
-      <% sub_role_disable = @user.sub_roles.include?(sub_role) ?   false : true    %>
+  <% role.sub_roles.where(:disabled=>false).each do |sub_role| %> 
+      <% sub_role_disable = @user.sub_roles.include?(sub_role) ?   false : true    %> 
+	  <%# sub_role_disable = !sub_role.disabled ? false : true    %>
       <%#= hidden_field_tag("[user][new_attribute_values][sub_role][disable][#{sub_role.id}]",sub_role_disable)%>