CONTRIBUTING.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 Styles/Javascript/Translations
  49. -------------------------------------------
  50. Javascript/CSS/Translations need to be built each time after updating. For this you need `Node <http://nodejs.org>`_
  51. and `Gulp <http://gulpjs.com>`_. It's out of the scope of this tutorial to go into details, but you should
  52. find lots of useful references on how to install it.
  53. Node is needed for Gulp, so install it using your system package manager:
  54. .. code-block:: bash
  55. apt-get install -nodejs
  56. # or
  57. yum install nodejs
  58. # or
  59. brew install node
  60. # ...
  61. Now you are able to install Gulp globally:
  62. .. code-block:: bash
  63. npm install --global gulp-cli
  64. Change your working directory to Django JET where ``package.json`` and ``gulpfile.js`` are located and
  65. install Gulp dependencies:
  66. .. code-block:: bash
  67. npm install
  68. Now you are ready for contribution. Run Gulp from JET's directory to build all styles/scripts/locales and
  69. start watching for changes (gulp will rebuild files as soon they change):
  70. .. code-block:: bash
  71. gulp
  72. Or if you want just to perform a single build without watching for changes run:
  73. .. code-block:: bash
  74. gulp build
  75. Building produces the following files:
  76. * CSS files for each theme:
  77. * jet/static/jet/css/themes/THEME_NAME/base.css
  78. * jet/static/jet/css/themes/THEME_NAME/jquery-ui.theme.css
  79. * jet/static/jet/css/themes/THEME_NAME/select2.theme.css
  80. * CSS for other JS libraries used in JET – jet/static/jet/css/vendor.css
  81. * Combined JS scripts of JET – jet/static/jet/js/build/bundle.min.js
  82. * Localization files for JS libraries:
  83. * jet/static/jet/js/i18n/jquery-ui/
  84. * jet/static/jet/js/i18n/jquery-ui-timepicker/
  85. * jet/static/jet/js/i18n/select2/
  86. * Compiled Django localizations:
  87. * jet/locale/LOCALE/LC_MESSAGES/django.mo
  88. * jet/locale/LOCALE/LC_MESSAGES/djangojs.mo
  89. * jet/dashboard/locale/LOCALE/LC_MESSAGES/django.mo
  90. * jet/dashboard/locale/LOCALE/LC_MESSAGES/djangojs.mo
  91. You should commit generated build files together with sources.
  92. Contribution Documentation
  93. --------------------------
  94. If you update documentation files, you can build the html files (this is not needed with a pull-request,
  95. but you might wanna check how documentation will look like locally). To do so change your working directory
  96. to ``docs/`` inside JET and run:
  97. .. code-block:: bash
  98. make html
  99. ``docs/_build/html/`` folder will contain all html files including starting ``index.html``.