Browse Source

move assets para projetosexterno de tema e configura sapl project para leitura de temas através do .env

pull/2485/head
Leandro Roberto 7 years ago
parent
commit
1778472e74
  1. 7
      sapl-frontend/package.json
  2. 2
      sapl-frontend/public/index.html
  3. BIN
      sapl-frontend/src/assets/img/arrow.png
  4. BIN
      sapl-frontend/src/assets/img/authenticated.png
  5. BIN
      sapl-frontend/src/assets/img/avatar.png
  6. BIN
      sapl-frontend/src/assets/img/beta.png
  7. BIN
      sapl-frontend/src/assets/img/brasao_transp.gif
  8. BIN
      sapl-frontend/src/assets/img/down_arrow_select.jpg
  9. BIN
      sapl-frontend/src/assets/img/etiqueta.png
  10. BIN
      sapl-frontend/src/assets/img/favicon.ico
  11. BIN
      sapl-frontend/src/assets/img/file.png
  12. BIN
      sapl-frontend/src/assets/img/hand-note.png
  13. BIN
      sapl-frontend/src/assets/img/icon_comissoes.png
  14. BIN
      sapl-frontend/src/assets/img/icon_delete_white.png
  15. BIN
      sapl-frontend/src/assets/img/icon_materia_legislativa.png
  16. BIN
      sapl-frontend/src/assets/img/icon_mesa_diretora.png
  17. BIN
      sapl-frontend/src/assets/img/icon_normas_juridicas.png
  18. BIN
      sapl-frontend/src/assets/img/icon_parlamentares.png
  19. BIN
      sapl-frontend/src/assets/img/icon_pautas.png
  20. BIN
      sapl-frontend/src/assets/img/icon_plenarias.png
  21. BIN
      sapl-frontend/src/assets/img/icon_relatorios.png
  22. BIN
      sapl-frontend/src/assets/img/icon_save_white.png
  23. BIN
      sapl-frontend/src/assets/img/lexml.gif
  24. BIN
      sapl-frontend/src/assets/img/logo.png
  25. BIN
      sapl-frontend/src/assets/img/logo_cc.png
  26. BIN
      sapl-frontend/src/assets/img/logo_interlegis.png
  27. BIN
      sapl-frontend/src/assets/img/manual.png
  28. BIN
      sapl-frontend/src/assets/img/pdflogo.png
  29. BIN
      sapl-frontend/src/assets/img/perfil.png
  30. BIN
      sapl-frontend/src/assets/img/search-gray.png
  31. BIN
      sapl-frontend/src/assets/img/search.png
  32. BIN
      sapl-frontend/src/assets/img/user.png
  33. 22
      sapl-frontend/vue.config.js
  34. 4
      sapl/context_processors.py
  35. 3
      sapl/settings.py
  36. 4
      sapl/templates/base.html

7
sapl-frontend/package.json

@ -13,13 +13,12 @@
"dotenv": "^6.2.0", "dotenv": "^6.2.0",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"popper.js": "^1.14.6", "popper.js": "^1.14.6",
"sapl-oficial-theme": "../../sapl-oficial-theme",
"vue": "^2.5.21", "vue": "^2.5.21",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.0.1", "vuex": "^3.0.1",
"webpack": "^4.28.4", "webpack": "^4.28.4",
"webpack-bundle-tracker": "^0.4.2-beta", "webpack-bundle-tracker": "^0.4.2-beta"
"sapl-oficial-theme": "../../sapl-oficial-theme"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0", "@vue/cli-plugin-babel": "^3.3.0",
@ -27,10 +26,10 @@
"@vue/cli-service": "^3.3.0", "@vue/cli-service": "^3.3.0",
"@vue/eslint-config-prettier": "^4.0.1", "@vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"css-loader": "^2.1.0",
"eslint": "^5.8.0", "eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.9.0", "node-sass": "^4.9.0",
"css-loader": "^2.1.0",
"sass-loader": "^7.0.1", "sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.21" "vue-template-compiler": "^2.5.21"
} }

2
sapl-frontend/public/index.html

@ -13,5 +13,7 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<img src="icon_comissoes">
</body> </body>
</html> </html>

BIN
sapl-frontend/src/assets/img/arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

BIN
sapl-frontend/src/assets/img/authenticated.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

BIN
sapl-frontend/src/assets/img/avatar.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

BIN
sapl-frontend/src/assets/img/beta.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

BIN
sapl-frontend/src/assets/img/brasao_transp.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

BIN
sapl-frontend/src/assets/img/down_arrow_select.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

BIN
sapl-frontend/src/assets/img/etiqueta.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

BIN
sapl-frontend/src/assets/img/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

BIN
sapl-frontend/src/assets/img/file.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1021 B

BIN
sapl-frontend/src/assets/img/hand-note.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

BIN
sapl-frontend/src/assets/img/icon_comissoes.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
sapl-frontend/src/assets/img/icon_delete_white.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

BIN
sapl-frontend/src/assets/img/icon_materia_legislativa.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

BIN
sapl-frontend/src/assets/img/icon_mesa_diretora.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

BIN
sapl-frontend/src/assets/img/icon_normas_juridicas.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

BIN
sapl-frontend/src/assets/img/icon_parlamentares.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
sapl-frontend/src/assets/img/icon_pautas.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

BIN
sapl-frontend/src/assets/img/icon_plenarias.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

BIN
sapl-frontend/src/assets/img/icon_relatorios.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
sapl-frontend/src/assets/img/icon_save_white.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

BIN
sapl-frontend/src/assets/img/lexml.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

BIN
sapl-frontend/src/assets/img/logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
sapl-frontend/src/assets/img/logo_cc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

BIN
sapl-frontend/src/assets/img/logo_interlegis.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
sapl-frontend/src/assets/img/manual.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

BIN
sapl-frontend/src/assets/img/pdflogo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

BIN
sapl-frontend/src/assets/img/perfil.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

BIN
sapl-frontend/src/assets/img/search-gray.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
sapl-frontend/src/assets/img/search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

BIN
sapl-frontend/src/assets/img/user.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

22
sapl-frontend/vue.config.js

@ -5,6 +5,8 @@ const BundleTracker = require('webpack-bundle-tracker')
const dotenv = require('dotenv') const dotenv = require('dotenv')
dotenv.config({ path: '../sapl/.env' }) dotenv.config({ path: '../sapl/.env' })
var THEME_CUSTOM = process.env.THEME_CUSTOM === undefined ? "sapl-oficial-theme" : process.env.THEME_CUSTOM
module.exports = { module.exports = {
publicPath: 'http://localhost:8080/', publicPath: 'http://localhost:8080/',
outputDir: './dist/', outputDir: './dist/',
@ -30,25 +32,29 @@ module.exports = {
.watchContentBase( true ) .watchContentBase( true )
.https(false) .https(false)
.headers({ 'Access-Control-Allow-Origin': '\*' }) .headers({ 'Access-Control-Allow-Origin': '\*' })
.contentBase( [path.join(__dirname, 'public'), path.join(__dirname, 'src', 'assets')] ) .contentBase( [
path.join(__dirname, 'public'),
path.join(__dirname, 'src', 'assets'),
path.join(__dirname, 'node_modules', THEME_CUSTOM, 'public'),
] )
config.entryPoints.delete('app') config.entryPoints.delete('app')
// then add your own
config.entry('hellow') config.entry('hellow')
.add('./src/hellow/main.js') .add('./src/hellow/main.js')
.end() .end()
config.entry('theme') /*config
.add('./src/theme/main.js')
.end()
config
.plugin('theme') .plugin('theme')
.use(webpack.DefinePlugin, [{ .use(webpack.DefinePlugin, [{
THEME_CUSTOM: JSON.stringify(process.env.THEME_CUSTOM) THEME_CUSTOM: JSON.stringify(THEME_CUSTOM)
}]) }])
.end()*/
config.entry(THEME_CUSTOM)
.add(THEME_CUSTOM + '/src/main.js')
.end() .end()
} }
} }

4
sapl/context_processors.py

@ -22,3 +22,7 @@ def mail_service_configured(request):
logger.warning(_('Servidor de email não configurado.')) logger.warning(_('Servidor de email não configurado.'))
return {'mail_service_configured': False} return {'mail_service_configured': False}
return {'mail_service_configured': True} return {'mail_service_configured': True}
def THEME_CUSTOM(request):
return {"THEME_CUSTOM": settings.THEME_CUSTOM}

3
sapl/settings.py

@ -190,6 +190,7 @@ TEMPLATES = [
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'sapl.context_processors.parliament_info', 'sapl.context_processors.parliament_info',
'sapl.context_processors.mail_service_configured', 'sapl.context_processors.mail_service_configured',
'sapl.context_processors.THEME_CUSTOM'
], ],
'debug': DEBUG 'debug': DEBUG
}, },
@ -274,7 +275,7 @@ WEBPACK_LOADER = {
'IGNORE': [r'.+\.hot-update.js', r'.+\.map'] 'IGNORE': [r'.+\.hot-update.js', r'.+\.map']
} }
} }
THEME_CUSTOM = config('THEME_CUSTOM', default='sapl-oficial-theme')
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/ # https://docs.djangoproject.com/en/1.8/howto/static-files/

4
sapl/templates/base.html

@ -30,7 +30,7 @@
{# Scripts #} {# Scripts #}
{# modernizr must be in head (see http://modernizr.com/docs/#installing) #} {# modernizr must be in head (see http://modernizr.com/docs/#installing) #}
{% endcomment %} {% endcomment %}
{% render_bundle 'theme' 'css' %} {% render_bundle THEME_CUSTOM 'css' %}
{% endblock %} {% endblock %}
</head> </head>
@ -233,7 +233,7 @@
{% endif %} {% endif %}
{% block foot_js %} {% block foot_js %}
{% render_bundle 'theme' 'js' %} {% render_bundle THEME_CUSTOM 'js' %}
{% comment "" %} {% comment "" %}

Loading…
Cancel
Save