Forgejo actions config
This commit is contained in:
parent
6e4f8937eb
commit
80d09eee99
6 changed files with 55 additions and 24 deletions
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v5
|
||||||
with:
|
with:
|
||||||
registry: code.hohl.cloud
|
registry: code.hohl.cloud
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
|
|
||||||
BIN
app/assets/images/logo-apfelschule.png
Normal file
BIN
app/assets/images/logo-apfelschule.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -1,14 +1,17 @@
|
||||||
module PdfDocuments
|
module PdfDocuments
|
||||||
class Base
|
class Base
|
||||||
|
attr_reader :params
|
||||||
|
|
||||||
def initialize(prawn_document, **params)
|
def initialize(prawn_document, **params)
|
||||||
@prawn_document = prawn_document
|
@prawn_document = prawn_document
|
||||||
@prawn_document.markup_options = markup_options
|
@prawn_document.markup_options = markup_options
|
||||||
@prawn_document.font_families.update('Lexend' => {
|
# @prawn_document.font_families.update('Lexend' => {
|
||||||
normal: 'vendor/assets/fonts/Lexend-Light.ttf',
|
# normal: 'vendor/assets/fonts/Lexend-Light.ttf',
|
||||||
bold: 'vendor/assets/fonts/Lexend-Bold.ttf',
|
# bold: 'vendor/assets/fonts/Lexend-Bold.ttf',
|
||||||
italic: 'vendor/assets/fonts/Lexend-Regular.ttf'
|
# exta_bold: 'vendor/assets/fonts/Lexend-ExtraBold.ttf',
|
||||||
})
|
# italic: 'vendor/assets/fonts/Lexend-Regular.ttf'
|
||||||
@prawn_document.font 'Lexend'
|
# })
|
||||||
|
@prawn_document.font 'Helvetica', size: 12
|
||||||
@params = OpenStruct.new(params)
|
@params = OpenStruct.new(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -24,14 +27,14 @@ module PdfDocuments
|
||||||
end
|
end
|
||||||
|
|
||||||
def heading1(text)
|
def heading1(text)
|
||||||
@prawn_document.markup "<h1><u>#{text}</u></h1>"
|
@prawn_document.markup "<h1>#{text}</h1>"
|
||||||
end
|
end
|
||||||
|
|
||||||
def heading2(text)
|
def heading2(text)
|
||||||
@prawn_document.markup "<h2>#{text}</h2>"
|
@prawn_document.markup "<h2>#{text}</h2>"
|
||||||
end
|
end
|
||||||
|
|
||||||
def heading2(text)
|
def heading3(text)
|
||||||
@prawn_document.markup "<h3>#{text}</h3>"
|
@prawn_document.markup "<h3>#{text}</h3>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -43,18 +46,27 @@ module PdfDocuments
|
||||||
@prawn_document.markup prepare_rich_text(text)
|
@prawn_document.markup prepare_rich_text(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def hr
|
||||||
|
@prawn_document.markup '<hr>'
|
||||||
|
end
|
||||||
|
|
||||||
def markup_options
|
def markup_options
|
||||||
{
|
{
|
||||||
text: { size: 10, margin_bottom: 10 },
|
text: { size: 12, margin_bottom: 5 },
|
||||||
heading1: { style: :bold, size: 24, margin_bottom: 10, margin_top: 20 },
|
heading1: { style: :bold, size: 26, margin_bottom: 10, margin_top: 0 },
|
||||||
heading2: { style: :bold, size: 18, margin_bottom: 10, margin_top: 15 },
|
heading2: { style: :bold, size: 17, margin_bottom: 10, margin_top: 5 },
|
||||||
heading3: { style: :bold, size: 16, margin_bottom: 10, margin_top: 10 },
|
heading3: { style: :bold, size: 13, margin_bottom: 10, margin_top: 5 },
|
||||||
heading4: { style: :bold, size: 14, margin_bottom: 10, margin_top: 5 },
|
heading4: { style: :bold, size: 12, margin_bottom: 10, margin_top: 5 },
|
||||||
heading5: { style: :bold, size: 14, margin_bottom: 10, margin_top: 5 },
|
heading5: { style: :bold, size: 12, margin_bottom: 10, margin_top: 5 },
|
||||||
heading6: { style: :thin, size: 14, margin_bottom: 10, margin_top: 5 }
|
heading6: { style: :thin, size: 12, margin_bottom: 10, margin_top: 5 }
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def logo
|
||||||
|
@prawn_document.image 'app/assets/images/logo-apfelschule.png', width: 150
|
||||||
|
@prawn_document.move_down 30
|
||||||
|
end
|
||||||
|
|
||||||
def prepare_rich_text(rich_text)
|
def prepare_rich_text(rich_text)
|
||||||
{ h1: 'h4' }.each do |tag, replacement|
|
{ h1: 'h4' }.each do |tag, replacement|
|
||||||
rich_text = rich_text.to_s.gsub("<#{tag}", "<#{replacement}")
|
rich_text = rich_text.to_s.gsub("<#{tag}", "<#{replacement}")
|
||||||
|
|
@ -63,5 +75,17 @@ module PdfDocuments
|
||||||
|
|
||||||
rich_text
|
rich_text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def font(...)
|
||||||
|
@prawn_document.font(...)
|
||||||
|
end
|
||||||
|
|
||||||
|
def formatted_text(...)
|
||||||
|
@prawn_document.formatted_text(...)
|
||||||
|
end
|
||||||
|
|
||||||
|
def move_down(...)
|
||||||
|
@prawn_document.move_down(...)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,22 @@ module PdfDocuments
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate
|
def generate
|
||||||
heading1 @params.report.name
|
logo
|
||||||
|
@prawn_document.formatted_text_box [{
|
||||||
|
text: "Dieses Dokument wurd am #{Time.current.strftime('%d %B %Y')} um #{Time.current.strftime('%H:%M:%S')} erstellt.", size: 8, align: :right
|
||||||
|
}], align: :right
|
||||||
|
|
||||||
@params.report.elements.each do |element|
|
heading1 params.report.name
|
||||||
heading2 element.title
|
rich_text params.report.comment_html
|
||||||
text element.path
|
|
||||||
|
params.report.elements.each.with_index(1) do |element, element_index|
|
||||||
|
heading2 "#{element_index} #{element.title}"
|
||||||
|
formatted_text [{ text: element.path, styles: %i[bold italic underline] }]
|
||||||
|
move_down(5)
|
||||||
rich_text element.description_html
|
rich_text element.description_html
|
||||||
|
|
||||||
element.success_criteria.each do |success_criterion|
|
element.success_criteria.each.with_index(1) do |success_criterion, sc_index|
|
||||||
text success_criterion.title
|
heading3 "#{element_index}.#{sc_index} #{success_criterion.title}"
|
||||||
rich_text success_criterion.description_html
|
rich_text success_criterion.description_html
|
||||||
rich_text success_criterion.comment_html
|
rich_text success_criterion.comment_html
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div id="<%= dom_id element %>" class="mt-4 border-top pt-3">
|
<div id="<%= dom_id element %>" class="mt-4 border-top pt-3">
|
||||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<h2 class="h3">
|
<h2 class="h4">
|
||||||
<i class="bi bi-card-checklist">
|
<i class="bi bi-card-checklist">
|
||||||
</i>
|
</i>
|
||||||
<%= element.title %>
|
<%= element.title %>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<% edit_mode = action_name == "edit" %>
|
<% edit_mode = action_name == "edit" %>
|
||||||
<div class="card-header d-flex">
|
<div class="card-header d-flex">
|
||||||
<h3
|
<h3
|
||||||
class="h4"
|
class="h5 mt-2"
|
||||||
data-bs-toggle="collapse"
|
data-bs-toggle="collapse"
|
||||||
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||||
role="button"
|
role="button"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue