Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 410 | Rev 412 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 410 Rev 411
Línea 312... Línea 312...
312
    $('body').on('click', 'button.btn-add-status', function(e) {
312
    $('body').on('click', 'button.btn-add-status', function(e) {
313
        e.preventDefault();
313
        e.preventDefault();
314
        objFormGenerator.editQuestion(
314
        objFormGenerator.editQuestion(
315
            $(this).data('section'),
315
            $(this).data('section'),
316
            $(this).data('question'),
316
            $(this).data('question'),
-
 
317
 
317
            true
318
            true
318
        );
319
        );
319
        renderSectionData(objFormGenerator.sections);
320
        renderSectionData(objFormGenerator.sections);
320
    });
321
    });
321
    /**
322
    /**
322
     * Clicked edit question
323
     * Clicked edit question
323
     */
324
     */
324
    $('body').on('click', 'button.btn-remove-status', function(e) {
325
    $('body').on('click', 'button.btn-edit-review', function(e) {
325
        e.preventDefault();
326
        e.preventDefault();
-
 
327
 
326
        objFormGenerator.editQuestion(
328
        e.preventDefault();
327
            $(this).data('section'),
329
        var slug_section = $(this).data('section');
328
            $(this).data('question'),
330
        var slug = $(this).data('question');
-
 
331
        var showForm = false;
-
 
332
        for (i = 0; i < objFormGenerator.sections.length; i++) {
-
 
333
            if (slug_section == objFormGenerator.sections[i].slug_section) {
-
 
334
                for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
-
 
335
                    if (slug == objFormGenerator.sections[i].questions[j].slug_question) {
-
 
336
 
-
 
337
                        if(objFormGenerator.sections[i].questions[j].status) {
-
 
338
                            $('#form-review #question-status').val('1');
-
 
339
                        } else {
-
 
340
                            $('#form-review #question-status').val('0');
-
 
341
  
-
 
342
                        }
-
 
343
                        if(objFormGenerator.sections[i].questions[j].comment) {
-
 
344
                            $('#form-review #question-comment').val('1');
-
 
345
                        }
-
 
346
                        showForm = true;
-
 
347
                        break;
-
 
348
                    }
329
            false
349
                }
-
 
350
                break;
-
 
351
            }
330
        );
352
        }
-
 
353
        if (showForm) {
331
        renderSectionData(objFormGenerator.sections);
354
            $('#modal-review').modal('show');
-
 
355
        }
-
 
356
       
332
    });
357
    });
333
    /**
358
    /**
334
     * Clicked on edit form
359
     * Clicked on edit form
335
     */
360
     */
336
    $('body').on('click', 'button.btn-edit-form', function(e) {
361
    $('body').on('click', 'button.btn-edit-form', function(e) {
Línea 528... Línea 553...
528
            </form>
553
            </form>
529
        </div>
554
        </div>
530
    </div>
555
    </div>
531
    <!-- Create/Edit Form-->
556
    <!-- Create/Edit Form-->
Línea -... Línea 557...
-
 
557
 
-
 
558
 
-
 
559
    <div  id="modal-review" class="modal" tabindex="-1" role="dialog">
-
 
560
        <div class="modal-dialog modal-lg" role="document">
-
 
561
            <form action="#" name="form-option" id="form-review">
-
 
562
                <input type="hidden" name="question-section" id="question-section" value="" />
-
 
563
                <input type="hidden" name="question-question" id="question-question" value="" />
-
 
564
                <div class="modal-content">
-
 
565
                    <div class="modal-header">
-
 
566
                        <h4 class="modal-title">LABEL_EDIT LABEL_REVIEW</h4>
-
 
567
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
568
                            <span aria-hidden="true">&times;</span>
-
 
569
                        </button>
-
 
570
                    </div>
-
 
571
                    <div class="modal-body">
-
 
572
                        <div class="form-group">
-
 
573
                            <label for="option-text">LABEL_TEXT</label>
-
 
574
                            <!--  ckeditor -->
-
 
575
                            <textarea  name="question-comment" id="question-comment" rows="5" class="form-control"></textarea>
-
 
576
                        </div>
-
 
577
                        <div class="form-group">
-
 
578
                            <label for="question-status">LABEL_ANSWER_CORRECT</label>
-
 
579
                            <select name="question-status" id="question-status" class="form-control">
-
 
580
                                <option value="1">LABEL_YES</option>
-
 
581
                                <option value="0">LABEL_NOT</option>
-
 
582
                            </select>
-
 
583
                        </div>
-
 
584
    
-
 
585
                    </div>
-
 
586
                    <div class="modal-footer">
-
 
587
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
588
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
589
                    </div>
-
 
590
                </div>
-
 
591
            </form>
-
 
592
        </div>
-
 
593
    </div>
532
 
594
 
533
    <!---Template Sections --->
595
    <!---Template Sections --->
534
    <script id="sectionTemplate" type="text/x-jsrender">
596
    <script id="sectionTemplate" type="text/x-jsrender">
535
        <div class="panel panel-default" id="panel-{{:slug_section}}">
597
        <div class="panel panel-default" id="panel-{{:slug_section}}">
536
   <div class="panel-heading">
598
   <div class="panel-heading">
Línea 575... Línea 637...
575
                        
637
                        
576
                     </td>
638
                     </td>
577
                     <td>
639
                     <td>
Línea 578... Línea -...
578
                        {{if type != 'simple'  && type !='multiple' }}
-
 
-
 
640
                        {{if type != 'simple'  && type !='multiple' }}
579
                       
641
                       
580
                        {{if status}} 
642
                    
581
                        <button class="btn btn-danger btn-remove-status"  data-section="{{:slug_section}}" data-question="{{:slug_question}}">
643
                        <button class="btn btn-danger btn-edit-review"  data-section="{{:slug_section}}" data-question="{{:slug_question}}">
582
                        <i class="fa fa-times" aria-hidden="true"></i> LABEL_TO_CHECK LABEL_FAIL
-
 
583
                        </button> 
-
 
584
                        {{else}}
-
 
585
                        <button class="btn btn-success btn-add-status" data-section="{{:slug_section}}" data-question="{{:slug_question}}" >
-
 
586
                        <i class="fa fa-check" aria-hidden="true"></i> LABEL_TO_CHECK LABEL_CORRECT
-
 
587
                        </button> 
644
                        <i class="fa fa-times" aria-hidden="true"></i> LABEL_EDIT LABEL_REVIEW
588
                        {{/if}}
-
 
-
 
645
                        </button> 
589
 
646
                        
590
                        {{/if}}
647
                        
591
                     </td>
648
                     </td>
592
                  </tr>
649
                  </tr>
593
               </tbody>
650
               </tbody>