Napraviti template za dokument #7

Closed
opened 2025-02-13 06:21:56 +01:00 by senaduka · 8 comments
senaduka commented 2025-02-13 06:21:56 +01:00 (Migrated from gitlab.com)

Trenutno kad se kreira dokument i dodaju sekcije to je hardkodirano. Trebamo napraviti da to bude iz templatea.
Napraviti document_template.yml fajl u samom home direktoriju aplikacije sa ovakvom strukturom ( ovo je samo primjer, napraviti strukturu iz email fajlova primjera dokumenta koji cu ti poslati):

  - segment_type: "title"
    content: "Document Title"

  - segment_type: "subtitle"
    content: "Document Subtitle"

  - segment_type: "h1"
    content: "Introduction"

  - segment_type: "body"
    content: "{{ dynamic_intro }}"

  - segment_type: "h2"
    content: "Section 1: Details"

  - segment_type: "body"
    content: |
      <p>This is a static section with an embedded HTML table:</p>
      <table>
        <tr>
          <th>Header 1</th>
          <th>Header 2</th>
        </tr>
        <tr>
          <td>Data 1</td>
          <td>Data 2</td>
        </tr>
      </table>

  - segment_type: "quote"
    content: "{{ dynamic_quote }}"

  - segment_type: "h3"
    content: "Subsection 1.1"

  - segment_type: "body"
    content: "{{ dynamic_subsection }}"

Ovaj template opet treba da se moze importovati i eksportovati u bazu. Napraviti poseban model za template, i admin interface gdje se moze cijeli fajl izmijeniti u bazi.

Osim toga napraviti i jednu stranicu za preview samog templatea koja ce prikazati kako bi template izgledao kad se ubaci u bazu i pretvori u html. Ta stranica mora biti nedostupna obicnim korisnicma, nego samo onome ko je ulogiran u django admin.

Cilj je da ovom jaranu sto pravi strukturu omogucimo da moze mijenjati to u aplikaciji i vidjeti kako izgleda.

Trenutno kad se kreira dokument i dodaju sekcije to je hardkodirano. Trebamo napraviti da to bude iz templatea. Napraviti document_template.yml fajl u samom home direktoriju aplikacije sa ovakvom strukturom ( ovo je samo primjer, napraviti strukturu iz email fajlova primjera dokumenta koji cu ti poslati): ```segments: - segment_type: "title" content: "Document Title" - segment_type: "subtitle" content: "Document Subtitle" - segment_type: "h1" content: "Introduction" - segment_type: "body" content: "{{ dynamic_intro }}" - segment_type: "h2" content: "Section 1: Details" - segment_type: "body" content: | <p>This is a static section with an embedded HTML table:</p> <table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table> - segment_type: "quote" content: "{{ dynamic_quote }}" - segment_type: "h3" content: "Subsection 1.1" - segment_type: "body" content: "{{ dynamic_subsection }}" ``` Ovaj template opet treba da se moze importovati i eksportovati u bazu. Napraviti poseban model za template, i admin interface gdje se moze cijeli fajl izmijeniti u bazi. Osim toga napraviti i jednu stranicu za preview samog templatea koja ce prikazati kako bi template izgledao kad se ubaci u bazu i pretvori u html. Ta stranica mora biti nedostupna obicnim korisnicma, nego samo onome ko je ulogiran u django admin. Cilj je da ovom jaranu sto pravi strukturu omogucimo da moze mijenjati to u aplikaciji i vidjeti kako izgleda.
senaduka commented 2025-02-13 06:21:56 +01:00 (Migrated from gitlab.com)

assigned to @amirsabani303

assigned to @amirsabani303
senaduka commented 2025-02-13 06:22:23 +01:00 (Migrated from gitlab.com)

changed the description

changed the description
senaduka commented 2025-02-13 06:22:47 +01:00 (Migrated from gitlab.com)

changed the description

changed the description
senaduka commented 2025-02-13 06:23:27 +01:00 (Migrated from gitlab.com)

changed the description

changed the description
senaduka commented 2025-02-13 06:25:17 +01:00 (Migrated from gitlab.com)

changed the description

changed the description
amirsabani303 commented 2025-02-13 17:55:59 +01:00 (Migrated from gitlab.com)

mentioned in commit f41997fd59

mentioned in commit f41997fd594d733b6e9b941542a8798288200476
amirsabani303 commented 2025-02-13 17:58:49 +01:00 (Migrated from gitlab.com)

mentioned in merge request !7

mentioned in merge request !7
senaduka commented 2025-02-14 06:09:39 +01:00 (Migrated from gitlab.com)

mentioned in commit 11e4c8e047

mentioned in commit 11e4c8e04702bba6a1312c751f3fa2d376a798ce
senaduka (Migrated from gitlab.com) closed this issue 2025-02-14 06:09:40 +01:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: senaduka/old-riskletpy#7