-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ticket opening from topology #401
Open
djw8605
wants to merge
16
commits into
opensciencegrid:master
Choose a base branch
from
djw8605:add_ticket
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2b09a43
Adding first ticket
djw8605 e717e82
Adding working ticket example
djw8605 67dd51b
Merge branch 'master' of https://github.com/opensciencegrid/topology …
djw8605 22397b6
Fixing tabs and spaces
djw8605 27bcfe7
Adding Google captcha
djw8605 355feef
Adding subject
djw8605 e0f45fb
Merge branch 'master' of https://github.com/opensciencegrid/topology …
djw8605 e8ae794
Adding markdown support to the ticket description
djw8605 ac32809
Moving jquery to the base, in the header
djw8605 9c60c8e
Recommended text
djw8605 098bbbe
Adding sentences at the top
djw8605 421fa23
Adding ticket to the home page
djw8605 f6aed2b
Merge branch 'master' of https://github.com/opensciencegrid/topology …
djw8605 dd1a8c8
Removing want_js
djw8605 46aa5e5
Merge branch 'master' of https://github.com/opensciencegrid/topology …
djw8605 294f1bb
Removing want_js from html files
djw8605 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ urllib3==1.23 | |
Werkzeug>=0.14.1,<0.15 | ||
WTForms>=2.2.1,<2.3 | ||
xmltodict>=0.11.0,<0.12 | ||
bleach | ||
Markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{% set want_js = true %} | ||
{% extends "base.html.j2" %} | ||
{% block title -%} | ||
OSG Ticket | ||
{%- endblock %} | ||
morehead | ||
|
||
{% block morehead %} | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.min.css" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/css/selectize.bootstrap3.min.css" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.6/js/standalone/selectize.min.js" integrity="sha256-+C0A5Ilqmu4QcSPxrlGpaZxJ04VjsRjKu+G82kl5UJk=" crossorigin="anonymous"></script> | ||
<script src="https://www.google.com/recaptcha/api.js?render=6LdJl44UAAAAAGaTKjXWjhPJ5MvyXCAYGxd2m4TS"></script> | ||
|
||
<style> | ||
.selectize-control .option .name { | ||
display: block; | ||
} | ||
.selectize-control .option .facility { | ||
font-size: 12px; | ||
display: block; | ||
color: #a0a0a0; | ||
} | ||
.selectize-control .item a { | ||
color: #006ef5; | ||
} | ||
.selectize-control .item.active a { | ||
color: #303030; | ||
} | ||
.selectize-control .optgroup-header { | ||
display: block; | ||
font-size: 1.2em; | ||
color: #303030; | ||
} | ||
</style> | ||
|
||
|
||
<script> | ||
|
||
$(function(){ | ||
|
||
grecaptcha.ready(function() { | ||
grecaptcha.execute('6LdJl44UAAAAAGaTKjXWjhPJ5MvyXCAYGxd2m4TS', {action: 'ticket'}).then(function(token) { | ||
$("#g-recaptcha-response").attr("value", token); | ||
}); | ||
}); | ||
|
||
var $select = $('#resource-list').selectize({ | ||
maxItems: null, | ||
valueField: 'name', | ||
labelField: 'name', | ||
searchField: ['name', 'facility'], | ||
options: [], | ||
create: false, | ||
optgroupField: 'facility', | ||
optgroupLabelField: 'facility', | ||
optgroupValueField: 'facility', | ||
render: { | ||
option: function(data, escape) { | ||
return '<div class="option">' + | ||
'<span class="name">' + escape(data.name) + '</span>' + | ||
'<span class="facility">' + escape(data.type) + '</span>' + | ||
'</div>'; | ||
}, | ||
item: function(data, escape) { | ||
return '<div class="item">' + escape(data.name) + '</a></div>'; | ||
}, | ||
optgroup_header: function(data, escape) { | ||
return '<div class="optgroup-header">' + escape(data.facility) + '</div>'; | ||
} | ||
}}); | ||
|
||
var control = $select[0].selectize; | ||
// Everything goes here | ||
// Parse the XML | ||
function parseResources(data) { | ||
// The returned data should be XML | ||
$(data).find("ResourceGroup").each(function(index, rg) { | ||
var facility = $(rg).find("Facility").find("Name").first(); | ||
console.log(facility[0].innerHTML); | ||
var facility_name = facility[0].innerHTML; | ||
control.addOptionGroup(facility_name, { | ||
facility: facility_name | ||
}) | ||
var resource_list = $(rg).find("Resource"); | ||
for (var i = 0; i < resource_list.length; i++) { | ||
var resource_name = $(resource_list[i]).find("Name")[0].innerHTML; | ||
var resource_id = $(resource_list[i]).find("ID")[0].innerHTML; | ||
var services = $(resource_list[i]).find("Services")[0]; | ||
var service = $(services).find("Service")[0] | ||
var type = $(service).find("Name")[0].innerHTML; | ||
//console.log(resource_name) | ||
control.addOption({ | ||
id: resource_id, | ||
name: resource_name, | ||
facility: facility_name, | ||
type: type | ||
}); | ||
} | ||
console.log(rg); | ||
}); | ||
|
||
} | ||
|
||
// Load the resource | ||
function loadResources() { | ||
$.get("/rgsummary/xml", parseResources); | ||
} | ||
|
||
loadResources(); | ||
|
||
}); | ||
|
||
|
||
</script> | ||
|
||
|
||
|
||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="container"> | ||
<p class="lead"> | ||
Use this form to open tickets regarding issues on <a href="https://opensciencegrid.org/">Open Science Grid</a> Resources. After submitting this form you will receive an email confirmation of the ticket creation. | ||
</p> | ||
<hr /> | ||
<form action="/submitTicket" method="POST"> | ||
<div class="form-group"> | ||
<label for="resource-list">Resource(s)</label> | ||
<select name="resource-list" id="resource-list" multiple placeholder="Pick OSG Resource(s)..."></select> | ||
</div> | ||
<div class="form-group"> | ||
<label for="requester">Requester Email</label> | ||
<input type="email" name="requester" class="form-control" id="requester" required placeholder="Requester Email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"></input> | ||
</div> | ||
<div class="form-group"> | ||
<label for="Subject">Summary</label> | ||
<input type="text" name="subject" class="form-control" id="subject" required></input> | ||
</div> | ||
<div class="form-group"> | ||
<label for="ticket-message"> | ||
Description of the issue | ||
</label> | ||
<textarea name="ticket-message" id="ticket-message" class="form-control" rows="10" cols="50" required></textarea> | ||
<small id="ticket-help" class="form-text text-muted">Supports Markdown <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">syntax</a></small> | ||
</div> | ||
<input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response" class="g-recaptcha"></input> | ||
<button type="submit" class="btn btn-primary">Submit</button> | ||
</form> | ||
|
||
|
||
|
||
</div> | ||
{% endblock %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should tell users that they'll receive an email shortly. Would it be possible to have this show up as a message on the form page? The page with the return_str is a little bare.