You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/18 16:44:00 UTC

[11/34] git commit: AMBARI-7367 Config History filter by date custom throws JS. (ababiichuk)

AMBARI-7367 Config History filter by date custom throws JS. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b4e1aed4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b4e1aed4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b4e1aed4

Branch: refs/heads/branch-alerts-dev
Commit: b4e1aed4a7e3b67e48eb330e518786c3a24a07d8
Parents: 117b455
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 17 19:26:46 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 17 19:26:46 2014 +0300

----------------------------------------------------------------------
 .../app/templates/common/custom_date_popup.hbs  | 39 ++++++++++++++++++++
 ambari-web/app/views.js                         |  1 +
 .../app/views/common/select_custom_date_view.js | 36 ++++++++++++++++++
 3 files changed, 76 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/templates/common/custom_date_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/custom_date_popup.hbs b/ambari-web/app/templates/common/custom_date_popup.hbs
new file mode 100644
index 0000000..04c4560
--- /dev/null
+++ b/ambari-web/app/templates/common/custom_date_popup.hbs
@@ -0,0 +1,39 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="jobs-custom-dates">
+  <div>
+    <label>{{t jobs.customDateFilter.startTime}}</label>
+    {{view Ember.TextField valueBinding="controller.customDateFormFields.startDate" class="input-small datepicker"}}
+    {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="controller.customDateFormFields.hoursForStart" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="controller.customDateFormFields.minutesForStart" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="controller.customDateFormFields.middayPeriodForStart" class="input-mini"}}
+    <span class="help-inline">{{controller.filterObject.errorMessages.startDate}}</span>
+  </div>
+  <div>
+
+  </div>
+  <div>
+    <label>{{t jobs.customDateFilter.endTime}}</label>
+    {{view Ember.TextField valueBinding="controller.customDateFormFields.endDate" class="input-small datepicker"}}
+    {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="controller.customDateFormFields.hoursForEnd" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="controller.customDateFormFields.minutesForEnd" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="controller.customDateFormFields.middayPeriodForEnd" class="input-mini"}}
+    <span class="help-inline">{{controller.filterObject.errorMessages.endDate}}</span>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index baaee39..12b2683 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -26,6 +26,7 @@ require('views/common/chart/linear');
 require('views/common/chart/linear_time');
 require('views/common/modal_popup');
 require('views/common/rolling_restart_view');
+require('views/common/select_custom_date_view');
 require('views/common/metric');
 require('views/common/time_range');
 require('views/common/form/field');

http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/views/common/select_custom_date_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/select_custom_date_view.js b/ambari-web/app/views/common/select_custom_date_view.js
new file mode 100644
index 0000000..55da7fd
--- /dev/null
+++ b/ambari-web/app/views/common/select_custom_date_view.js
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.JobsCustomDatesSelectView = Em.View.extend({
+
+  name: 'jobsCustomDatesSelectView',
+
+  templateName: require('templates/common/custom_date_popup'),
+
+  middayPeriodOptions: [Em.I18n.t('jobs.table.custom.date.am'), Em.I18n.t('jobs.table.custom.date.pm')],
+
+  hourOptions: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
+
+  minuteOptions: ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'],
+
+  didInsertElement: function () {
+    $('.datepicker').datepicker({
+      format: 'mm/dd/yyyy'
+    });
+  }
+});