From 7798cfedfaad1c79007702a6cfeb48a6ccb8b935 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 25 Aug 2015 13:26:16 +0200 Subject: [PATCH] Adding css for person (via grunt) --- .gitignore | 3 + Resources/Gruntfile.js | 46 +++++++++++ .../person.scssc | Bin 5952 -> 0 bytes Resources/assets/css/config.rb | 33 -------- Resources/assets/css/sass/person.scss | 74 ------------------ Resources/package.json | 16 ++++ Resources/public/css/person.css | 15 ++++ Resources/public/css/person.css.map | 7 ++ Resources/public/sass/person.scss | 16 ++++ Resources/views/layout.html.twig | 33 +++++--- Resources/views/menu.html.twig | 3 +- 11 files changed, 125 insertions(+), 121 deletions(-) create mode 100644 Resources/Gruntfile.js delete mode 100644 Resources/assets/css/.sass-cache/5423e640e54bbdf4d80063fe9dc2028bb970d84c/person.scssc delete mode 100644 Resources/assets/css/config.rb delete mode 100644 Resources/assets/css/sass/person.scss create mode 100644 Resources/package.json create mode 100644 Resources/public/css/person.css create mode 100644 Resources/public/css/person.css.map create mode 100644 Resources/public/sass/person.scss diff --git a/.gitignore b/.gitignore index 592e87f0c..9fcdf9d28 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ composer.lock vendor/* parameters.yml *~ +*.DS_Store +*.sass-cache +Resources/node_modules/ \ No newline at end of file diff --git a/Resources/Gruntfile.js b/Resources/Gruntfile.js new file mode 100644 index 000000000..60a81ed38 --- /dev/null +++ b/Resources/Gruntfile.js @@ -0,0 +1,46 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + chillperson: { + folders: { + pub: './public', + css: '<%= chillperson.folders.pub %>/css/', + sass: '<%= chillperson.folders.pub %>/sass/', + } + }, + sass: { + dist: { + options: { + debugInfo: true, + }, + files: [{ + expand: true, + cwd: '<%= chillperson.folders.sass.src %>', + src: ['*.scss'], + dest: '<%= chillperson.folders.css %>', + ext: '.css' + }] + } + }, + watch: { + css: { + files: [ '<%= chillperson.folders.sass %>/*.scss', '<%= chillperson.folders.sass %>/**/*.scss' ], + tasks: ['generatecss'], + /* + options: { + spawn: false, + interrupt: true, + } + */ + } + }, + }); + + grunt.loadNpmTasks('grunt-contrib-sass'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + grunt.registerTask('generatecss', 'sass'); + + grunt.registerTask('default', ['generatecss']); +}; \ No newline at end of file diff --git a/Resources/assets/css/.sass-cache/5423e640e54bbdf4d80063fe9dc2028bb970d84c/person.scssc b/Resources/assets/css/.sass-cache/5423e640e54bbdf4d80063fe9dc2028bb970d84c/person.scssc deleted file mode 100644 index 9287bacc26135338cce96335cc5c892b080a4361..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5952 zcmbtY>rNX-6b7qZ%woXA2{adytx0o{f@Pe5;u$GjCCUYzC)j(uh9qTQ?zF;yE{AU3!xz4Vdl&?=X~ePnREQK(Q53poJa48Pd(?o7ya_s zZtw22{r0o=-d?ZOBL3cU((ziI7HPMA?!>ZMCdRg1fic8 zi+^N3vC)d#J*9ykk?_beg+>A4LKS4Y5sZ(l{rZMaKW+_3G-ToNS>z31Xd&zMA&A6Y zXGrJJHFw}eL*gIvEklOt^4tRwkZ#N(gkG_J-#Z|`j!4)gWwh+}NxuV#{QON*IFYmP zGGE^+tkeD=Ac>R>QVR^-F{NGyq))JX@M1Zp@PdCy~-&+At8ypfNP9xI)|4Su9O8Qctvu9SEcp1x+t|uEX3EE z09?k`6HD+7rFTU~6(a5fyxznc41Z(cn?fUN9o*rh{%o2QfkiaYVzDGTz*;FYY!6=Rz2+!lwa2tJH^>qdiI@eB0gTZbNJC z01i4HehOpn9F;?Ih9#xTTqL7ztpT@byUW5DAZC&V7vq*0oUa17?#jN{Ixm;VZ#?_npg9Dj@J%G5P! zY65DXQ9nKv@+qFZ_e_zA$79q4E?4r_VV=1KfA%G@7)~xpA};R8`b1J-#brQ>{Inny z;Y9z+!1H|w0>gr4W0&-&u&|*lSRZ4-WjwA~AjO3Rw2m(&==m+9x9*_&6ngJ-dc}bzH4DCU%e40~clD*XxHu0}QcM$I#hw2f4pf6& zMqHBbL_XB2O^5&PwA=DQn2^IB<>O?09+6l)mpIKSq&!xnJS@bE9e5q`MJZ9+A*gvW zks4TW=l=m})F9{GE5-e`vg1j?j&)%N3R(Q95qUmkkH6#sm^L+2n;5=thL)4Hc@-YwX?+Tdj? zi6WJdXJm@RoR$2p8f~XGn^wV!TWZfkxFjR%sGQYx8hJC$P6`xlhq#Ss;?c0;miGD4 z$tXwYxcgX+$h4OXD5Ht>*02-YMO$jtHW>c~-lDSCO@*=f`;e_iY39DiU zB;3+*A$HWXg4c7p(k6kQvKe?v(El$_-z%P86nL^}I2g%{a#??8JA@H0Q;y6~gB7>* z8~1lIlC8u`rG|d?PmdWdJ88v6$~D-=>;n-dig`*C@!jr9TQj zOr|pd;fAE^U1=xfKRJ8JC?5r5D&mb?EvN>;WwJgHIfd3Q!_2|)f5cOW9MRonVp93Mupc-V(rP|0epH`@9MM`~ zZS}J@P7QMWxBwxXiX8r?==(XmXkW%JDXm2(Vs6XY4djRp!xYfk2n4(Zz9}Hu1LTN~ zKwq0=l&t;>rm0#QIlO$n1dd-okg);uX4R{X!%50qz-44rs>@`a)I1{U3?qP?oYk4n zCIje|p9z*$SrCo9UCcs@EA13raG3*TWpt5=awx4R;c*Cch<4Uk<+F;z)Osv0{1C+r zyv-UoU(gQV|K?TGUu5$rE`2pr@fwYT%O9?3rVTS0^VKmC(`0WhaLv`NmDel7 File.expand_path("#{extensions_dir}/modular-scale")) - -# Uncomment these to use regular Ruby gems. -require 'modular-scale' -require 'sassy-math' - -# Set this to the root of your project when deployed: -http_path = "/" -css_dir = "./../../public/css" -sass_dir = "sass" -images_dir = "img" - -# You can select your preferred output style here (can be overridden via the command line) :nested or :expanded or :compact or :compressed: -output_style = :compact - -# To enable relative paths to assets via compass helper functions. Uncomment: -# relative_assets = true - -# To disable debugging comments that display the original location of your selectors. Uncomment: -line_comments = false - - -# If you prefer the indented syntax, you might want to regenerate this -# project again passing --syntax sass, or you can uncomment this: -# preferred_syntax = :sass -# and then run: -# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass diff --git a/Resources/assets/css/sass/person.scss b/Resources/assets/css/sass/person.scss deleted file mode 100644 index c753b4a5c..000000000 --- a/Resources/assets/css/sass/person.scss +++ /dev/null @@ -1,74 +0,0 @@ -div#person_wrapper { - - div#general { - - } - - div#person_details { - margin-top: 50px; - - - .tab-content { - border-top: 1px solid #e5e5e5; - - width: 640px; - } - - dl { - padding: 0.5em; - } - - dt { - float: left; - clear: left; - width: 190px; - text-align: right; - font-weight: bold; - color: green; - } - - dt:after { - content: " :"; - } - - dd { - margin: 0 0 0 199px; - padding: 0 0 0.5em 0; - } - - label { - color: green; - } - - label:not(.radio) { - min-width: 190px; - font-weight: bold; - } - - label.radio{ - margin-left: 0.2em; - } - - .has_error { - label { - color: red; - } - - ul.errors li { - color: red; - } - - input { - - } - } - - div.form_control { - .controls { - float: right; - } - } - } - -} - diff --git a/Resources/package.json b/Resources/package.json new file mode 100644 index 000000000..3db5780e7 --- /dev/null +++ b/Resources/package.json @@ -0,0 +1,16 @@ +{ + "name": "chill-person-js-css", + "version": "0.0.0", + "description": "JS-CSS files for ChillPerson Bundle, a software for social workers", + "directories": { + }, + "author": "Champs-Libres ", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-copy": "^0.7.0", + "grunt-contrib-sass": "^0.8.1", + "grunt-contrib-watch": "^0.6.1", + "grunt-contrib-clean": "^0.6.0" + }, + "dependencies": {} +} diff --git a/Resources/public/css/person.css b/Resources/public/css/person.css new file mode 100644 index 000000000..e6557aad5 --- /dev/null +++ b/Resources/public/css/person.css @@ -0,0 +1,15 @@ +@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/marcu\/Projects\/Chill\/vendor\/chill-project\/person\/Resources\/public\/sass\/person\.scss}line{font-family:\000034}} +div#header-person-name { + background: none repeat scroll 0 0 #328474; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; } + +@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/marcu\/Projects\/Chill\/vendor\/chill-project\/person\/Resources\/public\/sass\/person\.scss}line{font-family:\0000311}} +div#header-person-details { + background: none repeat scroll 0 0 #43b29d; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; } + +/*# sourceMappingURL=person.css.map */ diff --git a/Resources/public/css/person.css.map b/Resources/public/css/person.css.map new file mode 100644 index 000000000..01f7c3c9f --- /dev/null +++ b/Resources/public/css/person.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": ";AAGA,sBAAuB;EACnB,UAAU,EAAE,8BAAwC;EACpD,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,GAAG;;;AAGvB,yBAA0B;EACtB,UAAU,EAAE,8BAAmC;EAC/C,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,GAAG;EAChB,cAAc,EAAE,GAAG", +"sources": ["../sass/person.scss"], +"names": [], +"file": "person.css" +} diff --git a/Resources/public/sass/person.scss b/Resources/public/sass/person.scss new file mode 100644 index 000000000..8b4f15e8e --- /dev/null +++ b/Resources/public/sass/person.scss @@ -0,0 +1,16 @@ + +@import '../../../../main/Resources/public/sass/config/colors'; + +div#header-person-name { + background: none repeat scroll 0 0 $chill-green-dark; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; +} + +div#header-person-details { + background: none repeat scroll 0 0 $chill-green; + color: #FFF; + padding-top: 1em; + padding-bottom: 1em; +} \ No newline at end of file diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index e27f1ab71..279092bf6 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -16,15 +16,24 @@ #} {% extends "ChillMainBundle::layout.html.twig" %} + +{% block css %} + {% stylesheets output="css/person.css" filter="cssrewrite" + "bundles/chillperson/css/person.css" + %} + + {% endstylesheets %} +{% endblock %} + {% block layout_content %}
- {{ 'Lastname'|trans|upper }} : {{ person.lastName|upper }} + {{ 'Lastname'|trans|upper }} : {{ person.lastName|upper }}
- {{ 'Fistname'|trans|upper}} : {{ person.firstName|upper }} + {{ 'Fistname'|trans|upper}} : {{ person.firstName|upper }}
- {{ 'Birthdate'|trans|upper }} : + {{ 'Birthdate'|trans|upper }} : {% if person.birthdate == null %} {{ 'Unknown date of birth'|trans }}, {{ ('person.gender.' ~ person.gender)|trans }} @@ -56,7 +65,7 @@ {% endif %}
- {{ 'Nationality'|trans|upper}} : + {{ 'Nationality'|trans|upper}} : {% if person.nationality is not null %} {{ person.nationality.name|localize_translatable_string }} {% else %} @@ -64,7 +73,7 @@ {% endif %}
- {{ 'Spoken languages'|trans|upper}} : + {{ 'Spoken languages'|trans|upper}} : {% if person.spokenLanguages|length == 0 %} {{ 'Unknown spoken languages'|trans }} {% else %} @@ -78,13 +87,6 @@
- {# Note: activeRouteKey should be defined in Controller or child layout #} - {{ chill_menu('person', { - 'layout': 'ChillPersonBundle::menu.html.twig', - 'args' : {'person_id': person.id }, - 'activeRouteKey': activeRouteKey - }) }} -
{# Flash messages ! #}
@@ -115,6 +117,13 @@ {% block personcontent %}{%endblock%}
+ + {# Note: activeRouteKey should be defined in Controller or child layout #} + {{ chill_menu('person', { + 'layout': 'ChillPersonBundle::menu.html.twig', + 'args' : {'person_id': person.id }, + 'activeRouteKey': activeRouteKey + }) }}
diff --git a/Resources/views/menu.html.twig b/Resources/views/menu.html.twig index f363f80f3..82be5518c 100644 --- a/Resources/views/menu.html.twig +++ b/Resources/views/menu.html.twig @@ -15,8 +15,7 @@ * along with this program. If not, see . #}
-