Esempio n. 1
0
File: jda.py Progetto: kinderp/3183
 def __init__(self, **kwargs):
     super(SessionPartOtherAttendeeUsersModel, self).__init__(**kwargs)
     self.other_attendees = TextField("Other Attendees<br/><br/>")
     self.attendee_replaced = TextField("Attendee Replaced<br/><br/>")
     self.company_name = TextField("Company Name<br/><br/>")
     self.email_address = TextField("Email Adreess<br/><br/>")
     self.signature = TextField("Signature<br/><br/>")
Esempio n. 2
0
    def __init__(self, **kwargs):
        """Init custom Model (Summary)

        Parameters:
            kwargs : {
                        "_event_name": "Nome evento",
                        "_session_id": "1234abc",
                        "_vendor": "ACME Labs",
                        "_start_date": "01/01/2017",
                        "_end_date": "01/01/2017",
                        "_parts": "1",
                        "_locations": "Location1, Location2",
                        "_available_languages": ""

            }

        """
        super(SummaryModel, self).__init__(**kwargs)
        super(SummaryModel, self)._('SummaryModel', SummaryModel.__t)
        self.event_name_and_session_id = TextField("<b>{} - {}</b>".format(self._event_name, self._session_id))
        self.vendor = TextField("<b>{}</b>".format(self._vendor))
        self.start_and_end_date_parts = TextField("<b>{}:</b> {} <b>{}:</b> {} (<b>{}:</b> {})".format(
                                                                                                        self._t_from,
                                                                                                        self._start_date,
                                                                                                        self._t_to,
                                                                                                        self._end_date,
                                                                                                        self._t_parts,
                                                                                                        self._parts
                                                                                                       )
        )

        self.locations = TextField("<b>{}:</b> {}".format(self._t_locations, self._locations))
        self.available_languages = TextField("<b>{}:</b> {}".format(self._t_available_languages, self._available_languages))
Esempio n. 3
0
File: jda.py Progetto: kinderp/3183
 def __init__(self, **kwargs):
     super(SessionPartInfoModel, self).__init__(**kwargs)
     self.locations = TextField("<b>Location:</b>")
     self.locations_value = TextField("{}".format(self._locations_value))
     self.instructor = TextField("<b>Instructor:</b>")
     self.instructor_value = TextField("{}<br/>{}".format(
         self._instructor_fullname, self._instructor_email))
     self.blank = TextField(" ")
Esempio n. 4
0
    def __init__(self, **kwargs):
        """Init custom Model (Header)

        Parameters: 
            kwargs : { '_title': 'Titolo centrale', '_session': 'Sessione di prova'}
        """
        super(HeaderModel, self).__init__(**kwargs)
        self.session = TextField(text="{}".format(self._session))
        self.title = TextField(text="{}".format(self._title))
        self.logo = ImageField('./sanofi.png', width=50, height=50)
Esempio n. 5
0
    def __init__(self, **kwargs):
        """Init custom Model (Session)

        Parameters:
            kwargs : { "_session_type": "Session One",
                       "_s1": "Bullet1",
                       "_s2": "Bullet2",
                       "_s3": "Bullet3",
                       "_session_title": "This is a session title",
                       "_session_id": "1234 session",
                       "_version": "1.0",
                       "_language": "English",
                       "_start_date": "01/01/2017",
                       "_end_date": "01/07/2017",
                       "_duration": "1h20m"
                     }
        """
        super(SessionModel, self).__init__(**kwargs)
        self.session_type = TextField(
            text="Session Type: {}".format(self._session_type))
        self.s1 = BulletTextField(text='{}'.format(self._s1))
        self.s2 = BulletTextField(text='{}'.format(self._s2))
        self.s3 = BulletTextField(text='{}'.format(self._s3))

        self.session_title = TextField(
            text='Session Title: {}'.format(self._session_title))
        self.session_id = TextField(
            text="Session Id: {}".format(self._session_id))

        self.version = TextField(text="Version: {}".format(self._version))
        self.language = TextField(text="Language: {}".format(self._language))

        self.start_date = TextField("Start date: {}".format(self._start_date))
        self.end_date = TextField("End date: {}".format(self._end_date))
        self.duration = TextField("Duration: {}".format(self._duration))
Esempio n. 6
0
File: jda.py Progetto: kinderp/3183
    def __init__(self, **kwargs):
        super(SessionPartInstructorSignatureModel, self).__init__(**kwargs)

        self.instructor_signature = TextField("Instructor Signature {}".format(
            "_" * 24))
        self.blank = TextField(" ")

        self.style_header = {
            "instructor_signature": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
        }
Esempio n. 7
0
    def __init__(self,**kwargs):
        """Init custom Model (Header)

        Parameters: 
            kwargs : { '_sign_in_sheet': 'Titolo centrale' }
        """
        super(HeaderModel, self).__init__(**kwargs)
        self.sign_in_sheet = TextField(text="{}".format(self._sign_in_sheet))
        self.logo_vendor = ImageField('./sanofi.png', width=50, height=50)
        self.logo_company = ImageField('./sanofi.png', width=50, height=50)
Esempio n. 8
0
    def __init__(self, **kwargs):
        """Init custom Model (Instructor)

        Parameters:
            kwargs : { "_instructor": "Mario Neri",
                       "_internal_bullet": "Internal Instructor",
                       "_external_bullet": "External Instructor",
                       "_instructor_infos": "bla bla bla ..."
                     }
        """

        super(InstructorModel, self).__init__(**kwargs)
        self.instructor = TextField("Instructor: <br/> {}".format(
            self._instructor))
        self.internal_bullet = BulletTextField("Internal Insructor")
        self.external_bullet = BulletTextField("External Instructor")

        self.instructor_infos = TextField("""Instructor: {} <br/>
                                          Data + Siganture""".format(
            self._instructor_infos))
Esempio n. 9
0
    def __init__(self, **kwargs):
        """Init custom Model (Instructor)

        Parameters:
            kwargs : { "_session": {
                            "session_part_title": "Session Part Title",
                            "session_date_time": "01/01/2017 10:00",
                            "timezone": "UTC+2",
                            "end_date_time": "01/01/2017 11:00",
                            "break": "...",
                            "session_location". "somewhere"
                        }
                     }
        """
        super(InstructorModel, self).__init__(**kwargs)
        self.instructors = TextField("<b>INSTRUCTOR(s)</b>")
        self.signatures = TextField("<b>SIGNATURES</b>")
        self.part1 = TextField("<i>Part 1</i>")
        self.part2 = TextField("<i>Part 2</i>")
        self.affiliation = TextField("<i>AFFILIATION</i>")
Esempio n. 10
0
    def __init__(self, **kwargs):
        """Init custom Model (Instructor)

        Parameters:
            kwargs : { "_session": {
                            "session_part_title": "Session Part Title",
                            "session_date_time": "01/01/2017 10:00",
                            "timezone": "UTC+2",
                            "end_date_time": "01/01/2017 11:00",
                            "break": "...",
                            "session_location". "somewhere"
                        }
                     }
        """
        super(InstructorModel, self).__init__(**kwargs)
        super(InstructorModel, self)._('InstructorModel', InstructorModel.__t)
        self.instructors = TextField("<b>{}</b>".format(self._t_instructors))
        self.signatures = TextField("<b>{}</b>".format(self._t_signatures))
        self.part1 = TextField("<i>{} 1</i>".format(self._t_part))
        self.part2 = TextField("<i>{} 2</i>".format(self._t_part))
        self.affiliation = TextField("<i>{}</i>".format(self._t_affiliation))
Esempio n. 11
0
    def __init__(self, **kwargs):
        """Init custom Model (Session)

        Parameters:
            kwargs : { "_session": {
                            "session_part_title": "Session Part Title",
                            "session_date_time": "01/01/2017 10:00",
                            "timezone": "UTC+2",
                            "end_date_time": "01/01/2017 11:00",
                            "break": "...",
                            "session_location". "somewhere"
                        }
                     }
        """
        super(SessionModel, self).__init__(**kwargs)
        text_for_session = """
        {session_part_title}<br/>
        Starts: {session_date_time} {timezone} End: {end_date_time} {timezone} Break: {break} <br/>
        <br/>
        Session Location: {session_location}
        """
        self.session = TextField(text_for_session.format(**self._session))

        self.participants = TextField("<b>Participants</b>")
        self.signatures = TextField("<b>SIGNATURES</b>")

        self.part1 = TextField("<i>Part 1</i>")
        self.part2 = TextField("<i>Part 2</i>")

        self.observations = TextField("<i>Observations</i>")
Esempio n. 12
0
File: jda.py Progetto: kinderp/3183
    def __init__(self, **kwargs):
        super(SessionPartAttendeeUsersModel, self).__init__(**kwargs)
        self.registered_attendees = TextField("Registered Attendees<br/><br/>")
        self.user_id = TextField("User ID<br/><br/>")
        self.company_name = TextField("Company Name<br/><br/>")
        self.email = TextField("Email Address<br/><br/>")
        self.signature = TextField("Signature<br/><br/>")

        self.style_header = {
            "registed_attendees": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
            "user_id": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
            "company_name": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
            "email": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
            "signature": {
                "style":
                "Normal",
                "commands": [('alignment', TA_LEFT), ('fontName', 'Helvetica'),
                             ('fontSize', 10)]
            },
        }
Esempio n. 13
0
    def __init__(self, **kwargs):
        """Init custom Model (Student)

        Parameters:
            kwargs : { "_course_title": "This is a course title",
                       "_start_date": "01/01/2017",
                       "_start_time": "10:00",
                       "_end_date": "01/01/2017",
                       "_end_time": "11:00"
                     }
        """

        super(StudentModel, self).__init__(**kwargs)
        self.course_title = TextField(
            text="Course Title: {}".format(self._course_title))

        self.start_date = TextField("Start date: {}".format(self._start_date))
        self.end_date = TextField("End date: {}".format(self._end_date))
        self.start_time = TextField("Start time: {}".format(self._start_time))
        self.end_time = TextField("End time: {}".format(self._end_time))

        self.student_name = TextField("Name")
        self.student_surname = TextField("Surname")
        self.student_infos = TextField("""
                              Workday ID<br/>
                              Network ID (internal)<br/>
                              Network ID / E-mail <br/>
                              Address    (external) <br/>
                              """)

        self.entry_signature = TextField("""
                                Part 1 <br/>
                                Date + Signature
                                """)

        self.exit_signature = TextField("""
                               Part 2 <br/>
                               Date + Signature
                               """)
Esempio n. 14
0
    def __init__(self, **kwargs):
        """Init custom Model (Session)

        Parameters:
            kwargs : { "_session": {
                            "session_part_title": "Session Part Title",
                            "session_date_time": "01/01/2017 10:00",
                            "timezone": "UTC+2",
                            "end_date_time": "01/01/2017 11:00",
                            "break": "...",
                            "session_location". "somewhere"
                        }
                     }
        """
        super(SessionModel, self).__init__(**kwargs)
        super(SessionModel, self)._('SessionModel', SessionModel.__t)
        #text_for_session = """
        #<b>{session_part_title}</b><br/>
        #<b>Starts:</b> {session_date_time} {timezone} <b>End:</b>
        #{end_date_time} {timezone} <b>Break:</b> {break} <br/>
        #<br/>
        #<b>Session Location:</b> {session_location}
        #"""

        text_for_session = """
        <b>{session_part_title}</b><br/>
        <b>{_t_starts}:</b> {session_date_time} {timezone} <b>{_t_end}:</b>
        {end_date_time} {timezone} <b>{_t_break}:</b> {break} <br/>
        <br/>
        <b>{_t_sesion_location}:</b> {session_location}
        """

        self._session.update(self._t)

        self.session = TextField(text_for_session.format(**self._session))

        #self.participants = TextField("<b>Participants</b>")
        #self.signatures = TextField("<b>SIGNATURES</b>")

        #self.part1 = TextField("<i>Part 1</i>")
        #self.part2 = TextField("<i>Part 2</i>")

        #self.observations = TextField("<i>Observations</i>")

        self.participants = TextField("<b>{}</b>".format(self._t_participants))
        self.signatures = TextField("<b>{}</b>".format(self._t_signatures))

        self.part1 = TextField("<i>{} 1</i>".format(self._t_part))
        self.part2 = TextField("<i>{} 2</i>".format(self._t_part))

        self.observations = TextField("<i>{}</i>".format(self._t_observations))
Esempio n. 15
0
File: jda.py Progetto: kinderp/3183
    def __init__(self, **kwargs):
        """Init custom Model (SessionDetails)

        Parameters:
        kwargs: {
                    "_locator_number_value": "3183",
                    "_subject_value": "Learning",
                    "_date_value",
        }
        """
        super(SessionDetailsModel, self).__init__(**kwargs)
        self.session_details = TextField("Session details")

        self.locator_number = TextField("Locator Number:")
        self.locator_number_value = TextField("{}".format(
            self._locator_number_value))

        self.subject = TextField("Subject:")
        self.subject_value = TextField("{}".format(self._subject_value))

        self.date = TextField("<b>Date:</b>")
        self.date_value = TextField("{}".format(self._date_value))
        self.blank = TextField(" ")
