Source

main / Source / WebClient / Web.Client / Views / Document / MetadataTab.cshtml

Full commit
Naethra D 3ee1b94 






























































































































































































@model DataUp.Web.Client.ViewModel.DocumentDetailViewModel
@{
    ViewBag.Title = "generate metadata";
}
<script type="text/javascript">
    $(function () {
        $('.dataDefinitionAnchor').click(function () {
            $('.metadataDefinition').css("display", "block");
            $('.paramtrHolder').css("display", "none");
            $('.dataDefinitionAnchor').addClass('active');
            $('.columnDefinitionAnchor').removeClass('active');
        });

        $('.columnDefinitionAnchor').click(function () {
            $('.metadataDefinition').css("display", "none");
            $('.paramtrHolder').css("display", "block");
            $('.dataDefinitionAnchor').removeClass('active');
            $('.columnDefinitionAnchor').addClass('active');
        });

        $('.clearAllMetadata').click(function () {
            $('.metadataText').val('');
        });

        $(".addProBtn").click(function () {
            var elem = $(".paramtrTableContainer tr");
            if (($(elem).length == 1) && ($(elem).is(":visible") == false)) {
                $(".paramtrTableContainer .noParameters").hide();
                var row = $(".paramtrTableContainer tr");
                $(row).find('.entityText').val($(row).find('.entityNameList option:eq(0)').val());
                row.show();
            }
            else {
                $('.paramtrTableContainer tr:last').clone(true).insertAfter('.paramtrTableContainer tr:last');
                var lastAddedRow = $(".paramtrTableContainer tr:last");
                var index = $(".paramtrTableContainer tr").length - 1;
                ClearParameterRow(lastAddedRow, index);
            }
        });

        $('.resetMetadata').click(function () {
            var docId = @Model.DocumentId;
            $.ajax({
                url: "/Document/FetchMetadata",
                data: {id: docId},
                type: "post",
                success: function (json) {
                    dataUp.hideBusy();
                        if (json.Status === true) {
                          ResetDescriptionMetadata(json.data);
                        }
                        else {
                            alert(json.Message);
                        }
                },
                error: function (errorMessage) {
                    alert(errorMessage);
                }
            });
        });

         $('.tTipQ').each(function(i){
            var my_tooltip = $("#helpTooltip");           
            $(this).mouseover(function(){
                    $(this).data("titleDat",$(this).attr("title")); //store title   
                    my_tooltip.html("<p>"+$(this).attr('title')+"</p>");
                    $(this).attr("title",""); 
				    my_tooltip.css({display:"none"}).fadeIn(400);
		    }).mousemove(function(kmouse){
				    my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
		    }).mouseout(function(){
				    my_tooltip.fadeOut(400);
                    $(this).attr("title",$(this).data("titleDat")); 
		    });
        });

        $('.multilineText').keypress(function(e){
            if(this.value.length >= 3000)
                return false;
        });

    });
 
</script>

<div class="screenInfoBox">
   <p>
        Describe your data set in the boxes provided. Get help by clicking on the (?) next
         to each empty field. Some fields are required to proceed.
</p>
</div>
<div class="documentSubTabHolder">
    <ul class="documentSubTab">
        <li><a href="javascript://" class="active dataDefinitionAnchor">Data Description</a></li>
        <li><a href="javascript://" class="columnDefinitionAnchor">Column Description</a></li>
    </ul>
</div>

<div class="docMetadataItmHolder metadataDefinition">
   <div class="metaDataBtnHolder">
        <input type="button" class="clearAllMetadata" value="clear all" />
        <!--<input type="button" class="resetMetadata" value="reset" /> -->
    </div>
     <div class="mandatory paddingTop5px" >
        * required fields</div>
    <div class="metadataScroll">
        @foreach (var metadata in Model.MetadataList)
        {
            int index = Model.MetadataList.IndexOf(metadata);
            if (metadata.IsCompulsory)
            {
            <div class="mandatoryItmBg docMetadataElemHolder">
                <label class="errLabel" title="@metadata.Description">
                    @metadata.Label <span>*</span></label>
                <a class="tTipQ" title="@metadata.Description"></a>
                @Html.HiddenFor(m => m.MetadataList[index].Label)
                @if(metadata.Validationtype == "TextArea")
                {
                  @Html.TextAreaFor(m => m.MetadataList[index].Value, new { @maxlength = 3000, @class = "metadataText multilineText"}) 
                }
                else
                {
                  @Html.TextBoxFor(m => m.MetadataList[index].Value, new { @maxlength = 200, @class = "metadataText" })
                }
                
                @Html.ValidationMessageFor(m => m.MetadataList[index].Value, "", new { @class = "reqFld" })
              
            </div>
            }
            else
            {
            <div class="docMetadataElemHolder">
                <label class="errLabel" title="@metadata.Description">
                    @metadata.Label
                </label>
                <a class="tTipQ" title="@metadata.Description"></a>
                @Html.HiddenFor(m => m.MetadataList[index].Label)
                @Html.TextBoxFor(m => m.MetadataList[index].Value, new { @maxlength = 200, @class = "metadataText" })
            </div>
            }
        }
    </div>
        <div id="requiredField" class="mandatory paddingTop5px" style="display: none">
        * Some mandatory fields are missing. Enter all required fields.
    </div>
    <div id="requiredemailformate" class="mandatory paddingTop5px" style="display: none">
        Email ID is not in correct format. Please correct!</div>
    <div id="requiredPhoneformate" class="mandatory paddingTop5px" style="display: none">
        Kindly specify a valid phone number!</div>
    <div id="requiredDateformate" class="mandatory paddingTop5px" style="display: none">
        Please specify a valid date in the YYYY-MM-DD format!</div>
    <div class='helpTooltip' id='helpTooltip'><p></p></div>
</div>

<div class="paramtrHolder" style="display: none">
     <div class="mandatory paddingTop5px" >
        * required fields</div>
    <div class="docRemovBtnHoldr">
        <a class="addProBtn rFloat">Add Item</a></div>
    <div class="metadataTableContainer">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="paramtrTableHeader">
        <thead>
        <tr>
             <td class="paramtrHdrType">
                Entity Name <span style="color:Red">*</span>
            </td>
               <td class="paramtrHdrDes">
                Entity Description
            </td>
            <td class="paramtrHdrName">
                Name <span style="color:Red">*</span>
            </td>
            <td class="paramtrHdrDes">
                Description
            </td>
            <td class="paramtrHdrType">
                Type
            </td>
            <td class="paramtrHdrUnit">
                Units
            </td>
            <td class="paramtrHdrBtn">
            Delete
            </td>
        </tr>
        </thead>
    </table>
     <div id="parameterDataPartial">
            @{Html.RenderPartial("_ParameterMetadata", Model);}
    </div>
    </div>
</div>