user id set & user fields set & role set & member frontend list & user translation & create new member bug fix
This commit is contained in:
1 parent
12e39b4d77
commit
697944a029
172 files changed
+3631
-96
No files matched your search
@@ -0,0 +1,9 @@
|
||||
class Admin::RoleCategorysController < Admin::RoleFiltersController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'role_category'
|
||||
@app_type_name = 'category'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,144 @@
|
||||
class Admin::RoleFiltersController < OrbitBackendController
|
||||
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
layout "new_admin"
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||
helper Admin::AttributeValuesViewHelper
|
||||
|
||||
def index
|
||||
get_types
|
||||
@role = Role.find(params[:role_id])
|
||||
@role_filters = @types.where(:role_id=>params[:role_id])
|
||||
@role_filter = @types.new(:display => 'List')
|
||||
|
||||
# @url = admin_role_filter_role_filters_path
|
||||
|
||||
if @app_type == 'role_statuses'
|
||||
@url = eval("admin_#{@app_type}_path")
|
||||
else
|
||||
@url = eval("admin_#{@app_type}s_path")
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def new
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.new(:display => 'List')
|
||||
|
||||
@verb = :post
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def edit
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
|
||||
@url = polymorphic_path([:admin, @role_filter])
|
||||
|
||||
@verb = :put
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def create
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.new(params[:role_filter])
|
||||
|
||||
respond_to do |format|
|
||||
if @role_filter.save
|
||||
format.html { redirect_to(admin_role_filter_url(params[:role_filter][:role_id])) }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
# debugger
|
||||
# @url = admin_role_filter_role_filter_path(@role_filter)
|
||||
# @url = eval("admin_role_filter_#{@app_type}_path(#{@role_filter})")
|
||||
@url = polymorphic_path([:admin, @role_filter])
|
||||
|
||||
respond_to do |format|
|
||||
if @role_filter.update_attributes(params[:role_filter])
|
||||
format.html { redirect_to(admin_role_filter_role_filters_url(params[:role_id]), :notice => t('role_filter.update_role_filter_success')) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.js { render :action => "edit" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
|
||||
get_types
|
||||
|
||||
@role_filter = @types.find(params[:id])
|
||||
@role_filter.disable = @role_filter.disable ? false : true
|
||||
|
||||
if @role_filter.save!
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(admin_role_filter_role_filters_url) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
end
|
||||
else
|
||||
flash[:error] = t("role_filter.update_failed")
|
||||
format.html { render :action => "index" }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def get_types
|
||||
@types = @app_type.classify.constantize
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class Admin::RoleStatusesController < Admin::RoleFiltersController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_type = 'role_statuses'
|
||||
@app_type_name = 'status'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -17,35 +17,34 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
def role_field
|
||||
|
||||
@field_name = 'role'
|
||||
@field_name = 'role'
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
|
||||
end
|
||||
|
||||
def sub_role
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute_fields_upper_object = @attribute.sub_roles
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute_fields_upper_object = @attribute.sub_roles
|
||||
|
||||
end
|
||||
|
||||
def add_sub_role
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
# @sub_attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
# @sub_attribute = Role.find(params[:role_id])
|
||||
|
||||
@sub_attribute = SubRole.new
|
||||
@sub_attribute = SubRole.new
|
||||
@sub_attribute.role_id = params[:role_id]
|
||||
|
||||
end
|
||||
|
||||
def edit_sub_role
|
||||
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
|
||||
@sub_attribute.role_id = @sub_attribute.role_id
|
||||
|
||||
@@ -55,53 +54,52 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
@field_name = 'sub_role'
|
||||
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
@sub_attribute = SubRole.find(params[:role_id])
|
||||
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
@attribute = Role.find(@sub_attribute.role_id)
|
||||
|
||||
end
|
||||
|
||||
def add_attribute_field
|
||||
|
||||
if params[:sub_role]
|
||||
if params[:sub_role]
|
||||
|
||||
@field_name = 'sub_role'
|
||||
@field_name = 'sub_role'
|
||||
|
||||
attribute = SubRole.find(params[:sub_role][:id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
attribute = SubRole.find(params[:sub_role][:id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
|
||||
@attribute = SubRole.find(params[:sub_role][:id])
|
||||
@attribute = SubRole.find(params[:sub_role][:id])
|
||||
|
||||
else
|
||||
else
|
||||
|
||||
@field_name = 'role'
|
||||
@field_name = 'role'
|
||||
|
||||
attribute = Role.find(params[:role_id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
attribute = Role.find(params[:role_id]) rescue nil
|
||||
@attribute_field_counter = attribute.attribute_fields.count
|
||||
@attribute_field = attribute.attribute_fields.build
|
||||
@attribute_field.save
|
||||
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
@attribute_field[:af_count] = @attribute_field_counter
|
||||
|
||||
@attribute = Role.find(params[:role_id])
|
||||
@attribute = Role.find(params[:role_id])
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
respond_to do |format|
|
||||
format.js { render 'add_attribute_field' }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@attribute = Role.new
|
||||
|
||||
if !params[:parent_id]
|
||||
if !params[:parent_id]
|
||||
render :template => 'admin/attributes/new'
|
||||
end
|
||||
|
||||
@@ -165,17 +163,17 @@ class Admin::RolesController < OrbitBackendController
|
||||
|
||||
def destroy
|
||||
|
||||
if params[:sub_role]
|
||||
if params[:sub_role]
|
||||
|
||||
@sub_role = SubRole.find(params[:sub_role][:id])
|
||||
@sub_role = SubRole.find(params[:sub_role][:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @sub_role.destroy
|
||||
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) }
|
||||
format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) }
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
else
|
||||
|
||||
@attribute = Role.find(params[:id])
|
||||
@attribute.destroy
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
helper MemberHelper
|
||||
|
||||
layout "new_admin"
|
||||
# before_filter :authenticate_user!
|
||||
@@ -23,13 +25,13 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
render case params[:at]
|
||||
when 'summary'
|
||||
@users=User.not_guest_user.page(page_num).per(12).includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar')
|
||||
"index_summary"
|
||||
when 'thumbnail'
|
||||
@users=User.not_guest_user.page(page_num).per(36).includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar')
|
||||
"index_thumbnail"
|
||||
else
|
||||
@users=User.not_guest_user.page(page_num).per(10).includes('avatar')
|
||||
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar')
|
||||
"index"
|
||||
end
|
||||
end
|
||||
@@ -43,7 +45,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
@student_data = []
|
||||
@staff_data = []
|
||||
|
||||
attribute_values = @user.attribute_values
|
||||
attribute_values = @user.attribute_values.asc("_id")
|
||||
attribute_values.each{|att_val|
|
||||
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" rescue false
|
||||
}
|
||||
@@ -80,21 +82,29 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
end
|
||||
|
||||
def create
|
||||
puts params.to_yaml
|
||||
# puts params.to_yaml
|
||||
# attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||
# attribute_values = params[:user].delete(attribute_values_key)
|
||||
@user = User.new(params["user"])
|
||||
|
||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
||||
|
||||
if !@checkuser.blank?
|
||||
flash.now[:error] = t("users.user_id_error")
|
||||
end
|
||||
|
||||
# attribute_values.to_hash.each{|key,value|
|
||||
# @user.attribute_values.build(value)
|
||||
# }
|
||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
# binding.pry
|
||||
if @user.save
|
||||
if !flash.now[:error] && @user.save
|
||||
flash[:notice] = t('create.success.user')
|
||||
redirect_to :action => :index
|
||||
else
|
||||
@user.attribute_values = nil
|
||||
@form_index = 0
|
||||
render :action => :new
|
||||
render :action => :new , :notice => flash.now[:error]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -110,16 +120,46 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
@form_index = 0
|
||||
get_info_and_roles
|
||||
end
|
||||
|
||||
def edit_passwd
|
||||
# @disable_all_field = false
|
||||
@user = User.find(params[:users_new_interface_id])
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@user = User.find(params[:id])
|
||||
|
||||
if params[:edit_type] == 'edit_passwd'
|
||||
|
||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
||||
|
||||
if !@checkuser.blank? && @checkuser.id != @user.id
|
||||
flash.now[:error] = t("users.user_id_error")
|
||||
elsif @user.admin && current_user.id == @user.id
|
||||
flash.now[:error] = t("users.admin_change_password")
|
||||
end
|
||||
|
||||
if !flash.now[:error] && @user.update_attributes(params[:user])
|
||||
redirect_to :action => :show
|
||||
else
|
||||
render :action => :edit_passwd, :notice => flash.now[:error]
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
@user.update_attributes(params[:user])
|
||||
|
||||
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||
attribute_values = params[:user].delete(attribute_values_key)
|
||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
@user.save
|
||||
|
||||
redirect_to :action => :show
|
||||
|
||||
end
|
||||
|
||||
|
||||
@user.update_attributes(params[:user])
|
||||
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||
attribute_values = params[:user].delete(attribute_values_key)
|
||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||
@user.save
|
||||
redirect_to :action => :show
|
||||
# # Update changes to the avatar
|
||||
# @user.remove_avatar! if params[:file]
|
||||
# @user.avatar = params[:file] if params[:file]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
module MemberHelper
|
||||
def nl2br(val)
|
||||
val.gsub(/\r\n/, '<br />').html_safe
|
||||
end
|
||||
end
|
||||
@@ -11,9 +11,14 @@ class Role < Attribute
|
||||
|
||||
has_many :sub_roles, :autosave => true, :dependent => :destroy
|
||||
has_many :users
|
||||
has_many :statuses, :autosave => true, :dependent => :destroy
|
||||
# has_many :statuses, :autosave => true, :dependent => :destroy
|
||||
# has_many :attribute_fields, :autosave => true, :dependent => :destroy
|
||||
has_many :role_statuses, :autosave => true, :dependent => :destroy
|
||||
has_many :role_categorys, :autosave => true, :dependent => :destroy
|
||||
|
||||
accepts_nested_attributes_for :sub_roles, :allow_destroy => true
|
||||
accepts_nested_attributes_for :role_statuses, :allow_destroy => true
|
||||
accepts_nested_attributes_for :role_categorys, :allow_destroy => true
|
||||
|
||||
def is_built_in?
|
||||
self.built_in
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
class RoleCategory < RoleFilter
|
||||
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
return @role.id
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
class RoleFilter
|
||||
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
# include OrbitCoreLib::ObjectAuthable
|
||||
include OrbitCoreLib::ObjectDisable
|
||||
|
||||
|
||||
field :key
|
||||
field :title, localize: true
|
||||
|
||||
# belongs_to :role
|
||||
|
||||
def pp_object
|
||||
title
|
||||
end
|
||||
|
||||
def self.from_id(id)
|
||||
RoleFilter.find(id) rescue nil
|
||||
end
|
||||
|
||||
def self.is_localized?(field_name)
|
||||
self.fields[field_name.to_s].localized?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
class RoleStatus < RoleFilter
|
||||
|
||||
has_and_belongs_to_many :users
|
||||
belongs_to :role
|
||||
|
||||
scope :can_display,where(disable: false)
|
||||
|
||||
def self.get_role_data(role_key)
|
||||
|
||||
@role = Role.where(:key =>role_key).first
|
||||
|
||||
return @role.id
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
+62
-5
@@ -9,7 +9,13 @@ class User
|
||||
|
||||
field :admin, :type => Boolean, :default => true
|
||||
field :active_role
|
||||
field :user_id
|
||||
field :sid
|
||||
field :first_name, localize: true
|
||||
field :last_name, localize: true
|
||||
field :email
|
||||
field :sex, :default => 'unknown'
|
||||
field :office_tel
|
||||
field :cache_dept,type: Hash
|
||||
field :status_record,type: Hash
|
||||
|
||||
@@ -25,9 +31,11 @@ class User
|
||||
# has_many :papers, :autosave => true, :dependent => :destroy
|
||||
has_and_belongs_to_many :sub_role_tags
|
||||
|
||||
has_and_belongs_to_many :statuses
|
||||
# has_and_belongs_to_many :statuses
|
||||
has_and_belongs_to_many :roles
|
||||
has_and_belongs_to_many :sub_roles
|
||||
has_and_belongs_to_many :role_statuses
|
||||
has_and_belongs_to_many :role_categorys
|
||||
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
||||
|
||||
before_create :initialize_desktop
|
||||
@@ -36,6 +44,9 @@ class User
|
||||
scope :remote_account, where(:nccu_id.ne => nil)
|
||||
scope :not_guest_user, all_of(:name.ne => "guest")
|
||||
|
||||
validates :user_id,
|
||||
:presence => { :message => I18n.t("users.user_id_not_null") } ,
|
||||
:length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }
|
||||
# validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
|
||||
|
||||
# def new_attribute_values=(vars)
|
||||
@@ -101,6 +112,24 @@ class User
|
||||
end
|
||||
end
|
||||
|
||||
def role_status=(var)
|
||||
self.role_statuses = []
|
||||
var[:id].each do |id,val|
|
||||
if (val=="true")
|
||||
self.role_statuses << RoleStatus.find(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def role_category=(var)
|
||||
self.role_categorys = []
|
||||
var[:id].each do |id,val|
|
||||
if (val=="true")
|
||||
self.role_categorys << RoleCategory.find(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def set_sub_role(sub_role_id,status_id)
|
||||
@@ -144,6 +173,17 @@ class User
|
||||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
||||
@attribute = ::Attribute.where(:key => role_type).first
|
||||
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first[I18n.locale.to_s]
|
||||
end
|
||||
|
||||
def create_dept_cache
|
||||
dept_hash = {}
|
||||
|
||||
@@ -170,12 +210,30 @@ class User
|
||||
(query1 + query2).uniq
|
||||
end
|
||||
|
||||
# def name
|
||||
# info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||
# if info
|
||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
# full_name = "#{last_name} #{first_name}"
|
||||
|
||||
# if full_name.strip.empty?
|
||||
# full_name = email
|
||||
# end
|
||||
|
||||
# return full_name
|
||||
# else
|
||||
# return nil
|
||||
# end
|
||||
# end
|
||||
|
||||
def name
|
||||
info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||
if info
|
||||
first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
full_name = "#{last_name} #{first_name}"
|
||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||
# full_name = (I18n.locale != 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
||||
full_name = (I18n.locale.to_s == 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
||||
|
||||
if full_name.strip.empty?
|
||||
full_name = email
|
||||
@@ -211,7 +269,6 @@ class User
|
||||
self.roles = self.roles.uniq
|
||||
end
|
||||
|
||||
|
||||
def rebuild_status_record
|
||||
self.status_record = {}
|
||||
self.attribute_values.reject{|t| t.key!='status'}.each do |status|
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
<% if @attribute_type == 'role' %>
|
||||
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
|
||||
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
|
||||
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
|
||||
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
|
||||
<% end %>
|
||||
<li><%= 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' %></li>
|
||||
<li><%= 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' %></li>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(:role_filter, :remote => true, :url => @url, :method => @verb, :html => { :id => 'form_role_filter' } ) do |f| %>
|
||||
|
||||
<h2><%= (@role_filter.new_record? ? 'Add' : 'Edit') %></h2>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.label :key %>
|
||||
<%= f.text_field :key %>
|
||||
</div>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class =>' input-xxlarge', :value => (@role_filter.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.hidden_field :role_id, :value => params[:role_id] if !params[:role_id].blank? %>
|
||||
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
<tr id="<%= dom_id role_filter %>" class="with_action">
|
||||
<td>
|
||||
<%= role_filter.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t('role_filter.edit'),
|
||||
polymorphic_path([:admin, role_filter], {:action => :edit}), :remote => true %></li>
|
||||
<li><%= link_to show_toggle_archive_btn(role_filter),
|
||||
polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<% if @types.is_localized?(:title) %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= role_filter.title_translations[locale] rescue nil %></td>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -0,0 +1,2 @@
|
||||
$('<%= j render :partial => 'role_filter', :collection => [@role_filter] %>').appendTo('#role_filters').hide().fadeIn();
|
||||
$("#form_role_filter")[0].reset();
|
||||
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id @role_filter %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@role_filter) %> ");
|
||||
@@ -0,0 +1 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
<% 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 %>
|
||||
|
||||
<div class="subnav">
|
||||
<ul class="breadcrumb">
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></li>
|
||||
</ul>
|
||||
<div id="accordion">
|
||||
<div class="accordion-group filters">
|
||||
<div class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
|
||||
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= t('role_filters.key') %><b class="web-symbol"></b></a></span></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th id="sort-name" class="sort span1-2 select"><span><a href="#"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %><b class="web-symbol"></b></a></span></th>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="role_filters" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%= render :partial => 'role_filter', :collection => @role_filters %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
$("#form > form").replaceWith("<%= j render "form" %>");
|
||||
@@ -0,0 +1,4 @@
|
||||
$("#<%= dom_id @role_filter %>").replaceWith("<%= j render :partial => 'role_filter', :collection => [@role_filter] %>");
|
||||
<% @role_filter = @types.new(:display => 'List') # reset for new form %>
|
||||
$("#form_role_filter").replaceWith("<%= j render "form" %>")
|
||||
$("#form_role_filter")[0].reset();
|
||||
@@ -1,3 +1,9 @@
|
||||
|
||||
<% 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 @sub_attribute,:url => eval("admin_#{@attribute_type}s_path") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
|
||||
<% 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 @sub_attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||
<div class="site-map role-block">
|
||||
<div class="map-block back">
|
||||
|
||||
@@ -4,12 +4,34 @@
|
||||
|
||||
<div class="groups map-block back <%= role_disable ? 'disabled' : '' %>">
|
||||
<h4>
|
||||
<button for=<%=@form_index%> class="onoff pull-right"><%= role_disable ? 'OFF' : 'ON' %></button><span><%= role.title %></span>
|
||||
<button for=<%=@form_index%> class="onoff pull-right"><%= role_disable ? 'OFF' : 'ON' %></button><span><%= role.title %><%= t(:role_info)%></span>
|
||||
<%= hidden_field_tag("user[disable_role][id][#{role.id}]",role_disable,:for=>@form_index,:class=>"subrole_disable_field",:value=>role_disable)%>
|
||||
</h4>
|
||||
|
||||
<div class="form-horizontal <%= role_disable ? 'hide' : '' %>">
|
||||
|
||||
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<div class="control-group">
|
||||
|
||||
<%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
|
||||
<% role.role_statuses.where(:disable => false).each_with_index do |rrs, i|%>
|
||||
<%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%>
|
||||
<%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"control-label") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% @form_index = @form_index +1 %>
|
||||
|
||||
<div class="control-group">
|
||||
<%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label"} %>
|
||||
<% role.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%>
|
||||
<%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%>
|
||||
<%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"control-label") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<% role.attribute_fields.each do |rf|%>
|
||||
|
||||
<%= rf.block_helper(@user,@form_index)%>
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<div class="roles <%= show_roles.key %>">
|
||||
<%= show_roles.title %>
|
||||
<%= show_roles.title %><%= t(:role_info)%>
|
||||
<div class="label-line">
|
||||
<hr />
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="span1"><%= t('status') %></td>
|
||||
<td><%= show_attribute_value(@user.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="span1"><%= t('category') %></td>
|
||||
<td><%= show_attribute_value(@user.role_categorys.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
|
||||
</tr>
|
||||
<% show_roles.attribute_fields.where(:disabled=>false).each do |rf| %>
|
||||
<tr>
|
||||
<td class="span1"><%= rf.title %></td>
|
||||
<td><%= show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale)) rescue '' %></td>
|
||||
<td><%= nl2br(show_attribute_value(@user.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
</tr>
|
||||
<% end -%>
|
||||
<%= render :partial => 'show_sub_role',:collection=> @user.get_sub_roles_by_role(show_roles)%>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<% show_sub_role.attribute_fields.each do |item|%>
|
||||
<tr>
|
||||
<td class="span1"><%= item.title %></td>
|
||||
<td><%= show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale)) rescue '' %></td>
|
||||
<td><%= nl2br(show_attribute_value(@user.get_attribute_value(item).get_value_by_locale(I18n.locale))) rescue '' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -1,32 +1,120 @@
|
||||
<%#= devise_error_messages! %>
|
||||
|
||||
<div class="map-block back">
|
||||
<h4><span><%=t(:sys_basic_form)%></span></h4>
|
||||
<h4><span><%=t(:sys_basic_form)%></span></h4>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:email),:class=>"control-label" %><br />
|
||||
<div class="controls">
|
||||
<%= f.email_field :email %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:password),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-horizontal">
|
||||
<div class="controls-block" >
|
||||
<div class="control-group language-swich">
|
||||
<%= f.label t("users.first_name"),{:class=>"control-label", :func=>"field_label"} %>
|
||||
<div class="controls">
|
||||
<div class="tabbable">
|
||||
<div class="tab-content">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= locale %> user-attribute_values-first_name <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%= f.fields_for :first_name_translations do |f| %>
|
||||
<%= f.text_field locale, :func=>'input_unit', :value => (@user.first_name_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
|
||||
<a data-toggle="tab" href=".user-attribute_values-first_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t(:password_confirmation),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password_confirmation %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-horizontal">
|
||||
<div class="controls-block" >
|
||||
<div class="control-group language-swich">
|
||||
<%= f.label t("users.last_name"),{:class=>"control-label", :func=>"field_label"} %>
|
||||
<div class="controls">
|
||||
<div class="tabbable">
|
||||
<div class="tab-content">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<div class="tab-pane fade <%= locale %> user-attribute_values-last_name <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%= f.fields_for :last_name_translations do |f| %>
|
||||
<%= f.text_field locale, :func=>'input_unit', :value => (@user.last_name_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="nav nav-pills">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %> for="<%= locale %>">
|
||||
<a data-toggle="tab" href=".user-attribute_values-last_name.<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.email"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.email_field :email %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.sid"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :sid %>
|
||||
<span>( <%= t("users.sid_note")%> )</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.office_tel"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :office_tel %>
|
||||
<span>( <%= t("users.office_tel_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.avatar"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.file_field :avatar %>
|
||||
<% if @user.avatar.file %>
|
||||
<%= f.check_box :remove_avatar %>
|
||||
<%= t('delete.file') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.sex"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<label func="input_unit" for="0" class=" radio inline">
|
||||
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
|
||||
</label>
|
||||
<label func="input_unit" for="1" class=" radio inline">
|
||||
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
|
||||
</label>
|
||||
<label func="input_unit" for="2" class=" radio inline">
|
||||
<%= f.radio_button :sex, "unknown" %><%= t('users.unknown')%>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
<%#= devise_error_messages! %>
|
||||
<%= flash_messages %>
|
||||
|
||||
<div class="map-block back">
|
||||
<h4><span><%=t(:sys_basic_id_form)%></span></h4>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.user_id"),:class=>"control-label" %>
|
||||
<%#= f.label t(:user_id),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field :user_id %>
|
||||
<span>( <%= t("users.user_id_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.new_password"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password %>
|
||||
<span>( <%= t("users.new_password_note")%> )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<%= f.label t("users.new_password_confirmation"),:class=>"control-label" %>
|
||||
<div class="controls">
|
||||
<%= f.password_field :password_confirmation %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -18,7 +18,10 @@
|
||||
<%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%>
|
||||
</p>
|
||||
<div class="user-title">
|
||||
<span>#TODO 教授兼系主任</span><span>#TODO 大學部校友</span>
|
||||
<% user_for_summary.roles.each do |rf| %>
|
||||
<% @roledata = Role.find(rf.id) %>
|
||||
<span><%= @roledata.title %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="user-itemborder clear">
|
||||
<li class="pull-left"><span>#TODO 258</span>Publications</li>
|
||||
|
||||
@@ -5,6 +5,32 @@
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.first_name')%></td>
|
||||
<td><%= @user.first_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.last_name')%></td>
|
||||
<td><%= @user.last_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.email')%></td>
|
||||
<td><%= @user.email %></td>
|
||||
</tr>
|
||||
<% if !@user.sid.blank? %>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.sid')%></td>
|
||||
<td><%= @user.sid %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.office_tel')%></td>
|
||||
<td><%= @user.office_tel %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td class="span1"><%= t('users.sex')%></td>
|
||||
<td><%= t("users.#{@user.sex}") %></td>
|
||||
</tr>
|
||||
<% items.each do |item| %>
|
||||
<tr>
|
||||
<td class="span1"><%= item[:name] %></td>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<% 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-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "member" %>
|
||||
<%= stylesheet_link_tag "site-map" %>
|
||||
<% end -%>
|
||||
<% content_for :page_specific_javascript do -%>
|
||||
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
|
||||
<%= javascript_include_tag "inc/modal-preview" %>
|
||||
<%= javascript_include_tag "lib/contenteditable" %>
|
||||
<%= javascript_include_tag "inc/ploy_input_field" %>
|
||||
<%= javascript_include_tag "inc/input_module" %>
|
||||
<%= javascript_include_tag "inc/attribute_panel_select" %>
|
||||
<%= javascript_include_tag "inc/attribute_onoff" %>
|
||||
<% end -%>
|
||||
|
||||
|
||||
<%= content_tag :div,:class=>"user-role site-map role-block" do%>
|
||||
|
||||
<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true } do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'user_basic_passwd', :locals => {:f => f}%>
|
||||
<div class="button_bar">
|
||||
<%= link_back %>
|
||||
<%= hidden_field_tag 'edit_type', 'edit_passwd' %>
|
||||
<%= link_to t(:update_), "#", :onclick=>"$('#edit_user_#{@user.id}').submit()" %>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<% end -%>
|
||||
@@ -21,6 +21,7 @@
|
||||
<%= form_for @user, :url => admin_users_new_interface_index_path, :html => { :multipart => true },:method => :post do |f| %>
|
||||
|
||||
<%= f.error_messages %>
|
||||
<%= render :partial => 'user_basic_passwd', :locals => {:f => f}%>
|
||||
<%= render :partial => 'user_basic', :locals => {:f => f}%>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<div class="button_bar">
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<%= @user.email %>
|
||||
</p>
|
||||
<%= link_to("<i class='icon-pencil'></i>#{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-small" ) if is_admin?%>
|
||||
<%= link_to("<i class='icon-pencil'></i>#{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-small" ) if is_admin?%>
|
||||
</div>
|
||||
<div class="user-roles my_scroll">
|
||||
<div class="scrollbar">
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<p class="alert hide">You need to sign in or sign up before continuing.</p>
|
||||
<div class="main">
|
||||
<div class="control-group clear">
|
||||
<%= f.label :email ,t(:email)%>
|
||||
<%= f.text_field :email, :placeholder => t(:email), :style => "width: 330px;" %>
|
||||
<%= f.label :user_id ,t(:user_id)%>
|
||||
<%= f.text_field :user_id, :placeholder => t(:email), :style => "width: 330px;" %>
|
||||
<span class="help-inline">Please correct the error</span>
|
||||
</div>
|
||||
<div class="control-group clear">
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<li>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<%= f.text_field :email, :class => 'span2', :placeholder => t(:email), :size => 16 %>
|
||||
<%= f.text_field :user_id, :class => 'span2', :placeholder => t(:email), :size => 16 %>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
Reference in new issue
Block a user