| @@ -42,15 +42,17 @@ app.state.GroupTermsConditions = function() | |||
| $content.find( '[data-id="checkbox-terms-conditions-accept"]' ).first().change( function() | |||
| { | |||
| let accepted = $content.find( '[data-id="checkbox-terms-conditions-accept"]' ).find('[data-id="checkbox-terms-conditions-accept"]').first().is(":checked"); | |||
| console.log(accepted); | |||
| let accepted = $content.find( '[data-id="checkbox-terms-conditions-accept"]' ).first().is(":checked"); | |||
| app.core.Rpc.call( | |||
| 'Profile', | |||
| 'acceptTerms', | |||
| { groupId: groupId, termsAccepted: accepted }, | |||
| function( res ) | |||
| { | |||
| app.core.View.toastSuccess( _lc( accepted ? 'GROUP_TERMS_ACCEPTED' : 'GROUP_TERMS_NOT_ACCEPTED' ) ); | |||
| let msg = _lc( accepted ? 'GROUP_TERMS_ACCEPTED' : 'GROUP_TERMS_NOT_ACCEPTED'); | |||
| $content.find( '[data-id="terms-accepted-note"]' ).first().text("(" + msg + ")"); | |||
| app.core.View.toastSuccess( msg ); | |||
| }, | |||
| function ( res ){ | |||
| app.core.View.toastError( _lc( 'GENERAL_SERVER_ERROR' ) ); | |||
| @@ -256,7 +256,6 @@ app.state.Home = function() | |||
| if (userGroups[ ui ].getTermsConditionsActive() && !groupData.terms_accepted) { | |||
| groupsTermsNotAccepted.push(userGroups[ ui ]); | |||
| } | |||
| console.log(groupsTermsNotAccepted); | |||
| gcgIds = userGroups[ ui ].getCourseCategories(); | |||
| for ( var gci = 0; gci < gcgIds.length; gci++ ) | |||
| @@ -672,7 +671,6 @@ app.state.Home = function() | |||
| $modalRoot.on( 'click', '[data-type="rsvp-button-accept"]', function() | |||
| { | |||
| callSetAttendanceStatus( appId, "accepted", $(this).attr( 'data-child-profile-id' ) ); | |||
| console.log('accept'); | |||
| //app.core.View.closeModal(); | |||
| //renderAppointmentItem( appointment ); | |||
| }); | |||
| @@ -680,7 +678,6 @@ app.state.Home = function() | |||
| $modalRoot.on( 'click', '[data-type="rsvp-button-recall"]', function() | |||
| { | |||
| callSetAttendanceStatus( appId, "declined", $(this).attr( 'data-child-profile-id' ) ); | |||
| console.log('decline'); | |||
| //app.core.View.closeModal(); | |||
| //renderAppointmentItem( appointment ); | |||
| }); | |||
| @@ -689,13 +686,11 @@ app.state.Home = function() | |||
| { | |||
| const $modalRoot = app.core.View.getModalContent(); | |||
| $modalRoot.off( 'click', '[data-type="rsvp-button-accept"]' ); | |||
| console.log('onHide - 685'); | |||
| renderAppointmentItem( getAppointment(appId) ); | |||
| }, | |||
| 'onConfirm' : function() | |||
| { | |||
| app.core.View.closeModal(); | |||
| console.log('onConfirm - 690'); | |||
| } | |||
| } | |||
| ); | |||
| @@ -1,4 +1,5 @@ | |||
| <%=raw app.core.View.getTemplate( 'group-nav', { activeTab : 'terms', group : group, currentProfile : currentProfile } ) %> | |||
| <% var termsAccepted = currentProfile.getGroupData(group.getId()).terms_accepted == 1; %> | |||
| <div class="row"> | |||
| <div class="col-sm-12"> | |||
| <div class="card"> | |||
| @@ -14,26 +15,43 @@ | |||
| </div> | |||
| </div> | |||
| <div class="card-body"> | |||
| <p> | |||
| <strong><%= _lc( 'GROUP_TERMS_DESCRIPTION' ) %></strong> | |||
| </p> | |||
| <textarea maxlength="4096" | |||
| rows="5" | |||
| class="form-control" | |||
| disabled | |||
| placeholder="<%= _lc( 'TEAM_DETAIL_TEAM_TERMS_PLACEHOLDER' ) %>"><%= group.getTermsConditions() ? group.getTermsConditions() : '' %></textarea> | |||
| <% if ( group.getTermsConditionsActive() ) { %> | |||
| <input type="checkbox" | |||
| name="checkbox-terms-conditions-accept" | |||
| data-id="checkbox-terms-conditions-accept" | |||
| id="checkbox-terms-conditions-accept" | |||
| class="custom-control-input" | |||
| > | |||
| <% } %> | |||
| <label class="custom-control-label" | |||
| for="checkbox-terms-conditions-accept"><%= _lc( 'GROUP_TERMS_ACTIVE' ) %></label> | |||
| <p> | |||
| <small><%= _lc( 'GROUP_TERMS_ACTIVE_DESCRIPTION' ) %></small> | |||
| <div class="form-group"> | |||
| <p> | |||
| <strong><%= _lc( 'GROUP_TERMS_DESCRIPTION' ) %></strong> | |||
| </p> | |||
| <textarea maxlength="4096" | |||
| rows="5" | |||
| class="form-control" | |||
| disabled | |||
| placeholder="<%= _lc( 'TEAM_DETAIL_TEAM_TERMS_PLACEHOLDER' ) %>"><%= group.getTermsConditions() ? group.getTermsConditions() : '' %></textarea> | |||
| <% if ( group.getTermsConditionsActive() ) { %> | |||
| <div class="form-group"> | |||
| <div class="custom-control custom-checkbox my-1 mr-sm-2"> | |||
| <input type="checkbox" | |||
| name="checkbox-terms-conditions-accept" | |||
| data-id="checkbox-terms-conditions-accept" | |||
| id="checkbox-terms-conditions-accept" | |||
| class="custom-control-input" | |||
| <%= termsAccepted ? 'checked' : '' %> | |||
| > | |||
| <label class="custom-control-label" | |||
| for="checkbox-terms-conditions-accept"><%= _lc( 'GROUP_TERMS_ACCEPT' ) %> | |||
| <span data-id="terms-accepted-note"> | |||
| <% if (termsAccepted) { %> | |||
| (<%= _lc( 'GROUP_TERMS_ACCEPTED' ) %>) | |||
| <% } else { %> | |||
| (<%= _lc( 'GROUP_TERMS_NOT_ACCEPTED' ) %>) | |||
| <% } %> | |||
| </span> | |||
| %> | |||
| </label> | |||
| <p> | |||
| <small><%= _lc( 'GROUP_TERMS_ACTIVE_DESCRIPTION' ) %></small> | |||
| </div> | |||
| </div> | |||
| <% } %> | |||
| </div> | |||
| </div> | |||
| <div class="card-footer"> | |||
| </div> | |||