<!-- builds the notes box, it receives a question id and a object plan-->
<!-- if there are notes then list of notes and view last note
else display display add note form -->
<% @notes = Note.where("question_id = ? AND plan_id = ?", questionId, plan_id) %>
<%= hidden_field_tag :question_id, questionId, :class => "question_id" %>
<% if @notes.count > 0 then%>
<!-- add note -->
<div id="add_comment_button_top_div_<%= questionId%>" class="move_2_right" >
<%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %>
</div>
<div class="div_clear">
</div>
<!-- list of notes, view and edit a note -->
<%= render :partial => "list_notes", locals: {notes: @notes}%>
<div class="div_clear">
</div>
<!-- add a note button -->
<div id="add_comment_button_bottom_div_<%= questionId%>" class="move_2_right">
<%= link_to t("helpers.comments.add_comment_label"),'#', :class => "btn btn-primary add_comment_button" %>
</div>
<div class="div_clear">
</div>
<!-- add a note block -->
<div id="add_comment_block_div_<%= questionId%>" style="display: none">
<%= render :partial => "add_note", locals: {questionId: questionId, planId: plan_id}%>
</div>
<% else%>
<%= t("helpers.comments.add_comment_text")%>
<%= render :partial => "add_note", locals: {questionId: questionId, planId: plan_id}%>
<% end%>