<div class="default_member">
    <div class="member-data">
		<table>
			<tbody>
				<tr>
					<td><%= t('users.name')%></td>
					<td><%= @member.name%></td>
				</tr>
				<tr>
					<td><%= t('users.email')%></td>
					<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
				</tr>
				<% if !@member.sid.blank? %>
				<tr>
					<td><%= t('users.sid')%></td>
					<td><%= @member.sid%></td>
				</tr>
				<% end %>
				<% if !@member.office_tel.blank? %>
				<tr>
					<td><%= t('users.office_tel')%></td>
					<td><%= @member.office_tel%></td>
				</tr>
				<% end %>
				<tr>
					<td><%= t('users.sex')%></td>
					<td><%= t("users.#{@member.sex}") %></td>
				</tr>

				<% @profile_data.each do |item| %>
				<% if !item[:value].blank? %>
				<tr>
					<td><%= item[:name] %></td>
					<td><%= show_attribute_value(item[:value]) %></td>
				</tr>
				<% end -%>
				<% end -%>

				<%= render :partial=> "show_roles",:collection=>@member.roles.where(:disabled=>false).asc(:created_at) %>

			</tbody>
		</table>
	</div>

    <div class="member-pic">
     <%= image_tag(@member.avatar) %>
    </div>

	<div class="member-module">
		<div class="module-nav">
			<ul>
				<%
				  @plugin_shows.each do |plugin| 

				  @data = plugin["app_name"].classify.constantize.where(is_hidden: false, :create_user_id=>@member.id)
				  @intro_data = plugin["intro_app_name"].classify.constantize.where(:user_id=>@member.id).first
				%>

					<% if !@intro_data.blank? %>

						<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
						  <li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
						<% end %>

					<% else %>

						<% if !@data.blank? %>
						  <li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
						<% end %>

					<% end %>

				<% end %>
			</ul>
		</div>
		<div class="module-content">
			<%
			  @plugin_shows.each do |plugin|

				@plugin_partial = !plugin["front_partial_path"].blank? ? OrbitApp::Plugin::Registration.find_by_key(plugin["name"]).front_partial_path : nil

				@data = plugin["app_name"].classify.constantize.where(:create_user_id=>@member.id)
				@intro_data = plugin["intro_app_name"].classify.constantize.where(:user_id=>@member.id).first
			%>

				<% if !@intro_data.blank? %>

					<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
						<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
							<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
						</div>					
					<% end %>

				<% else %>

					<% if !@data.blank? %>
						<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
							<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
						</div>					
					<% end %>

				<% end %>

			<% end %>

	    </div>

	</div>
	
</div>


<%= stylesheet_link_tag "member/default_member" %>

<%= javascript_include_tag "member/moduletab" %>
		
