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
gitlab
is the url of your gitlab instance ("gitlab.com","framagit.org",...)usgroup
is the gitlab username or group name where the project is storedproject
is the project id. Should not contains.
nor%2E
token
is the token of the secondary account used to post issues. Did I tell you about WARNING?form
is a table containing all form fields definitions. For each :name
is the name of the fieldtype
is one of the accepted html type of fieldsdestination
is one of the accepted gitlab issue fielddefault
is default value for the fieldrequired
is a boolean telling if the field is mandatoryhidden
is a boolean telling if the field is hidden
intro
is the text displayed above the submission formthanks
is the text displayed after submissionautoclose
can be defined tofalse
if you want the user to close the form by himself or to any value in ms if you want it to close automatically.