Newer
Older
dmpopidor / app / views / plans / export.html.erb
<div id="export_font">
	<h1><%= @plan.project.title %></h1>
	<h2><%= @plan.version.phase.title %></h2>
	<div class="dmp_details_body">
		<div class="dmp_details">
			<%
				details = @exported_plan.admin_details
				if details.present?
			%>
				<h3><%= t('org_admin.admin_details') %></h3>
				<table class="dmp_table">
					<thead>
						<tr>
							<th class="dmp_th_medium"><%= t('helpers.title')%></th>
							<th class="dmp_th_big"><%= t('helpers.desc')%></th>
						</tr>
					</thead>
					<tbody>
					<%
						details.each do |field|
							value = @exported_plan.send(field)
							if value.present?
					%>
						<tr>
							<th class="dmp_th_border"><p>- <%= t("helpers.plan.export.#{field}") -%></p></th>
							<td class="dmp_td_border"><%= value -%></td>
						</tr>
							<% end %>
						<% end %>
					</tbody>
				</table>
      <% end %>
			<% @exported_plan.sections.each do |section| %>
				<h3><%= section.title %></h3>
				<table class="dmp_table">
					<thead>
					    <tr>
					      	<th class="dmp_th_medium"><%= t('helpers.questions_label')%></th>
					      	<th class="dmp_th_big"><%= t('helpers.answers_label')%></th>
	   					</tr>
   					</thead>
   					<tbody>
						<% questions = @exported_plan.questions_for_section(section.id) %>
						<% questions.each do |question| %>
							<tr>
								<th class="dmp_th_border" >
									<p>- <%= question.text %></p>
								</th>
	        					<td class="dmp_td_border" >	
									<% answer = @plan.answer(question.id, false) %>
									<% if answer.nil? then %>
										<p>Question not answered.</p>
									<% else %>
                                        <% q_format = question.question_format %>
										<% if q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") ||
                                        q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown") then%>
											<ul>
												<% answer.options.each do |option| %>
													<li><%= option.text %></li>
												<% end %>
											</ul>
                                            <% if question.option_comment_display == true then%>
                                                <%= raw answer.text %>
                                            <% end %>
										<%else%>
                                            <%= raw answer.text %>
                                        <%end%>
									<% end %>	
								</td>
							</tr>
						<% end %>
					</tbody>	
				</table>			
			<% end %>
		</div>	
	</div>	
</div>