Revert "add Member frontend page selection options and fix backend role filter page"
This reverts commit ea3f9c8163
.
This commit is contained in:
parent
ea3f9c8163
commit
dc5ef21516
|
@ -39,8 +39,10 @@ if($.support.touch) {
|
|||
if(!$(this).closest('div').hasClass('togglebox')) {
|
||||
$(this).wrap('<div class="toggle-control"/>');
|
||||
if($(this).attr('type') == "hidden" && $(this).attr('value') == 'true') {
|
||||
console.log('true')
|
||||
$(this).wrap('<div class="togglebox disable" />');
|
||||
} else {
|
||||
console.log('false')
|
||||
$(this).wrap('<div class="togglebox" />');
|
||||
}
|
||||
$('<label><b></b></label>').insertAfter($(this));
|
||||
|
@ -71,6 +73,7 @@ if($.support.touch) {
|
|||
$(this).parent('.togglebox').removeClass('disable').closest('li').removeClass('disabled');
|
||||
};
|
||||
} else {
|
||||
console.log($(this))
|
||||
if($(this).prop('checked')) {
|
||||
$(this).parent('.togglebox').addClass('disable').closest('li').addClass('disabled');
|
||||
};
|
||||
|
@ -540,6 +543,7 @@ function changeStatusHidden() {
|
|||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
console.log('true')
|
||||
showFiltersOnPageRefresh();
|
||||
|
||||
new ini();
|
||||
|
|
|
@ -3,5 +3,4 @@
|
|||
//= require lib/all-list
|
||||
//= require lib/jquery.fastLiveFilter.js
|
||||
//= require lib/checkbox.card.js
|
||||
//= require lib/jquery.form.js
|
||||
//= require lib/member/member-role.js
|
||||
//= require lib/jquery.form.js
|
|
@ -40,18 +40,8 @@ class Admin::ItemsController < OrbitBackendController
|
|||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.app_pages.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
m["sub"] << [I18n.t('default_widget.default_widget'),'default_widget'] if module_app.has_default_widget?
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
|
|
@ -68,19 +68,8 @@ class Admin::PagePartsController < OrbitBackendController
|
|||
m = {}
|
||||
m["main"] = [module_app.label, module_app.id.to_s]
|
||||
m["sub"] = module_app.widgets.map{|name, data| [t(data["i18n"]), name]} rescue []
|
||||
|
||||
|
||||
if module_app.key == 'member'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("teacher") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
elsif module_app.key == 'member_staff'
|
||||
m["category"] = RoleStatus.can_display.where(:role_id=> RoleStatus.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = RoleCategory.can_display.where(:role_id=> RoleCategory.get_role_data("staff") ).map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
else
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
end
|
||||
|
||||
m["category"] = module_app.categories.map{|category| [category.title, category.id.to_s] } rescue ''
|
||||
m["tags"] = module_app.tags.map{|tag| [tag.name, tag.id.to_s] } rescue ''
|
||||
m["count"] = module_app.get_registration.get_data_count.to_a
|
||||
module_apps << m
|
||||
end
|
||||
|
|
|
@ -3,8 +3,6 @@ class RoleCategory < 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
|
||||
|
|
|
@ -186,21 +186,20 @@ class User
|
|||
}.uniq!
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_field(role_type,field_key)
|
||||
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
|
||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
||||
end
|
||||
|
||||
def self.get_member_list_attribute_value(user_id,field_id)
|
||||
# @attribute = ::Attribute.where(:key => role_type).first
|
||||
# @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
||||
return ::AttributeValue.where(attribute_field_id: field_id, :user_id => user_id).first
|
||||
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
|
||||
end
|
||||
|
||||
def self.get_role_member_data_by_sort(role, field_key, role_status_id)
|
||||
def self.get_role_member_data_by_sort(role_status_id)
|
||||
a = Array.new
|
||||
attribute_field_data = get_member_list_attribute_field(role,field_key)
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,attribute_field_data.id)['val'].to_i, t ] }
|
||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
|
||||
member_data = a.sort
|
||||
member_data_tmp = member_data.collect {|v| v[1] }
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<td class="action span3">
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= attribute.disabled ? 'disabled' : '' %>">
|
||||
<%= check_box_tag 'accept', attribute.disabled ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@attribute_type}_toggle_path(attribute)")}, :checked=> attribute.disabled} %>
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@attribute_type}_toggle_path(attribute)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// $("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
location.reload();
|
||||
$("#attributes_index").html("<%= j render 'admin/attributes/index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
<tr id="<%= dom_id role_filter %>" class="<%= role_filter.disable ? 'disable' : '' %>">
|
||||
<tr id="<%= dom_id role_filter %>" class="<% role_filter.disable ? 'disable' : '' %>">
|
||||
<td><span class="label label-info"><%= role_filter.key %></span></td>
|
||||
<% if @types.is_localized?(:title) %>
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
@ -18,7 +18,15 @@
|
|||
<td><%= role_filter.title %></td>
|
||||
<% end %>
|
||||
|
||||
<td class="action dsrgsdgsdg">
|
||||
<%= check_box_tag 'accept', role_filter.disable ? 'fasle' : 'true', false ,{ :class => 'toggle-check role_filter_checked', :data=>{:deploy=>"right"}, :data=>{:path=> eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)")}, :checked=> role_filter.disable} %>
|
||||
<td class="action">
|
||||
<%#= link_to role_filter.disable ? t(:disable) : t(:enable), polymorphic_path([:admin, role_filter]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"btn btn-mini btn-success", :type=>"button" %>
|
||||
|
||||
<div class="toggle-control" style="float: right;">
|
||||
<div class="togglebox <%= role_filter.disable ? 'disabled' : '' %>">
|
||||
<%= link_to (check_box_tag 'accept', false , :class => 'toggle-check', :data=>{:deploy=>"right"}) , eval("admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_toggle_path(role_filter)"), method: :post, remote: true, class: "switch" %>
|
||||
<label><b></b></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<% content_for :side_bar do %>
|
||||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
@ -10,6 +9,14 @@
|
|||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i, nil, class: "icons-plus") + " " + t(:add), eval("new_admin_#{@app_type == 'role_statuses' ? 'role_status' : @app_type }_path(:role_id=>params[:role_id])"), class: "btn btn-primary open-slide" %>
|
||||
|
@ -20,4 +27,4 @@
|
|||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
<% @path = "/admin/#{@app_type == 'role_category' ? 'role_categorys' : @app_type }/" %>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// $("#role_filters_index").html("<%= j render 'index' %>")
|
||||
location.reload();
|
||||
$("#role_filters_index").html("<%= j render 'index' %>")
|
||||
$.pageslide.close();
|
||||
openSlide();
|
|
@ -2,6 +2,7 @@
|
|||
<%= render :partial => 'admin/users_new_interface/side_bar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% content_for :page_specific_css do -%>
|
||||
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
|
||||
<%= stylesheet_link_tag "lib/pageslide.css" %>
|
||||
|
@ -9,6 +10,13 @@
|
|||
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||
<% end -%>
|
||||
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="bottomnav clearfix">
|
||||
<div class="action pull-right">
|
||||
<%= link_to content_tag(:i,t("new.sub_role"),:class=>"icon-plus"),eval("admin_#{@attribute_type}_add_sub_role_path(@attribute)"),:class=>"btn btn-primary open-slide"%>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<%=render :partial=>"role",:collection=>Role.where(:disabled=>false).asc("_id")%>
|
||||
<%=render :partial=>"role",:collection=>Role.all.asc("_id")%>
|
|
@ -24,16 +24,8 @@
|
|||
<div class="wrap-inner">
|
||||
<div id="filter" class="topnav clearfix">
|
||||
<ul class="breadcrumb text-info pull-left">
|
||||
<% if !@role.blank? %>
|
||||
<li><%= link_to( t("role"), admin_roles_path ) %> <span class="divider">/</span></li>
|
||||
<li class="active">( <%= @role.title %> ) <%= t(@app_type_name) %></a></li>
|
||||
<% elsif !@attribute.blank? %>
|
||||
<li><%= link_to( t("#{@attribute_type}"), admin_roles_path ) %>/</span></li>
|
||||
<li class="active"><%= @attribute.title %></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
|
||||
<li class="active">All</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= yield :right_nav %>
|
||||
</div>
|
||||
|
|
|
@ -27,27 +27,22 @@ class Panel::Member::FrontEnd::MemberListsController < OrbitWidgetController
|
|||
@member_role = Role.where(:_id => @role_id)
|
||||
|
||||
@member_subroles = SubRole.where(:role_id => @role_id, :disabled => false)
|
||||
|
||||
@member_list_categorys = RoleCategory.can_display.any_in(:_id => params[:tag_id]).asc("key")
|
||||
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
@member_list_categorys = RoleCategory.where(:role_id => @role_id,disable: false).asc("key")
|
||||
|
||||
@mlcs = @member_list_categorys.map{|category| category.id.to_s }
|
||||
|
||||
@mcs = params[:mcid].blank? ? @mlcs.first : params[:mcid]
|
||||
|
||||
if !@member_list_categorys.blank? or !@member_status.blank?
|
||||
|
||||
if !@mcs.blank? and @mlcs.include?(@mcs)
|
||||
@member_lists = User.where(:role_ids => @role_id,:role_category_ids => @mcs).asc(:position)
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id).asc(:position)
|
||||
end
|
||||
if !params[:category_id].blank?
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
else
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
@member_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
end
|
||||
|
||||
if !params[:mcid].blank?
|
||||
@member_lists = User.where(:role_ids => @role_id, :role_category_ids => params[:mcid])
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if !@member_lists.blank? %>
|
||||
|
||||
<% @job_title_field = @member_lists.get_member_list_attribute_field("teacher","job_title") %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
|
@ -12,7 +8,7 @@
|
|||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -21,8 +17,6 @@
|
|||
|
||||
<div class="o-members">
|
||||
|
||||
<%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? and @mlcs.include?(@mcs) %>
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
@ -36,11 +30,11 @@
|
|||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
<% @job_title = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -61,10 +55,12 @@
|
|||
|
||||
<% elsif @item.frontend_style == 'Two' or @item.frontend_style.blank? %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
<div class="o-members view-columns">
|
||||
|
||||
<%# @member_lists = @member_lists.where(:role_category_ids => @mcs) if !@mcs.blank? %>
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
@ -78,10 +74,10 @@
|
|||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
<% @job_title = show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"teacher","job_title").get_value_by_locale(I18n.locale))
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label"><%= @job_title_field.title %></b><%= @job_title %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b><%= @job_title %></li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
|
@ -102,6 +98,5 @@
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= stylesheet_link_tag "member/members" %>
|
||||
<%#= stylesheet_link_tag "member/members" %>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.where(:disabled=>false).asc(:created_at) %>
|
||||
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -8,36 +8,6 @@
|
|||
.o-members-category:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.o-members-nav {
|
||||
margin: 0 0 10px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.o-members-nav:after {
|
||||
content: "";
|
||||
clear: both;
|
||||
display: block;
|
||||
height: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
.o-members-nav li {
|
||||
float: left;
|
||||
}
|
||||
.o-members-nav li + li {
|
||||
margin-left: 8px;
|
||||
}
|
||||
.o-members-nav li a {
|
||||
display: inline-block;
|
||||
line-height: 23px;
|
||||
padding: 5px 8px;
|
||||
height: 23px;
|
||||
background-color: #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.o-members-nav li.active a {
|
||||
color: #FFF;
|
||||
background-color: #0088CE;
|
||||
}
|
||||
.o-members-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
|
@ -137,4 +107,4 @@
|
|||
font-size: 16px;
|
||||
margin: 0;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
|
@ -27,25 +27,17 @@ class Panel::MemberStaff::FrontEnd::MemberStaffListsController < OrbitWidgetCont
|
|||
@member_role = Role.where(:_id => @role_id)
|
||||
|
||||
@member_subroles = SubRole.where(:role_id => @role_id, :disabled => false)
|
||||
|
||||
@member_list_categorys = RoleCategory.can_display.any_in(:_id => params[:tag_id]).asc("key")
|
||||
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
if !params[:category_id].blank?
|
||||
@member_status = RoleStatus.can_display.any_in(:_id => params[:category_id]).asc("key")
|
||||
|
||||
@mlcs = @member_list_categorys.map{|category| category.id.to_s }
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
|
||||
@mcs = params[:mcid].blank? ? @mlcs.first : params[:mcid]
|
||||
|
||||
if !@member_list_categorys.blank? or !@member_status.blank?
|
||||
|
||||
if !@mcs.blank? and @mlcs.include?(@mcs)
|
||||
@member_lists = User.where(:role_ids => @role_id,:role_category_ids => @mcs).asc(:position)
|
||||
else
|
||||
@member_lists = User.where(:role_ids => @role_id).asc(:position)
|
||||
end
|
||||
else
|
||||
# @member_lists = User.where(:role_ids => @role_id)
|
||||
@member_lists = ''
|
||||
@member_status = RoleStatus.can_display.where(:role_id => @role_id).asc("key")
|
||||
|
||||
@member_lists = User.where(:role_ids => @role_id)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,61 +1,29 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if !@member_lists.blank? %>
|
||||
|
||||
<% @job_title_field = @member_lists.get_member_list_attribute_field("staff","job_title") %>
|
||||
<% @job_business_field = @member_lists.get_member_list_attribute_field("staff","business") %>
|
||||
|
||||
<% if @item.frontend_style == 'Single' or @item.frontend_style == 'Two' %>
|
||||
<% if @item.frontend_style == 'Single' %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if @item.frontend_style == 'Single' %>
|
||||
|
||||
<div class="o-members">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each do |member| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each do |member| %>
|
||||
|
||||
<li class="odd">
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></b><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_business_field.title %></b>
|
||||
<%= @job_business %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></b><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></b><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -65,47 +33,34 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% elsif @item.frontend_style == 'Two' %>
|
||||
<% elsif @item.frontend_style == 'Two' %>
|
||||
|
||||
<section>
|
||||
|
||||
<div class="side"></div>
|
||||
<div class="main">
|
||||
<div class="o-members view-columns">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
<ul class="o-members-list">
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<li <%= ( (i + 1) % 2 != 0 ) ? "class=odd" : '' %>>
|
||||
<div class="o-members-pic"><%= show_avatar(member) %></div>
|
||||
<ul class="o-members-info">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_title_field.title %></b>
|
||||
<%= @job_title %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></b><%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= t("users.name")%></b><%= link_to member.name, panel_member_front_end_member_list_path(member.id), {:class => "o-members-link"} %></li>
|
||||
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
|
||||
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
|
||||
|
||||
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<li><b class="o-members-label">
|
||||
<%= @job_business_field.title %></b>
|
||||
<%= @job_business %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></b><%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) %></li>
|
||||
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></b><%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) %></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -115,64 +70,47 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<% elsif @item.frontend_style == 'List' %>
|
||||
|
||||
<% if !@member_list_categorys.blank? %>
|
||||
<ul class="o-members-nav">
|
||||
<% @member_list_categorys.each do |mc| %>
|
||||
<li class="<%= (params[:mcid] == mc.id.to_s or @mcs.to_s == mc.id.to_s) ? 'active' : '' %>"><a href="?&mcid=<%= mc.id %>"><%= mc.title %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="o-members view-ntu-lists">
|
||||
|
||||
<% @member_status.each do |ms| %>
|
||||
|
||||
<% if @member_lists.where(:role_status_ids=>ms.id).count > 0 %>
|
||||
|
||||
<h3 class="o-members-category h3"><%= ms.title %></h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><span class="job_title"><%= @job_title_field.title %></span></td>
|
||||
<td><span class="job_title"><%= @member_lists.get_member_list_attribute_field_name("staff","job_title") %></span></td>
|
||||
<td><span class="name"><%= t("users.name")%></span></td>
|
||||
<td><span class="tel"><%= t("users.office_tel")%></span></td>
|
||||
<td><span class="business"><%= @job_business_field.title %></span></td>
|
||||
<td><span class="business"><%= @member_lists.get_member_list_attribute_field_name("staff","business") %></span></td>
|
||||
<td><span class="agent"><%= @member_lists.get_member_list_attribute_field_name("staff","agent") %></span></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<% @member_lists.where(:role_status_ids=>ms.id).each_with_index do |member, i| %>
|
||||
<% @member_lists.get_role_member_data_by_sort(ms.id).each_with_index do |member, i| %>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span class="job_title">
|
||||
<% @job_title = @member_lists.get_member_list_attribute_value(member.id,@job_title_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_title != 'NoData' and !@job_title.blank?
|
||||
%>
|
||||
<%= @job_title %>
|
||||
<% end %>
|
||||
<%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
<td><span class="name"><%= link_to member.name, "mailto:#{member.email}" %></span></td>
|
||||
<td><span class="tel"><%= member.office_tel %></span></td>
|
||||
<td>
|
||||
<span class="business">
|
||||
<% @job_business = @member_lists.get_member_list_attribute_value(member.id,@job_business_field.id).get_value_by_locale(I18n.locale)
|
||||
if @job_business != 'NoData' and !@job_business.blank?
|
||||
%>
|
||||
<%= @job_business %>
|
||||
<% end %>
|
||||
<%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="agent">
|
||||
<%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) rescue '' %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -183,12 +121,9 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
<%= stylesheet_link_tag "member_staff/members" %>
|
||||
|
|
Loading…
Reference in New Issue