#3588 Add a button to show the inactive milestones
Merged 2 years ago by pingou. Opened 2 years ago by pingou.

@@ -1389,6 +1389,13 @@ 

        var _a = form.find('input[name=active_milestone_' + idx + ']');

        $(_a).attr('name', 'active_milestone_' + (idx + 1 ));

        $(_a).prop('checked', true);

+   } else if (tgt == '#milestones_show'){

+     var _el = $('.milestone_inactive')

+     if (_el.css('display') == 'none'){

+       _el.css('display', 'flex');

+     } else {

+      _el.hide();

+     }

    }

    $(tgt).append(form);

  });

@@ -51,19 +51,25 @@ 

                  </div>

                  <div class="col-sm-1 p-r-0" >

                      <input type="checkbox" name="active_milestone_{{ loop.index

-                     }}"{% if not milestone or repo.milestones[milestone]['active']

+                     }}"{% if milestone and repo.milestones[milestone]['active']

                      %} checked{% endif %} />

                  </div>

                </div>

            {% endfor %}

            </div>

            <div class="row p-t-1">

-             <div class="col-sm-12">

+             <div class="col-sm-6">

                <a href="javascript:void(0)" class="btn btn-outline-primary btn-sm btn-block extend-form mt-1"

                  data-target="#milestones">

                    <i class="fa fa-plus"></i> Add new milestone

                </a>

              </div>

+             <div class="col-sm-6">

+               <a href="javascript:void(0)" class="btn btn-outline-primary btn-sm btn-block extend-form mt-1"

+                 data-target="#milestones_show">

+                   <i class="fa fa-repeat"></i> Show all milestones

+               </a>

+             </div>

            </div>

            <div class="row p-t-1">

              <div class="col-sm-12">

@@ -1449,7 +1449,7 @@ 

                          data-stone="1"></span>

                  </div>

                  <div class="col-sm-1 p-r-0" >

-                     <input type="checkbox" name="active_milestone_1" checked />

+                     <input type="checkbox" name="active_milestone_1" />

                  </div>

                </div>''', output_text)

  

@@ -84,7 +84,7 @@ 

                          data-stone="1"></span>

                  </div>

                  <div class="col-sm-1 p-r-0" >

-                     <input type="checkbox" name="active_milestone_1" checked />

+                     <input type="checkbox" name="active_milestone_1" />

                  </div>

                </div>''', output.get_data(as_text=True))