<% # encoding: utf-8 %>

<table>
	<caption> <%= t("module_name.personal_patent") %> </caption>
	<tbody>
		<% if !@writing_patent.year.blank? %>
		<tr><th><%= t("personal_patent.year")%></th><td><%= @writing_patent.year %></td></tr>
		<% end %>

		<% if !@writing_patent.language.blank? %>
		<tr><th><%= t("personal_patent.language")%></th><td><%= @writing_patent.language %></td></tr>
		<% end %>

		<% if !@writing_patent.patent_title.blank? %>
		<tr><th><%= t("personal_patent.patent_title")%></th><td><%= @writing_patent.patent_title %></td></tr>
		<% end %>

		<% if !@writing_patent.writing_patent_category.blank? %>
		<tr><th><%= t("personal_patent.patent_category")%></th><td><%= @writing_patent.writing_patent_category.title if @writing_patent.writing_patent_category %></td></tr>
		<% end %>

		<% if !@writing_patent.patent_no.blank? %>
		<tr><th><%= t("personal_patent.patent_no")%></th><td><%= @writing_patent.patent_no %></td></tr>
		<% end %>

		<% if !@writing_patent.patent_country.blank? %>
		<tr><th><%= t("personal_patent.patent_country")%></th><td><%= @writing_patent.patent_country %></td></tr>
		<% end %>

		<% if !@writing_patent.publish_date.blank? %>
		<tr><th><%= t("personal_patent.publication_date")%></th><td><%= @writing_patent.publish_date %></td></tr>
		<% end %>

		<% if !@writing_patent.url.blank? %>
		<tr><th><%= t("personal_patent.url")%></th><td><%= link_to t(:url), @writing_patent.url, {:target => '_blank', :title => @writing_patent.url} if !@writing_patent.url.blank? %></td></tr>
		<% end %>

		<tr><th><%= t("personal_patent.authors")%></th><td><%= "#{User.from_id(@writing_patent.create_user_id).name rescue ''},#{@writing_patent.authors rescue ''}"%></td></tr>
		
		<% if @writing_patent.writing_patent_files.size > 0 %>
		<tr><th><%= t("personal_patent.file")%></th>
		<td>
			<div>			
				<div class="showFile">
					<i class="icons-paperclip"></i>
					<% @writing_patent.writing_patent_files.each do | wjfile | %>
					<%= link_to wjfile.title, wjfile.file.url, {:target => '_blank', :title => wjfile.title} if wjfile.file.file %>
					<% end %>
				</div>
			</div>
		</td>
		</tr>
		<% end %>
	</tbody>
</table>
