Skip to content
Snippets Groups Projects
Commit d5f816e4 authored by François  LAURENT's avatar François LAURENT
Browse files

feat: footer with version number

parent 866f71ed
No related branches found
No related tags found
No related merge requests found
......@@ -6,3 +6,4 @@ build/
public/
log/
storage/
version.txt
......@@ -20,8 +20,8 @@ RUN export HOME="$JULIA_PROJECT" \
ENV PATH "$PATH:$JULIA_PROJECT/.juliaup/bin"
RUN cd "$JULIA_PROJECT" \
&& rm -rf public \
&& rm -rf storage \
&& git rev-parse --short HEAD > src/version.txt \
&& rm -rf .git public storage \
&& cp front/Manifest.toml . \
&& julia -e 'using Pkg; Pkg.instantiate()' \
&& mkdir -p public \
......
......@@ -30,19 +30,23 @@ if Genie.Configuration.isprod()
@error "GENIE_ENV=prod is not implemented"
end
function modelview(model, view)
page(model, NyxUI.add_footer(view); title=nyxui_title)
end
Stipple.Layout.add_css(nyxui_css)
include("src/apps/catalog/app.jl")
route("/") do
AppCatalog.handler(nyxui_title)
AppCatalog.handler(modelview)
end
include("src/apps/muscles/app.jl")
MuscleApp.bonito_app.name = "muscles"
route("/muscles") do
MuscleApp.handler(nyxui_title)
MuscleApp.handler(modelview)
end
run_as_script = isinteractive()
......
module GenieExtras
export publish_css
import Genie.Renderer.Html
export publish_css, add_footer
const project_root = dirname(Base.current_project())
......@@ -28,4 +30,21 @@ function publish_css(; clear=true)
return css_dir
end
function footer()
version = string(pkgversion(@__MODULE__))
if endswith(version, ".0")
version = version[1:end-2]
end
versionfile = joinpath(@__DIR__, "version.txt")
version = if isfile(versionfile)
join((version, readchomp(versionfile)), "-")
end
tagurl = "https://gitlab.com/dbc-nyx/NyxUI.jl/-/tags"
Html.footer("NyxUI.jl <a href=\"$tagurl\">v$version</a>")
end
add_footer(ui::AbstractString) = "$ui$(footer())"
add_footer(ui::Function) = () -> add_footer(ui())
end
......@@ -46,11 +46,11 @@ end
const ui = app_catalog_view
function handler(title)
function handler(modelview)
Stipple.Layout.add_css("/css/appcatalog.css")
publish_images()
empty_model = @init
page(empty_model, app_catalog_view; title=title)
modelview(empty_model, app_catalog_view)
end
function publish_images()
......
......@@ -298,13 +298,13 @@ end
const ui = muscle_view
function handler(title)
function handler(modelview)
muscle_model = @init
url = ""
#muscle_model, url = init_model()
Stipple.Layout.add_css("/css/muscleapp.css")
channel = muscle_model.channel__
page(muscle_model, muscle_view(url; channel=channel); title=title)
modelview(muscle_model, muscle_view(url; channel=channel))
end
function init_model(muscle_model=nothing)
......
......@@ -49,3 +49,8 @@ div.no-file-listing .q-icon {
.disabled {
pointer-events: none;
}
footer {
text-align: right;
padding-right: 1rem;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment