yodel_admin 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,6 +77,10 @@ class AdminSyncPage < Page
77
77
  end
78
78
  end
79
79
 
80
- conflicts
80
+ conflicts.tap do |conflicts|
81
+ if conflicts.empty?
82
+ Migration.run_migrations(site)
83
+ end
84
+ end
81
85
  end
82
86
  end
@@ -7,11 +7,23 @@ Array.prototype.remove = function(from, to) {
7
7
  return this.push.apply(this, rest);
8
8
  };
9
9
 
10
- function initialiseWidgets() {
10
+ function initialiseWidgets(newRecord) {
11
11
  hideModelPanel();
12
12
  initialiseHTMLFields();
13
13
  initialiseMultipleSelectFields();
14
14
  addClearLinks();
15
+ if(newRecord)
16
+ setDateTimeFieldsToNow();
17
+ }
18
+
19
+ function setDateTimeFieldsToNow() {
20
+ // TODO: should check that each field is blank first before setting; a default value may have been set
21
+ var now = new Date();
22
+ $('#record_form select[name*="[day]"]').val(now.getDate());
23
+ $('#record_form select[name*="[month]"]').val(now.getMonth() + 1);
24
+ $('#record_form select[name*="[year]"]').val(now.getFullYear());
25
+ $('#record_form select[name*="[hour]"]').val(now.getHours());
26
+ $('#record_form select[name*="[min]"]').val(now.getMinutes());
15
27
  }
16
28
 
17
29
  function initialiseHTMLFields() {
@@ -740,7 +752,7 @@ function loadNewRecord(modelID, parentID, modelWasSelected) {
740
752
 
741
753
  // load the blank default record
742
754
  $('#record').load(htmlURL + '?action=new&model=' + modelID + '&parent=' + parentID, function(text, status, req) {
743
- initialiseWidgets();
755
+ initialiseWidgets(true);
744
756
  if(parent.children.length == 0)
745
757
  highlightSelectedRow(parentID);
746
758
  else
data/lib/yodel_admin.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module YodelAdmin
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yodel_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-12 00:00:00.000000000Z
12
+ date: 2011-12-18 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Yodel CMS Admin Extension
15
15
  email: