diff --git a/src/index.html b/src/index.html
index 4c95098..dfdab07 100644
--- a/src/index.html
+++ b/src/index.html
@@ -1,7 +1,7 @@
-
+ AntOS webOS
diff --git a/src/packages/Blogger/cvsection.html b/src/packages/Blogger/cvsection.html
index 6fedf5c..3b53db8 100644
--- a/src/packages/Blogger/cvsection.html
+++ b/src/packages/Blogger/cvsection.html
@@ -2,7 +2,7 @@
-
+
@@ -19,7 +19,7 @@
-
+
diff --git a/src/packages/Blogger/dialogs.coffee b/src/packages/Blogger/dialogs.coffee
index c531727..1fbc2bc 100644
--- a/src/packages/Blogger/dialogs.coffee
+++ b/src/packages/Blogger/dialogs.coffee
@@ -17,7 +17,7 @@ class BloggerCategoryDialog extends this.OS.GUI.BasicDialog
sel = (d.find "content1").get "selectedItem"
return d.notify "Please select a parent category" unless sel
val = (d.find "content3").value
- return d.notify "Please enter category name" if val is ""
+ return d.notify "Please enter category name" if val is "" and not d.data.selonly
return d.notify "Parent can not be the category itself" if d.data.cat and d.data.cat.id is sel.id
d.handler { p: sel, value: val } if d.handler
d.quit()
@@ -75,7 +75,7 @@ class BloggerCVSectionDiaglog extends this.OS.GUI.BaseDialog
console.log inputs
data[v.name] = ($ v).val() for v in inputs
data.content = me.editor.value()
- return me.notify "Title must not be blank" if data.title is ""
+ return me.notify "Title or content must not be blank" if data.title is "" and data.content is ""
#return me.notify "Content must not be blank" if data.content is ""
data.id = me.data.id if me.data and me.data.id
me.handler data if me.handler
diff --git a/src/packages/Blogger/main.coffee b/src/packages/Blogger/main.coffee
index bad94ab..256d1d2 100644
--- a/src/packages/Blogger/main.coffee
+++ b/src/packages/Blogger/main.coffee
@@ -70,7 +70,6 @@ class Blogger extends this.OS.GUI.BaseApplication
(d) ->
return unless d
me.deleteCVCat cat
- me.refreshCVCat()
, "Delete cagegory" ,
{ iconclass: "fa fa-question-circle", text: "Do you really want to delete: #{cat.name} ?" }
@@ -88,6 +87,21 @@ class Blogger extends this.OS.GUI.BaseApplication
, "New section entry for #{cat.name}", null
+ (@find "cv-sec-move").set "onbtclick", (e) ->
+ sec = (me.find "cv-sec-list").get "selected"
+ return me.notify "Please select a section to move" unless sec
+
+ me.openDialog "BloggerCategoryDialog", (d) ->
+ c =
+ id: sec.id,
+ cid: d.p.id
+
+ me.cvsecdb.save c, (r) ->
+ return me.error "Cannot move section" if r.error
+ me.CVSectionByCID(sec.cid)
+ (me.find "cv-sec-list").set "selected", -1
+ , "Move to", { tree: (me.cvlist.get "data"), selonly: true }
+
(@find "cv-sec-edit").set "onbtclick", (e) ->
sec = (me.find "cv-sec-list").get "selected"
return me.notify "Please select a section to edit" unless sec
@@ -99,7 +113,6 @@ class Blogger extends this.OS.GUI.BaseApplication
d.publish = Number sec.publish
me.cvsecdb.save d, (r) ->
return me.error "Cannot save section: #{r.error}" if r.error
- console.log d.cid
me.CVSectionByCID Number(sec.cid)
, "Modify section entry", sec
@@ -189,7 +202,10 @@ class Blogger extends this.OS.GUI.BaseApplication
name: "Porfolio",
id:0,
nodes: []
- @cvcatdb.get null, (d) ->
+ cnd =
+ order:
+ name: "ASC"
+ @cvcatdb.find cnd, (d) ->
if d.error
me.cvlist.set "data", data
return me.notify "Cannot fetch CV categories"
@@ -214,15 +230,15 @@ class Blogger extends this.OS.GUI.BaseApplication
ids.push c.id
func(v) for v in c.nodes if c.nodes
func(cat)
- console.log dis
- return
- #delete all child
- @deleteCVCat v for v in cat.nodes if cat.nodes
+
+ cond = ({ "=": { cid: v } } for v in ids)
# delete all content
- @cvsecdb.delete { "=": { cid: cat.id } }, (r) ->
+ @cvsecdb.delete { "or": cond }, (r) ->
return me.error "Cannot delete all content of: #{cat.name} [#{r.error}]" if r.error
- me.cvcatdb.delete cat.id, (re) ->
+ cond = ({ "=": { id: v } } for v in ids)
+ me.cvcatdb.delete { "or": cond }, (re) ->
return me.error "Cannot delete the category: #{cat.name} [#{re.error}]" if re.error
+ me.refreshCVCat()
CVSectionByCID: (cid) ->
me = @
@@ -244,7 +260,10 @@ class Blogger extends this.OS.GUI.BaseApplication
v.end = Number(v.end)
v.detail = []
v.detail.push { text: v.subtitle, class: "cv-subtitle" } if v.subtitle isnt ""
- v.detail.push { text: "#{v.start} - #{v.end}", class: "cv-period" } if v.start isnt 0 and v.end isnt 0
+ if v.start isnt 0 and v.end isnt 0
+ v.detail.push { text: "#{v.start} - #{v.end}", class: "cv-period" }
+ else
+ v.detail.push { text: "", class: "cv-period" }
v.detail.push { text: v.location, class: "cv-loc" } if v.location isnt ""
#v.detail.push { text: v.end } if v.end isnt 0
v.closable = true
diff --git a/src/packages/Blogger/main.css b/src/packages/Blogger/main.css
index dd6eb72..1ea449a 100644
--- a/src/packages/Blogger/main.css
+++ b/src/packages/Blogger/main.css
@@ -67,6 +67,7 @@ afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .c
}
afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .cv-period, .cv-loc{
text-align: right;
+ clear: both;
}
afx-app-window[data-id="blogger-win"] afx-list-view[ data-id = "cv-sec-list"] .cv-subtitle{
font-style: italic;
diff --git a/src/packages/Blogger/scheme.html b/src/packages/Blogger/scheme.html
index a9b28fb..d58988d 100644
--- a/src/packages/Blogger/scheme.html
+++ b/src/packages/Blogger/scheme.html
@@ -49,6 +49,7 @@
+