-
Notifications
You must be signed in to change notification settings - Fork 4
[CITE-162] Implemented a new View Modal for Giles uploaded and Extracted #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Charishma0249
wants to merge
52
commits into
develop
Choose a base branch
from
story/CITE-162
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
87cd872
[CITE-162] Implemented a new View Modal for Giles uploaded and Extracted
Charishma0249 5fe4766
[CITE-162] Formatted indentations
Charishma0249 25b280b
[CITE-162] Formatted Indentations
Charishma0249 2584f67
[CITE-162] Formatted indentations
Charishma0249 54d6bb2
[CITE-162] Addressed review comments
Charishma0249 c3f4775
[CITE-162] Removed console logs
Charishma0249 d206620
[CITE-162]Addressed review comments
Charishma0249 0079897
[CITE-162]Fixed Indentation issues
Charishma0249 257461b
[CITE-162] Fixed Indentation issues
Charishma0249 fbb42c8
[CITE-162] Fixed indentation issues
Charishma0249 0794729
[CITE-162] Address review comments
Charishma0249 ae1b349
[CITE-162] Addressed review comments
Charishma0249 9648981
[CITE-162] Address review comments
Charishma0249 7e5f725
[CITE-162] Addressed review comments-Added boundary padding,reduced gaps
Charishma0249 b0badff
[CITE-162] Fixing indentation issues
Charishma0249 96a31a3
[CITE-162] Fix searching for multiple upload files
Charishma0249 26363fb
[CITE-162]Addressed review comments - Fixed content type issue
Charishma0249 895c16f
[CITE-162]Address code refactor issues
Charishma0249 1d8cedc
[CITE-162] Address code refactors
Charishma0249 afcd193
[CITE-162] Addressed review comments - Used streams to check the fileId
Charishma0249 9e528b7
[CITE-162] Addressed review comments - add comments
Charishma0249 72b8d47
[CITE-162] Fix indentations
Charishma0249 e28c1b3
[CITE-162] Fixing indentations
Charishma0249 ae166de
[CITE-162] Fixing indentations
Charishma0249 51c9bc1
[CITE-162] Addressing review comments
Charishma0249 984b615
[CITE-162]Address review comments
Charishma0249 218d26a
[CITE-162] Addressing review comments
Charishma0249 4c00e01
[CITE-162] Addressing review comments
Charishma0249 e6a471c
[CITE-162] Addressing review comments
Charishma0249 006b6f4
[CITE-162] Address review comments
Charishma0249 4672273
[CITE-162] Address review comments
Charishma0249 8db3efc
[CITE-162] Addressing review comments - code clean up
Charishma0249 e99d13d
[CITE-162] Addressing review comments
Charishma0249 02b3370
[CITE-162] Addressing review comments
Charishma0249 2328453
[CITE-162] Addressing review comments
Charishma0249 14fa940
[CITE-162] Addressing review comments
Charishma0249 c965f81
[CITE-162] Addressing review comments
Charishma0249 3f15692
[CITE-162] Addressing review comments
Charishma0249 a789c5b
[CITE-162] Addressing review comments
Charishma0249 b6eba77
[CITE-162] Addressing review comments
Charishma0249 dd3554a
Merge branch 'develop' into story/CITE-162
diya17 09730c9
[CITE-162] Changes to UI and API change
diya17 9a3df54
[GECO-162] Changing to stream
diya17 9e5e88c
[CITE-162] Removing fileId check
diya17 bd7d499
[CITE-162] Update to controller and view
diya17 1b2955a
[CITE:162] Fix duplication issue and files interleaving with upload m…
diya17 df3b383
[CITE-162] Making controller changes
diya17 28fdb53
Merge branch 'develop' into story/CITE-162
rajvi-patel-22 bc2e321
[CITE-162] Uncomment showfile function
rajvi-patel-22 4ec23db
[CITE-162] Update giles document controller
rajvi-patel-22 9691892
[CITE-162] Add citation validations
rajvi-patel-22 b1d3a9b
[CITE-162] Fix file not found errors in GilesDocumentController
rajvi-patel-22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<html layout:decorate="~{layouts/main}"> | ||
<head> | ||
<style> | ||
#viewUploadBody { | ||
padding-left: 30px; | ||
} | ||
</style> | ||
<script th:src="@{/resources/notify/bootstrap-notify.min.js}"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/handlebars.min.js"></script> | ||
|
||
|
@@ -130,7 +135,12 @@ | |
$('.btn-nav').each(function() { | ||
$(this).attr("href", $(this).attr("href") + "&" + queryParams); | ||
}) | ||
|
||
$(".view-link").click(function() { | ||
var item = $(this).parent(); | ||
var modalName = 'viewUpload'; | ||
showFiles(modalName, item); | ||
$("#"+modalName.toLowerCase()+"Modal").modal('show'); | ||
}); | ||
$('.note-info').each(function() { | ||
$(this).text(truncateNote($(this).attr('data-note-text'))); | ||
}) | ||
|
@@ -284,6 +294,50 @@ | |
}); | ||
} | ||
|
||
function showFiles(modalName, item) { | ||
|
||
var uploadItem = $(item); | ||
var modalNameLCase = modalName.toLowerCase(); | ||
|
||
$('#page-title, #page-list').remove(); | ||
|
||
$("#uploadedFileName").attr('href', uploadItem.attr("upload-href")); | ||
$("#uploadedFileName").text(uploadItem.attr("data-"+modalNameLCase+"-uploadedFile-filename")); | ||
|
||
$("#extractedFileName").attr('href', uploadItem.attr("extractedText-href")); | ||
$("#extractedFileName").text(uploadItem.attr("data-"+modalNameLCase+"-extractedText-filename")); | ||
|
||
$('.modal-body ul').append('<li id="page-title"><p style="margin-bottom:0;">Pages: </p></li>'); | ||
var pageCount=1 | ||
$('.modal-body ul').append('<ul id="page-list"></ul>'); | ||
|
||
$(uploadItem).children().each(function() { | ||
|
||
if($(this).attr('class')=="page-item"){ | ||
$('#page-list').append('<li><p style="margin : 0; padding-top:0;">Page '+pageCount+': </p></li>'); | ||
} | ||
$(this).children().each(function() { | ||
pageItems = "page-items"+pageCount | ||
$('#page-list').append('<ul id = "'+pageItems+'"></ul>'); | ||
$('#page-items'+pageCount).append('<li><p style="margin-bottom:0;">Image: <a href="'+ $(this).attr("image-href")+'">'+$(this).attr("data-"+modalNameLCase+"-image-filename")+'</a></p></li>'); | ||
$('#page-items'+pageCount).append('<li><p style="margin : 0; padding-top:0;">Text: <a href="'+ $(this).attr("pageText-href")+'">'+$(this).attr("data-"+modalNameLCase+"-pageText-filename")+'</a></p></li>'); | ||
$('#page-items'+pageCount).append('<li><p style="margin-bottom:0;">OCR Result: <a href="'+ $(this).attr("pageOcr-href")+'">'+$(this).attr("data-"+modalNameLCase+"-pageOcr-filename")+'</a></p></li>'); | ||
$('#page-items'+pageCount).append('<li><p style="margin : 0; padding-top:0;">Additional Files: </p></li>'); | ||
|
||
var additionalFilesCount = 1; | ||
additionalItems = "additional-list"+pageCount | ||
$('#page-items'+pageCount).append('<ul id="'+additionalItems+'"></ul>') | ||
$(this).children().each(function() { | ||
$(this).children().each(function() { | ||
$('#additional-list'+pageCount).append('<li><p style="margin-bottom:0;">Additional Files '+additionalFilesCount+': <a href="'+ $(this).attr("additionalFiles-href")+'">'+$(this).attr("data-"+modalNameLCase+"-additionalFiles-filename")+'</a></p></li>'); | ||
}) | ||
additionalFilesCount += 1; | ||
}) | ||
pageCount = pageCount+1; | ||
}) | ||
}) | ||
} | ||
|
||
</script> | ||
</head> | ||
|
||
|
@@ -533,10 +587,27 @@ <h2 style="margin-top: 0" id="citationTitleContainer"> | |
<h3 style="margin-top: 0">Files</h3> | ||
|
||
<ul class="list-group" > | ||
<li class="list-group-item" th:each="upload:${citation.gilesUploads}"> | ||
<li class="list-group-item" th:each="upload, status:${citation.gilesUploads}"> | ||
<i class="icon-giles"></i> | ||
|
||
<span th:if="${upload.uploadedFile?.filename}"> | ||
<a th:href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.uploadedFile?.id}|}">[[${upload.uploadedFile?.filename}]]</a> | ||
<span th:id="|upload${status.index}|" class="upload-item" th:data-viewupload-uploadId="${upload.uploadId}" th:upload-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.uploadedFile?.id}|}" th:data-viewupload-uploadedFile-filename="${upload.uploadedFile?.filename}" th:extractedText-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${upload.extractedText?.id}|}" th:data-viewupload-extractedText-filename="${upload.extractedText?.filename}" > | ||
|
||
<th:block th:each="pages, status:${upload.pages}"> | ||
<span class="page-item"> | ||
<span th:id="|pages${status.index}|" class="page-item" th:data-viewupload-uploadId="${upload.uploadId}" th:image-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.image?.id}|}" th:data-viewupload-image-filename="${pages.image?.filename}" th:pageText-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.text?.id}|}" th:data-viewupload-pageText-filename="${pages.text?.filename}" th:pageOcr-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${pages.ocr?.id}|}" th:data-viewupload-pageOcr-filename="${pages.ocr?.filename}" > | ||
|
||
<th:block th:each="additionalFiles, status:${pages.additionalFiles}"> | ||
<span class="additional-item" th:if="${additionalFiles?.filename}"> | ||
<span th:id="|additionalFiles${status.index}|" class="additional-item" th:data-viewupload-uploadId="${upload.uploadId}" th:additionalFiles-href="@{|/auth/group/${zoteroGroupId}/items/${citation.key}/giles/${additionalFiles?.id}|}" th:data-viewupload-additionalFiles-filename="${additionalFiles?.filename}" > | ||
</span> | ||
</span> | ||
</th:block> | ||
</span> | ||
</span> | ||
</th:block> | ||
<a class="view-link">[[${upload.uploadedFile?.filename}]]</a> | ||
</span> | ||
</span> | ||
<span th:unless="${upload.documentStatus != null && (upload.documentStatus != T(edu.asu.diging.citesphere.model.bib.GilesStatus).SUBMITTED || T(edu.asu.diging.citesphere.model.bib.GilesStatus).NEW)}"> | ||
File is being processed... ([[${upload.progressId}]]) | ||
|
@@ -549,7 +620,36 @@ <h3 style="margin-top: 0">Files</h3> | |
<i class="icon-sync" title="Sync Upload Status"></i></a> | ||
</li> | ||
</ul> | ||
|
||
|
||
<div class="modal fade" id="viewuploadModal" | ||
tabIndex="-1" role="dialog" | ||
aria-labelledby="viewUploadModal" aria-hidden="true"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content" id="viewUploadContent"> | ||
<div class="modal-header"> | ||
<h4 class="modal-title" id="viewUploadModal">Files uploaded to and extracted by Giles | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</h4> | ||
</div> | ||
<div class="modal-body" id="viewUploadBody"> | ||
<ul class="list-group" > | ||
<li><p style="margin-bottom:0;"> Upload File: | ||
<a id="uploadedFileName"> </a> | ||
</p></li> | ||
<li><p style="margin : 0; padding-top:0;"> Extracted Text: | ||
<a id="extractedFileName"> </a> | ||
</p></li> | ||
</ul> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal"> Close </button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all of these can be simplified by just creating a model for each upload and then show/hide those modals when the user clicks on an upload in the list. There is not javascript really needed (beyond opening/closing the modal). |
||
<h3>Notes</h3> | ||
|
||
<ul class="list-group"> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation