history view suggestion

19 views
Skip to first unread message

Timothy Pratley

unread,
Dec 9, 2013, 3:05:49 PM12/9/13
to version...@googlegroups.com
Hi,


I find it much easier to follow the history of a story when presented as a narrative
[see attached history.PNG]

This is calculated by querying the history and checking for added keys/removed keys/changed keys and applying some formatting.

The code is pretty straightforward at its core:
edits (for [[removed-keys added changed] (map exdiff delta-history (rest delta-history))]
                (concat
                 (when (seq removed-keys)
                   [(str "Cleared " (unwrap nil (map rename removed-keys)))])
                 (map (fn [[k v]]
                        (str "Set " (rename k) " to " (unwrap k v)))
                      (sort added))
                 (map (fn [[k v1 v2]]
                        (if (= k "Description")
                           [:div
                            [:div "Changed Description:"]
                            [:div
                             [:div.col-md-6 v1]
                             [:div.col-md-6 v2]]]
                          (str "Changed " (rename k) " from " (unwrap k v1) " to " (unwrap k v2))))
                      (sort changed))))

You could create two history tabs if you wanted to retain the existing view, users would benefit from this format.


Regards,
Timothy

history.PNG
historyV1.PNG
Reply all
Reply to author
Forward
0 new messages