Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1004 Rev 1005
Línea 590... Línea 590...
590
                objFormGenerator.clear();
590
                objFormGenerator.clear();
591
                objFormGenerator.sections = response['data']['content'] || [];
591
                objFormGenerator.sections = response['data']['content'] || [];
592
                objFormGenerator.render();
592
                objFormGenerator.render();
593
                renderSectionData(objFormGenerator.sections);
593
                renderSectionData(objFormGenerator.sections);
Línea 594... Línea 594...
594
                
594
                
595
                $('#row-forms').hide();
595
                $('#row-lists').hide();
596
                $('#row-edit').show();
596
                $('#row-form').show();
Línea 597... Línea 597...
597
                $('#form-main #form-name').focus();
597
                $('#form-main #form-name').focus();
598
 
598
 
599
            } else {
599
            } else {
Línea 794... Línea 794...
794
                        if (formContinue == 1) {
794
                        if (formContinue == 1) {
795
                            $('#form-main').attr('action',response['action_edit']);
795
                            $('#form-main').attr('action',response['action_edit']);
796
                            $('#form-main #form-id').val(response['id']);
796
                            $('#form-main #form-id').val(response['id']);
797
                            $('#form-main #form-continue').val(0);
797
                            $('#form-main #form-continue').val(0);
798
                        } else {
798
                        } else {
799
                            $('#row-edit').hide();
799
                            $('#row-form').hide();
800
                            $('#row-forms').show();
800
                            $('#row-lists').show();
801
                        /*---------- Reset Form -------- */
801
                        /*---------- Reset Form -------- */
802
                        $('#form-main')[0].reset();
802
                        $('#form-main')[0].reset();
803
                        /*--------Reset Ckeditor ----------*/
803
                        /*--------Reset Ckeditor ----------*/
804
                        CKEDITOR.instances['form-text'].setData('');
804
                        CKEDITOR.instances['form-text'].setData('');
805
                        CKEDITOR.instances['form-description'].setData('');
805
                        CKEDITOR.instances['form-description'].setData('');
Línea 966... Línea 966...
966
    });
966
    });
967
    /**
967
    /**
968
     * Clicked add new section
968
     * Clicked add new section
969
     */
969
     */
970
    $('#btn-add-section').click(function(e) {
970
    $('#btn-add-section').click(function(e) {
971
        console.log(0)
971
        $('#form-section #section-id').val('');
-
 
972
        CKEDITOR.instances['section-text'].setData('');
-
 
973
        $('#form-section #section-type').val($('#form-section #section-type option:first').val());
-
 
974
        $('#form-section #section-max-length').val('0');
-
 
975
        $('#form-section #section-max-length').parent().show();
-
 
976
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
972
        $('#modal-section').modal('show');
977
        $('#modal-section').modal('show');
973
    });
978
    });
974
    /**
979
    /**
975
     * Clicked edit section
980
     * Clicked edit section
976
     */
981
     */
977
    $('body').on('click', 'button.btn-edit-section', function(e) {
982
    $('#btn-edit-section').click(function(e) {
978
        e.preventDefault();
983
        console.log(0)
979
        var slug_section = $(this).data('section');
984
        $('#modal-section').modal('show');
980
        var slug = $(this).data('section');
-
 
981
        var showForm = false;
-
 
982
        
-
 
983
    });
985
    });
984
    /**
986
    /**
985
     * Clicked remove section
987
     * Clicked remove section
986
     */
988
     */
