pdfgen

package
v1.242.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: BSD-3-Clause Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pdfgen renders the planning PDFs (maroto documents) from already-fetched data. The plexams package gathers the data from the DB and passes it in; the pure table-content builders here (…Rows) are I/O-free and unit-tested, and the render functions wrap them with the shared page furniture. Keeping the maroto layout out of the plexams god-package is the point.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Constraints

func Constraints(semesterFull, jiraURL string, exams []*model.ZPAExamWithConstraints, sameSlotExam map[int]*model.ZPAExam) pdf.Maroto

Constraints renders the landscape constraints PDF. sameSlotExam resolves the same-slot partner ancodes (pre-fetched by the caller; see SameSlotAncodes).

func ConstraintsRows

func ConstraintsRows(exams []*model.ZPAExamWithConstraints, sameSlotExam map[int]*model.ZPAExam) [][]string

ConstraintsRows builds the constraints table rows (AnCode, Prüfender, Modul, Gruppe(n), Constraints), grouped and sorted by examer name; exams marked NotPlannedByMe are dropped. sameSlotExam resolves a same-slot partner ancode to its exam for the "zeitgleich: …" line (nil is tolerated only as far as the original code).

func DraftDoc

func DraftDoc(landscape bool, title, planerName, planerEmail, note string) pdf.Maroto

DraftDoc builds the shared "vorläufiger Planungsstand" draft document shell: the footer, a bold title, the planner line and a centered note (e.g. "--- zur Abstimmung ---" or "--- ENTWURF ---"). landscape selects the page orientation (the EXaHM draft is landscape, the rest portrait).

func ExahmHeading

func ExahmHeading(sortByDate bool) string

ExahmHeading returns the EXaHM/SEB table heading, which names the sort order.

func ExahmRows

func ExahmRows(exams []*model.PlannedExam, sortByDate bool,
	prePlannedRooms map[int][]string) [][]string

ExahmRows builds the EXaHM/SEB draft table rows (AnCode, Modul, Prüfender, Termin, Form, Plätze, Räume). When sortByDate the exams are ordered by (day, slot, ancode), otherwise the input order is kept. slotTime resolves a plan entry to its start; prePlannedRooms maps an ancode to its pre-planned room names, used only when the exam has no planned rooms yet. Every exam must already carry non-nil Constraints.RoomConstraints (the caller filters to EXaHM/SEB exams).

func ExahmTable

func ExahmTable(m pdf.Maroto, sortByDate bool, rows [][]string)

ExahmTable renders the EXaHM/SEB heading and table into m.

func ExamRows

func ExamRows(exams []*model.PlannedExam) [][]string

ExamRows builds the simple (AnCode, Modul, Prüfender, Termin) draft table rows sorted by ancode. An exam without a plan entry shows "fehlt noch"; slotTime resolves a plan entry's (day, slot) to its start. Used by the special-interest / LBA-repeater drafts.

func ExamTable

func ExamTable(m pdf.Maroto, name string, rows [][]string)

ExamTable renders the named (AnCode, Modul, Prüfender, Termin) draft table into m.

func ExamsToPlan

func ExamsToPlan(semesterFull, jiraURL string, exams []*model.ZPAExam) pdf.Maroto

ExamsToPlan renders the portrait "exams to plan" PDF (centrally planned exams, grouped by examer).

func ExamsToPlanRows

func ExamsToPlanRows(exams []*model.ZPAExam) [][]string

ExamsToPlanRows builds the "exams to plan" table rows (AnCode, Modul, Prüfender, Gruppe(n)), grouped and sorted by examer name.

func FormatTermin

func FormatTermin(t time.Time) string

FormatTermin renders a slot start time as e.g. "Mo. 02.01.06, 15:04 Uhr".

func ProgramRows

func ProgramRows(exams []*model.PlannedExam, program string) [][]string

ProgramRows builds the per-program draft table rows (AnCode, Modul, Prüfender, Termin) sorted by ancode. For an exam with a Primuss section in this program the section's ancode is used; a section with no registrations stops the listing (matching the original behaviour). slotTime resolves a plan entry's (day, slot) to its start.

func ProgramTable

func ProgramTable(m pdf.Maroto, programLong string, rows [][]string)

ProgramTable renders one program's heading and its exam table into m.

func SameModulNames

func SameModulNames(semesterFull string, exams []*model.ZPAExam) pdf.Maroto

SameModulNames renders the landscape "modules with the same name" PDF.

func SameModulNamesRows

func SameModulNamesRows(exams []*model.ZPAExam) [][]string

SameModulNamesRows builds the "modules with the same name" table rows (Modul, AnCode, Prüfender, Gruppe(n), Form): one block per module name (sorted), the module name shown only on the first row, followed by a blank separator row.

func SameSlotAncodes

func SameSlotAncodes(exams []*model.ZPAExamWithConstraints) []int

SameSlotAncodes returns the distinct same-slot partner ancodes referenced by the constraints, so the caller can pre-resolve their exams before rendering.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL