Search in sources :

Example 26 with ElementTag

use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.

the class PageData method getGracePeriodOptionsAsElementTags.

/**
 * Returns the grace period options as HTML code.
 */
public static List<ElementTag> getGracePeriodOptionsAsElementTags(long existingGracePeriod) {
    ArrayList<ElementTag> result = new ArrayList<>();
    for (int i = 0; i <= 30; i += 5) {
        ElementTag option = createOption(i + " mins", String.valueOf(i), isGracePeriodToBeSelected(existingGracePeriod, i));
        result.add(option);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag)

Example 27 with ElementTag

use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.

the class PageData method getNationalitiesAsElementTags.

/**
 * Returns the nationalities as HTML code.
 */
public static List<ElementTag> getNationalitiesAsElementTags(String existingNationality) {
    List<String> nationalities = NationalityHelper.getNationalities();
    List<ElementTag> result = new ArrayList<>();
    result.add(createOption("--- Select ---", "", !nationalities.contains(existingNationality)));
    for (String nationality : nationalities) {
        ElementTag option = createOption(nationality, nationality, nationality.equals(existingNationality));
        result.add(option);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag)

Example 28 with ElementTag

use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.

the class StudentHomePageData method createCourseTableLinks.

private List<ElementTag> createCourseTableLinks(String courseId) {
    List<ElementTag> links = new ArrayList<>();
    links.add(new ElementTag("View Team", "href", getStudentCourseDetailsLink(courseId), "title", Const.Tooltips.STUDENT_COURSE_DETAILS));
    return links;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag)

Example 29 with ElementTag

use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.

the class InstructorCoursesPageData method convertToArchivedCoursesTable.

private ArchivedCoursesTable convertToArchivedCoursesTable(List<CourseAttributes> archivedCourses) {
    ArchivedCoursesTable archivedCoursesTable = new ArchivedCoursesTable();
    int idx = this.activeCourses.getRows().size() - 1;
    for (CourseAttributes course : archivedCourses) {
        idx++;
        List<ElementTag> actionsParam = new ArrayList<>();
        String unarchiveLink = getInstructorCourseArchiveLink(course.getId(), false, false);
        ElementTag unarchivedButton = createButton("Unarchive", "btn btn-default btn-xs", "t_course_unarchive" + idx, unarchiveLink, "", false);
        String deleteLink = getInstructorCourseDeleteLink(course.getId(), false);
        Boolean hasDeletePermission = instructorsForCourses.get(course.getId()).isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE);
        ElementTag deleteButton = createButton("Delete", "btn btn-default btn-xs course-delete-link", "t_course_delete" + idx, deleteLink, Const.Tooltips.COURSE_DELETE, !hasDeletePermission);
        deleteButton.setAttribute("data-course-id", course.getId());
        actionsParam.add(unarchivedButton);
        actionsParam.add(deleteButton);
        ArchivedCoursesTableRow row = new ArchivedCoursesTableRow(SanitizationHelper.sanitizeForHtml(course.getId()), SanitizationHelper.sanitizeForHtml(course.getName()), course.getCreatedAtDateString(), course.getCreatedAtDateStamp(), course.getCreatedAtFullDateTimeString(), actionsParam);
        archivedCoursesTable.getRows().add(row);
    }
    return archivedCoursesTable;
}
Also used : ArrayList(java.util.ArrayList) ArchivedCoursesTable(teammates.ui.template.ArchivedCoursesTable) ElementTag(teammates.ui.template.ElementTag) ArchivedCoursesTableRow(teammates.ui.template.ArchivedCoursesTableRow) CourseAttributes(teammates.common.datatransfer.attributes.CourseAttributes)

Example 30 with ElementTag

use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.

the class InstructorFeedbackEditPageData method getPreviewAsStudentOptions.

private List<ElementTag> getPreviewAsStudentOptions(List<StudentAttributes> studentList) {
    List<ElementTag> results = new ArrayList<>();
    for (StudentAttributes student : studentList) {
        ElementTag option = createOption("[" + student.team + "] " + student.name, student.email);
        results.add(option);
    }
    return results;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes)

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