use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorCourseEditPageData method createBasicButton.
/**
* Creates a basic bootstrap button for use in {@code <a></a>} tags in panel header.
*/
private ElementTag createBasicButton(String buttonText, String buttonId, String href, String tooltipText, boolean isDisabled) {
ElementTag button = new ElementTag(buttonText);
button.setAttribute("type", "button");
button.setAttribute("class", "btn btn-primary btn-xs");
if (buttonId != null) {
button.setAttribute("id", buttonId);
}
if (href != null) {
button.setAttribute("href", href);
}
if (tooltipText != null) {
button.setAttribute("title", tooltipText);
button.setAttribute("data-toggle", "tooltip");
button.setAttribute("data-placement", "top");
}
if (isDisabled) {
button.setAttribute("disabled", null);
}
return button;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorCourseEditPageData method createDeleteCourseButton.
private ElementTag createDeleteCourseButton(boolean isDisabled) {
String buttonContent = "<span class=\"glyphicon glyphicon-trash\"></span> Delete";
String buttonId = "courseDeleteLink";
String href = getInstructorCourseDeleteLink(course.getId(), false);
ElementTag button = createBasicButton(buttonContent, buttonId, href, Const.Tooltips.COURSE_DELETE, isDisabled);
button.setAttribute("data-course-id", course.getId());
String existingClasses = button.removeAttribute("class");
button.setAttribute("class", existingClasses + " course-delete-link");
return button;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorCourseEditPageData method createRemindInstructorButton.
private ElementTag createRemindInstructorButton(InstructorAttributes instructor, int panelIndex, boolean isDisabled) {
String buttonContent = "<span class=\"glyphicon glyphicon-envelope\"></span> Resend Invite";
String buttonId = "instrRemindLink" + panelIndex;
String href = getInstructorCourseRemindInstructorLink(instructor.courseId, instructor.email);
ElementTag button = createBasicButton(buttonContent, buttonId, href, Const.Tooltips.COURSE_INSTRUCTOR_REMIND, isDisabled);
button.setAttribute("data-instructor-name", instructor.getName());
button.setAttribute("data-course-id", instructor.getCourseId());
return button;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class PageData method getTimeOptionsAsElementTags.
/**
* Returns the time options as HTML code.
* By default the selected one is the last one.
*/
public static List<ElementTag> getTimeOptionsAsElementTags(LocalDateTime timeToShowAsSelected) {
List<ElementTag> result = new ArrayList<>();
for (int i = 1; i <= 24; i++) {
ElementTag option = createOption(String.format("%04dH", i * 100 - (i == 24 ? 41 : 0)), String.valueOf(i), isTimeToBeSelected(timeToShowAsSelected, i));
result.add(option);
}
return result;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class FeedbackRankOptionsQuestionDetails method getSubmissionOptionsHtmlForRankingOptions.
private String getSubmissionOptionsHtmlForRankingOptions(int rankGiven) {
StringBuilder result = new StringBuilder(100);
ElementTag option = PageData.createOption("", "", rankGiven == Const.INT_UNINITIALIZED);
result.append("<option" + option.getAttributesToString() + ">" + option.getContent() + "</option>");
for (int i = 1; i <= options.size(); i++) {
option = PageData.createOption(String.valueOf(i), String.valueOf(i), rankGiven == i);
result.append("<option" + option.getAttributesToString() + ">" + option.getContent() + "</option>");
}
return result.toString();
}
Aggregations