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

@model DataUp.Web.Client.ViewModel.DocumentViewModel
@using DataUp.Web.BizLogic.Model;
@using DataUp.Web.Client.Infrastructure;
@{
    ViewBag.Title = "My Documents";

    string name = Helper.GetLoggedInUserName();
}
@section JavascriptContainer{
    <script src="@Url.Content("~/Scripts/DragAndDrop.js")" type="text/javascript"></script>
}
<script type="text/javascript">
    $(function () {
        $('.postingBtn').live("click", function () {
            var selectedDocumentId = $(this).next().val();
            var fileName = $(this).siblings('.fileName').val();
            var extension = fileName.substr(fileName.lastIndexOf(".")).toLowerCase();
            if (extension === ".csv") {
                $('.xlsHolder').attr("disabled", "disabled");
                $('.xlsHolder').addClass("removeMouseHoverPointer");
            } else {
                $('.xlsHolder').removeAttr('disabled');
                $('.xlsHolder').removeClass("removeMouseHoverPointer");
            }

            $('#documentId').val(selectedDocumentId);
            $('#divPostConfirmationPopup').show();
        });

        $('.csvHolder').click(function () {
            var documentId = $('#documentId').val();
            dataUp.showBusy();
            window.location.href = '/Document/Detail/' + documentId.toString() + '?isPostAsXSL=false';
        });

        $('.xlsHolder').click(function () {
            var documentId = $('#documentId').val();
            var attr = $(this).attr("disabled");
            if (typeof attr !== 'undefined' && attr !== false) {
                return;
            }
            dataUp.showBusy();
            window.location.href = '/Document/Detail/' + documentId.toString() + '?isPostAsXSL=true';
        });
    });
</script>
<section class="mainContainer documentProcess">
    <div class="headingHolder">
        <a href="@Url.Action("UpdateProfile", "Authentication", new { userId = Helper.GetLoggedInUserID() })" class="blueTextLink">Your Information</a>
    </div>
    <div class="infoText">
         Upload your tabular data to the DataUp site.
     Don't worry- we won't share your data with anyone
    </div>
    <div class="documentDropBox" id="dragDropBox" >
                <div style="width: 77px; margin: 0px auto">
                    <div class="dragDropIcon"></div>
                </div>
                <div class="dragDropLabel">Drag and drop your tabular data file(s) here</div>
                <div class="patternBackground">
                     @using (Html.BeginForm("UploadedPostedFile", "Document", FormMethod.Post, new { @enctype = "multipart/form-data", @target = "ieUploadFrame" }))
                     {
                        <div class="browseContainer">
                            <label class="orText">or</label>
                       
                            <a class="browsButton" href="#">Select file<input type="file" name="addContent" id="addContent" value=""/></a>&nbsp; to upload documents from your computer
                       
                        </div>
                     }
                </div>
                <iframe name="ieUploadFrame" id="ieUploadFrame" scrolling="no" class="hide"></iframe>
    </div>
    <div id="documentList">
        @{Html.RenderPartial("DocumentList", Model);}
    </div>
</section>
<!--Progressbar--------------------Start-->
<div id="divProgressbar" style="display: none">
    <div class="popupWraper">
    </div>
    <div class="popupHolder repositoryPopup uploadingDocument">
        <div class="greenNotification">
            Uploading Document...</div>
        <div class="loadingIcon">
        </div>
        <div class="pleaseWait">
            Please wait</div>
    </div>
</div>
<!--Progressbar--------------------End-->
<!--MultipleFileUploadPopup--------------------Start-->
<div id="divMultipleFileUploadPopup" class="hide">
    <div class="popupWraper">
    </div>
    <div class="popupHolder repositoryPopup UploadWindowPopup">
        <h2>Upload</h2>
        <div class="headLine"></div>
        <div class="UploadContainer">
        </div>
        <div class="btnHolder">
            <input type="button" value="upload" class="upload"/>
            <input type="button" value="cancel" class="cancel"/>
        </div>
    </div>
</div>
<!--MultipleFileUploadPopup--------------------End-->
<div id="divPostConfirmationPopup" style="display: none;">
    <div class="popupWraper">
    </div>
    <div class="popupHolder repositoryPopup postPop">
        <a class="closeBtn"></a>
        <div class="">
            <h2>
                Post</h2>
            <div class="headLine">
            </div>
            <div class="infoText">
                Will you be submitting this data file in csv or xlsx format to the repository?</div>
           <div class="contentHolder csvHolder">
                <div class="xslxcsvBlock">
                    CSV</div>
                <h3>
                   All embedded objects (graphs, images, etc.) will be removed from your data file.
                     You will also lose any formatting and embedded equations.<p style="color:red">Recommended</p></h3>
            </div>
            <div class="contentHolder xlsHolder">
                <div class="xslxcsvBlock xlsxBG">
                    XLSX</div>
               <h3>
                    You can retain embedded objects, formatting, and embedded equations.
                    <i><b>Note:</b> not all data centers accept .xlsx files.</i>
                </h3>
            </div>
            <div class="btnHolder hide">
                <input type="hidden" id="documentId" />
                <input type="button" value="CSV">
                <input type="button" value="XLSX"></div>
        </div>
    </div>
</div>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.