[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [% PROCESS global/variables.none.tmpl %] [% inline_style = BLOCK %] #bounty_form { padding: 10px; } #bounty_form .required:after { content: " *"; color: red; } #bounty_form .field_label { font-weight: bold; display: block; text-align: left; } #bounty_form .field_desc { padding-bottom: 3px; } #bounty_form .field_desc, #bounty_form .head_desc { width: 600px; word-wrap: normal; } #bounty_form .head_desc { padding-top: 5px; padding-bottom: 12px; } #bounty_form .form_section { margin-bottom: 10px; } #bounty_form textarea { font-family: inherit; font-size: inherit; } #bounty_form em { font-size: 1em; } .yui-calcontainer { z-index: 2; } [% END %] [% inline_javascript = BLOCK %] var validateDate = /^(\d{4}-\d{2}-\d{2}|)$/; var validators = { reporter_email: /^[^,]+$/, amount_paid: /^[0-9]*[-+?]?$/, reported_date: validateDate, fixed_date: validateDate, awarded_date: validateDate, publish: /^(0|1)$/, credit_1: /^([^,]+|)$/, credit_2: /^([^,]+|)$/, credit_3: /^([^,]+|)$/ }; function validateAndSubmit() { 'use strict'; var alert_text = ''; var requiredLabels = YAHOO.util.Selector.query('label.required'); var skip = {}; if (requiredLabels) { requiredLabels.forEach(function (label) { var name = label.getAttribute('for'); var ids = YAHOO.util.Selector.query( '#bounty_form *[name="' + name + '"]' ).map(function (e) { return e.id }); if (ids && ids[0]) { var id = ids[0]; var desc = label.textContent || name; if (!isFilledOut(id)) { alert_text += "Please enter a value for " + desc.replace(/[\r\n]+/, "").replace(/\s+/g, " ") + "\n"; skip[id] = true; } } }); for (var id in validators) { if (skip[id]) continue; var el = document.getElementById(id); if (validators[id] && !validators[id].test( el.value )) { var labels = YAHOO.util.Selector.query('label[for="' + id + '"]'); var desc; if (labels && labels[0]) { desc = labels[0].textContent; } else { desc = id; } alert_text += "Invalid value for " + desc.replace(/[\r\n]+/, "").replace(/\s+/g, " ") + "\n"; } } } if (alert_text != '') { alert(alert_text); return false; } return true; } [% END %] [% PROCESS global/header.html.tmpl title = "Bounty Attachment Form" generate_api_token = 1 style = inline_style javascript = inline_javascript javascript_urls = [ 'extensions/BMO/web/js/form_validate.js', 'js/field.js', 'js/util.js' ] yui = [ "calendar", "selector" ] %] [% USE Bugzilla %] [% cgi = Bugzilla.cgi %]
Bounty Attachment for [% "$terms.Bug $bug.id" FILTER bug_link(bug.id) FILTER none %]

[ * Required Field ]

[% PROCESS global/footer.html.tmpl %]