diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 0000000..92e88c7 --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,50 @@ +#!/bin/sh + +# This hook handle CSS and JS minification for the default templates. + +# ****************************************************************** +# You'll need to have java installed on your system to use this hook +# ****************************************************************** + +# *** Replace these two vars if need to use another YUICOMPRESSOR than provided *** +YUICOMPRESSOR="../../.hooks/yuicompressor-2.4.8.jar" +# *** + +# Templates to process +TEMPLATES="tpl/default_en/ tpl/default_fr/" +# ============= + +for template in $TEMPLATES +do + cd $template + if `git diff-index --cached HEAD | grep js/main.js > /dev/null 2>&1` || ! [ -e "js/main.min.js" ] + then + echo ">>> Minify hook started" + if [ -e "js/main.min.js" ] + then + rm js/main.min.js + fi + + cat js/jquery-1.10.2.min.js js/main.js > js/main.tmp.js + java -jar $YUICOMPRESSOR -o "js/main.min.js" js/main.tmp.js + rm js/main.tmp.js + + git add js/main.min.js + echo -e ">>> JS files minified.\n" + fi + + if `git diff-index --cached HEAD | grep css/style.css > /dev/null 2>&1` || ! [ -e "css/style.min.css" ] + then + echo ">>> Minify hook started" + if [ -e "css/style.min.css" ] + then + rm css/style.min.css + fi + + java -jar $YUICOMPRESSOR css/style.css -o css/style.min.css + git add css/style.min.css + echo -e ">>> CSS files minified.\n" + fi + cd ../.. +done +exit 0 diff --git a/.hooks/yuicompressor-2.4.8.jar b/.hooks/yuicompressor-2.4.8.jar new file mode 100644 index 0000000..a1cf0a0 Binary files /dev/null and b/.hooks/yuicompressor-2.4.8.jar differ diff --git a/tpl/default_en/css/style.min.css b/tpl/default_en/css/style.min.css new file mode 100644 index 0000000..085f514 --- /dev/null +++ b/tpl/default_en/css/style.min.css @@ -0,0 +1 @@ +html{height:100%}body{position:relative;padding-bottom:2em;min-height:calc(100% - 2em);font-family:sans-serif;margin:0}body>p,body>ul,body>dl{margin-left:1em;margin-right:1em}fieldset{border:1px solid #999;margin-bottom:1em}form a{position:relative}form img{height:1.5em;vertical-align:middle;position:absolute;left:.5em}table{margin:auto;text-align:center;max-width:100%;border-collapse:collapse}table td,table th{padding:.75em;border:1px solid black}table th{background-color:#DDD}h2{background-color:#333;padding:.5em;text-align:right;color:white;border-top-right-radius:1em;border-bottom-right-radius:1em;display:inline-block;padding-left:3em;border:.3em solid green;border-left:0}hr{width:33%;margin-top:2em;margin-bottom:2em}input[type="checkbox"]{margin-left:2em}.red{color:red}.center{text-align:center}.label-block{display:inline-block;text-align:right;margin-right:10px;width:200px}.cell-disabled{background-color:#ddd}input[type=submit]{background-color:green;color:white;border-radius:10px}#title,#title a,#title a:visited,#install h1{background-color:#333;border-bottom:.3em solid green;color:white;padding:.5em;margin:0;text-align:center}#title a{text-decoration:none}#menu ul{text-align:center}#menu li{display:inline-block;margin-left:1em;margin-right:1em;margin-bottom:.5em}#notice{text-align:center;font-size:1.5em;background-color:green;padding:.1em}#detailed_summary{margin-top:2.5em}#connexion_form{margin:auto;width:67%;text-align:center}#connexion_form .label-block{width:150px}#edit_password_form,#edit_user_form,#invoice_form,#notice_form,#global_payback_form{width:67%;margin:auto}#global_payback_form fieldset{margin-top:2em}#edit_password_form p,#edit_user_form p,#notice_form p,#global_payback_form p{text-align:center}#edit_user_admin_rights{text-align:center}#textarea_notice{width:75%}textarea#what{width:75%}#list_expenses tr:hover,#balance_table tr:not(:first-child):hover *,#global_paybacks_table tr:not(:first-child):hover *,.highlight_td{background-color:green}#user_connected{text-align:right;margin-right:1em;position:absolute;bottom:0;height:1em;font-size:.75em;right:0;font-style:italic}#install{margin:0}#install form,#settings_form{width:67%;margin:auto}.error{font-size:1.5em;color:red;font-weight:bold;text-align:center} \ No newline at end of file diff --git a/tpl/default_en/footer.html b/tpl/default_en/footer.html index 00702f8..0ecccff 100755 --- a/tpl/default_en/footer.html +++ b/tpl/default_en/footer.html @@ -1,7 +1,6 @@ {if condition="!$connection"}
Connected as {$current_user->getDisplayName()}.
{/if} - - +