<%
  if @member

    @diplomas = Diploma.where(is_hidden: false, :create_user_id => @member.id).desc(:start_date)

    @diploma_intro = !PersonalDiplomaIntro.where(:user_id => @member.id).blank? ? PersonalDiplomaIntro.where(:user_id => @member.id).first : PersonalDiplomaIntro.new
%>

  <% if @diploma_intro.brief_intro and !@diploma_intro.blank? %> 

    <div class="info">
        <%= @diploma_intro.text.html_safe rescue '' %>
      </div>

  <% end %> 

  <% if ( !@diploma_intro.blank? and @diploma_intro.complete_list ) or @diploma_intro.blank? %> 

    <% if !@diplomas.blank? %> 

      <table class="table">
        <thead>
          <tr>
            <th class="grid2"><%= t('personal_diploma.school_name') %></th>
            <th class="grid2"><%= t('personal_diploma.country') %></th>
            <th class="grid1"><%= t('personal_diploma.department') %></th>
            <th class="grid1"><%= t('personal_diploma.degree') %></th>
      			<th class="grid3"><%= t('date_') %></th>
      		</tr>
        </thead>
        <tbody>
      		
      	<% @diplomas.each do |diploma| %>	
      			
          <tr>
            <td>
            <%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
            </td>
            <td><%= diploma.country %></td>
            <td><%= diploma.department %></td>
            <td><%= diploma.degree %></td>
      			<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
      		</tr>		
      		
      	<% end %>	

        </tbody>
      </table>

    <% end %>

  <% end %>

<% end %> 