diff --git a/app/assets/javascripts/user_attribute_form.js b/app/assets/javascripts/user_attribute_form.js deleted file mode 100644 index 3af8dc01..00000000 --- a/app/assets/javascripts/user_attribute_form.js +++ /dev/null @@ -1,10 +0,0 @@ -var new_one = $('fieldset #new_one').clone(); -$('fieldset #new_one').remove(); - -$('fieldset a.remove').live( "click", function(){ - $(this).parent().remove(); -}); - -$('fieldset a.add').click(function(){ - new_one.clone().appendTo( $('fieldset') ); -}) \ No newline at end of file diff --git a/app/controllers/admin/user_attributes_controller.rb b/app/controllers/admin/user_attributes_controller.rb deleted file mode 100644 index c7021c74..00000000 --- a/app/controllers/admin/user_attributes_controller.rb +++ /dev/null @@ -1,43 +0,0 @@ -class Admin::UserAttributesController < ApplicationController - - layout "admin" - before_filter :authenticate_user! - - def index - @user_attributes = UserAttribute.all - end - - def show - @user_attribute = UserAttribute.find(params[:id]) - end - - def new - @user_attribute = UserAttribute.new - end - - def edit - @user_attribute = UserAttribute.find(params[:id]) - end - - def create - @user_attribute = UserAttribute.new(params[:user_attribute]) - @user_attribute.save - - redirect_to :action => :index - end - - def update - @user_attribute = UserAttribute.find(params[:id]) - @user_attribute.update_attributes(params[:user_attribute]) - - redirect_to :action => :index - end - - def destroy - @user_attribute = UserAttribute.find(params[:id]) - @user_attribute.destroy - - redirect_to :action => :index - end - -end diff --git a/app/views/admin/user_attributes/_form.html.erb b/app/views/admin/user_attributes/_form.html.erb deleted file mode 100644 index 98953d2c..00000000 --- a/app/views/admin/user_attributes/_form.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -

- <%= f.label :name %> - <%= f.text_field :name %> -

- -
- <% @user_attribute.attrs.each_with_index do |attr, i| %> -

- - <%= hidden_field_tag "user_attribute[attrs][][key]", attr["key"] %> - <%= text_field_tag "user_attribute[attrs][][name]", attr["name"] %> - <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field", "select"], attr["type"]) %> - (remove) -

- <% end -%> - -

- - <%= text_field_tag "user_attribute[attrs][][key]", "" %> - - <%= text_field_tag "user_attribute[attrs][][name]", "" %> - <%= select_tag "user_attribute[attrs][][type]", options_for_select(["text_field"], "") %> - (remove) -

- - (add) - -
- -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "user_attribute_form" %> -<% end -%> \ No newline at end of file diff --git a/app/views/admin/user_attributes/edit.html.erb b/app/views/admin/user_attributes/edit.html.erb deleted file mode 100644 index 1bc86bc4..00000000 --- a/app/views/admin/user_attributes/edit.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - -

Editing user attribute: <%= @user_attribute.key %>

- -<% form_for @user_attribute, :url => admin_user_attribute_path(@user_attribute) do |f| %> - - <%= render :partial => "form", :locals => { :f => f } %> - -

- <%= f.submit %> -

- -<% end -%> diff --git a/app/views/admin/user_attributes/index.html.erb b/app/views/admin/user_attributes/index.html.erb deleted file mode 100644 index c9fe93b4..00000000 --- a/app/views/admin/user_attributes/index.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -

Listing user attributes

- - - - - - - - - -<% @user_attributes.each do |user_attribute| %> - - - - - - -<% end %> -
名稱Key
<%= user_attribute.name %><%= user_attribute.key %><%= link_to t(:edit), edit_admin_user_attribute_path(user_attribute) %><%= link_to t(:delete), admin_user_attribute_path(user_attribute), :confirm => 'Are you sure?', :method => :delete %>
- -
- -<%= link_to t(:new_user_attribute, :scope => :admin), new_admin_user_attribute_path, :class => 'button positive' %> \ No newline at end of file diff --git a/app/views/admin/user_attributes/new.html.erb b/app/views/admin/user_attributes/new.html.erb deleted file mode 100644 index c2ada3c1..00000000 --- a/app/views/admin/user_attributes/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - -

New user attribute: <%= @user_attribute.key %>

- -<% form_for @user_attribute, :url => admin_user_attributes_path do |f| %> - -

- <%= f.label :key, "Key" %> - <%= f.text_field :key %> -

- - <%= render :partial => "form", :locals => { :f => f } %> - -

- <%= f.submit %> -

- -<% end -%>