aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-12 18:47:01 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-29 19:49:13 +0200
commit84c29dd7f3fc64ea491f0342476f7bc31a20171f (patch)
tree6bd86e4dac5bc216de46c5e18569de8deeaf012d /app/views/taglibs
parentAllow project leads to add Project Acceptances easily (diff)
downloadrecruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.tar.gz
recruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.tar.bz2
recruiting-webapp-84c29dd7f3fc64ea491f0342476f7bc31a20171f.zip
Email questions
Also make sure users can answer questions with multiple and text content and can't answer email questions within application. Added "Gentoo-dev-announce posting" question to seed
Diffstat (limited to 'app/views/taglibs')
-rw-r--r--app/views/taglibs/detailed.dryml20
-rw-r--r--app/views/taglibs/forms.dryml12
-rw-r--r--app/views/taglibs/views.dryml22
3 files changed, 54 insertions, 0 deletions
diff --git a/app/views/taglibs/detailed.dryml b/app/views/taglibs/detailed.dryml
index f7df48e..ceb8dc9 100644
--- a/app/views/taglibs/detailed.dryml
+++ b/app/views/taglibs/detailed.dryml
@@ -50,3 +50,23 @@
</answer:>
</detailed>
</def>
+
+<def tag="detailed" for="EmailAnswer">
+ <h2>
+ Answer of
+ <with:owner><name/></with>
+ for question
+ "<with:question><name/></with>
+ <a action="edit" if="&can_edit?">(Edit)</a>
+ </h2>
+ <h5>Question:</h5>
+ <with:question><view:content/></with>
+
+ <h5>Answer:</h5>
+ <if:correct>
+ You sent proper email.
+ </if>
+ <else>
+ Email you sent didn't match requirements.
+ </else>
+</def>
diff --git a/app/views/taglibs/forms.dryml b/app/views/taglibs/forms.dryml
index eddfc0f..013f84c 100644
--- a/app/views/taglibs/forms.dryml
+++ b/app/views/taglibs/forms.dryml
@@ -37,3 +37,15 @@
</div>
</form>
</def>
+
+<def tag="form" for="QuestionContentEmail">
+ <form merge param="default">
+ <error-messages param/>
+ <field-list fields="description, req_text" param>
+ <req_text-label:>Requirements</req_text-label:>
+ </field-list>
+ <div param="actions">
+ <submit label="#{ht 'question_content_emails.actions.save', :default=>['Save']}" param/><or-cancel param="cancel"/>
+ </div>
+ </form>
+</def>
diff --git a/app/views/taglibs/views.dryml b/app/views/taglibs/views.dryml
index fcbec6d..79bd41d 100644
--- a/app/views/taglibs/views.dryml
+++ b/app/views/taglibs/views.dryml
@@ -19,3 +19,25 @@
<%raise HoboError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}" unless can_view?%>
<input disabled/>
</def>
+
+<def tag="view" for="QuestionContentEmail">
+ <%=
+ if this.viewable_by?(current_user, :req_text)
+ "#{h(this.req_text).sub("\n", "<br/>\n")}<br/>"
+ else
+ raise HoboError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}"
+ end
+ %>
+
+ <%=
+ if this.viewable_by?(current_user, :description)
+ "#{this.description.to_html}"
+ else
+ raise HoboError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}"
+ end
+ %>
+
+ <if test="&current_user.signed_up?">
+ Your answer should have subject (without quotes) "<%= "#{this.question.id}-#{current_user.try.token}" %>".
+ </if>
+</def>