Esempio n. 16
0
File: jda.py Progetto: kinderp/3183
def make():
    pdf = SingInSheets()

    common_table_style = [
        ('BOX', (0, 0), (-1, -1), 0.1, colors.white),
        ('INNERGRID', (0, 0), (-1, -1), 0.1, colors.white),
        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
    ]

    data_title = {"_title": "A very long long long but very long title..."}
    title = TitleView(**data_title)
    title.set_style([
        ('BOX', (0, 0), (-1, -1), 0.1, colors.white),
        ('INNERGRID', (0, 0), (-1, -1), 0.1, colors.white),
        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
        ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
    ])
    rendered_fields = title.render()
    pdf.story.add(rendered_fields)

    some_space = Spacer(1, 10)
    pdf.story.add(some_space)

    data_session_details = {
        "_locator_number_value": "3183",
        "_subject_value": "Learning",
        "_date_value": "30/09/2019 - 03/10/2019",
    }
    sess_dets = SessionDetailsView(**data_session_details)
    sess_dets.set_style(common_table_style)
    rendered_fields = sess_dets.render()
    pdf.story.add(rendered_fields)

    some_space = Spacer(1, 10)
    pdf.story.add(some_space)

    data_session_part_info = {
        "_locations_value": "Mexico City",
        "_instructor_fullname": "Mario Rossi",
        "_instructor_email": "*****@*****.**"
    }
    sess_part_i = SessionPartInfoView(**data_session_part_info)
    sess_part_i.set_style(common_table_style)
    rendered_fields = sess_part_i.render()
    pdf.story.add(rendered_fields)

    sess_part_sign = SessionPartInstructorSignatureView()
    sess_part_sign.set_style(common_table_style)
    rendered_fields = sess_part_sign.render()
    pdf.story.add(rendered_fields)

    some_space = Spacer(1, 10)
    pdf.story.add(some_space)

    attendee_users_table_data = []
    cell_formatted_text = """
                {family_name}<br/>
                {first_name}<br/>
                """
    cell_values = [
        {
            "family_name": "family name 1",
            "first_name": "fitst name 1"
        },
        {
            "family_name": "family name 2",
            "first_name": "fitst name 2"
        },
        {
            "family_name": "family name 3",
            "first_name": "fitst name 3"
        },
        {
            "family_name": "family name 4",
            "first_name": "fitst name 4"
        },
        {
            "family_name": "family name 5",
            "first_name": "fitst name 5"
        },
        {
            "family_name": "family name 6",
            "first_name": "fitst name 6"
        },
        {
            "family_name": "family name 7",
            "first_name": "fitst name 7"
        },
        {
            "family_name": "family name 8",
            "first_name": "fitst name 8"
        },
        {
            "family_name": "family name 9",
            "first_name": "fitst name 9"
        },
        {
            "family_name": "family name 10",
            "first_name": "fitst name 10"
        },
    ]

    for elem in cell_values:
        attendee_users_table_data.append([
            cell_formatted_text.format(**elem), '1234abc', 'ACME Labs',
            '*****@*****.**', ''
        ])

    sess_part_users = SessionPartAttendeeUsersView()
    rendered_fields = sess_part_users.render(attendee_users_table_data)
    pdf.story.add(rendered_fields)

    some_space = Spacer(1, 10)
    pdf.story.add(some_space)

    sess_part_other_users = SessionPartOtherAttendeeUsersView()
    other_attendee_user_tale_data = [[
        TextField("<br/>"),
        TextField("<br/>"),
        TextField("<br/>"),
        TextField("<br/>"),
        TextField("<br/>"),
    ] for elem in range(0, 10)]
    other_attendee_user_tale_data = [[
        "<br/><br/>",
        "<br/><br/>",
        "<br/><br/>",
        "<br/><br/>",
        "<br/><br/>",
    ] for elem in range(0, 10)]
    rendered_fields = sess_part_other_users.render(
        other_attendee_user_tale_data)
    pdf.story.add(rendered_fields)
    pdf.build()
Esempio n. 17
0
File: jda.py Progetto: kinderp/3183
    def __init__(self, **kwargs):
        super(TitleModel, self).__init__(**kwargs)

        self.title = TextField("{}".format(self._title))
        self.logo = ImageField('./jda.png', width=80, height=50)