Skip to content

Commit

Permalink
pi merge
Browse files Browse the repository at this point in the history
Merge branch 'starwisp_lib' of github.com:nebogeo/mongoose-web into starwisp_lib
  • Loading branch information
nebogeo committed Feb 2, 2015
2 parents 66be4ac + 396fca0 commit c713c3e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 10 deletions.
4 changes: 2 additions & 2 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foam.mongoose"
android:versionCode="13"
android:versionName="1.0">
android:versionCode="17"
android:versionName="1.2">
<application android:label="@string/app_name"
android:icon="@drawable/logo"
android:theme="@style/StarwispTheme"
Expand Down
39 changes: 36 additions & 3 deletions android/assets/mongoose.scm
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,18 @@
(cons
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))

(string-append type
(cond
((equal? type "pup-focal")
(string-append
" on " (uid->name db (ktv-get entity "id-focal-subject"))))
((equal? type "group-comp")
(string-append
" on pack " (uid->name db (ktv-get entity "pack"))))
(else ""))
(if time (string-append " at " time) "") )

(lambda ()
(set-current! 'review-collection uid)
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
Expand All @@ -640,7 +651,7 @@
(cons
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))
(string-append type (if time (string-append "-" time) "") " ")
(lambda ()
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
(list (start-activity "review-item" 0 ""))))
Expand All @@ -665,7 +676,27 @@
(uid (list-ref data 1)))
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))
(string-append type
(cond
((equal? type "group-comp-pup-assoc")
(string-append
" between pup " (uid->name db (ktv-get entity "id-mongoose"))
" and " (uid->name db (ktv-get entity "id-escort"))))
((equal? type "group-comp-mate-guard")
(string-append
" between female " (uid->name db (ktv-get entity "id-mongoose"))
" and " (uid->name db (ktv-get entity "id-escort"))))
((equal? type "group-comp-weight")
(string-append
" for " (uid->name db (ktv-get entity "id-mongoose"))))
((equal? type "pup-focal")
(string-append
" on " (uid->name db (ktv-get entity "id-focal-subject"))))
((equal? type "group-comp")
(string-append
" on pack " (uid->name db (ktv-get entity "pack"))))
(else ""))
(if time (string-append " at " time) "") )
(lambda ()
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
(list (start-activity "review-item" 0 ""))))
Expand Down Expand Up @@ -729,6 +760,8 @@
(lambda (v)
(cond
((eqv? v 1)
(set-current! 'parent-id #f)
(set-current! 'pup-focal-id #f)
(list (finish-activity 1)))
(else
(set-current! 'timer-minutes 1)
Expand Down
18 changes: 16 additions & 2 deletions android/assets/starwisp.scm
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@
(mbutton "note-done" "Done"
(lambda ()
(set-current! 'entity-type "note")
;; parent is the current pup focal or group comp, or nothing
(let ((parent (get-current 'parent-id #f)))
(if parent
(entity-set-value! "parent" "varchar" parent)
(entity-set-value! "parent" "varchar" "not-set")))
(entity-record-values!)
(list (replace-fragment (get-id "event-holder") "events"))))
(mbutton "note-cancel" "Cancel"
Expand Down Expand Up @@ -994,7 +999,9 @@
(entity-update-single-value! (ktv "baby-byelim" "varchar" (assemble-array individuals)))
(list)))
)
(update-grid-selector-enabled "gc-baby-byelim" (get-current 'gc-not-present '()))
(update-grid-selector-enabled "gc-baby-byelim"
(invert-mongoose-selection
(get-current 'gc-not-present '())))
(update-grid-selector-checked "gc-baby-byelim" "baby-byelim")))
(lambda (fragment) '())
(lambda (fragment) '())
Expand All @@ -1011,6 +1018,7 @@
(lambda ()
;; clean up...
(get-current 'gc-not-present '())
(set-current! 'parent-id #f)
(set-current! 'group-composition-id #f)
(list (finish-activity 0))))))
(lambda (fragment arg)
Expand Down Expand Up @@ -1160,7 +1168,9 @@
(entity-init&save!
db "stream" "group-comp"
(list (ktv "pack" "varchar" (ktv-get (get-current 'pack ()) "unique_id"))
(ktv "group-comp-code" "varchar" "")))))
(ktv "group-comp-code" "varchar" ""))))
(set-current! 'parent-id (get-current 'group-composition-id #f))
)
(list
(start-activity "group-composition" 2 ""))))
(list
Expand All @@ -1183,6 +1193,7 @@
(ktv-get (get-current 'pack '()) "unique_id"))))
;; need to clear the current group comp
;; id here if we are changing the pack
(set-current! 'parent-id #f)
(set-current! 'group-composition-id #f))
(set-current! 'pack pack)
'()))))
Expand Down Expand Up @@ -1265,6 +1276,7 @@
(cond
((current-exists? 'individual)
(set-current! 'pup-focal-id (entity-record-values!))
(set-current! 'parent-id (get-current 'pup-focal-id #f))
(set-current! 'timer-minutes pf-length)
(set-current! 'timer-seconds 0)
(list
Expand Down Expand Up @@ -1332,6 +1344,8 @@
(lambda (v)
(cond
((eqv? v 1)
(set-current! 'parent-id #f)
(set-current! 'pup-focal-id #f)
(list (finish-activity 1)))
(else
(list))))))))))
Expand Down
7 changes: 5 additions & 2 deletions eavdb/entity-filter.ss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@
"left join " table "_value_int "
"as d on d.entity_id = e.entity_id and d.attribute_id = 'deleted' ")
filter)
(if typed "where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by n.value"
(if (not (equal? typed "*"))
(if (equal? typed "mongoose")
"where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by substr(n.value,3)"
"where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by n.value")
"order by n.value")))

(define (build-query-inc-deleted table filter)
Expand All @@ -119,7 +122,7 @@
filter))

(define (filter-entities db table type filter)
(let ((q (build-query table filter (not (equal? type "*")))))
(let ((q (build-query table filter type)))
(let ((s (apply
db-select
(dbg (append
Expand Down
2 changes: 1 addition & 1 deletion eavdb/entity-sync.ss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"select e.entity_id, e.entity_type, e.unique_id, e.dirty, e.version from " table "_entity as e "
"left join stream_value_varchar "
"as p on p.entity_id = e.entity_id and p.attribute_id = 'parent' "
"where e.dirty = 1 and p.value is NULL"))))
"where e.dirty = 1 and p.value is NULL or p.value='not-set'"))))
(if (null? de)
'()
(map
Expand Down

0 comments on commit c713c3e

Please sign in to comment.