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.
- data/lib/models/admin_sync_page.rb +5 -1
- data/lib/public/admin/js/admin.js +14 -2
- data/lib/yodel_admin.rb +1 -1
- metadata +2 -2
|
@@ -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
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.
|
|
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
|
+
date: 2011-12-18 00:00:00.000000000Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: Yodel CMS Admin Extension
|
|
15
15
|
email:
|