<%
  if @member

    @writing_journals = WritingJournal.where(is_hidden: false, :create_user_id => @member.id).desc(:year, :publication_date)

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

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

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

  <% end %> 

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

    <% if !@writing_journals.blank? %> 

      <table class="table">
        <thead>
          <tr>
      			<th class="grid1"><%= t('personal_journal.year') %></th>
      			<th class="grid8"><%= t('module_name.personal_journal') %></th>
      			<th class="grid3"><%= t('personal_journal.authors') %></th>
      		</tr>
        </thead>
        <tbody>

      	<% @writing_journals.each do |writing_journal| %>	
      			
          <tr>
      			<td><%= writing_journal.year %></td>
      			<td>
      			<%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %>
      			</td>
      			<td><%= User.find(writing_journal.create_user_id).name rescue '' %></td>
      		</tr>		
      		
        <% end %> 

        </tbody>
      </table>

    <% end %> 

  <% end %> 

<% end %> 
