aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-20 18:49:21 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2010-07-27 23:02:45 +0200
commitca22c38bcdf026310185a4b6a3d12fd9df869d94 (patch)
tree8c439d0297aeac751252d6bb9174f4ae177fee3c
parentMade Checklist a regular input (diff)
downloadrecruiting-webapp-ca22c38bcdf026310185a4b6a3d12fd9df869d94.tar.gz
recruiting-webapp-ca22c38bcdf026310185a4b6a3d12fd9df869d94.tar.bz2
recruiting-webapp-ca22c38bcdf026310185a4b6a3d12fd9df869d94.zip
Reorganized homepage (grouped elements relevant for each role together)
And changed them a bit (some rewording, some cleaning code, stopped showing recruit bits to non-recruits).
-rw-r--r--app/views/taglibs/pages.dryml107
-rw-r--r--features/clean_ui.feature2
2 files changed, 61 insertions, 48 deletions
diff --git a/app/views/taglibs/pages.dryml b/app/views/taglibs/pages.dryml
index 4ed22bc..1d2297e 100644
--- a/app/views/taglibs/pages.dryml
+++ b/app/views/taglibs/pages.dryml
@@ -6,55 +6,68 @@
</def>
<def tag="home-page" for="User">
+
<h3>Welcome, <name/>.</h3>
+
<section class="content-body">
- Your current role is: <view:role/>
- <if:administrator>
- and you are administrator
- </if>.<br/>
- <if:question_categories>
- You are currently assigned to categories:
- <collection/>
- View questions:
- <ul>
- <li><a with="&Question" action="answered_questions">You answered.</a></li>
- <li><a with="&Question" action="unanswered_questions">You didn't answer yet but you should.</a></li>
- <li><a href="&user_questions_path(current_user)">All questions you should answer(including answered).</a></li>
- </ul>
- </if>
- <if with="&!this.recruits.empty?">
- Check <a with="&Answer" action="my_recruits">answers</a> of recruits you mentor.
- You also can view answers of the recruits you mentor:
- <collection with="&QuestionCategory.all">
- <a href="/answers/my_recruits_cat/#{this.id}"><name/></a>
- </collection>
- </if>
- <if with="&this.role.is_recruiter?">
- <h3>Registered users:</h3>
- <collection with="&User.all"/>
- </if>
- <if test="&current_user.signed_up?">
- <a with="&current_user">See your profile</a><br/>
- </if>
- <if test="&current_user.try.any_pending_project_acceptances?">
- <a with="&ProjectAcceptance" action="pending_acceptances">Recruits waiting for your acceptance</a>.
- </if>
- <if test="&(User.recruits_answered_all.count > 0) && current_user.try.role.try.is_recruiter?">
- <a with="&User" action="ready_recruits">Recruits that answered all questions</a>.<br/>
- </if>
- <if test="&current_user.try.role.try.is_mentor? && User.mentorless_recruits.count > 0">
- <a with="&User" action="mentorless_recruits">See mentorless recruits</a><br/>
- </if>
- <if test="&current_user.answered_all_multi_choice_questions?">
- <if test="&Answer.wrong_answers_of(current_user.try.id).count > 0">
- You answered all multiple choice questions, but some of them wrong.<br/>
+
+ <section class="users common">
+ Your current role is: <view:role/><if:administrator> and you are administrator</if>,
+ <a with="&current_user">view your profile</a>.<br/>
+ </section>
+
+ <section class="users recruits" if="&this.try.role.try.is_recruit?">
+
+ <if:question_categories>
+ You are currently assigned to categories:
+ <collection/>
+ View questions:
+ <ul>
+ <li><a with="&Question" action="answered_questions">You answered.</a></li>
+ <li><a with="&Question" action="unanswered_questions">You didn't answer yet but you should.</a></li>
+ <li><a href="&user_questions_path(current_user)">All questions you should answer(including answered).</a></li>
+ </ul>
+ </if>
+
+ <if test="&current_user.try.any_pending_project_acceptances?">
+ <a with="&ProjectAcceptance" action="pending_acceptances">Recruits waiting for your acceptance</a>.
+ </if>
+
+ <if test="&current_user.answered_all_multi_choice_questions?">
+ <if test="&Answer.wrong_answers_of(current_user.try.id).count > 0">
+ You answered all multiple choice questions, but some of them wrong.<br/>
+ </if>
+ <else>
+ You answered all multiple choice questions, correctly.<br/>
+ </else>
</if>
- <else>
- You answered all multiple choice questions, correctly.<br/>
- </else>
- </if>
- <if:try.project_acceptances>
- <collection/>
- </if>
+
+ <if:try.project_acceptances> <collection/> </if>
+
+ </section>
+
+ <section class="users mentors" if="&current_user.try.role.try.is_mentor? || current_user.try.role.try.is_recruiter?">
+
+ <a with="&User" action="mentorless_recruits" if="&User.mentorless_recruits.count > 0">See mentorless recruits</a><br/>
+
+ <unless test="&this.try.recruits.try.empty?">
+ Check <a with="&Answer" action="my_recruits">answers</a> of recruits you mentor.
+ You also can view answers of the recruits you mentor in categories:
+ <collection with="&QuestionCategory.all">
+ <a href="/answers/my_recruits_cat/#{this.id}"><name/></a>
+ </collection>
+ </unless>
+
+ </section>
+
+ <section class="users recruiters" if="&this.try.role.try.is_recruiter?">
+ <h3>Registered users:</h3>
+ <collection with="&User.all"/>
+
+ <if test="&User.recruits_answered_all.count > 0">
+ <a with="&User" action="ready_recruits">Recruits that answered all questions</a>.<br/>
+ </if>
+ </section>
+
</section>
</def>
diff --git a/features/clean_ui.feature b/features/clean_ui.feature
index 6136fb2..86928fe 100644
--- a/features/clean_ui.feature
+++ b/features/clean_ui.feature
@@ -6,7 +6,7 @@ Feature: Clean UI
Scenario: Don't show project acceptances edit to recruit editing own profile
Given I am logged in as "recruit"
When I am on the homepage
- And I follow "See your profile"
+ And I follow "view your profile"
And I follow "Edit User"
Then I should not see "Project Acceptances"