Skip to content

Commit 1edefa1

Browse files
authored
Merge pull request creativecommons#403 from creativecommons/add-reason-vote
Add compatibility to show reason for a No vote
2 parents 0656b8f + 6f567e0 commit 1edefa1

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

plugins/cc-global-network/admin/assets/css/admin_styles.css

+7
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ table.ccgn-profile tr td.title {
207207
}
208208
.applicant-columns .ccgn-box.applicant {
209209
text-align: center;
210+
max-width: 15%;
211+
}
212+
.applicant-columns .ccgn-box.applicant .reason-text {
213+
max-height: 10rem;
214+
overflow: auto;
215+
padding: .5rem;
216+
border: 1px solid #f0f0f0;
210217
}
211218
.applicant-columns .ccgn-box .icon .dashicons {
212219
font-size: 3rem;

plugins/cc-global-network/admin/user-application-page.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,21 @@ function ccgn_application_users_page_vote_responses ( $applicant_id ) {
5353
$votes = ccgn_application_votes ( $applicant_id );
5454
foreach ($votes as $vote) {
5555
$voter = get_user_by('ID', $vote['created_by']);
56+
$reason = $vote[ CCGN_GF_VOTE_APPROVE_MEMBERSHIP_APPLICATION_REASON ];
5657
$result .= '<div class="ccgn-box applicant">';
5758
$result .= '<h4>'. $voter->display_name . '</h4>'
5859
.'<p><strong>Voted:</strong>'
5960
. $vote[
6061
CCGN_GF_VOTE_APPROVE_MEMBERSHIP_APPLICATION
6162
]
6263
. '</p>';
63-
$result .= '</div>';
64+
if ( is_admin() && !empty($reason) ) {
65+
$result .= '<div class="reason">'
66+
. '<strong>Reason:</strong><br />'
67+
. '<p class="reason-text">'.$reason.'</p>'
68+
.'</div>';
69+
}
70+
$result .= '</div>';
6471
}
6572
return $result;
6673
}

plugins/cc-global-network/includes/gravityforms-interaction.php

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
define('CCGN_GF_PRE_APPROVAL_APPLICANT_MUST_UPDATE_DETAILS', '5');
181181

182182
define('CCGN_GF_VOTE_APPROVE_MEMBERSHIP_APPLICATION', '2');
183+
define('CCGN_GF_VOTE_APPROVE_MEMBERSHIP_APPLICATION_REASON', '5');
183184
define('CCGN_GF_VOTE_APPLICANT_ID_PARAMETER', 'applicant_id');
184185
define('CCGN_GF_VOTE_APPLICANT_ID', '4');
185186

0 commit comments

Comments
 (0)