Merge Request #43

Merged
noosfero-themes/angular-theme!43
Created by Michel Felipe

Skin structure - Folder organization + Validation

This changes closes #81, #96 issues.

Added skin folder structure and a verify whether the .scss file exists. Added a verify to the theme folder.

Now, when the theme or skin configured with npm config not exists, a exception is displayed in your terminal.

The screen below shows a example:

skin-error

Assignee: None
Milestone: 2016.06

Merged by Michel Felipe

Source branch has been removed
Commits (3)
2 participants
    75f9da986cd17e271b4e4e64023bfa4a?s=40&d=identicon
    Evandro Junior started a discussion on commit 3a1d52ef
    last updated by Michel Felipe
    README.md
    62 64 }
    63 65 ```
    64 66 - Configure application to use the new theme, e.g.:
    65   -`npm config set angular-theme:skin custom-skin`
      67 +`npm config set angular-theme:skin skin-myscustom`
    2
    75f9da986cd17e271b4e4e64023bfa4a?s=40&d=identicon
    Evandro Junior started a discussion on commit 3a1d52ef
    last updated by Evandro Junior
    README.md
    62 64 }
    63 65 ```
    64 66 - Configure application to use the new theme, e.g.:
    65   -`npm config set angular-theme:skin custom-skin`
      67 +`npm config set angular-theme:skin skin-myscustom`
    66 68  
    67 69 - Start the application with `npm start` scripts ou make a build
      70 + > **PS:** If the configured skin is invalid, a error message is showed in the terminal.
    1
    75f9da986cd17e271b4e4e64023bfa4a?s=40&d=identicon
    Evandro Junior started a discussion on commit 3a1d52ef
    last updated by Evandro Junior
    gulp/conf.js
      42 +* Check if skin file exists on "{theme}/app/layout/skins" directory
      43 +*
      44 +* @param skin The skin name passed by arg to gulp task
      45 +*/
      46 +exports.skinExists = function (skin) {
      47 + var skinFile = skin+'.scss';
      48 + if(/skin-/.test(skin)){
      49 + skinFile = skin.replace('skin-','_')+'.scss';
      50 + }
      51 +
      52 + var skinPath = path.join(exports.paths.themes, exports.paths.theme, '/app/layout/skins/', skinFile);
      53 +
      54 + try {
      55 + fs.statSync(skinPath);
      56 + }catch(e) {
      57 + throw new Error('The skin "'+skin+'" on path "'+skinPath+'" was not found');
    1
    • 75f9da986cd17e271b4e4e64023bfa4a?s=40&d=identicon
      Evandro Junior @evandrojr

      IMHO this sounds better: throw new Error('The skin "'+skin+'" was not found in "'+skinPath+'"');

      Choose File ...   File name...
      Cancel
  • Me
    Michel Felipe @mfdeveloper

    Added 1 new commit:

    • 6be9287d - Fix gramatical and text mistakes
    Choose File ...   File name...
    Cancel
  • 75f9da986cd17e271b4e4e64023bfa4a?s=40&d=identicon
    Evandro Junior @evandrojr

    Added 1 new commit:

    Choose File ...   File name...
    Cancel
  • Me
    Michel Felipe @mfdeveloper
    Choose File ...   File name...
    Cancel
  • Me
    Michel Felipe @mfdeveloper

    mentioned in merge request !48

    Choose File ...   File name...
    Cancel
  • Me
    Michel Felipe @mfdeveloper

    mentioned in merge request !48

    Choose File ...   File name...
    Cancel