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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations