Install
grab js/pgi.js and user/pgi_config.js. Add them as scripts in your project.
<script src="./user/pgi_config.js" /> <script src="./js/pgi.js" />Then Configure...
Configure
Contribute
You may help the project by forking it, or using it and post issues. Contact the author for any question.
!! WARNING !!
This is a very fast way to enable issues posting to your gitlab hosted project. It's also a pretty INSECURE way to make this. Using your own personal token with full privilege here CAN NOT BE SECURE. It can be grabbed by any (even very noob) hacker and give him access to your whole projects on gitlab.
So you SHOULD create a secondary account with ONLY GUEST PRIVILEGE and grab corresponding token here. This way the hacker will "only" spam your issue box until you reset token.
Configuration details
Dependencies
For now, script will need jQuery and Font Awesome to be installed in your page. You can add them to your own repo or load them from a free cdn like jsdelivr.<link rel="stylesheet" href="https://cdn.jsdelivr.net/normalize/3.0.3/normalize.min.css" media="all" type="text/css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/fontawesome/4.6.1/css/font-awesome.min.css" media="all" type="text/css">
about integration
By default, PGI form is hidden. It will be shown when clicking on any element with the.pgiButton class. The script will create a new div called "pgiDiv" with "pgiDiv" class at the end of your document containing the comment form you can customize style by creating a stylesheet declaring styles for #pgiDiv or .pgiDiv elements.
about pgi_config parameters
gitlabis the url of your gitlab instance ("gitlab.com","framagit.org",...)usgroupis the gitlab username or group name where the project is storedprojectis the project id. Should not contains.nor%2Etokenis the token of the secondary account used to post issues. Did I tell you about WARNING?formis a table containing all form fields definitions. For each :nameis the name of the fieldtypeis one of the accepted html type of fieldsdestinationis one of the accepted gitlab issue fielddefaultis default value for the fieldrequiredis a boolean telling if the field is mandatoryhiddenis a boolean telling if the field is hidden
introis the text displayed above the submission formthanksis the text displayed after submissionautoclosecan be defined tofalseif you want the user to close the form by himself or to any value in ms if you want it to close automatically.