<%
  if @member

    @writing_books = WritingBook.where(is_hidden: false, :create_user_id => @member.id).desc(:year,:publish_date)

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

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

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

  <% end %> 

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

    <% if !@writing_books.blank? %>  

      <table class="table">
        <thead>
          <tr>
      			<th class="grid1"><%= t('personal_book.year') %></th>
            <th class="grid8"><%= t('personal_book.book_title') %></th>
      			<th class="grid3"><%= t('personal_book.authors') %></th>
      		</tr>
        </thead>
        <tbody>
      		
      	<% @writing_books.each do |writing_book| %>	
      			
          <tr>
            <td><%= writing_book.year %></td>
      			<td>
      			<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
      			</td>
            <td><%= User.find(writing_book.create_user_id).name rescue '' %></td>
      		</tr>		
      		
      	<% end %>	

        </tbody>
      </table>

    <% end %>

  <% end %> 

<% end %> 