Newer
Older
dmpopidor / app / views / plans / _answer_form_ro.html.erb
<!-- 
**Project: DMPRoadmap
**Description: This block sets up the type of question, its guidance.
**Arguments transferred: an instance of "question"
**Copyright: Digital Curation Centre and University of California Curation Center
-->
<% answer = @plan.answer(question.id) %>

<div class="question-div">
  <!--question format-->
  <% q_format = question.question_format%>

  <div id="question-readonly-<%= question.id %>" class="question-readonly">
		<h4><%= question.text %></h4>
		
		<div class="answer-readonly">
			<% if q_format.title == "Check box" || q_format.title == "Multi select box" ||
						q_format.title == "Radio buttons" || q_format.title == "Dropdown" %>
				<ul class="options">
					<% if answer.question_options.is_a? Array then %>
						<li><%= answer.question_options.text %></li>
					<% else %>
						<% answer.question_options.each do |o| %>
							<li><%= o.text %></li>
						<% end %>
					<% end %>
				</ul>
			<% end %>
                
			<div class="answer-text-readonly">
				<%= raw answer.text %>
			</div>
		</div>
	</div>

	<% if answer.created_at.nil? then %>
		<span id="<%= question.id %>-status" class="label label-warning answer-status"><%= _('Not answered yet') %></span>
	<% else %>
		<span id="<%= question.id %>-status" class="label label-info answer-status"><%= _('Answered')%><abbr class="timeago" data-time="<%= answer.created_at.iso8601 %>" title="<%= answer.created_at.iso8601 %>"><%= answer.created_at %></abbr><%= _(' by')%><%= answer.user.name %></span>
	<% end %>

	<span id="<%= question.id %>-unsaved" class="label label-inverse answer-unsaved" style="display:none;"><%= _('Unsaved changes') %></span>

</div>

<!--display or not the break line between questions-->
<% if last_question_id == question.id then %>
  <div class="two-column-clear"></div>
<% else %>
  <div class="two-column-clear question-divider"></div>
<% end %>