contribution.rst 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Contributing
  2. ============
  3. Django JET is open-source and every member of the community can contribute to it. We are happy to see patches
  4. and improvements with Django JET. But please keep in mind that there are some guidelines you should follow.
  5. .. _requirements:
  6. Requirements
  7. ------------
  8. * Git master branch should always be stable
  9. * All pull requests are made to git dev branch
  10. * Non AGPL compatible code is not eligible for inclusion
  11. Guidelines For Reporting An Issue/Feature
  12. -----------------------------------------
  13. So you've found a bug or have a great idea for a feature. Here's the steps you should take
  14. to help get it added/fixed in Django JET:
  15. * First check if there's an existing issue/pull request for this bug/feature. Issues can be found here
  16. https://github.com/geex-arts/django-jet/issues, PRs here https://github.com/geex-arts/django-jet/pulls
  17. * If there isn't one there, please add an issue. The ideal report includes:
  18. * A description of the problem/suggestion
  19. * How to reproduce the bug
  20. * If relevant including the versions of your:
  21. * Python interpreter
  22. * Django
  23. * Django JET
  24. * Optionally of the other dependencies involved
  25. * It would be great if you also make a pull request which solves your issue
  26. Guidelines For Contributing Code
  27. --------------------------------
  28. If you're ready to contribute back some code/docs, the process should look like:
  29. * Fork the project on GitHub into your own account
  30. * Clone your copy of Django JET to a separate folder
  31. * Install it into your demo project using ``pip install -e PATH_TO_CLONED_JET``
  32. * Make a new branch in git & commit your changes there
  33. * Push your new branch up to GitHub
  34. * Again, ensure there isn't already an issue or pull request out there on it. If there is and you feel you have
  35. a better fix, please take note of the issue number and mention it in your pull request
  36. * Create a new pull request (based on your branch), including what the problem/feature is, versions of
  37. your software and referencing any related issues/pull requests
  38. In order to be merged into Django JET, contributions must have the following:
  39. * A solid patch that:
  40. * is clear
  41. * works across all supported versions of Python/Django
  42. * follows the existing style of the code base (mostly PEP-8)
  43. * Desirably a test case that demonstrates the previous flaw that now passes with the included patch
  44. * If it adds/changes a public API, it must also include documentation for those changes
  45. * Must be appropriately licensed (see requirements_)
  46. If your contribution lacks any of these things, they will have to be added by a core contributor before
  47. being merged into Django JET proper, which may take time to get to.
  48. Contribution Translations
  49. -------------------------
  50. If you want to add new translations locale, please do not use automatic Django locale generation, because it will
  51. produce files with missing JS strings and duplicates. Instead copy the following well formatted "en" files to your
  52. new locale folder:
  53. * jet/locale/LOCALE/LC_MESSAGES/django.mo
  54. * jet/locale/LOCALE/LC_MESSAGES/djangojs.mo
  55. * jet/dashboard/locale/LOCALE/LC_MESSAGES/django.mo
  56. * jet/dashboard/locale/LOCALE/LC_MESSAGES/djangojs.mo
  57. Contribution Styles/Javascript/Translations
  58. -------------------------------------------
  59. Javascript/CSS/Translations need to be built each time after updating. For this you need `Node <http://nodejs.org>`_
  60. and `Gulp <http://gulpjs.com>`_. It's out of the scope of this tutorial to go into details, but you should
  61. find lots of useful references on how to install it.
  62. Node is needed for Gulp, so install it using your system package manager:
  63. .. code-block:: bash
  64. apt-get install -nodejs
  65. # or
  66. yum install nodejs
  67. # or
  68. brew install node
  69. # ...
  70. Now you are able to install Gulp globally:
  71. .. code-block:: bash
  72. npm install --global gulp-cli
  73. Change your working directory to Django JET where ``package.json`` and ``gulpfile.js`` are located and
  74. install Gulp dependencies:
  75. .. code-block:: bash
  76. npm install
  77. Now you are ready for contribution. Run Gulp from JET's directory to build all styles/scripts/locales and
  78. start watching for changes (gulp will rebuild files as soon they change):
  79. .. code-block:: bash
  80. gulp
  81. Or if you want just to perform a single build without watching for changes run:
  82. .. code-block:: bash
  83. gulp build
  84. Building produces the following files:
  85. * CSS files for each theme:
  86. * jet/static/jet/css/themes/THEME_NAME/base.css
  87. * jet/static/jet/css/themes/THEME_NAME/jquery-ui.theme.css
  88. * jet/static/jet/css/themes/THEME_NAME/select2.theme.css
  89. * CSS for other JS libraries used in JET – jet/static/jet/css/vendor.css
  90. * Combined JS scripts of JET – jet/static/jet/js/build/bundle.min.js
  91. * Localization files for JS libraries:
  92. * jet/static/jet/js/i18n/jquery-ui/
  93. * jet/static/jet/js/i18n/jquery-ui-timepicker/
  94. * jet/static/jet/js/i18n/select2/
  95. * Compiled Django localizations:
  96. * jet/locale/LOCALE/LC_MESSAGES/django.mo
  97. * jet/locale/LOCALE/LC_MESSAGES/djangojs.mo
  98. * jet/dashboard/locale/LOCALE/LC_MESSAGES/django.mo
  99. * jet/dashboard/locale/LOCALE/LC_MESSAGES/djangojs.mo
  100. You should commit generated build files together with sources.
  101. Contribution Documentation
  102. --------------------------
  103. If you update documentation files, you can build the html files (this is not needed with a pull-request,
  104. but you might wanna check how documentation will look like locally). To do so change your working directory
  105. to ``docs/`` inside JET and run:
  106. .. code-block:: bash
  107. make html
  108. ``docs/_build/html/`` folder will contain all html files including starting ``index.html``.