[opw-web] Allow previous mentors to sign up again immediately
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [opw-web] Allow previous mentors to sign up again immediately
- Date: Mon, 22 Sep 2014 14:07:25 +0000 (UTC)
commit f22f2202a92e128649c416b983443f3f66c3cb03
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Sep 22 10:00:29 2014 -0400
Allow previous mentors to sign up again immediately
If someone was a mentor on a previous program, show 'Will mentor again'
on the front page instead of 'Apply as mentor', and approve them
immediately.
lang/en-gb.php | 1 +
modules/mod_program_home.php | 6 ++++++
modules/mod_view_projects.php | 5 +++++
skins/easterngreen/html/tpl_program_home.html | 2 +-
4 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lang/en-gb.php b/lang/en-gb.php
index c16ff44..7053c05 100644
--- a/lang/en-gb.php
+++ b/lang/en-gb.php
@@ -131,6 +131,7 @@ $lang_data = array(
'program_started' => 'This program isn\'t accepting new participants',
'apply_student' => 'Apply to participate',
'apply_mentor' => 'Apply to mentor',
+ 'will_mentor_again' => 'Will mentor again',
'home' => 'Home',
'my_profile' => 'My profile',
'view_submissions' => 'View my submissions',
diff --git a/modules/mod_program_home.php b/modules/mod_program_home.php
index 2853f5d..b068c25 100644
--- a/modules/mod_program_home.php
+++ b/modules/mod_program_home.php
@@ -88,6 +88,11 @@ if ($program_data != null)
$role_message = '';
}
+ if ($project_permissions->can_apply_mentor && $user->isMentorAnyProgram())
+ $apply_mentor_message = $lang->get('will_mentor_again');
+ else
+ $apply_mentor_message = $lang->get('apply_mentor');
+
// Assign screen data for the program
$skin->assign(array(
'program_id' => $program_data['id'],
@@ -108,6 +113,7 @@ if ($program_data != null)
'prg_mentor_visibility' => $skin->visibility($role == 'm'),
'apply_student_visibility' => $skin->visibility($project_permissions->can_apply_student),
'apply_mentor_visibility' => $skin->visibility($project_permissions->can_apply_mentor),
+ 'apply_mentor_message' => $apply_mentor_message,
'dl_student_visibility' => $skin->visibility($show_student),
'late_submission_visibility' => $skin->visibility($late_submission),
'dl_mentor_visibility' => $skin->visibility($show_mentor),
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index 97aadd2..1226486 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -932,6 +932,11 @@ else if ($action == 'apply')
$user->restrict(($new_role == 's' && $project_permissions->can_apply_student) ||
($new_role == 'i' && $project_permissions->can_apply_mentor));
+ // previous mentors can directly sign up to be a mentor for a new program
+ if ($new_role == 'i' && $user->isMentorAnyProgram()) {
+ $new_role = 'm';
+ }
+
$params['role'] = $new_role;
// Insert the new role
diff --git a/skins/easterngreen/html/tpl_program_home.html b/skins/easterngreen/html/tpl_program_home.html
index e34d986..e7298f2 100644
--- a/skins/easterngreen/html/tpl_program_home.html
+++ b/skins/easterngreen/html/tpl_program_home.html
@@ -83,7 +83,7 @@
<a href="#" onclick="submitForm(event,
'?q=view_projects&prg=[[program_id]]&a=apply&c=mentor')"
class="btn btn-large [[apply_mentor_visibility]]">
<img src="[[skin_path]]/images/mentor-project.png" width="26" height="26" alt="" />
- {{apply_mentor}}
+ [[apply_mentor_message]]
</a>
</div>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]