doortts doortts 2017-01-12
project-info: Remove project label feature
It is easy to make bugs and (IMHO)
it is not so useful in these days.

So I thought it would be better to remove that feature.

See:
Yona Github issues #122 #93
@133a42e60a03ac0634b236bc3e2f4528a6e890fb
app/views/project/home.scala.html
--- app/views/project/home.scala.html
+++ app/views/project/home.scala.html
@@ -137,47 +137,6 @@
                             }
                         }
                     }
-
-                    <div class="inner project-info">
-                        <header>
-                            <h3>@Messages("project.info")</h3>
-                            @if(isAllowed(UserApp.currentUser(), project.labelsAsResource(), Operation.UPDATE)){
-                            <button type="button" class="ybtn ybtn-minimum" data-toggle="button" id="label-editor-toggle"><i class="yobicon-edit"></i> @Messages("button.edit")</button>
-                            }
-                        </header>
-                        <ul class="infos" id="label-board">
-                            <!-- labels are added here by yobi.project.Home.js -->
-                        </ul>
-
-                        <script id="label-delete-button-template" type="text/x-jquery-tmpl">
-                            <a href="javascript:void(0)">&times;</a>
-                        </script>
-
-                        <script id="label-template" type="text/x-jquery-tmpl">
-                            <span class="label">${name}</span>
-                        </script>
-
-                        <script id="category-template" type="text/x-jquery-tmpl">
-                            <li class="info" data-category="${category}">
-                                <strong>${category} : </strong>
-                                <span class="label-list"></span>
-                            </li>
-                        </script>
-
-                        <script id="plus-button-template" type="text/x-jquery-tmpl">
-                            <button class="ybtn ybtn-minimum">
-                                <i class="yobicon-plus"></i>
-                            </button>
-                        </script>
-
-                        <script id="label-input-template" type="text/x-jquery-tmpl">
-                            <input type="text" autocomplete="off" class="text" style="margin-bottom: 0px;">
-                        </script>
-
-                        <script id="label-submit-template" type="text/x-jquery-tmpl">
-                            <button type="button" class="ybtn ybtn-mini">@Messages("button.add")</button>
-                        </script>
-                    </div>
                     <div class="inner member-info">
                         <header>
                             <h3>@Messages("project.members")</h3>
public/javascripts/service/yobi.project.Home.js
--- public/javascripts/service/yobi.project.Home.js
+++ public/javascripts/service/yobi.project.Home.js
@@ -31,7 +31,6 @@
             _initVar(htOpt);
             _initElement(htOptions);
             _attachEvent();
-            _initLabels();
 
 //            _resizeProjectInfo();
         }
@@ -60,50 +59,7 @@
             htElement.welInputCloneURL =$('#cloneURL');
             htElement.welBtnCopy   = $('#cloneURLBtn');
 
-            // project label
-            htElement.welLabelBoard = htOptions.welLabelBoard;
-            htElement.welLabelEditorToggle = htOptions.welLabelEditorToggle;
-
-            htElement.welInputCategory = $('#label-input-template').tmpl();
-            htElement.welSubmitCategory = $('#label-submit-template').tmpl();
-            htElement.welInputCategory.attr('placeholder', Messages('label.addNewCategory'));
-            htElement.welInputCategory.keypress(_onKeyPressNewCategory);
-            htElement.welSubmitCategory.click(_onClickNewCategory);
-
-            htElement.welInputLabel = $('#label-input-template').tmpl();
-            htElement.welSubmitLabel = $('#label-submit-template').tmpl();
-            htElement.welInputLabel.keypress(_onKeyPressNewLabel);
-            htElement.welInputLabel.attr('placeholder', Messages('label.new'));
-            htElement.welSubmitLabel.click(_submitLabel);
-
-            htElement.welInputLabelBox = $('<p>')
-                .append(htElement.welInputLabel)
-                .append(htElement.welSubmitLabel);
-
-            htElement.welInputCategoryBox = $('<p>')
-                .append(htElement.welInputCategory)
-                .append(htElement.welSubmitCategory);
-
-            htElement.welBtnPlusLabel = welBtnPlus.clone();
-            htElement.welBtnPlusCategory = welBtnPlus.clone();
-
-            htElement.aLabel = [];
-            htElement.htCategory = {};
-            htElement.aBtnPlusLabel = [];
-
-            htElement.welNewCategory = $('<li>')
-                .append(htElement.welBtnPlusCategory);
-
-            htElement.welLabelBoard.append(htElement.welNewCategory);
-
             htElement.welAlertLeave = $("#alertLeave");
-
-            /*
-            htElement.welHome = $(".project-home");
-            htElement.welHomeLogo = htElement.welHome.find(".logo");
-            htElement.welHomeInfo = htElement.welHome.find(".project-info");
-            htElement.welHomeMember = htElement.welHome.find(".member-info");
-            */
         }
 
         /**
@@ -111,29 +67,6 @@
          */
         function _attachEvent(){
             htElement.welRepoURL.click(_onClickRepoURL);
-            htElement.welLabelEditorToggle.on('click', function() {
-                if ($(this).hasClass('active')) {
-                    // Now inactive
-                    $(this).removeClass('active');
-                    $(this).text(Messages("button.edit"));
-                    _hideLabelEditor();
-                } else {
-                    // Now active
-                    $(this).addClass('active');
-                    $(this).text(Messages("button.done"));
-                    _showLabelEditor();
-                }
-            });
-
-            new yobi.ui.Typeahead(htElement.welInputCategory, {
-                "sActionURL": htVar.sURLLabelCategories,
-                "htData": {
-                    "project_id": htVar.nProjectId,
-                    "limit": 8
-                }
-            });
-
-            htElement.welBtnPlusCategory.click(_onClickPlusCategory);
 
             htElement.welBtnCopy.zclip({
                 "path": htVar.sURLZeroClipboard,
Add a comment
List