initialize from imio-publik-themes and clean static and templates directories

This commit is contained in:
Benjamin Dauvergne 2023-06-08 11:05:00 +02:00
commit f7827015e6
15 changed files with 200 additions and 0 deletions

6
.editorconfig Normal file
View File

@ -0,0 +1,6 @@
[*.scss]
charset = utf-8
indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

16
.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
*.pyc
*.swp
*.map
tmp.html
style.css
style.css.map
local_settings.py
passerelle.sqlite3
media
themes.json
package.json
package-lock.json
node_modules
watcher.sh
listener.sh

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "publik-base-theme"]
path = publik-base-theme
url = gitea@git.entrouvert.org:entrouvert/publik-base-theme.git
branch = main

6
.prettierrc.json Normal file
View File

@ -0,0 +1,6 @@
{
"useTabs": true,
"tabWidth": 2,
"useTabs": true,
"endOfLine": "lf"
}

2
COPYING Normal file
View File

@ -0,0 +1,2 @@
Fargo is entirely under the copyright of Entr'ouvert and distributed
under the license AGPLv3 or later.

37
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,37 @@
@Library('eo-jenkins-lib@main') import eo.Utils
pipeline {
agent any
stages {
stage('Packaging') {
steps {
script {
env.SHORT_JOB_NAME=sh(
returnStdout: true,
// given JOB_NAME=gitea/project/PR-46, returns project
// given JOB_NAME=project/main, returns project
script: '''
echo "${JOB_NAME}" | sed "s/gitea\\///" | awk -F/ '{print $1}'
'''
).trim()
if (env.GIT_BRANCH == 'main' || env.GIT_BRANCH == 'origin/main') {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye ${SHORT_JOB_NAME}"
} else if (env.GIT_BRANCH.startsWith('hotfix/')) {
sh "sudo -H -u eobuilder /usr/local/bin/eobuilder -d bullseye --branch ${env.GIT_BRANCH} --hotfix ${SHORT_JOB_NAME}"
}
}
}
}
}
post {
always {
script {
utils = new Utils()
utils.mail_notify(currentBuild, env, 'admints@imio.be')
}
}
success {
cleanWs()
}
}
}

61
Makefile Normal file
View File

@ -0,0 +1,61 @@
VERSION=`git describe | sed 's/^v//; s/-/./g' `
NAME="imio-publik-themes"
prefix = /usr
all: themes.json css
themes.json: $(wildcard static/*/config.json)
python3 publik-base-theme/create_themes_json.py --overlay imio
%.css: export LC_ALL=C.UTF-8
.SECONDEXPANSION:
%.css: %.scss $$(wildcard $$(@D)/*.scss)
sassc $< $@
publik-base-theme/static/includes/_data_uris.scss: $(wildcard publik-base-theme/static/includes/img/*)
cd publik-base-theme; python3 make_data_uris.py static/includes/
css: publik-base-theme/static/includes/_data_uris.scss $(shell python3 get_themes.py)
rm -rf static/*/.sass-cache/
for inode2 in $(shell ls -d templates/variants/*/) ; do \
if [ -f $$inode2/prepare-template.py ]; then \
cd $$inode2 && python3 prepare-template.py; \
cd ../../..; \
fi \
done
clean:
rm -rf sdist
DIST_FILES = \
Makefile \
publik-base-theme \
static templates \
get_themes.py
dist: clean
-mkdir sdist
rm -rf sdist/$(NAME)-$(VERSION)
mkdir -p sdist/$(NAME)-$(VERSION)
for i in $(DIST_FILES); do \
cp -R "$$i" sdist/$(NAME)-$(VERSION); \
done
install:
mkdir -p $(DESTDIR)$(prefix)/share/publik/themes/imio
cp -r static templates themes.json $(DESTDIR)$(prefix)/share/publik/themes/imio
rm $(DESTDIR)$(prefix)/share/publik/themes/imio/static/*/config.json
dist-bzip2: dist
-mkdir sdist
cd sdist && tar cfj ../sdist/$(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)
version:
@(echo $(VERSION))
name:
@(echo $(NAME))
fullname:
@(echo $(NAME)-$(VERSION))

View File

@ -0,0 +1,22 @@
# Script to add new scss @import in all style.scss files (except in static/imio folder)
# SAMPLE : python add_import_in_style.scss.py ../imio/cells.scss
# This line "../imio/cells.scss" will be adding in all commune folder
# Use git checkout to undo!
import os
import sys
root_folder = "static"
fileSet = set()
value = "@import '{}';\n".format(sys.argv[1])
for folder, under_folders, files in os.walk(root_folder):
for filename in files:
if filename == 'style.scss' and folder != 'imio':
relative_folder = os.path.relpath(folder, root_folder)
relative_path_file = os.path.join(relative_folder, filename)
with open('{}/{}'.format(root_folder, relative_path_file), "r") as f_in_readonly:
contents = f_in_readonly.readlines()
if value not in contents:
contents.insert(len(contents) -1, value)
with open('{}/{}'.format(root_folder, relative_path_file), "w") as f_in_write:
contents = "".join(contents)
f_in_write.write(contents)

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
imio-publik-themes (0.1-1) unstable; urgency=low
* Initial packaging.
-- Frederic Peters <fpeters@debian.org> Thu, 25 Jun 2015 07:27:48 +0200

14
debian/control vendored Normal file
View File

@ -0,0 +1,14 @@
Source: imio-publik-themes
Section: web
Priority: optional
Maintainer: Frédéric Péters <fpeters@entrouvert.com>
Build-Depends: debhelper-compat (= 12), sassc (>= 3.4.2), wget(>= 1.16), python3-all
Standards-Version: 3.9.4
Homepage: http://git.entrouvert.org/imio-publik-themes.git
Package: imio-publik-themes
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, publik-base-theme (>= 6.46)
Conflicts: python-authentic2 (< 2.1.20.742.gb6ee096-0)
Breaks: combo (< 0.7.1)
Description: Publik themes for iMio

16
debian/rules vendored Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@
override_dh_auto_build:
dh_auto_build --no-parallel

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

9
get_themes.py Normal file
View File

@ -0,0 +1,9 @@
#! /usr/bin/env python3
import os
for dirname in sorted(os.listdir('static')):
config = os.path.join('static', dirname, 'config.json')
if not os.path.exists(config):
continue
print('static/%s/style.css' % dirname)

1
publik-base-theme Submodule

@ -0,0 +1 @@
Subproject commit 7653d2496707fa93a700592a9582e8ebe684a39f

0
templates/.empty Normal file
View File