Skip to content
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

#5117 - Guidelines dialog has wrong title #5118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,19 @@
<div class="d-flex flex-column overflow-auto">
<div class="modal-header">
<h5 class="modal-title">
<wicket:message key="export" />
<wicket:message key="guidelines" />
</h5>
<button wicket:id="closeDialog" type="button" class="btn-close" aria-label="Close"></button>
</div>
<div class="modal-body overflow-auto">
<div class="container-fluid">
<ul class="list-group">
<li wicket:id="guidelineRepeater" class="list-group-item">
<i class="fas fa-book"></i>
<span wicket:id="guidelineName"></span>
<button wicket:id="guideine" class="float-end btn btn-sm btn-primary">
<i class="fas fa-book-open"></i>
Open Guideline
</button>
</li>
</ul>
<div class="modal-body p-0 overflow-auto">
<div class="list-group list-group-flush">
<wicket:container wicket:id="guidelineRepeater" >
<a wicket:id="guideine" class="list-group-item list-group-item-action">
<i class="fas fa-book me-3"></i>
<u wicket:id="guidelineName" class="link-primary"></u>
<i class="fa-solid fa-arrow-up-right-from-square link-primary"></i>
</a>
</wicket:container>
</div>
</div>
<div class="modal-footer">
Expand All @@ -47,5 +44,4 @@ <h5 class="modal-title">
</div>
</div>
</wicket:panel>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.wicket.request.resource.ResourceStreamResource;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.util.resource.FileResourceStream;
import org.apache.wicket.util.resource.IResourceStream;

import de.tudarmstadt.ukp.inception.rendering.editorstate.AnnotatorState;
import de.tudarmstadt.ukp.inception.support.lambda.LambdaAjaxLink;
Expand All @@ -54,26 +53,27 @@ public GuidelinesDialogContent(String aId, final IModel<AnnotatorState> aModel)
super(aId);

// Overall progress by Projects
RepeatingView guidelineRepeater = new RepeatingView("guidelineRepeater");
var guidelineRepeater = new RepeatingView("guidelineRepeater");
add(guidelineRepeater);

for (String guidelineFileName : guidelinesService
for (var guidelineFileName : guidelinesService
.listGuidelines(aModel.getObject().getProject())) {
AbstractItem item = new AbstractItem(guidelineRepeater.newChildId());
var item = new AbstractItem(guidelineRepeater.newChildId());

guidelineRepeater.add(item);

// Add a popup window link to display annotation guidelines
PopupSettings popupSettings = new PopupSettings(RESIZABLE | SCROLLBARS).setHeight(500)
// Add a pop-up window link to display annotation guidelines
var popupSettings = new PopupSettings(RESIZABLE | SCROLLBARS).setHeight(500)
.setWidth(700);

IResourceStream stream = new FileResourceStream(guidelinesService
var stream = new FileResourceStream(guidelinesService
.getGuideline(aModel.getObject().getProject(), guidelineFileName));
ResourceStreamResource resource = new ResourceStreamResource(stream);
ResourceLink<Void> rlink = new ResourceLink<>("guideine", resource);
var resource = new ResourceStreamResource(stream);
var rlink = new ResourceLink<Void>("guideine", resource);
rlink.setPopupSettings(popupSettings);
item.add(new Label("guidelineName", guidelineFileName));
item.add(rlink);
item.queue(rlink);

item.queue(new Label("guidelineName", guidelineFileName));
}

cancelButton = new LambdaAjaxLink("cancel", this::actionCloseDialog);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Technische Universit�t Darmstadt under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The Technische Universit�t Darmstadt
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
guidelines=Guidelines