987
    $('body').on('click', 'button.btn-delete-section', function(e) {
989
    $('#btn-delete-section').click(function(e) {
988
        e.preventDefault();
-
 
989
        var slug_section = $(this).data('section');
-
 
990
        var slug = $(this).data('section');
990
        var id = $(this).data('section');
991
        bootbox.confirm({
991
        bootbox.confirm({
992
            title: "LABEL_DELETE LABEL_SECTION",
992
            title: "LABEL_DELETE LABEL_SECTION",
993
            message: "LABEL_SECTION_DELETE",
993
            message: "LABEL_SECTION_DELETE",
994
            buttons: {
994
            buttons: {
995
                cancel: {
995
                cancel: {
Línea 999... Línea 999...
999
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
999
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
1000
                }
1000
                }
1001
            },
1001
            },
1002
            callback: function(result) {
1002
            callback: function(result) {
1003
                if (result) {
1003
                if (result) {
1004
                    objFormGenerator.deletesection(slug_section, slug);
1004
                    objFormGenerator.deletesection(id);
1005
                    renderSectionData(objFormGenerator.sections);
1005
                    renderSectionData(objFormGenerator.sections);
1006
                }
1006
                }
1007
            }
1007
            }
1008
        });
1008
        });
1009
    });
1009
    });
Línea 1140... Línea 1140...
1140
        clearSectionData();
1140
        clearSectionData();
1141
        $('#form-main').attr('action', '$routeAdd');
1141
        $('#form-main').attr('action', '$routeAdd');
1142
        $('#form-main #form-id').val('0');
1142
        $('#form-main #form-id').val('0');
1143
        $('#form-main #form-continue').val('0');
1143
        $('#form-main #form-continue').val('0');
1144
        $('#form-main #form-name').val('');
1144
        $('#form-main #form-name').val('');
1145
        $('#row-forms').hide();
1145
        $('#row-lists').hide();
1146
        $('#row-edit').show();
1146
        $('#row-form').show();
1147
        $('#form-main #form-name').focus();
1147
        $('#form-main #form-name').focus();
1148
    });
1148
    });
1149
    /**
1149
    /**
1150
     * Clicked cancel new/edit Form
1150
     * Clicked cancel new/edit Form
1151
     */
1151
     */
1152
    $('button.btn-edit-cancel').click(function(e) {
1152
    $('button.btn-edit-cancel').click(function(e) {
1153
        e.preventDefault();
1153
        e.preventDefault();
1154
        $('#row-edit').hide();
1154
        $('#row-form').hide();
1155
        $('#row-forms').show();
1155
        $('#row-lists').show();
1156
    });
1156
    });
1157
    /**
1157
    /**
1158
     * Clicked save and continue new Form
1158
     * Clicked save and continue new Form
1159
     */
1159
     */
1160
    $('button.btn-form-save-continue').click(function(e) {
1160
    $('button.btn-form-save-continue').click(function(e) {
Línea 1206... Línea 1206...
1206
        </div>
1206
        </div>
1207
    </div>
1207
    </div>
1208
    <!-- /.container-fluid -->
1208
    <!-- /.container-fluid -->
1209
</section>
1209
</section>
1210
<section class="content">
1210
<section class="content">
1211
    <div class="container-fluid" id="row-forms">
1211
    <div class="container-fluid" id="row-lists">
1212
        <div class="row">
1212
        <div class="row">
1213
            <div class="col-12">
1213
            <div class="col-12">
1214
                <div class="card">
1214
                <div class="card">
1215
                    <div class="card-body">
1215
                    <div class="card-body">
1216
                        <table id="gridTable" class="table   table-hover">
1216
                        <table id="gridTable" class="table   table-hover">
Línea 1238... Línea 1238...
1238
        </div>
1238
        </div>
1239
    </div>
1239
    </div>
Línea 1240... Línea 1240...
1240
 
1240
 
Línea 1241... Línea 1241...
1241
    <!-- Create/Edit Form -->
1241
    <!-- Create/Edit Form -->
1242
 
1242
 
1243
    <div class="row" id="row-edit" style="display: none">
1243
    <div class="row" id="row-form" style="display: none">
1244
        <div class="col-xs-12 col-md-12">
1244
        <div class="col-xs-12 col-md-12">
1245
            <form action="#" name="form-main" id="form-main">
1245
            <form action="#" name="form-main" id="form-main">
1246
                <input type="hidden" name="form-id" id="form-id" value="0" />
1246
                <input type="hidden" name="form-id" id="form-id" value="0" />
Línea 1269... Línea 1269...
1269
        </div>
1269
        </div>
1270
    </div>
1270
    </div>
Línea 1271... Línea 1271...
1271
 
1271
 
Línea 1272... Línea -...
1272
    <!-- Create/Edit Form-->
-
 
1273
 
-
 
1274
  
1272
    <!-- Create/Edit Form-->
Línea 1275... Línea 1273...
1275
 
1273
 
1276
    <!-- section Modal -->
1274
     <!-- section Modal -->
-
 
1275
 
-
 
1276
    <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
-
 
1277
        <div class="modal-dialog modal-lg" role="document">
-
 
1278
            <form action="#" name="form-section" id="form-section">
-
 
1279
                <input type="hidden" name="section-id" id="section-id" />
-
 
1280
                <div class="modal-content">
-
 
1281
                    <div class="modal-header">
-
 
1282
                        <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
-
 
1283
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
1284
                            <span aria-hidden="true">&times;</span>
-
 
1285
                        </button>
-
 
1286
                    </div>
-
 
1287
                    <div class="modal-body">
-
 
1288
                        <div class="form-group">
-
 
1289
                            <label for="section-text">LABEL_TEXT</label>
-
 
1290
                            <!--  ckeditor -->
-
 
1291
                            <textarea  name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
-
 
1292
                        </div>
-
 
1293
                        <div class="form-group">
-
 
1294
                            <label for="section-type">LABEL_TYPE</label>
-
 
1295
                            <select name="section-type" id="section-type" class="form-control">
-
 
1296
                                <option value="open">LABEL_OPEN</option>
-
 
1297
                                <option value="simple">Simple</option>
-
 
1298
                                <option value="multiple">Multiple</option>
-
 
1299
                            </select>
-
 
1300
                        </div>
-
 
1301
                        <div class="form-group">
-
 
1302
                            <label for="section-max-length">LABEL_MAXLENGTH</label>
-
 
1303
                            <input type="text" name="section-max-length" id="section-max-length"  class="form-control" />
-
 
1304
                        </div>
-
 
1305
                    </div>
-
 
1306
                    <div class="modal-footer">
-
 
1307
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
1308
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
1309
                    </div>
-
 
1310
                </div>
-
 
1311
            </form>
-
 
1312
        </div>
-
 
1313
    </div>
-
 
1314
 
1277
 
1315
    <!-- End Modal section -->
-
 
1316
 
-
 
1317
    <!-- Modal Options -->
-
 
1318
 
-
 
1319
    <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
-
 
1320
        <div class="modal-dialog modal-lg" role="document">
-
 
1321
            <form action="#" name="form-option" id="form-option">
-
 
1322
                <input type="hidden" name="option-section" id="option-section" value="" />
-
 
1323
                <input type="hidden" name="option-section" id="option-section" value="" />
-
 
1324
                <input type="hidden" name="option-slug" id="option-slug" value="" />
-
 
1325
                <div class="modal-content">
-
 
1326
                    <div class="modal-header">
-
 
1327
                        <h4 class="modal-title">LABEL_OPTION</h4>
-
 
1328
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
1329
                            <span aria-hidden="true">&times;</span>
-
 
1330
                        </button>
-
 
1331
                    </div>
-
 
1332
                    <div class="modal-body">
-
 
1333
                        <div class="form-group">
-
 
1334
                            <label for="option-text">LABEL_TEXT</label>
-
 
1335
                            <!--  ckeditor -->
-
 
1336
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
-
 
1337
                        </div>
-
 
1338
                    </div>
-
 
1339
                    <div class="modal-footer">
-
 
1340
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
1341
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1278
    <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
1342
                    </div>
1279
        <div class="modal-dialog modal-lg" role="document">
1343
                </div>
Línea -... Línea 1344...
-
 
1344
            </form>
-
 
1345
        </div>
Línea 1280... Línea 1346...
1280
           
1346
    </div>
1281
        </div>
1347