Search in sources :

Example 11 with ElementTag

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;
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Example 12 with ElementTag

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;
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Example 13 with ElementTag

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;
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Example 14 with ElementTag

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;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag)

Example 15 with ElementTag

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();
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Aggregations

ElementTag (teammates.ui.template.ElementTag)30 ArrayList (java.util.ArrayList)16 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)3 FeedbackQuestionDetails (teammates.common.datatransfer.questions.FeedbackQuestionDetails)3 InstructorFeedbackResultsResponseRow (teammates.ui.template.InstructorFeedbackResultsResponseRow)3 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)2 FeedbackSessionsTableRow (teammates.ui.template.FeedbackSessionsTableRow)2 InstructorFeedbackResultsModerationButton (teammates.ui.template.InstructorFeedbackResultsModerationButton)2 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)1 ActiveCoursesTable (teammates.ui.template.ActiveCoursesTable)1 ActiveCoursesTableRow (teammates.ui.template.ActiveCoursesTableRow)1 ArchivedCoursesTable (teammates.ui.template.ArchivedCoursesTable)1 ArchivedCoursesTableRow (teammates.ui.template.ArchivedCoursesTableRow)1 FeedbackSessionsCopyFromModal (teammates.ui.template.FeedbackSessionsCopyFromModal)1 InstructorFeedbackResultsQuestionTable (teammates.ui.template.InstructorFeedbackResultsQuestionTable)1 InstructorFeedbackSessionActions (teammates.ui.template.InstructorFeedbackSessionActions)1