\ No newline at end of file
diff --git a/plugins/redmine_questions/assets/images/answered.svg b/plugins/redmine_questions/assets/images/answered.svg
new file mode 100644
index 0000000..f5a00d4
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/answered.svg
@@ -0,0 +1,8 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/answered_check.svg b/plugins/redmine_questions/assets/images/answered_check.svg
new file mode 100644
index 0000000..9c0e2fd
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/answered_check.svg
@@ -0,0 +1,7 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/book_open.png b/plugins/redmine_questions/assets/images/book_open.png
new file mode 100644
index 0000000..7d863f9
Binary files /dev/null and b/plugins/redmine_questions/assets/images/book_open.png differ
diff --git a/plugins/redmine_questions/assets/images/downvote.svg b/plugins/redmine_questions/assets/images/downvote.svg
new file mode 100644
index 0000000..7616f05
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/downvote.svg
@@ -0,0 +1,15 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/downvote_arrow.svg b/plugins/redmine_questions/assets/images/downvote_arrow.svg
new file mode 100644
index 0000000..8ac1909
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/downvote_arrow.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/upvote.graffle b/plugins/redmine_questions/assets/images/upvote.graffle
new file mode 100644
index 0000000..05ecdbf
Binary files /dev/null and b/plugins/redmine_questions/assets/images/upvote.graffle differ
diff --git a/plugins/redmine_questions/assets/images/upvote.svg b/plugins/redmine_questions/assets/images/upvote.svg
new file mode 100644
index 0000000..69ad57a
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/upvote.svg
@@ -0,0 +1,15 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/upvote_arrow.svg b/plugins/redmine_questions/assets/images/upvote_arrow.svg
new file mode 100644
index 0000000..2d65861
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/upvote_arrow.svg
@@ -0,0 +1,3 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/images/voting.svg b/plugins/redmine_questions/assets/images/voting.svg
new file mode 100644
index 0000000..973ee64
--- /dev/null
+++ b/plugins/redmine_questions/assets/images/voting.svg
@@ -0,0 +1,26 @@
+
+
+
diff --git a/plugins/redmine_questions/assets/javascripts/jquery.simplecolorpicker.js b/plugins/redmine_questions/assets/javascripts/jquery.simplecolorpicker.js
new file mode 100644
index 0000000..9cfc456
--- /dev/null
+++ b/plugins/redmine_questions/assets/javascripts/jquery.simplecolorpicker.js
@@ -0,0 +1,235 @@
+/*
+ * Very simple jQuery Color Picker
+ * https://github.com/tkrotoff/jquery-simplecolorpicker
+ *
+ * Copyright (C) 2012-2013 Tanguy Krotoff
+ *
+ * Licensed under the MIT license
+ */
+
+(function($) {
+ 'use strict';
+
+ /**
+ * Constructor.
+ */
+ var SimpleColorPicker = function(select, options) {
+ this.init('simplecolorpicker', select, options);
+ };
+
+ /**
+ * SimpleColorPicker class.
+ */
+ SimpleColorPicker.prototype = {
+ constructor: SimpleColorPicker,
+
+ init: function(type, select, options) {
+ var self = this;
+
+ self.type = type;
+
+ self.$select = $(select);
+ self.$select.hide();
+
+ self.options = $.extend({}, $.fn.simplecolorpicker.defaults, options);
+
+ self.$colorList = null;
+
+ if (self.options.picker === true) {
+ var selectText = self.$select.find('> option:selected').text();
+ self.$icon = $(''
+ + '').insertAfter(self.$select);
+ self.$icon.on('click.' + self.type, $.proxy(self.showPicker, self));
+
+ self.$picker = $('').appendTo(document.body);
+ self.$colorList = self.$picker;
+
+ // Hide picker when clicking outside
+ $(document).on('mousedown.' + self.type, $.proxy(self.hidePicker, self));
+ self.$picker.on('mousedown.' + self.type, $.proxy(self.mousedown, self));
+ } else {
+ self.$inline = $('').insertAfter(self.$select);
+ self.$colorList = self.$inline;
+ }
+
+ // Build the list of colors
+ //
+ self.$select.find('> option').each(function() {
+ var $option = $(this);
+ var color = $option.val();
+
+ var isSelected = $option.is(':selected');
+ var isDisabled = $option.is(':disabled');
+
+ var selected = '';
+ if (isSelected === true) {
+ selected = ' data-selected';
+ }
+
+ var disabled = '';
+ if (isDisabled === true) {
+ disabled = ' data-disabled';
+ }
+
+ var title = '';
+ if (isDisabled === false) {
+ title = ' title="' + $option.text() + '"';
+ }
+
+ var role = '';
+ if (isDisabled === false) {
+ role = ' role="button" tabindex="0"';
+ }
+
+ var $colorSpan = $(''
+ + '');
+
+ self.$colorList.append($colorSpan);
+ $colorSpan.on('click.' + self.type, $.proxy(self.colorSpanClicked, self));
+
+ var $next = $option.next();
+ if ($next.is('optgroup') === true) {
+ // Vertical break, like hr
+ self.$colorList.append('');
+ }
+ });
+ },
+
+ /**
+ * Changes the selected color.
+ *
+ * @param color the hexadecimal color to select, ex: '#fbd75b'
+ */
+ selectColor: function(color) {
+ var self = this;
+
+ var $colorSpan = self.$colorList.find('> span.color').filter(function() {
+ return $(this).data('color').toLowerCase() === color.toLowerCase();
+ });
+
+ if ($colorSpan.length > 0) {
+ self.selectColorSpan($colorSpan);
+ } else {
+ console.error("The given color '" + color + "' could not be found");
+ }
+ },
+
+ showPicker: function() {
+ var pos = this.$icon.offset();
+ this.$picker.css({
+ // Remove some pixels to align the picker icon with the icons inside the dropdown
+ left: pos.left - 1,
+ top: pos.top - 4//+ this.$icon.outerHeight()
+ });
+
+ this.$picker.show(this.options.pickerDelay);
+ },
+
+ hidePicker: function() {
+ this.$picker.hide(this.options.pickerDelay);
+ },
+
+ /**
+ * Selects the given span inside $colorList.
+ *
+ * The given span becomes the selected one.
+ * It also changes the HTML select value, this will emit the 'change' event.
+ */
+ selectColorSpan: function($colorSpan) {
+ var color = $colorSpan.data('color');
+ var title = $colorSpan.prop('title');
+
+ // Mark this span as the selected one
+ $colorSpan.siblings().removeAttr('data-selected');
+ $colorSpan.attr('data-selected', '');
+
+ if (this.options.picker === true) {
+ this.$icon.css('background-color', color);
+ this.$icon.prop('title', title);
+ this.hidePicker();
+ }
+
+ // Change HTML select value
+ this.$select.val(color);
+ },
+
+ /**
+ * The user clicked on a color inside $colorList.
+ */
+ colorSpanClicked: function(e) {
+ // When a color is clicked, make it the new selected one (unless disabled)
+ if ($(e.target).is('[data-disabled]') === false) {
+ this.selectColorSpan($(e.target));
+ this.$select.trigger('change');
+ }
+ },
+
+ /**
+ * Prevents the mousedown event from "eating" the click event.
+ */
+ mousedown: function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+ },
+
+ destroy: function() {
+ if (this.options.picker === true) {
+ this.$icon.off('.' + this.type);
+ this.$icon.remove();
+ $(document).off('.' + this.type);
+ }
+
+ this.$colorList.off('.' + this.type);
+ this.$colorList.remove();
+
+ this.$select.removeData(this.type);
+ this.$select.show();
+ }
+ };
+
+ /**
+ * Plugin definition.
+ * How to use: $('#id').simplecolorpicker()
+ */
+ $.fn.simplecolorpicker = function(option) {
+ var args = $.makeArray(arguments);
+ args.shift();
+
+ // For HTML element passed to the plugin
+ return this.each(function() {
+ var $this = $(this),
+ data = $this.data('simplecolorpicker'),
+ options = typeof option === 'object' && option;
+ if (data === undefined) {
+ $this.data('simplecolorpicker', (data = new SimpleColorPicker(this, options)));
+ }
+ if (typeof option === 'string') {
+ data[option].apply(data, args);
+ }
+ });
+ };
+
+ /**
+ * Default options.
+ */
+ $.fn.simplecolorpicker.defaults = {
+ // No theme by default
+ theme: '',
+
+ // Show the picker or make it inline
+ picker: false,
+
+ // Animation delay in milliseconds
+ pickerDelay: 0
+ };
+
+})(jQuery);
diff --git a/plugins/redmine_questions/assets/javascripts/questions.js b/plugins/redmine_questions/assets/javascripts/redmine_questions.js
similarity index 100%
rename from plugins/redmine_questions/assets/javascripts/questions.js
rename to plugins/redmine_questions/assets/javascripts/redmine_questions.js
diff --git a/plugins/redmine_questions/assets/javascripts/tag-it.js b/plugins/redmine_questions/assets/javascripts/tag-it.js
deleted file mode 100755
index 1280eca..0000000
--- a/plugins/redmine_questions/assets/javascripts/tag-it.js
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
-* jQuery UI Tag-it!
-*
-* @version v2.0 (06/2011)
-*
-* Copyright 2011, Levy Carneiro Jr.
-* Released under the MIT license.
-* http://aehlke.github.com/tag-it/LICENSE
-*
-* Homepage:
-* http://aehlke.github.com/tag-it/
-*
-* Authors:
-* Levy Carneiro Jr.
-* Martin Rehfeld
-* Tobias Schmidt
-* Skylar Challand
-* Alex Ehlke
-*
-* Maintainer:
-* Alex Ehlke - Twitter: @aehlke
-*
-* Dependencies:
-* jQuery v1.4+
-* jQuery UI v1.8+
-*/
-(function($) {
-
- $.widget('ui.tagit', {
- options: {
- itemName : 'item',
- fieldName : 'tags',
- availableTags : [],
- tagSource : null,
- removeConfirmation: false,
- caseSensitive : true,
- placeholderText : null,
-
- // When enabled, quotes are not neccesary
- // for inputting multi-word tags.
- allowSpaces: false,
-
- // Whether to animate tag removals or not.
- animate: true,
-
- // The below options are for using a single field instead of several
- // for our form values.
- //
- // When enabled, will use a single hidden field for the form,
- // rather than one per tag. It will delimit tags in the field
- // with singleFieldDelimiter.
- //
- // The easiest way to use singleField is to just instantiate tag-it
- // on an INPUT element, in which case singleField is automatically
- // set to true, and singleFieldNode is set to that element. This
- // way, you don't need to fiddle with these options.
- singleField: false,
-
- singleFieldDelimiter: ',',
-
- // Set this to an input DOM node to use an existing form field.
- // Any text in it will be erased on init. But it will be
- // populated with the text of tags as they are created,
- // delimited by singleFieldDelimiter.
- //
- // If this is not set, we create an input node for it,
- // with the name given in settings.fieldName,
- // ignoring settings.itemName.
- singleFieldNode: null,
-
- // Optionally set a tabindex attribute on the input that gets
- // created for tag-it.
- tabIndex: null,
-
-
- // Event callbacks.
- onTagAdded : null,
- onTagRemoved: null,
- onTagClicked: null
- },
-
-
- _create: function() {
- // for handling static scoping inside callbacks
- var that = this;
-
- // There are 2 kinds of DOM nodes this widget can be instantiated on:
- // 1. UL, OL, or some element containing either of these.
- // 2. INPUT, in which case 'singleField' is overridden to true,
- // a UL is created and the INPUT is hidden.
- if (this.element.is('input')) {
- this.tagList = $('
').insertAfter(this.element);
- this.options.singleField = true;
- this.options.singleFieldNode = this.element;
- this.element.css('display', 'none');
- } else {
- this.tagList = this.element.find('ul, ol').andSelf().last();
- }
-
- this._tagInput = $('').addClass('ui-widget-content');
- if (this.options.tabIndex) {
- this._tagInput.attr('tabindex', this.options.tabIndex);
- }
- if (this.options.placeholderText) {
- this._tagInput.attr('placeholder', this.options.placeholderText);
- }
-
- this.options.tagSource = this.options.tagSource || function(search, showChoices) {
- var filter = search.term.toLowerCase();
- var choices = $.grep(this.options.availableTags, function(element) {
- // Only match autocomplete options that begin with the search term.
- // (Case insensitive.)
- return (element.toLowerCase().indexOf(filter) === 0);
- });
- showChoices(this._subtractArray(choices, this.assignedTags()));
- };
-
- // Bind tagSource callback functions to this context.
- if ($.isFunction(this.options.tagSource)) {
- this.options.tagSource = $.proxy(this.options.tagSource, this);
- }
-
- this.tagList
- .addClass('tagit')
- .addClass('ui-widget ui-widget-content ui-corner-all')
- // Create the input field.
- .append($('').append(this._tagInput))
- .click(function(e) {
- var target = $(e.target);
- if (target.hasClass('tagit-label')) {
- that._trigger('onTagClicked', e, target.closest('.tagit-choice'));
- } else {
- // Sets the focus() to the input field, if the user
- // clicks anywhere inside the UL. This is needed
- // because the input field needs to be of a small size.
- that._tagInput.focus();
- }
- });
-
- // Add existing tags from the list, if any.
- this.tagList.children('li').each(function() {
- if (!$(this).hasClass('tagit-new')) {
- that.createTag($(this).html(), $(this).attr('class'));
- $(this).remove();
- }
- });
-
- // Single field support.
- if (this.options.singleField) {
- if (this.options.singleFieldNode) {
- // Add existing tags from the input field.
- var node = $(this.options.singleFieldNode);
- var tags = node.val().split(this.options.singleFieldDelimiter);
- node.val('');
- $.each(tags, function(index, tag) {
- that.createTag(tag);
- });
- } else {
- // Create our single field input after our list.
- this.options.singleFieldNode = this.tagList.after('');
- }
- }
-
- // Events.
- this._tagInput
- .keydown(function(event) {
- // Backspace is not detected within a keypress, so it must use keydown.
- if (event.which == $.ui.keyCode.BACKSPACE && that._tagInput.val() === '') {
- var tag = that._lastTag();
- if (!that.options.removeConfirmation || tag.hasClass('remove')) {
- // When backspace is pressed, the last tag is deleted.
- that.removeTag(tag);
- } else if (that.options.removeConfirmation) {
- tag.addClass('remove ui-state-highlight');
- }
- } else if (that.options.removeConfirmation) {
- that._lastTag().removeClass('remove ui-state-highlight');
- }
-
- // Comma/Space/Enter are all valid delimiters for new tags,
- // except when there is an open quote or if setting allowSpaces = true.
- // Tab will also create a tag, unless the tag input is empty, in which case it isn't caught.
- if (
- // event.which == $.ui.keyCode.COMMA ||
- event.which == $.ui.keyCode.ENTER ||
- (
- event.which == $.ui.keyCode.TAB &&
- that._tagInput.val() !== ''
- ) ||
- (
- event.which == $.ui.keyCode.SPACE &&
- that.options.allowSpaces !== true &&
- (
- $.trim(that._tagInput.val()).replace( /^s*/, '' ).charAt(0) != '"' ||
- (
- $.trim(that._tagInput.val()).charAt(0) == '"' &&
- $.trim(that._tagInput.val()).charAt($.trim(that._tagInput.val()).length - 1) == '"' &&
- $.trim(that._tagInput.val()).length - 1 !== 0
- )
- )
- )
- ) {
- event.preventDefault();
- that.createTag(that._cleanedInput());
-
- // The autocomplete doesn't close automatically when TAB is pressed.
- // So let's ensure that it closes.
- that._tagInput.autocomplete('close');
- }
- }).blur(function(e){
- // Create a tag when the element loses focus (unless it's empty).
- that.createTag(that._cleanedInput());
- });
-
-
- // Autocomplete.
- if (this.options.availableTags || this.options.tagSource) {
- this._tagInput.autocomplete({
- source: this.options.tagSource,
- select: function(event, ui) {
- // Delete the last tag if we autocomplete something despite the input being empty
- // This happens because the input's blur event causes the tag to be created when
- // the user clicks an autocomplete item.
- // The only artifact of this is that while the user holds down the mouse button
- // on the selected autocomplete item, a tag is shown with the pre-autocompleted text,
- // and is changed to the autocompleted text upon mouseup.
- if (that._tagInput.val() === '') {
- that.removeTag(that._lastTag(), false);
- }
- that.createTag(ui.item.value);
- // Preventing the tag input to be updated with the chosen value.
- return false;
- }
- });
- }
- },
-
- _cleanedInput: function() {
- // Returns the contents of the tag input, cleaned and ready to be passed to createTag
- return $.trim(this._tagInput.val().replace(/^"(.*)"$/, '$1'));
- },
-
- _lastTag: function() {
- return this.tagList.children('.tagit-choice:last');
- },
-
- assignedTags: function() {
- // Returns an array of tag string values
- var that = this;
- var tags = [];
- if (this.options.singleField) {
- tags = $(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter);
- if (tags[0] === '') {
- tags = [];
- }
- } else {
- this.tagList.children('.tagit-choice').each(function() {
- tags.push(that.tagLabel(this));
- });
- }
- return tags;
- },
-
- _updateSingleTagsField: function(tags) {
- // Takes a list of tag string values, updates this.options.singleFieldNode.val to the tags delimited by this.options.singleFieldDelimiter
- $(this.options.singleFieldNode).val(tags.join(this.options.singleFieldDelimiter));
- },
-
- _subtractArray: function(a1, a2) {
- var result = [];
- for (var i = 0; i < a1.length; i++) {
- if ($.inArray(a1[i], a2) == -1) {
- result.push(a1[i]);
- }
- }
- return result;
- },
-
- tagLabel: function(tag) {
- // Returns the tag's string label.
- if (this.options.singleField) {
- return $(tag).children('.tagit-label').text();
- } else {
- return $(tag).children('input').val();
- }
- },
-
- _isNew: function(value) {
- var that = this;
- var isNew = true;
- this.tagList.children('.tagit-choice').each(function(i) {
- if (that._formatStr(value) == that._formatStr(that.tagLabel(this))) {
- isNew = false;
- return false;
- }
- });
- return isNew;
- },
-
- _formatStr: function(str) {
- if (this.options.caseSensitive) {
- return str;
- }
- return $.trim(str.toLowerCase());
- },
-
- createTag: function(value, additionalClass) {
- var that = this;
- // Automatically trims the value of leading and trailing whitespace.
- value = $.trim(value);
-
- if (!this._isNew(value) || value === '') {
- return false;
- }
-
- var label = $(this.options.onTagClicked ? '' : '').text(value);
-
- // Create tag.
- var tag = $('')
- .addClass('tagit-choice ui-widget-content ui-state-default ui-corner-all')
- .addClass(additionalClass)
- .append(label);
-
- // Button for removing the tag.
- var removeTagIcon = $('')
- .addClass('ui-icon ui-icon-close');
- var removeTag = $('\xd7') // \xd7 is an X
- .addClass('tagit-close')
- .append(removeTagIcon)
- .click(function(e) {
- // Removes a tag when the little 'x' is clicked.
- that.removeTag(tag);
- });
- tag.append(removeTag);
-
- // Unless options.singleField is set, each tag has a hidden input field inline.
- if (this.options.singleField) {
- var tags = this.assignedTags();
- tags.push(value);
- this._updateSingleTagsField(tags);
- } else {
- var escapedValue = label.html();
- tag.append('');
- }
-
- this._trigger('onTagAdded', null, tag);
-
- // Cleaning the input.
- this._tagInput.val('');
-
- // insert tag
- this._tagInput.parent().before(tag);
- },
-
- removeTag: function(tag, animate) {
- animate = animate || this.options.animate;
-
- tag = $(tag);
-
- this._trigger('onTagRemoved', null, tag);
-
- if (this.options.singleField) {
- var tags = this.assignedTags();
- var removedTagLabel = this.tagLabel(tag);
- tags = $.grep(tags, function(el){
- return el != removedTagLabel;
- });
- this._updateSingleTagsField(tags);
- }
- // Animate the removal.
- if (animate) {
- tag.fadeOut('fast').hide('blind', {direction: 'horizontal'}, 'fast', function(){
- tag.remove();
- }).dequeue();
- } else {
- tag.remove();
- }
- },
-
- removeAll: function() {
- // Removes all tags.
- var that = this;
- this.tagList.children('.tagit-choice').each(function(index, tag) {
- that.removeTag(tag, false);
- });
- }
-
- });
-
-})(jQuery);
-
-
diff --git a/plugins/redmine_questions/assets/stylesheets/jquery.simplecolorpicker.css b/plugins/redmine_questions/assets/stylesheets/jquery.simplecolorpicker.css
new file mode 100644
index 0000000..234017d
--- /dev/null
+++ b/plugins/redmine_questions/assets/stylesheets/jquery.simplecolorpicker.css
@@ -0,0 +1,88 @@
+/*
+ * Very simple jQuery Color Picker
+ * https://github.com/tkrotoff/jquery-simplecolorpicker
+ *
+ * Copyright (C) 2012-2013 Tanguy Krotoff
+ *
+ * Licensed under the MIT license
+ */
+
+/**
+ * Inspired by Bootstrap Twitter.
+ * See https://github.com/twbs/bootstrap/blob/master/less/navbar.less
+ * See https://github.com/twbs/bootstrap/blob/master/less/dropdowns.less
+ */
+
+.simplecolorpicker.picker {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1051; /* Above Bootstrap modal (@zindex-modal = 1050) */
+ display: none;
+ float: left;
+
+ min-width: 160px;
+ max-width: 283px; /* @popover-max-width = 276px + 7 */
+
+ padding: 5px 0 0 5px;
+ margin: 2px 0 0;
+ list-style: none;
+ background-color: #fff; /* @dropdown-bg */
+
+ border: 1px solid #ccc;
+}
+
+.simplecolorpicker.inline {
+ display: inline-block;
+}
+
+.simplecolorpicker span {
+ margin: 0 5px 5px 0;
+}
+
+.simplecolorpicker.button,
+.simplecolorpicker span.color {
+ display: inline-block;
+ outline: none;
+ cursor: pointer;
+ border: 1px solid transparent;
+}
+
+.simplecolorpicker.button {
+ border: 1px solid #DDD;
+}
+
+.simplecolorpicker.button:after,
+.simplecolorpicker span.color:after {
+ content: '\00a0\00a0\00a0\00a0'; /* Spaces */
+}
+
+.simplecolorpicker span.color[data-disabled]:hover {
+ cursor: not-allowed;
+ border: 1px solid transparent;
+}
+
+.simplecolorpicker span.color:hover,
+.simplecolorpicker span.color[data-selected],
+.simplecolorpicker span.color[data-selected]:hover {
+ border: 1px solid #222; /* @gray-dark */
+}
+.simplecolorpicker span.color[data-selected]:after {
+ color: #fff;
+}
+
+/* Vertical separator, replaces optgroup. */
+.simplecolorpicker span.vr {
+ border-left: 1px solid #222; /* @gray-dark */
+}
+
+.simplecolorpicker span.color[data-selected]:after {
+ /*font-family: 'FontAwesome';*/
+ -webkit-font-smoothing: antialiased;
+
+ content: '\2714'; /* Ok/check mark */
+
+ margin-right: 2px;
+ margin-left: 2px;
+}
+
diff --git a/plugins/redmine_questions/assets/stylesheets/jquery.tagit.css b/plugins/redmine_questions/assets/stylesheets/jquery.tagit.css
deleted file mode 100755
index 36dc882..0000000
--- a/plugins/redmine_questions/assets/stylesheets/jquery.tagit.css
+++ /dev/null
@@ -1,54 +0,0 @@
-ul.tagit {
- padding: 1px 5px;
- overflow: auto;
- margin-left: inherit; /* usually we don't want the regular ul margins. */
- margin-right: inherit;
-}
-ul.tagit li {
- display: block;
- float: left;
- margin: 2px 5px 2px 0;
-}
-ul.tagit li.tagit-choice {
- padding: .2em 18px .2em .5em;
- position: relative;
- line-height: inherit;
-}
-ul.tagit li.tagit-new {
- padding: .25em 4px .25em 0;
-}
-
-ul.tagit li.tagit-choice a.tagit-label {
- cursor: pointer;
- text-decoration: none;
-}
-ul.tagit li.tagit-choice .tagit-close {
- cursor: pointer;
- position: absolute;
- right: .1em;
- top: 50%;
- margin-top: -8px;
-}
-
-/* used for some custom themes that don't need image icons */
-ul.tagit li.tagit-choice .tagit-close .text-icon {
- display: none;
-}
-
-ul.tagit li.tagit-choice input {
- display: block;
- float: left;
- margin: 2px 5px 2px 0;
-}
-ul.tagit input[type="text"] {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-
- border: none;
- margin: 0;
- padding: 0;
- width: inherit;
- background-color: inherit;
- outline: none;
-}
diff --git a/plugins/redmine_questions/assets/stylesheets/questions.css b/plugins/redmine_questions/assets/stylesheets/questions.css
deleted file mode 100644
index 667aec3..0000000
--- a/plugins/redmine_questions/assets/stylesheets/questions.css
+++ /dev/null
@@ -1,239 +0,0 @@
-#forum_list div.list-item {
- margin-bottom: 10px;
-}
-
-#forum_list div.list-item .last-author {
- font-size: 80%;
- color: gray;
-}
-
-#forum_list div.list-item .last-author a {
- color: gray;
-}
-
-#forum_list > ul > li {
- float: left;
- width: 44%;
- padding: 0;
- margin: 15px 3% 0 0;
-}
-
-#forum_list div.project-forums {
- border-bottom: 1px solid #CCC;
- padding-top: 20px;
- clear: left;
-}
-
-#forum_list > ul {
- list-style: none;
- padding: 0px;
- margin-top: 0px;
-}
-
-#forum_list > ul > li.even {
- margin-right: 0;
- width: 46%;
-}
-
-#forum_list > ul > li.odd {
- clear: left;
-}
-
-#forum_list > ul > li.odd, #forum_list > ul > li.even {
- background-color: inherit;
-}
-
-.topic {
- padding: 10px 0 20px;
-}
-
-div.topic p {
- margin: 5px 0;
-}
-
-div.topic h3.subject {
- margin: 0px;
-}
-
-div.topic ul.meta {
- margin: 0px;
- padding: 0px;
-}
-
-div.topic ul.meta li {
- display: block;
- float: left;
- font-size: 11px;
- color: #999;
- margin-right: 8px;
- list-style: none;
-}
-
-#topics_list div.title-bar h4 {
- padding: 15px 0;
- border-bottom: 1px dotted #bbb;
-}
-
-input.questions-search {
- background: url(/images/magnifier.png) no-repeat 6px 50%;
- border: 1px solid #D7D7D7;
- background-color: white;
- padding-left: 30px;
- border-radius: 3px;
- height: 1.5em;
- width: 94%;
- font-size: 16px;
-}
-
-input.questions-search.ajax-loading {
- background-image: url(/images/loading.gif);
-}
-
-div.message.reply {
- margin-bottom: 20px;
-}
-
-div.message.reply div.avatar {
- position: absolute;
-}
-
-div.message.reply div.reply-details.use-avatar {
- padding-left: 50px;
-}
-
-div.message.reply .author{
- margin-bottom: 5px;
-}
-
-div.message.reply .wiki > p:first-child {
- margin-top: 0px;
-}
-
-div.message.reply .contextual .icon.vote {
- position: relative;
- bottom: 5px;
-}
-
-div.message.details img.gravatar {
- float: left;
- margin-right: 5px;
-}
-
-div.message.details p.author {
- margin-top: 15px;
-}
-
-div.message.details .wiki {
- margin-top: 15px;
- padding-top: 10px;
- border-top: 1px dotted #BBB;
-}
-
-/* Question meta */
-
-#sidebar ul.question-meta, #sidebar ul.related-topics {
- list-style: none;
- padding: 0px;
-}
-
-#sidebar ul.question-meta li {
- margin-bottom: 10px;
- padding-left: 20px;
- padding-top: 2px;
- padding-bottom: 3px;
-}
-
-#sidebar ul.related-topics li {
- margin-bottom: 5px;
-}
-
-/* Tags cloud */
-
-#sidebar ul.questions-tags {
- list-style: none;
- padding: 0px;
-}
-
-#sidebar ul.questions-tags li {
- margin-bottom: 5px;
-}
-
-#sidebar ul.questions-tags span.count {
- color: gray;
-}
-
-
-
-/**********************************************************************/
-/* TAGS
-/**********************************************************************/
-.message-tags-edit ul.tagit li.tagit-choice:hover, ul.tagit li.tagit-choice.remove {
- background-color: #E5E5E5;
- text-decoration: none;
- color: black;
-}
-
-.message-tags-edit ul.tagit {
- border: 1px solid #D7D7D7;
- -moz-border-radius: 0px;
- -webkit-border-radius: 0px;
- -khtml-border-radius: 0px;
- border-radius: 0px;
- background: white;
- padding: 0px;
- margin-top: 0px;
-}
-
-.message-tags-edit ul.tagit li.tagit-choice {
- font-weight: normal;
- -moz-border-radius: 0px;
- -webkit-border-radius: 0px;
- border-radius: 0px;
- font-size: 11px;
- color: inherit;
- padding-top: 0px;
- padding-bottom: 0px;
- background-color: #F7F7F7;
- margin: 1px;
-}
-
-.message-tags-edit ul.tagit li.tagit-choice {
- font-weight: normal;
- font-size: 11px;
- color: inherit;
-}
-
-.message-tags-edit ul.tagit li.tagit-choice a.tagit-close {
- text-decoration: none;
-}
-
-.message-tags-edit ul.tagit li.tagit-choice .tagit-close .text-icon {
- display: inline;
- line-height: 16px;
-}
-
-.message-tags-edit ul.tagit li.tagit-choice .ui-icon {
- display: none;
-}
-
-.message-tags-edit ul.tagit li.tagit-new {
- padding: 0px;
-}
-
-.message-tags-edit ul.tagit li.tagit-new input {
- font-size: 11px;
- background: white;
- margin-bottom: 2px;
- margin-left: 2px;
- width: 200px;
-}
-
-/**********************************************************************/
-/* ICONS
-/**********************************************************************/
-
-.icon-vote { background-image: url(../images/thumb_up.png); }
-.icon-unvote { background-image: url(../images/unvote.png); }
-.icon-view { background-image: url(../images/eye.png); }
-.icon-calendar { background-image: url(/images/calendar.png); }
-.icon-tag { background-image: url(../images/tag_blue.png); }
\ No newline at end of file
diff --git a/plugins/redmine_questions/assets/stylesheets/redmine_questions.css b/plugins/redmine_questions/assets/stylesheets/redmine_questions.css
new file mode 100644
index 0000000..7843900
--- /dev/null
+++ b/plugins/redmine_questions/assets/stylesheets/redmine_questions.css
@@ -0,0 +1,402 @@
+/**********************************************************************/
+/* SECTION list
+/**********************************************************************/
+
+.section-list {margin-top: 10px}
+.section-list .section-tile {
+ text-align: center;
+ display: inline-block;
+ width: 29%;
+ border: 1px solid #e0e0e0;
+ margin: 0 .8% 20px;
+ padding: 1.5em 1em;
+ cursor: pointer;
+ -webkit-transition: background .15s;
+ -moz-transition: background .15s;
+ -o-transition: background .15s;
+ transition: background .15s;
+ vertical-align: top;
+}
+
+.section-list .section-tile:hover {
+ text-decoration: none;
+ background: #f8f8f8
+}
+.section-list .section-tile .description {
+ color: #999;
+}
+/**********************************************************************/
+/* QUESTION index
+/**********************************************************************/
+
+.questions h2.section-title {
+ margin-bottom: 0px;
+}
+
+.questions .filters {
+ margin-top: 10px;
+}
+
+.questions-filters {
+ float: right;
+}
+
+.questions-filters > ul > li {
+ list-style-type: none;
+ float: left;
+ margin-left: 5px;
+}
+
+.questions-filters > ul > li:not(:last-child):after {
+ content: " |"
+}
+
+.questions-filters > ul > li a.selected {
+ color: #888;
+}
+
+#forum_list div.list-item {
+ margin-bottom: 10px;
+}
+
+#forum_list div.list-item .last-author {
+ font-size: 80%;
+ color: gray;
+}
+
+#forum_list div.list-item .last-author a {
+ color: gray;
+}
+
+#forum_list > ul > li {
+ float: left;
+ width: 44%;
+ padding: 0;
+ margin: 15px 3% 0 0;
+}
+
+#forum_list div.project-forums {
+ border-bottom: 1px solid #CCC;
+ padding-top: 20px;
+ clear: left;
+}
+
+#forum_list > ul {
+ list-style: none;
+ padding: 0px;
+ margin-top: 0px;
+}
+
+#forum_list > ul > li.even {
+ margin-right: 0;
+ width: 46%;
+}
+
+#forum_list > ul > li.odd {
+ clear: left;
+}
+
+#forum_list > ul > li.odd, #forum_list > ul > li.even {
+ background-color: inherit;
+}
+
+.topic {
+ padding: 20px 0 20px;
+}
+
+.comment_container .topic{
+ padding: 5px 0 5px;
+}
+
+div.topic p {
+ margin: 5px 0;
+}
+
+div.topic h3.subject {
+ margin: 0px;
+}
+
+div.topic ul.meta {
+ margin: 0px;
+ padding: 0px;
+}
+
+div.topic ul.meta li {
+ display: block;
+ float: left;
+ font-size: 11px;
+ color: #999;
+ margin-right: 8px;
+ list-style: none;
+}
+
+div.topic ul.meta li a {
+ color: #999;
+}
+
+#topics_container.votable .topic-vote {float: left; width: 60px; text-align: center;}
+#topics_container.votable .topic-content {padding-left: 60px;}
+#topics_container.votable .topic-vote .vote-score {display: block; font-size: 24px;}
+#topics_container.votable .topic-vote .vote-score {display: block; font-size: 24px;}
+#topics_container.votable .topic-vote label {color: #999; line-height: 1; font-size: 12px; margin-bottom: 3px; display: block;}
+#topics_container.votable .topic-vote .status-answered {
+ height: 30px;
+ width: 35px;
+ background-position: -35px -75px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+#topics_list div.title-bar h4 {
+ padding: 15px 0;
+ border-bottom: 1px dotted #bbb;
+}
+
+input.questions-search {
+ background: url(/images/magnifier.png) no-repeat 6px 50%;
+ border: 1px solid #D7D7D7;
+ background-color: white;
+ padding-left: 30px !important;
+ border-radius: 3px;
+ height: 1.5em;
+ width: 94%;
+ font-size: 16px;
+}
+
+input.questions-search.ajax-loading {
+ background-image: url(/images/loading.gif);
+}
+
+
+
+/**********************************************************************/
+/* QUESTION show
+/**********************************************************************/
+
+h1.question-title {
+ font-weight: normal;
+}
+
+div.question.answer {
+ margin-bottom: 20px;
+ padding-top: 10px;
+ border-top: 1px solid #ddd;
+}
+
+.question a[disabled] {
+ color: #aaa;
+ pointer-events: none;
+}
+
+div.question img.gravatar {
+ float: left;
+ margin-right: 5px;
+}
+
+div.question p.author {
+ margin-top: 0px;
+}
+
+.question-status-tag {
+ font-family: Verdana, sans-serif;
+ background-color: #759FCF;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 3px;
+ padding: 2px 4px;
+ font-size: 10px;
+ display: inline-block;
+ vertical-align: middle;
+ color: white;
+ font-weight: normal;
+}
+
+/* Question vote*/
+
+div.question {display: table; width: 100%;}
+div.question.votable .vote {display: table-cell; padding: 0px 12px;}
+div.question.votable .question-container {display: table-cell;vertical-align: top;}
+div.question.votable .question-container .contextual {margin-top: 0px;}
+
+.question .vote a.disabled {pointer-events: none;opacity: 0.5}
+.question .vote {font-size: 24px; width: 35px;}
+
+.question .vote .vote-up,
+.question .vote .vote-down,
+.question .vote .vote-count,
+.question .vote .accepted {
+ display: block;
+ margin: 0 auto;
+ width: 35px;
+ height: 35px;
+ margin-bottom: 2px;
+ text-align: center;
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.question .vote .vote-up,
+.question .vote .vote-down,
+.question .vote .accepted,
+#topics_container.votable .topic-vote .status-answered {
+ background-image: url(../images/voting.svg);
+ background-size: initial;
+ background-repeat: no-repeat;
+ overflow: hidden;
+}
+
+.question .vote .accepted {cursor: default; background-position: 0px -69px;}
+.question .vote .vote-up {background-position: -70px 0px;}
+.question .vote .vote-down {background-position: -35px 0px;}
+.question .vote .vote-count {height: 32px;}
+/*.question .vote .vote-up:hover {background-position: -70px -35px;}
+.question .vote .vote-down:hover {background-position: -35px -35px;}
+*/
+.question div.attachments {
+ margin-bottom: 12px;
+}
+
+/* Question meta */
+
+#sidebar ul.question-meta, #sidebar ul.related-topics {
+ list-style: none;
+ padding: 0px;
+}
+
+#sidebar ul.question-meta li {
+ margin-bottom: 10px;
+ padding-left: 20px;
+ padding-top: 2px;
+ padding-bottom: 3px;
+}
+
+#sidebar ul.related-topics li {
+ margin-bottom: 5px;
+}
+
+/* Tags cloud */
+
+#sidebar ul.questions-tags {
+ list-style: none;
+ padding: 0px;
+}
+
+#sidebar ul.questions-tags li {
+ margin-bottom: 5px;
+}
+
+#sidebar ul.questions-tags span.count {
+ color: gray;
+}
+
+/**********************************************************************/
+/* SOLUTION show
+/**********************************************************************/
+.question.solution > h2 {
+ margin-bottom: 0px;
+ padding-bottom: 10px;
+ border-bottom: 1px solid #ddd;
+}
+
+.question.solution .liking {
+ padding: 10px 0px;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 10px 0px
+}
+
+.question.solution .liking > a {
+ padding: 0 5px;
+}
+
+
+.question.solution .liking .author {
+ float: right;
+}
+
+
+
+
+/**********************************************************************/
+/* COMMENTS
+/**********************************************************************/
+
+.comments_container {
+ background-color: #f5f5f5;
+ font-size: 0.9em;
+ margin: 10px 0px 0px 10px;
+}
+
+.question-comments .comment .contextual {
+ display: none;
+}
+
+.question-comments .comment:hover .contextual {
+ display: inline-block;
+ opacity: 0.4;
+}
+
+.question-comments .comment .contextual:hover {
+ opacity: 1;
+}
+
+
+.question-comments .comment {
+ padding: 10px;
+ border-bottom: 1px dashed #ccc;
+}
+
+.question-comments .comment:last-child {
+ border-bottom: 0px;
+}
+
+.question-comments .comment .author {
+ margin-bottom: 3px;
+}
+
+.question-comments .comment .wiki-content {
+ color: #707070;
+ display: inline-block;
+}
+.comments_container .comment .wiki-content p {
+ margin-bottom: 0px;
+}
+
+.question-comments .comment .wiki-content p:first-child {
+ margin-top: 0px;
+}
+
+.add-comment-link {
+ font-size: 0.9em;
+ display: block;
+}
+
+.add_comments {padding: 10px 10px 10px;}
+.add_comments:not(:first-child) {border-top: 1px dashed #ccc;}
+
+.add_comments textarea {
+ width: 98%;
+}
+
+/* Answers*/
+
+#answers {
+ padding-top: 10px;
+}
+
+.accepted_answer{
+ float: right;
+}
+
+
+/**********************************************************************/
+/* ICONS
+/**********************************************************************/
+
+.icon-vote { background-image: url(../images/thumb_up.png); }
+.icon-unvote { background-image: url(../images/unvote.png); }
+.icon-downvote { background-image: url(../images/thumb_down.png); }
+.icon-view { background-image: url(../images/eye.png); }
+.icon-calendar { background-image: url(/images/calendar.png); }
+.icon-tag { background-image: url(../images/tag_blue.png); }
+.icon-question { background-image: url(../../../images/help.png); }
+.icon-solution { background-image: url(../images/book_open.png); }
diff --git a/plugins/redmine_questions/config/locales/en.yml b/plugins/redmine_questions/config/locales/en.yml
index 660c65a..1c06d6c 100644
--- a/plugins/redmine_questions/config/locales/en.yml
+++ b/plugins/redmine_questions/config/locales/en.yml
@@ -6,13 +6,13 @@ en:
label_questions_new: New question
label_questions_message: Message
label_questions_added_time: "Added %{value} ago"
- label_questions_related_messages: Related messages
+ label_questions_related_questions: Related questions
label_questions_latest_messages: Latest messages
label_questions_views: '%{count} views'
label_questions_votes: '%{count} votes'
label_questions_answers: '%{count} answers'
label_questions_tags: Tags
- label_questions_tagged_by: '%{count} topic(s) tagged by %{tag}'
+ label_questions_tagged_by: '%{count} item(s) tagged by %{tag}'
label_questions_sidebar_message: Sidebar message
label_questions_notice: Notice
label_questions_most_voted: Most voted
@@ -24,9 +24,31 @@ en:
field_questions_tags: Tags
- permission_view_questions: View Help & Support
- permission_edit_messages_tags: Edit tags
- permission_edit_vote_messages: Vote messages
+ label_questions_add_comment: Add comment
+ label_question_comment_successful_added: Comment successful added
+ label_question_successful_update: Question successful updated
+ label_answer_successful_update: Answer successful updated
+ label_answer_successful_added: Answer successful added
+ lebel_questions_new_comment: New comment
+
+ button_questions_to_issue: Convert to issue
+ button_questions_issue_to_question: Convert to question
+ label_questions_actions: Actions
+ label_questions_accept: Accept
+
+ label_questions_section_type_questions: Questions
+ label_questions_section_type_solutions: Solutions
+ label_questions_section_type_ideas: Ideas
+
+ label_questions_section: Section
+ label_questions_sections_plural: Sections
+ label_questions_section_new: New section
+ label_questions_section_type: Section type
+ label_questions_topic: Topic
+ label_questions_featured: Featured
+ label_questions_locked: Locked
+
+ project_module_questions: Questions
i18n:
transliterate:
@@ -105,4 +127,46 @@ en:
"Ь": ""
"Э": "E"
"Ю": "YU"
- "Я": "YA"
\ No newline at end of file
+ "Я": "YA"
+ label_questions_comment: Comment
+ label_questions_your_answer: Your answer
+ label_questions_answer_plural: Answers
+ label_questions_x_votes:
+ one: "vote"
+ other: "votes"
+ label_questions_wasthishelpful: Was this helpful?
+
+ label_question_plural: Questions
+ label_questions_related_solutions: Related solutions
+ label_questions_section_edit: Edit section
+ label_soluition_plural: Solutions
+ label_questions_add_tag: '+ add tag'
+ label_questions_vote_added: Vote added
+ label_questions_vote_removed: Vote removed
+ label_questions_vote_own: Vote own questions
+ label_questions_show_popular: Show popular articles in section
+ label_questions_most_popular: Most popular
+ label_questions_status_plural: Idea statuses
+ label_questions_status_closed: Closed
+ label_questions_status_new: New status
+ label_questions_newest: Newest
+ label_questions_active: Active
+ label_questions_voted: Voted
+ label_questions_unanswered: Unanswered
+
+ permission_view_questions: View questions
+ permission_create_tags: Create new tags
+ permission_edit_vote_messages: Vote questions
+ permission_add_answers: Add answers
+ permission_delete_answers: Delete answers
+ permission_edit_question_comments: Edit comments
+ permission_edit_own_question_comments: Edit own comments
+ permission_comment_question: Add comments
+ permission_add_questions: Add questions
+ permission_edit_questions: Edit questions
+ permission_edit_own_questions: Edit own questions
+ permission_delete_questions: Delete questions
+ permission_vote_questions: Vote questions
+ permission_accept_answers: Accept answers
+ permission_manage_sections: Manage sections
+ permission_create_tags: Create new tags
\ No newline at end of file
diff --git a/plugins/redmine_questions/config/locales/es.yml b/plugins/redmine_questions/config/locales/es.yml
index 9531ee3..b052764 100644
--- a/plugins/redmine_questions/config/locales/es.yml
+++ b/plugins/redmine_questions/config/locales/es.yml
@@ -4,7 +4,7 @@ es:
label_questions_new: Nueva pregunta
label_questions_message: Mensaje
label_questions_added_time: "Agregado hace %{value}"
- label_questions_related_messages: Mensajes relacionados
+ label_questions_related_questions: Mensajes relacionados
label_questions_latest_messages: Últimos mensajes
label_questions_views: '%{count} vistas'
label_questions_votes: '%{count} votos'
diff --git a/plugins/redmine_questions/config/locales/ru.yml b/plugins/redmine_questions/config/locales/ru.yml
index e5da458..a8c198d 100644
--- a/plugins/redmine_questions/config/locales/ru.yml
+++ b/plugins/redmine_questions/config/locales/ru.yml
@@ -1,11 +1,13 @@
# Russian strings go here for Rails i18n
+# encoding: utf-8
+# English strings go here for Rails i18n
ru:
- label_questions: 'Поддержка'
+ label_questions: 'Вопросы/Ответы'
label_questions_search: 'Поиск вопросов и ответов ...'
label_questions_new: Новая тема
label_questions_message: Сообщение
label_questions_added_time: "Добавлена %{value} назад"
- label_questions_related_messages: Связанные темы
+ label_questions_related_questions: Связанные вопросы
label_questions_latest_messages: Последние сообщения
label_questions_views: '%{count} просмотров'
label_questions_votes: '%{count} голосов'
@@ -23,6 +25,73 @@ ru:
field_questions_tags: Тэги
+
+ label_questions_add_comment: Комментировать
+ label_question_comment_successful_added: Комментарий добавлен
+ label_question_successful_update: Вопрос обновлен
+ label_answer_successful_update: Ответ обновлен
+ label_answer_successful_added: Ответ добавлен
+ lebel_questions_new_comment: Новый комментарий
+
+ button_questions_to_issue: Конв. в задачу
+ button_questions_issue_to_question: Конв. в вопрос
+ label_questions_actions: Действия
+ label_questions_accept: Принять
+
+ label_questions_section_type_questions: Вопросы
+ label_questions_section_type_solutions: Решения
+ label_questions_section_type_ideas: Идеи
+
+ label_questions_section: Раздел
+ label_questions_sections_plural: Разделы
+ label_questions_section_new: Новый раздел
+ label_questions_section_type: Тип раздела
+ label_questions_featured: Выделено
+ label_questions_locked: Заблокировано
+
+ project_module_questions: Вопросы/Ответы
+
+ label_questions_comment: Комментарий
+ label_questions_your_answer: Ваш ответ
+ label_questions_answer_plural: Оветы
+ label_questions_x_votes:
+ one: "голос"
+ few: "голоса"
+ many: "голосов"
+ other: "голоса"
+ label_questions_wasthishelpful: Полезно ли Вам было?
+
+ label_question_plural: Вопросы
+ label_questions_related_solutions: Связанные решения
+ label_questions_section_edit: Редактировать раздел
+ label_soluition_plural: Решения
+ label_questions_add_tag: '+ добавить тэг'
+ label_questions_vote_added: Голос добавлен
+ label_questions_vote_removed: Голос удален
+ label_questions_vote_own: Голосовать за свои вопросы
+ label_questions_show_popular: Показыть популярные вопросы на списке секций
+ label_questions_most_popular: Популярные
+ label_questions_status_plural: Статусы идеи
+ label_questions_status_closed: Закрыто
+ label_questions_status_new: Новый статус
+ label_questions_newest: Новейшие
+ label_questions_active: Активные
+ label_questions_voted: Голоса
+ label_questions_unanswered: Неотвеченные
+
permission_view_questions: Просматривать вопросы ответы
- permission_edit_messages_tags: Редактирвоать тэги
+ permission_create_tags: Создавать тэги
permission_edit_vote_messages: Голосовать
+ permission_add_answers: Добавить ответы
+ permission_delete_answers: Удалить ответы
+ permission_edit_question_comments: Редактировать комментарии
+ permission_edit_own_question_comments: Редактировать свои комментарии
+ permission_comment_question: Добавить комментарии
+ permission_add_questions: Добавить вопросы
+ permission_edit_questions: Редактировать вопросы
+ permission_edit_own_questions: Редактировать свои вопросы
+ permission_delete_questions: Удалить вопросы
+ permission_vote_questions: Голосовать за вопросы
+ permission_accept_answers: Принимать ответы
+ permission_manage_sections: Управлять секциями
+ permission_create_tags: Создавать новые тэги
\ No newline at end of file
diff --git a/plugins/redmine_questions/config/locales/zh.yml b/plugins/redmine_questions/config/locales/zh.yml
index 090f103..d0e517f 100644
--- a/plugins/redmine_questions/config/locales/zh.yml
+++ b/plugins/redmine_questions/config/locales/zh.yml
@@ -2,11 +2,10 @@
# Simplified Chinese strings go here for Rails i18n
# Author: Salivaxiu@163.com
# Based on file: en.yml
-
zh:
label_questions: '帮助与支持'
label_questions_search: '搜索特定的问题或回答或帖子...'
- label_questions_new: 新问题
+ label_questions_new: 新问答
label_questions_message: 消息
label_questions_added_time: "在 %{value} 之前增加"
label_questions_related_messages: 相关的消息
@@ -16,7 +15,7 @@ zh:
label_questions_answers: '回答 %{count} 次'
label_questions_tags: 标签
label_questions_tagged_by: '%{count} 个主题包含标签 %{tag}'
- label_questions_notice_message: 通知消息
+ label_questions_sidebar_message: 侧边栏信息
label_questions_notice: 通知
label_questions_most_voted: 大多数投票
diff --git a/plugins/redmine_questions/config/routes.rb b/plugins/redmine_questions/config/routes.rb
index 60e6c79..9135b49 100644
--- a/plugins/redmine_questions/config/routes.rb
+++ b/plugins/redmine_questions/config/routes.rb
@@ -1,14 +1,65 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
# Plugin's routes
# See: http://guides.rubyonrails.org/routing.html
+# match '/news/:id/comments', :to => 'comments#create', :via => :post
+# match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
resources :questions do
collection do
- get :autocomplete_for_topic
+ put :preview
+ put :update_form
+ # match :preview, :to => 'questions#preview', :via => [:get, :put, :post]
+ get :autocomplete_for_subject
get :topics
+ get :index_public
end
member do
- get :vote
+ get :from_issue
+ # post :new_comment
+ end
+ resources :questions_answers, :as => :answers
+end
+
+resources :questions_answers, :except => [:show, :index] do
+ collection do
+ put :preview
end
end
-match "issues/:issue_id/move_to_forum/:board_id" => "questions#convert_issue", :via => [:get, :post]
+match "questions_votes", :to => 'questions_votes#create', :via => [:get, :post], :as => 'questions_votes'
+
+resources :questions_comments do
+ member do
+ post :update
+ end
+end
+
+resources :questions_sections
+resources :questions_statuses, :except => :show
+
+resources :projects do
+ resources :questions_sections
+ resources :questions
+end
+
+match "projects/:project_id/questions/questions_sections/:section_id" => "questions#index", :via => [:get]
+match "questions/questions_sections/:section_id" => "questions#index", :via => [:get]
+match 'auto_completes/questions_tags' => 'auto_completes#questions_tags', :via => :get, :as => 'auto_complete_questions_tags'
diff --git a/plugins/redmine_questions/db/migrate/001_acts_as_votable_migration.rb b/plugins/redmine_questions/db/migrate/001_acts_as_votable_migration.rb
index 326fe3a..7f4787d 100644
--- a/plugins/redmine_questions/db/migrate/001_acts_as_votable_migration.rb
+++ b/plugins/redmine_questions/db/migrate/001_acts_as_votable_migration.rb
@@ -1,18 +1,27 @@
-class ActsAsVotableMigration < ActiveRecord::Migration
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class ActsAsVotableMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def self.up
ActiveRecord::Base.create_votable_table
- add_column :messages, :cached_votes_total, :integer, :default => 0
- add_column :messages, :cached_votes_up, :integer, :default => 0
- add_column :messages, :cached_votes_down, :integer, :default => 0
- add_index :messages, :cached_votes_total
- add_index :messages, :cached_votes_up
- add_index :messages, :cached_votes_down
end
def self.down
- ActiveRecord::Base.drop_votable_table
- remove_column :messages, :cached_votes_total
- remove_column :messages, :cached_votes_up
- remove_column :messages, :cached_votes_down
end
end
diff --git a/plugins/redmine_questions/db/migrate/002_add_viewing_migration.rb b/plugins/redmine_questions/db/migrate/002_add_viewing_migration.rb
index 386d522..63f04c0 100644
--- a/plugins/redmine_questions/db/migrate/002_add_viewing_migration.rb
+++ b/plugins/redmine_questions/db/migrate/002_add_viewing_migration.rb
@@ -1,10 +1,29 @@
-class AddViewingMigration < ActiveRecord::Migration
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+class AddViewingMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def self.up
- ActiveRecord::Base.create_viewings_table
+ unless table_exists?(:viewings)
+ ActiveRecord::Base.create_viewings_table
+ end
end
def self.down
- ActiveRecord::Base.drop_viewings_table
end
end
diff --git a/plugins/redmine_questions/db/migrate/003_add_tagging_migration.rb b/plugins/redmine_questions/db/migrate/003_add_tagging_migration.rb
index 2b1c55d..a54614e 100644
--- a/plugins/redmine_questions/db/migrate/003_add_tagging_migration.rb
+++ b/plugins/redmine_questions/db/migrate/003_add_tagging_migration.rb
@@ -1,4 +1,23 @@
-class AddTaggingMigration < ActiveRecord::Migration
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class AddTaggingMigration < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def up
ActiveRecord::Base.create_taggable_table
end
diff --git a/plugins/redmine_questions/db/migrate/004_create_questions.rb b/plugins/redmine_questions/db/migrate/004_create_questions.rb
new file mode 100644
index 0000000..8165cf0
--- /dev/null
+++ b/plugins/redmine_questions/db/migrate/004_create_questions.rb
@@ -0,0 +1,39 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class CreateQuestions < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
+ def change
+ create_table :questions do |t|
+ t.string :subject
+ t.text :content
+ t.references :section, :index => true
+ t.references :status, :index => true
+ t.references :author, :index => true
+ t.boolean :featured, :default => false
+ t.boolean :locked, :default => false
+ t.integer :cached_weighted_score, :default => 0
+ t.integer :comments_count, :default => 0
+ t.integer :answers_count, :default => 0
+ t.integer :views, :default => 0
+ t.integer :total_views, :default => 0
+ t.datetime :created_on
+ t.datetime :updated_on
+ end
+ end
+end
diff --git a/plugins/redmine_questions/db/migrate/005_create_questions_sections.rb b/plugins/redmine_questions/db/migrate/005_create_questions_sections.rb
new file mode 100644
index 0000000..f53d117
--- /dev/null
+++ b/plugins/redmine_questions/db/migrate/005_create_questions_sections.rb
@@ -0,0 +1,31 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class CreateQuestionsSections < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
+ def change
+ create_table :questions_sections do |t|
+ t.string :name
+ t.text :description
+ t.references :project, :index => true
+ t.string :section_type
+ t.integer :position
+ end
+ add_index :questions_sections, :position
+ end
+end
diff --git a/plugins/redmine_questions/db/migrate/006_create_questions_answers.rb b/plugins/redmine_questions/db/migrate/006_create_questions_answers.rb
new file mode 100644
index 0000000..2c984b2
--- /dev/null
+++ b/plugins/redmine_questions/db/migrate/006_create_questions_answers.rb
@@ -0,0 +1,35 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class CreateQuestionsAnswers < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
+ def change
+ create_table :questions_answers do |t|
+ t.text :content
+ t.references :author, :index => true
+ t.references :question, :index => true
+ t.boolean :accepted, :default => false
+ t.integer :cached_weighted_score, :default => 0
+ t.integer :comments_count, :default => 0
+ t.datetime :created_on
+ t.datetime :updated_on
+ end
+
+ add_index :questions_answers, :accepted
+ end
+end
diff --git a/plugins/redmine_questions/db/migrate/007_create_questions_statuses.rb b/plugins/redmine_questions/db/migrate/007_create_questions_statuses.rb
new file mode 100644
index 0000000..9fb72d0
--- /dev/null
+++ b/plugins/redmine_questions/db/migrate/007_create_questions_statuses.rb
@@ -0,0 +1,32 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+class CreateQuestionsStatuses < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
+ def change
+ create_table :questions_statuses do |t|
+ t.string :name
+ t.boolean :is_closed, :default => false
+ t.string :color
+ t.integer :position
+ end
+
+ add_index :questions_statuses, :is_closed
+ add_index :questions_statuses, :position
+ end
+end
diff --git a/plugins/redmine_questions/doc/CHANGELOG b/plugins/redmine_questions/doc/CHANGELOG
old mode 100644
new mode 100755
index dee05fc..aee16f7
--- a/plugins/redmine_questions/doc/CHANGELOG
+++ b/plugins/redmine_questions/doc/CHANGELOG
@@ -1,13 +1,19 @@
== Redmine Q&A plugin changelog
Redmine Q&A plugin
-Copyright (C) 2011-2016 Kirill Bezrukov
-http://www.redminecrm.com/
+Copyright (C) 2011-2018 RedmineUP
+https://www.redmineup.com/
-== 2016-01-18 v0.0.7
+== 2018-08-31 v1.0.0
+* Separate models for questions, answers and comments
+* Voting for questions and answers
+* Comments for questions and asnwers
+* Section types: Question, Idea, Solution
+* Different main page styles
+* Answered question status
+* Idea statutes
* Chinese translation (zhoutt)
-* Redmine 3+ support
== 2014-02-04 v0.0.6
diff --git a/plugins/redmine_questions/doc/COPYING b/plugins/redmine_questions/doc/COPYING
index 82fa1da..63e41a4 100644
--- a/plugins/redmine_questions/doc/COPYING
+++ b/plugins/redmine_questions/doc/COPYING
@@ -336,4 +336,4 @@ This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
+Public License instead of this License.
\ No newline at end of file
diff --git a/plugins/redmine_questions/doc/LICENSE b/plugins/redmine_questions/doc/LICENSE
index 9457f59..e2e50b5 100644
--- a/plugins/redmine_questions/doc/LICENSE
+++ b/plugins/redmine_questions/doc/LICENSE
@@ -1,26 +1,26 @@
LICENSING
-RedmineCRM Licencing
+RedmineUP Licencing
-This End User License Agreement is a binding legal agreement between you and RedmineCRM. Purchase, installation or use of RedmineCRM Extensions provided on redminecrm.com signifies that you have read, understood, and agreed to be bound by the terms outlined below.
+This End User License Agreement is a binding legal agreement between you and RedmineUP. Purchase, installation or use of RedmineUP Extensions provided on redmineup.com signifies that you have read, understood, and agreed to be bound by the terms outlined below.
-RedmineCRM GPL Licencing
+RedmineUP GPL Licencing
-All Redmine Extensions produced by RedmineCRM are released under the GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html). Specifically, the Ruby code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript are NOT GPL, and are released under the RedmineCRM Proprietary Use License v1.0 (See below) unless specifically authorized by RedmineCRM. Elements of the extensions released under this proprietary license may not be redistributed or repackaged for use other than those allowed by the Terms of Service.
+All Redmine Extensions produced by RedmineUP are released under the GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html). Specifically, the Ruby code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript are NOT GPL, and are released under the RedmineUP Proprietary Use License v1.0 (See below) unless specifically authorized by RedmineUP. Elements of the extensions released under this proprietary license may not be redistributed or repackaged for use other than those allowed by the Terms of Service.
-RedmineCRM Proprietary Use License (v1.0)
+RedmineUP Proprietary Use License (v1.0)
-The RedmineCRM Proprietary Use License covers any images, cascading stylesheets, manuals and JavaScript files in any extensions produced and/or distributed by redminecrm.com. These files are copyrighted by redminecrm.com (RedmineCRM) and cannot be redistributed in any form without prior consent from redminecrm.com (RedmineCRM)
+The RedmineUP Proprietary Use License covers any images, cascading stylesheets, manuals and JavaScript files in any extensions produced and/or distributed by redmineup.com. These files are copyrighted by redmineup.com (RedmineUP) and cannot be redistributed in any form without prior consent from redmineup.com (RedmineUP)
Usage Terms
You are allowed to use the Extensions on one or many "production" domains, depending on the type of your license
You are allowed to make any changes to the code, however modified code will not be supported by us.
-Modification Of Extensions Produced By RedmineCRM.
+Modification Of Extensions Produced By RedmineUP.
-You are authorized to make any modification(s) to RedmineCRM extension Ruby code. However, if you change any Ruby code and it breaks functionality, support may not be available to you.
+You are authorized to make any modification(s) to RedmineUP extension Ruby code. However, if you change any Ruby code and it breaks functionality, support may not be available to you.
-In accordance with the RedmineCRM Proprietary Use License v1.0, you may not release any proprietary files (modified or otherwise) under the GPL license. The terms of this license and the GPL v2 prohibit the removal of the copyright information from any file.
+In accordance with the RedmineUP Proprietary Use License v1.0, you may not release any proprietary files (modified or otherwise) under the GPL license. The terms of this license and the GPL v2 prohibit the removal of the copyright information from any file.
Please contact us if you have any requirements that are not covered by these terms.
\ No newline at end of file
diff --git a/plugins/redmine_questions/init.rb b/plugins/redmine_questions/init.rb
index f3e086d..0e373b3 100644
--- a/plugins/redmine_questions/init.rb
+++ b/plugins/redmine_questions/init.rb
@@ -1,38 +1,68 @@
-requires_redmine_crm(:version_or_higher => '0.0.17')
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+requires_redmine_crm version_or_higher: '0.0.38'
+
require 'redmine_questions'
+QA_VERSION_NUMBER = '1.0.0'
+QA_VERSION_TYPE = "Light version"
Redmine::Plugin.register :redmine_questions do
- name 'Redmine Q&A plugin'
- author 'RedmineCRM'
+ name "Redmine Q&A plugin (#{QA_VERSION_TYPE})"
+ author 'RedmineUP'
description 'This is a Q&A plugin for Redmine'
- version '0.0.7'
- url 'http://www.redminecrm.com/projects/questions'
- author_url 'mailto:support@redminecrm.com'
+ version QA_VERSION_NUMBER
+ url 'https://www.redmineup.com/pages/plugins/questions'
+ author_url 'mailto:support@redmineup.com'
- requires_redmine :version_or_higher => '2.1.2'
-
- settings :default => {
- :sidebar_message => '*Can\'t find the answer you\'re looking for?* Email us at ...'
- }, :partial => 'settings/questions'
-
- permission :view_questions, {
- :questions => [:index, :autocomplete_for_topic, :topics]
- }
+ requires_redmine :version_or_higher => '2.6'
delete_menu_item(:top_menu, :help)
- menu :top_menu, :questions, {:controller => 'questions', :action => 'index'},
- :last => true,
- :caption => :label_questions,
- :if => Proc.new {User.current.allowed_to?({:controller => 'questions', :action => 'index'}, nil, {:global => true})}
+ menu :top_menu, :questions, {controller: 'questions_sections', action: 'index', project_id: nil},
+ caption: :label_questions,
+ if: Proc.new {User.current.allowed_to?({controller: 'questions_sections', action: 'index'}, nil, {global: true})}
- Redmine::AccessControl.map do |map|
- map.project_module :boards do |map|
- map.permission :view_questions, {:questions => [:autocomplete_for_topic, :topics]}
- map.permission :vote_messages, {:questions => [:vote]}
- map.permission :convert_issues, {:questions => [:convert_issue]}
- map.permission :edit_messages_tags, {}
- end
+ menu :project_menu, :questions, {controller: 'questions_sections', action: 'index'},
+ param: :project_id
+
+ project_module :questions do
+ permission :add_questions, { questions: [:create, :new, :preview, :update_form] }
+ permission :edit_questions, { questions: [:edit, :update, :preview, :update_form], questions_answers: [:edit, :update, :preview] }, require: :loggedin
+ permission :edit_own_questions, {questions: [:edit, :update, :preview, :update_form]}, require: :loggedin
+ permission :add_answers, { questions_answers: [:create, :show, :new, :edit, :update, :preview] }
+ permission :view_questions, { questions: [:index, :show, :autocomplete_for_subject], questions_sections: [:index] }, read: true
+ permission :delete_questions, { questions: [:destroy] }, require: :loggedin
+ permission :delete_answers, { questions_answers: [:destroy] }, require: :loggedin
+ permission :vote_questions, { questions_votes: [:create] }
+ permission :accept_answers, { questions_answers: [:update] }, require: :loggedin
+ permission :comment_question, { questions_comments: [:create] }
+ permission :edit_question_comments, { questions_comments: [:update, :destroy, :edit] }, require: :loggedin
+ permission :edit_own_question_comments, { questions_comments: [:update, :destroy, :edit] }, require: :loggedin
+ permission :manage_sections, { projects: :settings, questions_sections: [:create, :new, :edit, :update] }, require: :loggedin
+ permission :create_tags, {}
end
+
+ activity_provider :questions, default: false, class_name: ['Question', 'QuestionsAnswer']
+
+ Redmine::Search.map do |search|
+ search.register :questions
+ end
end
diff --git a/plugins/redmine_questions/lib/acts_as_attachable_questions/init.rb b/plugins/redmine_questions/lib/acts_as_attachable_questions/init.rb
new file mode 100755
index 0000000..92731f3
--- /dev/null
+++ b/plugins/redmine_questions/lib/acts_as_attachable_questions/init.rb
@@ -0,0 +1,28 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+# $LOAD_PATH.unshift(File.dirname(__FILE__))
+# require "lib/acts_as_viewable"
+# $LOAD_PATH.shift
+
+require File.dirname(__FILE__) + '/lib/acts_as_attachable_questions'
+
+unless ActiveRecord::Base.included_modules.include?(Redmine::Acts::AttachableQuestions)
+ ActiveRecord::Base.send(:include, Redmine::Acts::AttachableQuestions)
+end
diff --git a/plugins/redmine_questions/lib/acts_as_attachable_questions/lib/acts_as_attachable_questions.rb b/plugins/redmine_questions/lib/acts_as_attachable_questions/lib/acts_as_attachable_questions.rb
new file mode 100755
index 0000000..61edb90
--- /dev/null
+++ b/plugins/redmine_questions/lib/acts_as_attachable_questions/lib/acts_as_attachable_questions.rb
@@ -0,0 +1,108 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module Redmine
+ module Acts
+ module AttachableQuestions
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ module ClassMethods
+ def acts_as_attachable_questions(options = {})
+ if ActiveRecord::VERSION::MAJOR >= 4
+ has_many :attachments, lambda { order("#{Attachment.table_name}.created_on") }, options.merge(:as => :container,
+ :dependent => :destroy)
+ else
+ has_many :attachments, options.merge(:as => :container,
+ :order => "#{Attachment.table_name}.created_on",
+ :dependent => :destroy)
+ end
+
+ send :include, Redmine::Acts::AttachableQuestions::InstanceMethods
+ before_save :attach_saved_attachments
+ end
+ end
+
+ module InstanceMethods
+ def self.included(base)
+ base.extend ClassMethods
+ end
+
+ def attachments_visible?(user = User.current)
+ respond_to?(:visible?) ? visible?(user) : true
+ end
+
+ def attachments_editable?(user = User.current)
+ (respond_to?(:visible?) ? visible?(user) : true) &&
+ (user.allowed_to?(:manage_sections, project, :global => true) ||
+ user.allowed_to?(:add_questions, project, :global => true))
+ end
+
+ def attachments_deletable?(user = User.current)
+ (respond_to?(:visible?) ? visible?(user) : true) &&
+ (user.allowed_to?(:delete_questions, project, :global => true) ||
+ user.allowed_to?(:add_questions, project, :global => true))
+ end
+
+ def saved_attachments
+ @saved_attachments ||= []
+ end
+
+ def unsaved_attachments
+ @unsaved_attachments ||= []
+ end
+
+ def save_attachments(attachments, author = User.current)
+ attachments = attachments.values if attachments.is_a?(Hash)
+ if attachments.is_a?(Array)
+ attachments.each do |attachment|
+ a = nil
+ if file = attachment['file']
+ next unless file.size > 0
+ a = Attachment.create(:file => file, :author => author)
+ elsif token = attachment['token']
+ a = Attachment.find_by_token(token)
+ next unless a
+ a.filename = attachment['filename'] unless attachment['filename'].blank?
+ a.content_type = attachment['content_type']
+ end
+ next unless a
+ a.description = attachment['description'].to_s.strip
+ if a.new_record?
+ unsaved_attachments << a
+ else
+ saved_attachments << a
+ end
+ end
+ end
+ { :files => saved_attachments, :unsaved => unsaved_attachments }
+ end
+
+ def attach_saved_attachments
+ saved_attachments.each do |attachment|
+ attachments << attachment
+ end
+ end
+ module ClassMethods
+ end
+ end
+ end
+ end
+end
diff --git a/plugins/redmine_questions/lib/acts_as_votable_vote_patch.rb b/plugins/redmine_questions/lib/acts_as_votable_vote_patch.rb
deleted file mode 100644
index a6db3c5..0000000
--- a/plugins/redmine_questions/lib/acts_as_votable_vote_patch.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-module RedmineQuestions
- module Patches
- module ActsAsVotableVotePatch
- def self.included(base) # :nodoc:
- base.class_eval do
- unloadable # Send unloadable so it will not be unloaded in development
- attr_accessible :votable, :voter, :vote_scope
- end
- end
- end
- end
-end
-
-unless RedmineCrm::ActsAsVotable::Vote.included_modules.include?(RedmineQuestions::Patches::ActsAsVotableVotePatch)
- RedmineCrm::ActsAsVotable::Vote.send(:include, RedmineQuestions::Patches::ActsAsVotableVotePatch)
-end
\ No newline at end of file
diff --git a/plugins/redmine_questions/lib/redmine_questions.rb b/plugins/redmine_questions/lib/redmine_questions.rb
index e58ca81..f74816b 100644
--- a/plugins/redmine_questions/lib/redmine_questions.rb
+++ b/plugins/redmine_questions/lib/redmine_questions.rb
@@ -1,7 +1,32 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
require_dependency 'redmine_questions/hooks/views_layouts_hook'
-# require_dependency 'redmine_questions/patches/boards_controller_patch'
-require_dependency 'redmine_questions/patches/message_patch'
require_dependency 'redmine_questions/patches/user_patch'
-require_dependency 'redmine_questions/patches/messages_controller_patch'
-require_dependency 'acts_as_votable_vote_patch' if ActiveRecord::VERSION::MAJOR >= 4
+require_dependency 'redmine_questions/patches/project_patch'
+require_dependency 'redmine_questions/patches/notifiable_patch'
+require_dependency 'redmine_questions/patches/mailer_patch'
+require_dependency 'redmine_questions/patches/projects_helper_patch'
+require_dependency 'redmine_questions/patches/auto_completes_controller_patch'
+require_dependency 'redmine_questions/patches/comment_patch'
+
+require_dependency 'acts_as_attachable_questions/init'
+
+require 'redmine_questions/patches/compatibility/application_controller_patch' if Rails::VERSION::MAJOR < 4
diff --git a/plugins/redmine_questions/lib/redmine_questions/hooks/views_layouts_hook.rb b/plugins/redmine_questions/lib/redmine_questions/hooks/views_layouts_hook.rb
index 94e1933..2405ae1 100644
--- a/plugins/redmine_questions/lib/redmine_questions/hooks/views_layouts_hook.rb
+++ b/plugins/redmine_questions/lib/redmine_questions/hooks/views_layouts_hook.rb
@@ -1,9 +1,28 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
module RedmineQuestions
module Hooks
class ViewsLayoutsHook < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context={})
- return stylesheet_link_tag(:questions, :plugin => 'redmine_questions')
+ return stylesheet_link_tag(:redmine_questions, :plugin => 'redmine_questions')
end
end
end
-end
\ No newline at end of file
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/auto_completes_controller_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/auto_completes_controller_patch.rb
new file mode 100644
index 0000000..7449d84
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/auto_completes_controller_patch.rb
@@ -0,0 +1,48 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+require_dependency 'auto_completes_controller'
+
+module RedmineQuestions
+ module Patches
+ module AutoCompletesControllerPatch
+ def self.included(base)
+ base.send(:include, InstanceMethods)
+
+ base.class_eval do
+ end
+ end
+
+ module InstanceMethods
+ def questions_tags
+ @names_only = params[:names]
+ @questions_tags = []
+ q = (params[:q] || params[:term]).to_s.strip
+ scope = Question.tags_cloud(:name_like => q, :limit => params[:limit] || 10)
+ @questions_tags = scope.to_a.sort! { |x, y| x.name <=> y.name }
+ render :layout => false, :partial => 'questions_tags'
+ end
+ end
+ end
+ end
+end
+
+unless AutoCompletesController.included_modules.include?(RedmineQuestions::Patches::AutoCompletesControllerPatch)
+ AutoCompletesController.send(:include, RedmineQuestions::Patches::AutoCompletesControllerPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/boards_controller_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/boards_controller_patch.rb
deleted file mode 100644
index a64da13..0000000
--- a/plugins/redmine_questions/lib/redmine_questions/patches/boards_controller_patch.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require_dependency 'boards_controller'
-require_dependency 'board'
-
-module RedmineQuestions
- module Patches
-
- module BoardsControllerPatch
- def self.included(base) # :nodoc:
- base.class_eval do
- helper :questions
- end
- end
-
- end
-
- end
-end
-
-unless MessagesController.included_modules.include?(RedmineQuestions::Patches::BoardsControllerPatch)
- MessagesController.send(:include, RedmineQuestions::Patches::BoardsControllerPatch)
-end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/comment_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/comment_patch.rb
new file mode 100644
index 0000000..94146b7
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/comment_patch.rb
@@ -0,0 +1,51 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module RedmineQuestions
+ module Patches
+ module CommentPatch
+ def self.included(base) # :nodoc:
+ base.send(:include, InstanceMethods)
+ base.class_eval do
+ unloadable
+ if method_defined?(:send_notification)
+ alias_method :send_notification_without_questions, :send_notification
+ alias_method :send_notification, :send_notification_with_questions
+ end
+ end
+ end
+
+ module InstanceMethods
+ def send_notification_with_questions
+ if [Question, QuestionsAnswer].include?(commented.class)
+ if Setting.notified_events.include?('question_comment_added')
+ Mailer.send('question_comment_added', self).deliver
+ end
+ else
+ send_notification_without_questions
+ end
+ end
+ end
+ end
+ end
+end
+
+unless Comment.included_modules.include?(RedmineQuestions::Patches::CommentPatch)
+ Comment.send(:include, RedmineQuestions::Patches::CommentPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/compatibility/application_controller_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/compatibility/application_controller_patch.rb
new file mode 100644
index 0000000..723eb8c
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/compatibility/application_controller_patch.rb
@@ -0,0 +1,37 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module RedmineQuestions
+ module Patches
+ module ApplicationControllerPatch
+ def self.included(base) # :nodoc:
+ base.class_eval do
+ unloadable # Send unloadable so it will not be unloaded in development
+ class << self
+ alias_method :before_action, :before_filter
+ end
+ end
+ end
+ end
+ end
+end
+
+unless ApplicationController.included_modules.include?(RedmineQuestions::Patches::ApplicationControllerPatch)
+ ApplicationController.send(:include, RedmineQuestions::Patches::ApplicationControllerPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/mailer_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/mailer_patch.rb
new file mode 100644
index 0000000..b0022af
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/mailer_patch.rb
@@ -0,0 +1,87 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module RedmineQuestions
+ module Patches
+ module MailerPatch
+ module InstanceMethods
+ def question_comment_added(comment)
+ question = comment.commented.is_a?(Question) ? comment.commented : comment.commented.question
+ @question_url = url_for(:controller => 'questions', :action => 'show', :id => question.id)
+ project_identifier = question.project.try(:identifier)
+ redmine_headers 'Project' => project_identifier, 'Question-Id' => question.id
+ message_id comment
+ @author = comment.author
+ @comment = comment
+ @question = question
+ project_prefix = [project_identifier, question.section_name, "q&a#{question.id}"].compact.join(' - ')
+ recipients = question.watcher_recipients
+ mail :to => recipients,
+ :subject => "[#{project_prefix}] RE: #{question.subject}"
+ end
+
+ def question_question_added(question)
+ @question_url = url_for(:controller => 'questions', :action => 'show', :id => question.id)
+ project_identifier = question.project.try(:identifier)
+ redmine_headers 'Project' => project_identifier, 'Question-Id' => question.id
+ message_id question
+ @author = question.author
+ @question = question
+ recipients = question.notified_users
+ cc = question.section.notified_watchers - recipients
+ project_prefix = [project_identifier, question.section_name, "q&a#{question.id}"].compact.join(' - ')
+ mail :to => recipients,
+ :cc => cc,
+ :subject => "[#{project_prefix}] #{question.subject}"
+ end
+
+ def question_answer_added(answer)
+ question = answer.question
+ @question_url = url_for(:controller => 'questions', :action => 'show', :id => question.id)
+ project_identifier = question.project.try(:identifier)
+ redmine_headers 'Project' => project_identifier, 'Question-Id' => question.id
+ message_id question
+ recipients = question.notified_users
+ watchers = (question.notified_watchers + question.section.notified_watchers).uniq
+ watchers = watchers.map(&:mail) if watchers.first.respond_to?(:mail)
+ cc = watchers - recipients
+
+ @author = answer.author
+ @answer = answer
+ @question = question
+ project_prefix = [project_identifier, question.section_name, "q&a#{question.id}"].compact.join(' - ')
+ mail :to => recipients,
+ :cc => cc,
+ :subject => "[#{project_prefix}] - answ##{answer.id} - RE: #{question.subject}"
+ end
+ end
+
+ def self.included(receiver)
+ receiver.send :include, InstanceMethods
+ receiver.class_eval do
+ unloadable
+ end
+ end
+ end
+ end
+end
+
+unless Mailer.included_modules.include?(RedmineQuestions::Patches::MailerPatch)
+ Mailer.send(:include, RedmineQuestions::Patches::MailerPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/message_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/message_patch.rb
deleted file mode 100644
index fbe9b45..0000000
--- a/plugins/redmine_questions/lib/redmine_questions/patches/message_patch.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-module RedmineQuestions
- module Patches
- module MessagePatch
- def self.included(base) # :nodoc:
- base.send(:include, InstanceMethods)
-
- base.class_eval do
- unloadable # Send unloadable so it will not be unloaded in development
- rcrm_acts_as_taggable
- rcrm_acts_as_votable
- rcrm_acts_as_viewed
-
- safe_attributes 'tag_list',
- :if => lambda {|message, user|
- user.allowed_to?(:edit_messages_tags, message.project)
- }
- end
-
- end
-
- module InstanceMethods
-
- def to_param
- "#{id}-#{ActiveSupport::Inflector.transliterate(subject).parameterize}"
- end
-
- def like(user)
- liked_by(user)
- end
-
- def dislike(user)
- unvote(:voter => user)
- end
-
- end
-
- end
- end
-end
-
-unless Message.included_modules.include?(RedmineQuestions::Patches::MessagePatch)
- Message.send(:include, RedmineQuestions::Patches::MessagePatch)
-end
-
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/messages_controller_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/messages_controller_patch.rb
deleted file mode 100644
index f4707d4..0000000
--- a/plugins/redmine_questions/lib/redmine_questions/patches/messages_controller_patch.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module RedmineQuestions
- module Patches
-
- module MessagesControllerPatch
-
- module InstanceMethods
-
- def view_message
- @message.view(request.env['HTTP_X_FORWARDED_FOR'] || request.remote_ip || request.remote_addr, User.current.logged? ? User.current : nil) unless @message.author == User.current
- end
-
- end
-
- def self.included(base) # :nodoc:
- base.send(:include, InstanceMethods)
-
- base.class_eval do
- after_filter :view_message, :only => :show
- end
- end
-
- end
-
- end
-end
-
-unless MessagesController.included_modules.include?(RedmineQuestions::Patches::MessagesControllerPatch)
- MessagesController.send(:include, RedmineQuestions::Patches::MessagesControllerPatch)
-end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/notifiable_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/notifiable_patch.rb
new file mode 100644
index 0000000..578d435
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/notifiable_patch.rb
@@ -0,0 +1,49 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module RedmineQuestions
+ module Patches
+ module NotifiablePatch
+ def self.included(base)
+ base.extend(ClassMethods)
+ base.class_eval do
+ unloadable
+ class << self
+ alias_method :all_without_questions, :all
+ alias_method :all, :all_with_questions
+ end
+ end
+ end
+
+ module ClassMethods
+ def all_with_questions
+ notifications = all_without_questions
+ notifications << Redmine::Notifiable.new('question_added')
+ notifications << Redmine::Notifiable.new('question_answer_added')
+ notifications << Redmine::Notifiable.new('question_comment_added')
+ notifications
+ end
+ end
+ end
+ end
+end
+
+unless Redmine::Notifiable.included_modules.include?(RedmineQuestions::Patches::NotifiablePatch)
+ Redmine::Notifiable.send(:include, RedmineQuestions::Patches::NotifiablePatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/project_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/project_patch.rb
new file mode 100644
index 0000000..cb9ef94
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/project_patch.rb
@@ -0,0 +1,36 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+module RedmineQuestions
+ module Patches
+ module ProjectPatch
+ def self.included(base) # :nodoc:
+ base.class_eval do
+ unloadable # Send unloadable so it will not be unloaded in development
+ has_many :questions_sections, :dependent => :delete_all
+ has_many :questions, :through => :questions_sections
+ end
+ end
+ end
+ end
+end
+
+unless Project.included_modules.include?(RedmineQuestions::Patches::ProjectPatch)
+ Project.send(:include, RedmineQuestions::Patches::ProjectPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/projects_helper_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/projects_helper_patch.rb
new file mode 100644
index 0000000..96ba21a
--- /dev/null
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/projects_helper_patch.rb
@@ -0,0 +1,56 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
+require_dependency 'queries_helper'
+
+module RedmineQuestions
+ module Patches
+ module ProjectsHelperPatch
+ def self.included(base)
+ base.send(:include, InstanceMethods)
+
+ base.class_eval do
+ unloadable
+ alias_method :project_settings_tabs_without_questions, :project_settings_tabs
+ alias_method :project_settings_tabs, :project_settings_tabs_with_questions
+ end
+ end
+
+ module InstanceMethods
+ # include ContactsHelper
+
+ def project_settings_tabs_with_questions
+ tabs = project_settings_tabs_without_questions
+
+ tabs.push({ :name => 'questions',
+ :action => :manage_sections,
+ :partial => 'projects/questions_settings',
+ :label => :label_questions }) if User.current.allowed_to?(:manage_sections, @project)
+ tabs
+
+ end
+ end
+
+ end
+ end
+end
+
+unless ProjectsHelper.included_modules.include?(RedmineQuestions::Patches::ProjectsHelperPatch)
+ ProjectsHelper.send(:include, RedmineQuestions::Patches::ProjectsHelperPatch)
+end
diff --git a/plugins/redmine_questions/lib/redmine_questions/patches/user_patch.rb b/plugins/redmine_questions/lib/redmine_questions/patches/user_patch.rb
index 8cf223e..e2467ad 100644
--- a/plugins/redmine_questions/lib/redmine_questions/patches/user_patch.rb
+++ b/plugins/redmine_questions/lib/redmine_questions/patches/user_patch.rb
@@ -1,3 +1,22 @@
+# This file is a part of Redmine Q&A (redmine_questions) plugin,
+# Q&A plugin for Redmine
+#
+# Copyright (C) 2011-2018 RedmineUP
+# http://www.redmineup.com/
+#
+# redmine_questions is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# redmine_questions is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with redmine_questions. If not, see .
+
module RedmineQuestions
module Patches
module UserPatch
diff --git a/plugins/redmine_questions/lib/tasks/migrate_from_boards.rake b/plugins/redmine_questions/lib/tasks/migrate_from_boards.rake
new file mode 100644
index 0000000..c13175b
--- /dev/null
+++ b/plugins/redmine_questions/lib/tasks/migrate_from_boards.rake
@@ -0,0 +1,59 @@
+namespace :redmine do
+ namespace :questions do
+ desc <<-END_DESC
+Migrate forum board to questions section
+
+ rake redmine:questions:migrate_board_to_section RAILS_ENV="production" board_id="source forum board id" question_section_id="destination question section id" project_id="section project id (nil for global section)"
+
+END_DESC
+
+ task :migrate_board_to_section => :environment do
+ board_id = ENV['board_id']
+ question_section_id = ENV['question_section_id']
+ question_section_name = ENV['question_section_name']
+ project_id = ENV['project_id']
+
+ if board_id.blank? && project_id.blank?
+ puts 'RedmineQuestions: Params board_id or project_id should be present'
+ exit
+ end
+
+ project = Project.where(:identifier => project_id).first
+ project.enable_module!(:questions) if project
+ boards = [Board.where(:id => board_id).first].compact
+ boards = project.boards if project && boards.blank?
+ boards.each do |board|
+ section = QuestionsSection.for_project(project).where(:id => question_section_id).first
+ section ||= QuestionsSection.for_project(project).find_or_create_by(:name => question_section_name) if question_section_name
+ section ||= QuestionsSection.for_project(project).find_or_create_by(:name => board.name)
+ if section.nil? || board.nil?
+ puts 'RedmineQuestions: Destination section does not found' unless section
+ puts 'RedmineQuestions: Source board does not found' unless board
+ exit
+ end
+
+ board.topics.reverse.each do |topic|
+ if section.questions.where(:subject => topic.subject).first.present?
+ puts "Questions with subject #{topic.subject} already exists."
+ next
+ end
+
+ question_attrs = topic.attributes.slice('subject', 'content', 'author_id', 'locked').merge('project_id' => project.try(:id))
+ migrated_question = section.questions.create(question_attrs)
+ migrated_question.attachments = topic.attachments.map { |attachment| attachment.copy }
+
+ topic.children.each do |reply|
+ if section.section_type == 'questions'
+ answer_attrs = reply.slice('subject', 'content', 'author_id', 'locked').merge('project_id' => project.try(:id))
+ migrated_answer = migrated_question.answers.create(answer_attrs)
+ migrated_answer.attachments = reply.attachments.map { |attachment| attachment.copy }
+ else
+ comment_attrs = { 'author_id' => reply.author_id, 'comments' => reply.content }
+ migrated_question.comments.create(comment_attrs)
+ end
+ end
+ end
+ end #each
+ end
+ end
+end
diff --git a/plugins/redmine_questions/test/fixtures/comments-3.4.6.yml b/plugins/redmine_questions/test/fixtures/comments-3.4.6.yml
new file mode 100644
index 0000000..8046621
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/comments-3.4.6.yml
@@ -0,0 +1,17 @@
+_fixture:
+ model_class: Comment
+comment_001:
+ content: text for cooment 001
+ commented_type: Question
+ commented_id: 1
+ author_id: 1
+comment_002:
+ content: text for cooment 002
+ commented_type: Question
+ commented_id: 2
+ author_id: 1
+comment_003:
+ content: text for cooment 003 (comment for answer!)
+ commented_type: Question
+ commented_id: 5
+ author_id: 1
diff --git a/plugins/redmine_questions/test/fixtures/comments.yml b/plugins/redmine_questions/test/fixtures/comments.yml
new file mode 100644
index 0000000..094815d
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/comments.yml
@@ -0,0 +1,16 @@
+comment_001:
+ comments: text for cooment 001
+ commented_type: Question
+ commented_id: 1
+ author_id: 1
+comment_002:
+ comments: text for cooment 002
+ commented_type: Question
+ commented_id: 2
+ author_id: 1
+comment_003:
+ comments: text for cooment 003 (comment for answer!)
+ commented_type: Question
+ commented_id: 5
+ author_id: 1
+
diff --git a/plugins/redmine_questions/test/fixtures/questions.yml b/plugins/redmine_questions/test/fixtures/questions.yml
new file mode 100644
index 0000000..5d81934
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/questions.yml
@@ -0,0 +1,26 @@
+question_001:
+ id: 1
+ subject: Hard question
+ content: Text for hard question
+ author_id: 1
+ section_id: 1
+question_002:
+ id: 2
+ subject: Another hard question
+ content: Text for Another hard question
+ author_id: 2
+ section_id: 1
+ featured: true
+question_003:
+ id: 3
+ subject: Simple question
+ content: Text for simple question
+ author_id: 1
+ section_id: 2
+question_004:
+ id: 4
+ subject: Another hard question
+ content: Text for simple hard question
+ author_id: 2
+ section_id: 2
+ locked: true
\ No newline at end of file
diff --git a/plugins/redmine_questions/test/fixtures/questions_answers.yml b/plugins/redmine_questions/test/fixtures/questions_answers.yml
new file mode 100644
index 0000000..1b9ff76
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/questions_answers.yml
@@ -0,0 +1,12 @@
+answer_001:
+ id: 1
+ content: This is answer for question_001
+ question_id: 1
+ author_id: 2
+ accepted: true
+answer_002:
+ id: 2
+ content: This is answer for question_002
+ question_id: 2
+ author_id: 1
+ accepted: false
\ No newline at end of file
diff --git a/plugins/redmine_questions/test/fixtures/questions_sections.yml b/plugins/redmine_questions/test/fixtures/questions_sections.yml
new file mode 100644
index 0000000..8028ea1
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/questions_sections.yml
@@ -0,0 +1,25 @@
+section_001:
+ id: 1
+ name: FAQ
+ section_type: questions
+ project_id: 1
+section_002:
+ id: 2
+ name: Ideas
+ section_type: ideas
+ project_id: 2
+section_003:
+ id: 3
+ name: Global FAQ
+ section_type: questions
+ project_id: 1
+section_004:
+ id: 4
+ name: Off topic
+ section_type: questions
+ project_id: 1
+section_005:
+ id: 5
+ name: Ideas in project 1
+ section_type: ideas
+ project_id: 1
diff --git a/plugins/redmine_questions/test/fixtures/taggings.yml b/plugins/redmine_questions/test/fixtures/taggings.yml
new file mode 100644
index 0000000..f3cffd7
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/taggings.yml
@@ -0,0 +1,19 @@
+tagging_001:
+ tag_id: 1
+ taggable_id: 1
+ taggable_type: Question
+
+tagging_002:
+ tag_id: 1
+ taggable_id: 2
+ taggable_type: Question
+
+tagging_003:
+ tag_id: 2
+ taggable_id: 3
+ taggable_type: Question
+
+tagging_004:
+ tag_id: 2
+ taggable_id: 4
+ taggable_type: Question
diff --git a/plugins/redmine_questions/test/fixtures/tags.yml b/plugins/redmine_questions/test/fixtures/tags.yml
new file mode 100644
index 0000000..c92d758
--- /dev/null
+++ b/plugins/redmine_questions/test/fixtures/tags.yml
@@ -0,0 +1,6 @@
+tag_hard:
+ id: 1
+ name: hard
+tag_simple:
+ id: 2
+ name: simple
\ No newline at end of file
diff --git a/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/images/vcard.png b/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/images/vcard.png
new file mode 100644
index 0000000..c02f315
Binary files /dev/null and b/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/images/vcard.png differ
diff --git a/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/javascripts/Chart.bundle.min.js b/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/javascripts/Chart.bundle.min.js
new file mode 100644
index 0000000..a7c0cf9
--- /dev/null
+++ b/plugins/redmine_questions/test/functional/public/plugin_assets/redmine_crm/javascripts/Chart.bundle.min.js
@@ -0,0 +1,16 @@
+/*!
+ * Chart.js
+ * http://chartjs.org/
+ * Version: 2.6.0
+ *
+ * Copyright 2017 Nick Downie
+ * Released under the MIT license
+ * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
+ */
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Chart=t()}}(function(){var t;return function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};e[o][0].call(d.exports,function(t){var n=e[o][1][t];return a(n?n:t)},d,d.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;on?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new r,i=this.values,a=n.values;for(var o in i)i.hasOwnProperty(o)&&(t=i[o],e={}.toString.call(t),"[object Array]"===e?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return n}},r.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},r.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},r.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var a=.4124*e+.3576*n+.1805*i,r=.2126*e+.7152*n+.0722*i,o=.0193*e+.1192*n+.9505*i;return[100*a,100*r,100*o]}function d(t){var e,n,i,a=u(t),r=a[0],o=a[1],s=a[2];return r/=95.047,o/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,n=500*(r-o),i=200*(o-s),[e,n,i]}function c(t){return Y(d(t))}function h(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return r=255*l,[r,r,r];n=l<.5?l*(1+s):l+s-l*s,e=2*l-n,a=[0,0,0];for(var u=0;u<3;u++)i=o+1/3*-(u-1),i<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function f(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return 0===r?[0,0,0]:(r*=2,a*=r<=1?r:2-r,n=(r+a)/2,e=2*a/(r+a),[i,100*e,100*n])}function p(t){return o(h(t))}function m(t){return s(h(t))}function v(t){return l(h(t))}function y(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r)),i=255*i;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function x(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return n=(2-a)*r,e=a*r,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]}function _(t){return o(y(t))}function k(t){return s(y(t))}function w(t){return l(y(t))}function M(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),e=Math.floor(6*o),n=1-l,i=6*o-e,0!=(1&e)&&(i=1-i),a=s+i*(n-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function S(t){return i(M(t))}function D(t){return a(M(t))}function C(t){return s(M(t))}function P(t){return l(M(t))}function T(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]}function I(t){return i(T(t))}function A(t){return a(T(t))}function F(t){return o(T(t))}function O(t){return l(T(t))}function R(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+r*-1.5372+o*-.4986,n=a*-.9689+1.8758*r+.0415*o,i=.0557*a+r*-.204+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function L(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]}function V(t){return Y(L(t))}function W(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return r<=8?(n=100*r/903.3,a=7.787*(n/100)+16/116):(n=100*Math.pow((r+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3),[e,n,i]}function Y(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),n=360*e/2/Math.PI,n<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]}function z(t){return R(W(t))}function N(t){var e,n,i,a=t[0],r=t[1],o=t[2];return i=o/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]}function B(t){return W(N(t))}function E(t){return z(N(t))}function H(t){return J[t]}function j(t){return i(H(t))}function U(t){return a(H(t))}function G(t){return o(H(t))}function q(t){return s(H(t))}function Z(t){return d(H(t))}function X(t){return u(H(t))}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:c,hsl2rgb:h,hsl2hsv:f,hsl2hwb:p,hsl2cmyk:m,hsl2keyword:v,hsv2rgb:y,hsv2hsl:x,hsv2hwb:_,hsv2cmyk:k,hsv2keyword:w,hwb2rgb:M,hwb2hsl:S,hwb2hsv:D,hwb2cmyk:C,hwb2keyword:P,cmyk2rgb:T,cmyk2hsl:I,cmyk2hsv:A,cmyk2hwb:F,cmyk2keyword:O,keyword2rgb:H,keyword2hsl:j,keyword2hsv:U,keyword2hwb:G,keyword2cmyk:q,keyword2lab:Z,keyword2xyz:X,xyz2rgb:R,xyz2lab:L,xyz2lch:V,lab2xyz:W,lab2rgb:z,lab2lch:Y,lch2lab:N,lch2xyz:B,lch2rgb:E};var J={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},K={};for(var Q in J)K[JSON.stringify(J[Q])]=Q},{}],4:[function(t,e,n){var i=t(3),a=function(){return new u};for(var r in i){a[r+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(r);var o=/(\w+)2(\w+)/.exec(r),s=o[1],l=o[2];a[s]=a[s]||{},a[s][l]=a[r]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a0)for(n=0;n0?"future":"past"];return C(n)?n(e):n.replace(/%s/i,e)}function W(t,e){var n=t.toLowerCase();Vi[n]=Vi[n+"s"]=Vi[e]=t}function Y(t){return"string"==typeof t?Vi[t]||Vi[t.toLowerCase()]:void 0}function z(t){var e,n,i={};for(n in t)c(t,n)&&(e=Y(n),e&&(i[e]=t[n]));return i}function N(t,e){Wi[t]=e}function B(t){var e=[];for(var n in t)e.push({unit:n,priority:Wi[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function E(e,n){return function(i){return null!=i?(j(this,e,i),t.updateOffset(this,n),this):H(this,e)}}function H(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function j(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function U(t){return t=Y(t),C(this[t])?this[t]():this}function G(t,e){if("object"==typeof t){t=z(t);for(var n=B(t),i=0;i=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}function Z(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(Bi[t]=a),e&&(Bi[e[0]]=function(){return q(a.apply(this,arguments),e[1],e[2])}),n&&(Bi[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function X(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function J(t){var e,n,i=t.match(Yi);for(e=0,n=i.length;e=0&&zi.test(t);)t=t.replace(zi,n),zi.lastIndex=0,i-=1;return t}function $(t,e,n){ra[t]=C(e)?e:function(t,i){return t&&n?n:e}}function tt(t,e){return c(ra,t)?ra[t](e._strict,e._locale):new RegExp(et(t))}function et(t){return nt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a}))}function nt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function it(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),l(e)&&(i=function(t,n){n[e]=k(t)}),n=0;n=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function kt(t,e,n){var i=7+e-n,a=(7+_t(t,0,i).getUTCDay()-e)%7;return-a+i-1}function wt(t,e,n,i,a){var r,o,s=(7+n-i)%7,l=kt(t,i,a),u=1+7*(e-1)+s+l;return u<=0?(r=t-1,o=vt(r)+u):u>vt(t)?(r=t+1,o=u-vt(t)):(r=t,o=u),{year:r,dayOfYear:o}}function Mt(t,e,n){var i,a,r=kt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?(a=t.year()-1,i=o+St(a,e,n)):o>St(t.year(),e,n)?(i=o-St(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function St(t,e,n){var i=kt(t,e,n),a=kt(t+1,e,n);return(vt(t)-i+a)/7}function Dt(t){return Mt(t,this._week.dow,this._week.doy).week}function Ct(){return this._week.dow}function Pt(){return this._week.doy}function Tt(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function It(t){var e=Mt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function At(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function Ft(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ot(t,e){return t?a(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:a(this._weekdays)?this._weekdays:this._weekdays.standalone}function Rt(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Lt(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Vt(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?(a=ma.call(this._weekdaysParse,o),a!==-1?a:null):"ddd"===e?(a=ma.call(this._shortWeekdaysParse,o),a!==-1?a:null):(a=ma.call(this._minWeekdaysParse,o),a!==-1?a:null):"dddd"===e?(a=ma.call(this._weekdaysParse,o),a!==-1?a:(a=ma.call(this._shortWeekdaysParse,o),a!==-1?a:(a=ma.call(this._minWeekdaysParse,o),a!==-1?a:null))):"ddd"===e?(a=ma.call(this._shortWeekdaysParse,o),a!==-1?a:(a=ma.call(this._weekdaysParse,o),a!==-1?a:(a=ma.call(this._minWeekdaysParse,o),a!==-1?a:null))):(a=ma.call(this._minWeekdaysParse,o),a!==-1?a:(a=ma.call(this._weekdaysParse,o),a!==-1?a:(a=ma.call(this._shortWeekdaysParse,o),a!==-1?a:null)))}function Wt(t,e,n){var i,a,r;if(this._weekdaysParseExact)return Vt.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function Yt(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=At(t,this.localeData()),this.add(t-e,"d")):e}function zt(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Nt(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Ft(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Bt(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Ca),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Et(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Pa),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ht(t){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||jt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ta),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function jt(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=f([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=nt(s[e]),l[e]=nt(l[e]),u[e]=nt(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ut(){return this.hours()%12||12}function Gt(){return this.hours()||24}function qt(t,e){Z(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Zt(t,e){return e._meridiemParse}function Xt(t){return"p"===(t+"").toLowerCase().charAt(0)}function Jt(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function Qt(t){for(var e,n,i,a,r=0;r0;){if(i=$t(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&w(a,n,!0)>=e-1)break;e--}r++}return null}function $t(t){var i=null;if(!Ra[t]&&"undefined"!=typeof n&&n&&n.exports)try{i=Ia._abbr,e("./locale/"+t),te(i)}catch(t){}return Ra[t]}function te(t,e){var n;return t&&(n=s(e)?ie(t):ee(t,e),n&&(Ia=n)),Ia._abbr}function ee(t,e){if(null!==e){var n=Oa;if(e.abbr=t,null!=Ra[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Ra[t]._config;else if(null!=e.parentLocale){if(null==Ra[e.parentLocale])return La[e.parentLocale]||(La[e.parentLocale]=[]),La[e.parentLocale].push({name:t,config:e}),null;n=Ra[e.parentLocale]._config}return Ra[t]=new I(T(n,e)),La[t]&&La[t].forEach(function(t){ee(t.name,t.config)}),te(t),Ra[t]}return delete Ra[t],null}function ne(t,e){if(null!=e){var n,i=Oa;null!=Ra[t]&&(i=Ra[t]._config),e=T(i,e),n=new I(e),n.parentLocale=Ra[t],Ra[t]=n,te(t)}else null!=Ra[t]&&(null!=Ra[t].parentLocale?Ra[t]=Ra[t].parentLocale:null!=Ra[t]&&delete Ra[t]);return Ra[t]}function ie(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ia;if(!a(t)){if(e=$t(t))return e;t=[t]}return Qt(t)}function ae(){return Ti(Ra)}function re(t){var e,n=t._a;return n&&p(t).overflow===-2&&(e=n[la]<0||n[la]>11?la:n[ua]<1||n[ua]>ot(n[sa],n[la])?ua:n[da]<0||n[da]>24||24===n[da]&&(0!==n[ca]||0!==n[ha]||0!==n[fa])?da:n[ca]<0||n[ca]>59?ca:n[ha]<0||n[ha]>59?ha:n[fa]<0||n[fa]>999?fa:-1,p(t)._overflowDayOfYear&&(eua)&&(e=ua),p(t)._overflowWeeks&&e===-1&&(e=ga),p(t)._overflowWeekday&&e===-1&&(e=pa),p(t).overflow=e),t}function oe(t){var e,n,i,a,r,o,s=t._i,l=Va.exec(s)||Wa.exec(s);if(l){for(p(t).iso=!0,e=0,n=za.length;e10?"YYYY ":"YY "),r="HH:mm"+(n[4]?":ss":""),n[1]){var c=new Date(n[2]),h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][c.getDay()];if(n[1].substr(0,3)!==h)return p(t).weekdayMismatch=!0,void(t._isValid=!1)}switch(n[5].length){case 2:0===l?s=" +0000":(l=d.indexOf(n[5][1].toUpperCase())-12,s=(l<0?" -":" +")+(""+l).replace(/^-?/,"0").match(/..$/)[0]+"00");break;case 4:s=u[n[5]];break;default:s=u[" GMT"]}n[5]=s,t._i=n.splice(1).join(""),o=" ZZ",t._f=i+a+r+o,fe(t),p(t).rfc2822=!0}else t._isValid=!1}function le(e){var n=Ba.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(oe(e),void(e._isValid===!1&&(delete e._isValid,se(e),e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e)))))}function ue(t,e,n){return null!=t?t:null!=e?e:n}function de(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function ce(t){var e,n,i,a,r=[];if(!t._d){for(i=de(t),t._w&&null==t._a[ua]&&null==t._a[la]&&he(t),null!=t._dayOfYear&&(a=ue(t._a[sa],i[sa]),(t._dayOfYear>vt(a)||0===t._dayOfYear)&&(p(t)._overflowDayOfYear=!0),n=_t(a,0,t._dayOfYear),t._a[la]=n.getUTCMonth(),t._a[ua]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[da]&&0===t._a[ca]&&0===t._a[ha]&&0===t._a[fa]&&(t._nextDay=!0,t._a[da]=0),t._d=(t._useUTC?_t:xt).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[da]=24)}}function he(t){var e,n,i,a,r,o,s,l;if(e=t._w,null!=e.GG||null!=e.W||null!=e.E)r=1,o=4,n=ue(e.GG,t._a[sa],Mt(_e(),1,4).year),i=ue(e.W,1),a=ue(e.E,1),(a<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=Mt(_e(),r,o);n=ue(e.gg,t._a[sa],u.year),i=ue(e.w,u.week),null!=e.d?(a=e.d,(a<0||a>6)&&(l=!0)):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>St(n,r,o)?p(t)._overflowWeeks=!0:null!=l?p(t)._overflowWeekday=!0:(s=wt(n,i,a,r,o),t._a[sa]=s.year,t._dayOfYear=s.dayOfYear)}function fe(e){if(e._f===t.ISO_8601)return void oe(e);if(e._f===t.RFC_2822)return void se(e);e._a=[],p(e).empty=!0;var n,i,a,r,o,s=""+e._i,l=s.length,u=0;for(a=Q(e._f,e._locale).match(Yi)||[],n=0;n0&&p(e).unusedInput.push(o),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Bi[r]?(i?p(e).empty=!1:p(e).unusedTokens.push(r),rt(r,i,e)):e._strict&&!i&&p(e).unusedTokens.push(r);p(e).charsLeftOver=l-u,s.length>0&&p(e).unusedInput.push(s),e._a[da]<=12&&p(e).bigHour===!0&&e._a[da]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[da]=ge(e._locale,e._a[da],e._meridiem),ce(e),re(e)}function ge(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function pe(t){var e,n,i,a,r;if(0===t._f.length)return p(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ee(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),t=ye(t),t._a){var e=t._isUTC?f(t._a):_e(t._a);this._isDSTShifted=this.isValid()&&w(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function He(){return!!this.isValid()&&!this._isUTC}function je(){return!!this.isValid()&&this._isUTC}function Ue(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ge(t,e){var n,i,a,r=t,o=null;return Te(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:l(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=Za.exec(t))?(n="-"===o[1]?-1:1,r={y:0,d:k(o[ua])*n,h:k(o[da])*n,m:k(o[ca])*n,s:k(o[ha])*n,ms:k(Ie(1e3*o[fa]))*n}):(o=Xa.exec(t))?(n="-"===o[1]?-1:1,r={y:qe(o[2],n),M:qe(o[3],n),w:qe(o[4],n),d:qe(o[5],n),h:qe(o[6],n),m:qe(o[7],n),s:qe(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=Xe(_e(r.from),_e(r.to)),r={},r.ms=a.milliseconds,r.M=a.months),i=new Pe(r),Te(t)&&c(t,"_locale")&&(i._locale=t._locale),i}function qe(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ze(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Xe(t,e){var n;return t.isValid()&&e.isValid()?(e=Oe(e,t),t.isBefore(e)?n=Ze(t,e):(n=Ze(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Je(t,e){return function(n,i){var a,r;return null===i||isNaN(+i)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,a=Ge(n,i),Ke(this,a,t),this}}function Ke(e,n,i,a){var r=n._milliseconds,o=Ie(n._days),s=Ie(n._months);e.isValid()&&(a=null==a||a,r&&e._d.setTime(e._d.valueOf()+r*i),o&&j(e,"Date",H(e,"Date")+o*i),s&&ct(e,H(e,"Month")+s*i),a&&t.updateOffset(e,o||s))}function Qe(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function $e(e,n){var i=e||_e(),a=Oe(i,this).startOf("day"),r=t.calendarFormat(this,a)||"sameElse",o=n&&(C(n[r])?n[r].call(this,i):n[r]);return this.format(o||this.localeData().calendar(r,this,_e(i)))}function tn(){return new b(this)}function en(t,e){var n=x(t)?t:_e(t);return!(!this.isValid()||!n.isValid())&&(e=Y(s(e)?"millisecond":e),"millisecond"===e?this.valueOf()>n.valueOf():n.valueOf()9999?K(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):C(Date.prototype.toISOString)?this.toDate().toISOString():K(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function hn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",r=e+'[")]';return this.format(n+i+a+r)}function fn(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var n=K(this,e);return this.localeData().postformat(n)}function gn(t,e){return this.isValid()&&(x(t)&&t.isValid()||_e(t).isValid())?Ge({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function pn(t){return this.from(_e(),t)}function mn(t,e){return this.isValid()&&(x(t)&&t.isValid()||_e(t).isValid())?Ge({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function vn(t){return this.to(_e(),t)}function yn(t){var e;return void 0===t?this._locale._abbr:(e=ie(t),null!=e&&(this._locale=e),this)}function bn(){return this._locale}function xn(t){switch(t=Y(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this}function _n(t){return t=Y(t),void 0===t||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))}function kn(){return this._d.valueOf()-6e4*(this._offset||0)}function wn(){return Math.floor(this.valueOf()/1e3)}function Mn(){return new Date(this.valueOf())}function Sn(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Dn(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Cn(){return this.isValid()?this.toISOString():null}function Pn(){return m(this)}function Tn(){return h({},p(this))}function In(){return p(this).overflow}function An(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Fn(t,e){Z(0,[t,t.length],0,e)}function On(t){return Wn.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Rn(t){return Wn.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Ln(){return St(this.year(),1,4)}function Vn(){var t=this.localeData()._week;return St(this.year(),t.dow,t.doy)}function Wn(t,e,n,i,a){var r;return null==t?Mt(this,i,a).year:(r=St(t,i,a),e>r&&(e=r),Yn.call(this,t,e,n,i,a))}function Yn(t,e,n,i,a){var r=wt(t,e,n,i,a),o=_t(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function zn(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Nn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function Bn(t,e){e[fa]=k(1e3*("0."+t))}function En(){return this._isUTC?"UTC":""}function Hn(){return this._isUTC?"Coordinated Universal Time":""}function jn(t){return _e(1e3*t)}function Un(){return _e.apply(null,arguments).parseZone()}function Gn(t){return t}function qn(t,e,n,i){var a=ie(),r=f().set(i,e);return a[n](r,t)}function Zn(t,e,n){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return qn(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=qn(t,i,n,"month");return a}function Xn(t,e,n,i){"boolean"==typeof t?(l(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,l(e)&&(n=e,e=void 0),e=e||"");var a=ie(),r=t?a._week.dow:0;if(null!=n)return qn(e,(n+r)%7,i,"day");var o,s=[];for(o=0;o<7;o++)s[o]=qn(e,(o+r)%7,i,"day");return s}function Jn(t,e){return Zn(t,e,"months")}function Kn(t,e){return Zn(t,e,"monthsShort")}function Qn(t,e,n){return Xn(t,e,n,"weekdays")}function $n(t,e,n){return Xn(t,e,n,"weekdaysShort")}function ti(t,e,n){return Xn(t,e,n,"weekdaysMin")}function ei(){var t=this._data;return this._milliseconds=or(this._milliseconds),this._days=or(this._days),this._months=or(this._months),t.milliseconds=or(t.milliseconds),t.seconds=or(t.seconds),t.minutes=or(t.minutes),t.hours=or(t.hours),t.months=or(t.months),t.years=or(t.years),this}function ni(t,e,n,i){var a=Ge(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function ii(t,e){return ni(this,t,e,1)}function ai(t,e){return ni(this,t,e,-1)}function ri(t){return t<0?Math.floor(t):Math.ceil(t)}function oi(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*ri(li(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=_(r/1e3),l.seconds=t%60,e=_(t/60),l.minutes=e%60,n=_(e/60),l.hours=n%24,o+=_(n/24),a=_(si(o)),s+=a,o-=ri(li(a)),i=_(s/12),s%=12,l.days=o,l.months=s,l.years=i,this}function si(t){return 4800*t/146097}function li(t){return 146097*t/4800}function ui(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if(t=Y(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+si(e),"month"===t?n:n/12;switch(e=this._days+Math.round(li(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function di(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN}function ci(t){return function(){return this.as(t)}}function hi(t){return t=Y(t),this.isValid()?this[t+"s"]():NaN}function fi(t){return function(){return this.isValid()?this._data[t]:NaN}}function gi(){return _(this.days()/7)}function pi(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}function mi(t,e,n){var i=Ge(t).abs(),a=kr(i.as("s")),r=kr(i.as("m")),o=kr(i.as("h")),s=kr(i.as("d")),l=kr(i.as("M")),u=kr(i.as("y")),d=a<=wr.ss&&["s",a]||a0,d[4]=n,pi.apply(null,d)}function vi(t){return void 0===t?kr:"function"==typeof t&&(kr=t,!0)}function yi(t,e){return void 0!==wr[t]&&(void 0===e?wr[t]:(wr[t]=e,"s"===t&&(wr.ss=e-1),!0))}function bi(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=mi(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function xi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i=Mr(this._milliseconds)/1e3,a=Mr(this._days),r=Mr(this._months);t=_(i/60),e=_(t/60),i%=60,t%=60,n=_(r/12),r%=12;var o=n,s=r,l=a,u=e,d=t,c=i,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||d||c?"T":"")+(u?u+"H":"")+(d?d+"M":"")+(c?c+"S":""):"P0D"}var _i,ki;ki=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i68?1900:2e3)};var ka=E("FullYear",!0);Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),W("week","w"),W("isoWeek","W"),N("week",5),N("isoWeek",5),$("w",qi),$("ww",qi,Hi),$("W",qi),$("WW",qi,Hi),at(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=k(t)});var wa={dow:0,doy:6};Z("d",0,"do","day"),Z("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Z("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Z("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),W("day","d"),W("weekday","e"),W("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),$("d",qi),$("e",qi),$("E",qi),$("dd",function(t,e){return e.weekdaysMinRegex(t)}),$("ddd",function(t,e){return e.weekdaysShortRegex(t)}),$("dddd",function(t,e){return e.weekdaysRegex(t)}),at(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:p(n).invalidWeekday=t;
+}),at(["d","e","E"],function(t,e,n,i){e[i]=k(t)});var Ma="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Sa="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Da="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ca=aa,Pa=aa,Ta=aa;Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,Ut),Z("k",["kk",2],0,Gt),Z("hmm",0,0,function(){return""+Ut.apply(this)+q(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+Ut.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),qt("a",!0),qt("A",!1),W("hour","h"),N("hour",13),$("a",Zt),$("A",Zt),$("H",qi),$("h",qi),$("k",qi),$("HH",qi,Hi),$("hh",qi,Hi),$("kk",qi,Hi),$("hmm",Zi),$("hmmss",Xi),$("Hmm",Zi),$("Hmmss",Xi),it(["H","HH"],da),it(["k","kk"],function(t,e,n){var i=k(t);e[da]=24===i?0:i}),it(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),it(["h","hh"],function(t,e,n){e[da]=k(t),p(n).bigHour=!0}),it("hmm",function(t,e,n){var i=t.length-2;e[da]=k(t.substr(0,i)),e[ca]=k(t.substr(i)),p(n).bigHour=!0}),it("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[da]=k(t.substr(0,i)),e[ca]=k(t.substr(i,2)),e[ha]=k(t.substr(a)),p(n).bigHour=!0}),it("Hmm",function(t,e,n){var i=t.length-2;e[da]=k(t.substr(0,i)),e[ca]=k(t.substr(i))}),it("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[da]=k(t.substr(0,i)),e[ca]=k(t.substr(i,2)),e[ha]=k(t.substr(a))});var Ia,Aa=/[ap]\.?m?\.?/i,Fa=E("Hours",!0),Oa={calendar:Ii,longDateFormat:Ai,invalidDate:Fi,ordinal:Oi,dayOfMonthOrdinalParse:Ri,relativeTime:Li,months:ya,monthsShort:ba,week:wa,weekdays:Ma,weekdaysMin:Da,weekdaysShort:Sa,meridiemParse:Aa},Ra={},La={},Va=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wa=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ya=/Z|[+-]\d\d(?::?\d\d)?/,za=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Na=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ba=/^\/?Date\((\-?\d+)/i,Ea=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;t.createFromInputFallback=S("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Ha=S("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=_e.apply(null,arguments);return this.isValid()&&t.isValid()?tthis?this:t:v()}),Ua=function(){return Date.now?Date.now():+new Date},Ga=["year","quarter","month","week","day","hour","minute","second","millisecond"];Ae("Z",":"),Ae("ZZ",""),$("Z",na),$("ZZ",na),it(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Fe(na,t)});var qa=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Za=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Xa=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ge.fn=Pe.prototype,Ge.invalid=Ce;var Ja=Je(1,"add"),Ka=Je(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Qa=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Fn("gggg","weekYear"),Fn("ggggg","weekYear"),Fn("GGGG","isoWeekYear"),Fn("GGGGG","isoWeekYear"),W("weekYear","gg"),W("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),$("G",ta),$("g",ta),$("GG",qi,Hi),$("gg",qi,Hi),$("GGGG",Ki,Ui),$("gggg",Ki,Ui),$("GGGGG",Qi,Gi),$("ggggg",Qi,Gi),at(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=k(t)}),at(["gg","GG"],function(e,n,i,a){n[a]=t.parseTwoDigitYear(e)}),Z("Q",0,"Qo","quarter"),W("quarter","Q"),N("quarter",7),$("Q",Ei),it("Q",function(t,e){e[la]=3*(k(t)-1)}),Z("D",["DD",2],"Do","date"),W("date","D"),N("date",9),$("D",qi),$("DD",qi,Hi),$("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),it(["D","DD"],ua),it("Do",function(t,e){e[ua]=k(t.match(qi)[0],10)});var $a=E("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),W("dayOfYear","DDD"),N("dayOfYear",4),$("DDD",Ji),$("DDDD",ji),it(["DDD","DDDD"],function(t,e,n){n._dayOfYear=k(t)}),Z("m",["mm",2],0,"minute"),W("minute","m"),N("minute",14),$("m",qi),$("mm",qi,Hi),it(["m","mm"],ca);var tr=E("Minutes",!1);Z("s",["ss",2],0,"second"),W("second","s"),N("second",15),$("s",qi),$("ss",qi,Hi),it(["s","ss"],ha);var er=E("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),Z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),Z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),Z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),Z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),Z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),W("millisecond","ms"),N("millisecond",16),$("S",Ji,Ei),$("SS",Ji,Hi),$("SSS",Ji,ji);var nr;for(nr="SSSS";nr.length<=9;nr+="S")$(nr,$i);for(nr="S";nr.length<=9;nr+="S")it(nr,Bn);var ir=E("Milliseconds",!1);Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");var ar=b.prototype;ar.add=Ja,ar.calendar=$e,ar.clone=tn,ar.diff=ln,ar.endOf=_n,ar.format=fn,ar.from=gn,ar.fromNow=pn,ar.to=mn,ar.toNow=vn,ar.get=U,ar.invalidAt=In,ar.isAfter=en,ar.isBefore=nn,ar.isBetween=an,ar.isSame=rn,ar.isSameOrAfter=on,ar.isSameOrBefore=sn,ar.isValid=Pn,ar.lang=Qa,ar.locale=yn,ar.localeData=bn,ar.max=ja,ar.min=Ha,ar.parsingFlags=Tn,ar.set=G,ar.startOf=xn,ar.subtract=Ka,ar.toArray=Sn,ar.toObject=Dn,ar.toDate=Mn,ar.toISOString=cn,ar.inspect=hn,ar.toJSON=Cn,ar.toString=dn,ar.unix=wn,ar.valueOf=kn,ar.creationData=An,ar.year=ka,ar.isLeapYear=bt,ar.weekYear=On,ar.isoWeekYear=Rn,ar.quarter=ar.quarters=zn,ar.month=ht,ar.daysInMonth=ft,ar.week=ar.weeks=Tt,ar.isoWeek=ar.isoWeeks=It,ar.weeksInYear=Vn,ar.isoWeeksInYear=Ln,ar.date=$a,ar.day=ar.days=Yt,ar.weekday=zt,ar.isoWeekday=Nt,ar.dayOfYear=Nn,ar.hour=ar.hours=Fa,ar.minute=ar.minutes=tr,ar.second=ar.seconds=er,ar.millisecond=ar.milliseconds=ir,ar.utcOffset=Le,ar.utc=We,ar.local=Ye,ar.parseZone=ze,ar.hasAlignedHourOffset=Ne,ar.isDST=Be,ar.isLocal=He,ar.isUtcOffset=je,ar.isUtc=Ue,ar.isUTC=Ue,ar.zoneAbbr=En,ar.zoneName=Hn,ar.dates=S("dates accessor is deprecated. Use date instead.",$a),ar.months=S("months accessor is deprecated. Use month instead",ht),ar.years=S("years accessor is deprecated. Use year instead",ka),ar.zone=S("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ve),ar.isDSTShifted=S("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ee);var rr=I.prototype;rr.calendar=A,rr.longDateFormat=F,rr.invalidDate=O,rr.ordinal=R,rr.preparse=Gn,rr.postformat=Gn,rr.relativeTime=L,rr.pastFuture=V,rr.set=P,rr.months=st,rr.monthsShort=lt,rr.monthsParse=dt,rr.monthsRegex=pt,rr.monthsShortRegex=gt,rr.week=Dt,rr.firstDayOfYear=Pt,rr.firstDayOfWeek=Ct,rr.weekdays=Ot,rr.weekdaysMin=Lt,rr.weekdaysShort=Rt,rr.weekdaysParse=Wt,rr.weekdaysRegex=Bt,rr.weekdaysShortRegex=Et,rr.weekdaysMinRegex=Ht,rr.isPM=Xt,rr.meridiem=Jt,te("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=S("moment.lang is deprecated. Use moment.locale instead.",te),t.langData=S("moment.langData is deprecated. Use moment.localeData instead.",ie);var or=Math.abs,sr=ci("ms"),lr=ci("s"),ur=ci("m"),dr=ci("h"),cr=ci("d"),hr=ci("w"),fr=ci("M"),gr=ci("y"),pr=fi("milliseconds"),mr=fi("seconds"),vr=fi("minutes"),yr=fi("hours"),br=fi("days"),xr=fi("months"),_r=fi("years"),kr=Math.round,wr={ss:44,s:45,m:45,h:22,d:26,M:11},Mr=Math.abs,Sr=Pe.prototype;return Sr.isValid=De,Sr.abs=ei,Sr.add=ii,Sr.subtract=ai,Sr.as=ui,Sr.asMilliseconds=sr,Sr.asSeconds=lr,Sr.asMinutes=ur,Sr.asHours=dr,Sr.asDays=cr,Sr.asWeeks=hr,Sr.asMonths=fr,Sr.asYears=gr,Sr.valueOf=di,Sr._bubble=oi,Sr.get=hi,Sr.milliseconds=pr,Sr.seconds=mr,Sr.minutes=vr,Sr.hours=yr,Sr.days=br,Sr.weeks=gi,Sr.months=xr,Sr.years=_r,Sr.humanize=bi,Sr.toISOString=xi,Sr.toString=xi,Sr.toJSON=xi,Sr.locale=yn,Sr.localeData=bn,Sr.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xi),Sr.lang=Qa,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),$("x",ta),$("X",ia),it("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),it("x",function(t,e,n){n._d=new Date(k(t))}),t.version="2.18.1",i(_e),t.fn=ar,t.min=we,t.max=Me,t.now=Ua,t.utc=f,t.unix=jn,t.months=Jn,t.isDate=u,t.locale=te,t.invalid=v,t.duration=Ge,t.isMoment=x,t.weekdays=Qn,t.parseZone=Un,t.localeData=ie,t.isDuration=Te,t.monthsShort=Kn,t.weekdaysMin=ti,t.defineLocale=ee,t.updateLocale=ne,t.locales=ae,t.weekdaysShort=$n,t.normalizeUnits=Y,t.relativeTimeRounding=vi,t.relativeTimeThreshold=yi,t.calendarFormat=Qe,t.prototype=ar,t})},{}],7:[function(t,e,n){var i=t(28)();t(26)(i),t(40)(i),t(22)(i),t(25)(i),t(30)(i),t(21)(i),t(23)(i),t(24)(i),t(29)(i),t(32)(i),t(33)(i),t(31)(i),t(27)(i),t(34)(i),t(35)(i),t(36)(i),t(37)(i),t(38)(i),t(46)(i),t(44)(i),t(45)(i),t(47)(i),t(48)(i),t(49)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=[];a.push(t(41)(i),t(42)(i),t(43)(i)),i.plugins.register(a),e.exports=i,"undefined"!=typeof window&&(window.Chart=i)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,34:34,35:35,36:36,37:37,38:38,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){var e={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}};t.defaults.scatter=e,t.controllers.scatter=t.controllers.line,t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},t.controllers.bar=t.DatasetController.extend({dataElementType:t.elements.Rectangle,initialize:function(){var e,n=this;t.DatasetController.prototype.initialize.apply(n,arguments),e=n.getMeta(),e.stack=n.getDataset().stack,e.bar=!0},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e=0&&a>0)&&(m+=a));return r=c.getPixelForValue(m),o=c.getPixelForValue(m+f),s=(o-r)/2,{size:s,base:r,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,n){var i=this,a=n.scale,r=i.chart.isCombo,o=i.getStackIndex(t),s=a.getPixelForValue(null,e,t,r),l=n.barSize;return s-=r?n.tickSize/2:0,s+=n.fullBarSize*o,s+=n.categorySpacing/2,s+=n.barSpacing/2,{size:l,base:s,head:s+l,center:s+l/2}},draw:function(){var t,n=this,i=n.chart,a=n.getMeta().data,r=n.getDataset(),o=a.length,s=0;for(e.canvas.clipArea(i.ctx,i.chartArea);s0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r'),a[r]&&e.push(a[r]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var n=t.data;return n.labels.length&&n.datasets.length?n.labels.map(function(i,a){var r=t.getDatasetMeta(0),o=n.datasets[0],s=r.data[a],l=s&&s.custom||{},u=e.getValueAtIndexOrDefault,d=t.options.elements.arc,c=l.backgroundColor?l.backgroundColor:u(o.backgroundColor,a,d.backgroundColor),h=l.borderColor?l.borderColor:u(o.borderColor,a,d.borderColor),f=l.borderWidth?l.borderWidth:u(o.borderWidth,a,d.borderWidth);return{text:i,fillStyle:c,strokeStyle:h,lineWidth:f,hidden:isNaN(o.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n=Math.PI?-1:g<-Math.PI?1:0);var p=g+f,m={x:Math.cos(g),y:Math.sin(g)},v={x:Math.cos(p),y:Math.sin(p)},y=g<=0&&0<=p||g<=2*Math.PI&&2*Math.PI<=p,b=g<=.5*Math.PI&&.5*Math.PI<=p||g<=2.5*Math.PI&&2.5*Math.PI<=p,x=g<=-Math.PI&&-Math.PI<=p||g<=Math.PI&&Math.PI<=p,_=g<=.5*-Math.PI&&.5*-Math.PI<=p||g<=1.5*Math.PI&&1.5*Math.PI<=p,k=h/100,w={x:x?-1:Math.min(m.x*(m.x<0?1:k),v.x*(v.x<0?1:k)),y:_?-1:Math.min(m.y*(m.y<0?1:k),v.y*(v.y<0?1:k))},M={x:y?1:Math.max(m.x*(m.x>0?1:k),v.x*(v.x>0?1:k)),y:b?1:Math.max(m.y*(m.y>0?1:k),v.y*(v.y>0?1:k))},S={width:.5*(M.x-w.x),height:.5*(M.y-w.y)};u=Math.min(s/S.width,l/S.height),d={x:(M.x+w.x)*-.5,y:(M.y+w.y)*-.5}}i.borderWidth=n.getMaxBorderWidth(c.data),i.outerRadius=Math.max((u-i.borderWidth)/2,0),i.innerRadius=Math.max(h?i.outerRadius/100*h:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=d.x*i.outerRadius,i.offsetY=d.y*i.outerRadius,c.total=n.calculateTotal(),n.outerRadius=i.outerRadius-i.radiusLength*n.getRingIndex(n.index),n.innerRadius=Math.max(n.outerRadius-i.radiusLength,0),e.each(c.data,function(e,i){n.updateElement(e,i,t)})},updateElement:function(t,n,i){var a=this,r=a.chart,o=r.chartArea,s=r.options,l=s.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s.rotation,h=s.rotation,f=a.getDataset(),g=i&&l.animateRotate?0:t.hidden?0:a.calculateCircumference(f.data[n])*(s.circumference/(2*Math.PI)),p=i&&l.animateScale?0:a.innerRadius,m=i&&l.animateScale?0:a.outerRadius,v=e.getValueAtIndexOrDefault;e.extend(t,{_datasetIndex:a.index,_index:n,_model:{x:u+r.offsetX,y:d+r.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:m,innerRadius:p,label:v(f.label,n,r.data.labels[n])}});var y=t._model;this.removeHoverStyle(t),i&&l.animateRotate||(0===n?y.startAngle=s.rotation:y.startAngle=a.getMeta().data[n-1]._model.endAngle,y.endAngle=y.startAngle+y.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,n=this.getDataset(),i=this.getMeta(),a=0;return e.each(i.data,function(e,i){t=n.data[i],isNaN(t)||e.hidden||(a+=Math.abs(t))}),a},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,r=t.length,o=0;oi?e:i,i=n>i?n:i;return i}})}},{}],18:[function(t,e,n){"use strict";e.exports=function(t){function e(t,e){return n.getValueOrDefault(t.showLine,e.showLines)}var n=t.helpers;t.defaults.line={showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}},t.controllers.line=t.DatasetController.extend({datasetElementType:t.elements.Line,dataElementType:t.elements.Point,update:function(t){var i,a,r,o=this,s=o.getMeta(),l=s.dataset,u=s.data||[],d=o.chart.options,c=d.elements.line,h=o.getScaleForId(s.yAxisID),f=o.getDataset(),g=e(f,d);for(g&&(r=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=o.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:r.tension?r.tension:n.getValueOrDefault(f.lineTension,c.tension),backgroundColor:r.backgroundColor?r.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:f.borderWidth||c.borderWidth,borderColor:r.borderColor?r.borderColor:f.borderColor||c.borderColor,borderCapStyle:r.borderCapStyle?r.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:r.borderDash?r.borderDash:f.borderDash||c.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:r.fill?r.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:r.steppedLine?r.steppedLine:n.getValueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:r.cubicInterpolationMode?r.cubicInterpolationMode:n.getValueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},l.pivot()),i=0,a=u.length;i');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r'),a[r]&&e.push(a[r]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var n=t.data;return n.labels.length&&n.datasets.length?n.labels.map(function(i,a){var r=t.getDatasetMeta(0),o=n.datasets[0],s=r.data[a],l=s.custom||{},u=e.getValueAtIndexOrDefault,d=t.options.elements.arc,c=l.backgroundColor?l.backgroundColor:u(o.backgroundColor,a,d.backgroundColor),h=l.borderColor?l.borderColor:u(o.borderColor,a,d.borderColor),f=l.borderWidth?l.borderWidth:u(o.borderWidth,a,d.borderWidth);return{text:i,fillStyle:c,strokeStyle:h,lineWidth:f,hidden:isNaN(o.data[a])||r.data[a].hidden,index:a}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n0&&!isNaN(t)?2*Math.PI/e:0}})}},{}],20:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.radar={aspectRatio:1,scale:{type:"radialLinear"},elements:{line:{tension:0}}},t.controllers.radar=t.DatasetController.extend({datasetElementType:t.elements.Line,dataElementType:t.elements.Point,linkScales:e.noop,update:function(t){var n=this,i=n.getMeta(),a=i.dataset,r=i.data,o=a.custom||{},s=n.getDataset(),l=n.chart.options.elements.line,u=n.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),e.extend(i.dataset,{_datasetIndex:n.index,_scale:u,_children:r,_loop:!0,_model:{tension:o.tension?o.tension:e.getValueOrDefault(s.lineTension,l.tension),backgroundColor:o.backgroundColor?o.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:s.borderWidth||l.borderWidth,borderColor:o.borderColor?o.borderColor:s.borderColor||l.borderColor,fill:o.fill?o.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:o.borderCapStyle?o.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:o.borderDash?o.borderDash:s.borderDash||l.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),i.dataset.pivot(),e.each(r,function(e,i){n.updateElement(e,i,t)},n),n.updateBezierControlPoints()},updateElement:function(t,n,i){var a=this,r=t.custom||{},o=a.getDataset(),s=a.chart.scale,l=a.chart.options.elements.point,u=s.getPointPositionForValue(n,o.data[n]);void 0!==o.radius&&void 0===o.pointRadius&&(o.pointRadius=o.radius),void 0!==o.hitRadius&&void 0===o.pointHitRadius&&(o.pointHitRadius=o.hitRadius),e.extend(t,{_datasetIndex:a.index,_index:n,_scale:s,_model:{x:i?s.xCenter:u.x,y:i?s.yCenter:u.y,tension:r.tension?r.tension:e.getValueOrDefault(o.lineTension,a.chart.options.elements.line.tension),radius:r.radius?r.radius:e.getValueAtIndexOrDefault(o.pointRadius,n,l.radius),backgroundColor:r.backgroundColor?r.backgroundColor:e.getValueAtIndexOrDefault(o.pointBackgroundColor,n,l.backgroundColor),borderColor:r.borderColor?r.borderColor:e.getValueAtIndexOrDefault(o.pointBorderColor,n,l.borderColor),borderWidth:r.borderWidth?r.borderWidth:e.getValueAtIndexOrDefault(o.pointBorderWidth,n,l.borderWidth),pointStyle:r.pointStyle?r.pointStyle:e.getValueAtIndexOrDefault(o.pointStyle,n,l.pointStyle),hitRadius:r.hitRadius?r.hitRadius:e.getValueAtIndexOrDefault(o.pointHitRadius,n,l.hitRadius)}}),t._model.skip=r.skip?r.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,n=this.getMeta();e.each(n.data,function(i,a){var r=i._model,o=e.splineCurve(e.previousItem(n.data,a,!0)._model,r,e.nextItem(n.data,a,!0)._model,r.tension);r.controlPointPreviousX=Math.max(Math.min(o.previous.x,t.right),t.left),r.controlPointPreviousY=Math.max(Math.min(o.previous.y,t.bottom),t.top),r.controlPointNextX=Math.max(Math.min(o.next.x,t.right),t.left),r.controlPointNextY=Math.max(Math.min(o.next.y,t.bottom),t.top),i.pivot()})},setHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},a=t._index,r=t._model;r.radius=i.hoverRadius?i.hoverRadius:e.getValueAtIndexOrDefault(n.pointHoverRadius,a,this.chart.options.elements.point.hoverRadius),r.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:e.getValueAtIndexOrDefault(n.pointHoverBackgroundColor,a,e.getHoverColor(r.backgroundColor)),r.borderColor=i.hoverBorderColor?i.hoverBorderColor:e.getValueAtIndexOrDefault(n.pointHoverBorderColor,a,e.getHoverColor(r.borderColor)),r.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:e.getValueAtIndexOrDefault(n.pointHoverBorderWidth,a,r.borderWidth)},removeHoverStyle:function(t){var n=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},a=t._index,r=t._model,o=this.chart.options.elements.point;r.radius=i.radius?i.radius:e.getValueAtIndexOrDefault(n.pointRadius,a,o.radius),r.backgroundColor=i.backgroundColor?i.backgroundColor:e.getValueAtIndexOrDefault(n.pointBackgroundColor,a,o.backgroundColor),r.borderColor=i.borderColor?i.borderColor:e.getValueAtIndexOrDefault(n.pointBorderColor,a,o.borderColor),r.borderWidth=i.borderWidth?i.borderWidth:e.getValueAtIndexOrDefault(n.pointBorderWidth,a,o.borderWidth)}})}},{}],21:[function(t,e,n){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:e.noop,onComplete:e.noop},t.Animation=t.Element.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,r=o.length;a1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var n,i,a=this.animations,r=0;r=n.numSteps?(e.callback(n.onAnimationComplete,[n],i),i.animating=!1,a.splice(r,1)):++r}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{}],22:[function(t,e,n){"use strict";e.exports=function(t){var e=t.canvasHelpers={};e.drawPoint=function(e,n,i,a,r){var o,s,l,u,d,c;if("object"==typeof n&&(o=n.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return void e.drawImage(n,a-n.width/2,r-n.height/2,n.width,n.height);if(!(isNaN(i)||i<=0)){switch(n){default:e.beginPath(),e.arc(a,r,i,0,2*Math.PI),e.closePath(),e.fill();break;case"triangle":e.beginPath(),s=3*i/Math.sqrt(3),d=s*Math.sqrt(3)/2,e.moveTo(a-s/2,r+d/3),e.lineTo(a+s/2,r+d/3),e.lineTo(a,r-2*d/3),e.closePath(),e.fill();break;case"rect":c=1/Math.SQRT2*i,e.beginPath(),e.fillRect(a-c,r-c,2*c,2*c),e.strokeRect(a-c,r-c,2*c,2*c);break;case"rectRounded":var h=i/Math.SQRT2,f=a-h,g=r-h,p=Math.SQRT2*i;t.helpers.drawRoundedRectangle(e,f,g,p,p,i/2),e.fill();break;case"rectRot":c=1/Math.SQRT2*i,e.beginPath(),e.moveTo(a-c,r),e.lineTo(a,r+c),e.lineTo(a+c,r),e.lineTo(a,r-c),e.closePath(),e.fill();break;case"cross":e.beginPath(),e.moveTo(a,r+i),e.lineTo(a,r-i),e.moveTo(a-i,r),e.lineTo(a+i,r),e.closePath();break;case"crossRot":e.beginPath(),l=Math.cos(Math.PI/4)*i,u=Math.sin(Math.PI/4)*i,e.moveTo(a-l,r-u),e.lineTo(a+l,r+u),e.moveTo(a-l,r+u),e.lineTo(a+l,r-u),e.closePath();break;case"star":e.beginPath(),e.moveTo(a,r+i),e.lineTo(a,r-i),e.moveTo(a-i,r),e.lineTo(a+i,r),l=Math.cos(Math.PI/4)*i,u=Math.sin(Math.PI/4)*i,e.moveTo(a-l,r-u),e.lineTo(a+l,r+u),e.moveTo(a-l,r+u),e.lineTo(a+l,r-u),e.closePath();break;case"line":e.beginPath(),e.moveTo(a-i,r),e.lineTo(a+i,r),e.closePath();break;case"dash":e.beginPath(),e.moveTo(a,r),e.lineTo(a+i,r),e.closePath()}e.stroke()}},e.clipArea=function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},e.unclipArea=function(t){t.restore()},e.lineTo=function(t,e,n,i){return n.steppedLine?("after"===n.steppedLine?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y)):n.tension?void t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):void t.lineTo(n.x,n.y)},t.helpers.canvas=e}},{}],23:[function(t,e,n){"use strict";e.exports=function(t){function e(e){e=e||{};var n=e.data=e.data||{};return n.datasets=n.datasets||[],n.labels=n.labels||[],e.options=a.configMerge(t.defaults.global,t.defaults[e.type],e.options||{}),e}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function i(t){return"top"===t||"bottom"===t}var a=t.helpers,r=t.plugins,o=t.platform;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var r=this;i=e(i);var s=o.acquireContext(n,i),l=s&&s.canvas,u=l&&l.height,d=l&&l.width;return r.id=a.uid(),r.ctx=s,r.canvas=l,r.config=i,r.width=d,r.height=u,r.aspectRatio=u?d/u:null,r.options=i.options,r._bufferedRender=!1,r.chart=r,r.controller=r,t.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(t){r.config.data=t}}),s&&l?(r.initialize(),void r.update()):void console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return r.notify(t,"beforeInit"),a.retinaScale(t),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),r.notify(t,"afterInit"),t},clear:function(){return a.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,o=n.maintainAspectRatio&&e.aspectRatio||null,s=Math.floor(a.getMaximumWidth(i)),l=Math.floor(o?s/o:a.getMaximumHeight(i));if((e.width!==s||e.height!==l)&&(i.width=e.width=s,i.height=e.height=l,i.style.width=s+"px",i.style.height=l+"px",a.retinaScale(e),!t)){var u={width:s,height:l};r.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,r=e.scales={},o=[];n.scales&&(o=o.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(o,function(n){var o=n.options,s=a.getValueOrDefault(o.type,n.dtype),l=t.scaleService.getScaleConstructor(s);if(l){i(o.position)!==i(n.dposition)&&(o.position=n.dposition);var u=new l({id:o.id,options:o,ctx:e.ctx,chart:e});r[u.id]=u,n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];if(a.each(e.data.datasets,function(a,r){var o=e.getDatasetMeta(r);if(o.type||(o.type=a.type||e.config.type),n.push(o.type),o.controller)o.controller.updateIndex(r);else{var s=t.controllers[o.type];if(void 0===s)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new s(e,r),i.push(o.controller)}},e),n.length>1)for(var r=1;r=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);r.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};r.notify(n,"beforeDatasetDraw",[a])!==!1&&(i.controller.draw(e),r.notify(n,"afterDatasetDraw",[a]))},getElementAtEvent:function(e){return t.Interaction.modes.single(this,e)},getElementsAtEvent:function(e){return t.Interaction.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return t.Interaction.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,n,i){var a=t.Interaction.modes[n];return"function"==typeof a?a(this,e,i):[]},getDatasetAtEvent:function(e){return t.Interaction.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var i=t.helpers,a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;ti&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n=0;a--)e.call(n,t[a],a);else for(a=0;a=i[n].length||!i[n][a].type?i[n].push(r.configMerge(s,e)):e.type&&e.type!==i[n][a].type?i[n][a]=r.configMerge(i[n][a],s,e):i[n][a]=r.configMerge(i[n][a],e)}):(i[n]=[],r.each(e,function(e){var a=r.getValueOrDefault(e.type,"xAxes"===n?"category":"linear");i[n].push(r.configMerge(t.scaleService.getScaleDefaults(a),e))})):i.hasOwnProperty(n)&&"object"==typeof i[n]&&null!==i[n]&&"object"==typeof e?i[n]=r.configMerge(i[n],e):i[n]=e}),i},r.getValueAtIndexOrDefault=function(t,e,n){return void 0===t||null===t?n:r.isArray(t)?e=0;i--){var a=t[i];if(e(a))return a}},r.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=r.inherits,t&&r.extend(n.prototype,t),n.__super__=e.prototype,n},r.noop=function(){},r.uid=function(){var t=0;return function(){return t++}}(),r.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},r.almostEquals=function(t,e,n){return Math.abs(t-e)t},r.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},r.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},r.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},r.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},r.toRadians=function(t){return t*(Math.PI/180)},r.toDegrees=function(t){return t*(180/Math.PI)},r.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},r.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},r.aliasPixel=function(t){return t%2===0?0:.5},r.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;var c=i*u,h=i*d;return{previous:{x:r.x-c*(o.x-a.x),y:r.y-c*(o.y-a.y)},next:{x:r.x+h*(o.x-a.x),y:r.y+h*(o.y-a.y)}}},r.EPSILON=Number.EPSILON||1e-14,r.splineCurveMonotone=function(t){var e,n,i,a,o=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=o.length;for(e=0;e0?o[e-1]:null,a=e0?o[e-1]:null,a=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},r.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},r.niceNum=function(t,e){var n,i=Math.floor(r.log10(t)),a=t/Math.pow(10,i);return n=e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10,n*Math.pow(10,i)};var o=r.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===(t/=1)?1:(n||(n=.3),i0?(n=l[0].clientX,i=l[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(r.getStyle(o,"padding-left")),d=parseFloat(r.getStyle(o,"padding-top")),c=parseFloat(r.getStyle(o,"padding-right")),h=parseFloat(r.getStyle(o,"padding-bottom")),f=s.right-s.left-u-c,g=s.bottom-s.top-d-h;return n=Math.round((n-s.left-u)/f*o.width/e.currentDevicePixelRatio),i=Math.round((i-s.top-d)/g*o.height/e.currentDevicePixelRatio),{x:n,y:i}},r.addEvent=function(t,e,n){t.addEventListener?t.addEventListener(e,n):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n},r.removeEvent=function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=r.noop},r.getConstraintWidth=function(t){return a(t,"max-width","clientWidth")},r.getConstraintHeight=function(t){return a(t,"max-height","clientHeight")},r.getMaximumWidth=function(t){var e=t.parentNode,n=parseInt(r.getStyle(e,"padding-left"),10),i=parseInt(r.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,o=r.getConstraintWidth(t);return isNaN(o)?a:Math.min(a,o)},r.getMaximumHeight=function(t){var e=t.parentNode,n=parseInt(r.getStyle(e,"padding-top"),10),i=parseInt(r.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,o=r.getConstraintHeight(t);return isNaN(o)?a:Math.min(a,o)},r.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},r.retinaScale=function(t){var e=t.currentDevicePixelRatio=window.devicePixelRatio||1;if(1!==e){var n=t.canvas,i=t.height,a=t.width;n.height=i*e,n.width=a*e,t.ctx.scale(e,e),n.style.height=i+"px",n.style.width=a+"px"}},r.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},r.fontString=function(t,e,n){return e+" "+t+"px "+n},r.longestText=function(t,e,n,i){i=i||{};var a=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},o=i.garbageCollect=[],i.font=e),t.font=e;var s=0;r.each(n,function(e){void 0!==e&&null!==e&&r.isArray(e)!==!0?s=r.measureText(t,a,o,s,e):r.isArray(e)&&r.each(e,function(e){void 0===e||null===e||r.isArray(e)||(s=r.measureText(t,a,o,s,e))})});var l=o.length/2;if(l>n.length){for(var u=0;ui&&(i=r),i},r.numberOfLabelLines=function(t){var e=1;return r.each(t,function(t){r.isArray(t)&&t.length>e&&(e=t.length)}),e},r.drawRoundedRectangle=function(t,e,n,i,a,r){t.beginPath(),t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+r),t.lineTo(e+i,n+a-r),t.quadraticCurveTo(e+i,n+a,e+i-r,n+a),t.lineTo(e+r,n+a),t.quadraticCurveTo(e,n+a,e,n+a-r),t.lineTo(e,n+r),t.quadraticCurveTo(e,n,e+r,n),t.closePath()},r.color=i?function(e){return e instanceof CanvasGradient&&(e=t.defaults.global.defaultColor),i(e)}:function(t){return console.error("Color.js not found!"),t},r.isArray=Array.isArray?function(t){return Array.isArray(t)}:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.arrayEquals=function(t,e){var n,i,a,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n0&&(s=t.getDatasetMeta(s[0]._datasetIndex).data),s},"x-axis":function(t,e){return r(t,e,!0)},point:function(t,n){var a=e(n,t);return i(t,a)},nearest:function(t,n,i){var r=e(n,t),o=a(t,r,i.intersect);return o.length>1&&o.sort(function(t,e){var n=t.getArea(),i=e.getArea(),a=n-i;return 0===a&&(a=t._datasetIndex-e._datasetIndex),a}),o.slice(0,1)},x:function(t,i,a){var r=e(i,t),o=[],s=!1;return n(t,function(t){t.inXRange(r.x)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),a.intersect&&!s&&(o=[]),o},y:function(t,i,a){var r=e(i,t),o=[],s=!1;return n(t,function(t){t.inYRange(r.y)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),a.intersect&&!s&&(o=[]),o}}}}},{}],28:[function(t,e,n){"use strict";e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},legendCallback:function(t){var e=[];e.push('