mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Nicer transformation
This commit is contained in:
@@ -52,15 +52,12 @@ angular.module("sideBySide").factory("transformer", ->
|
||||
|
||||
checkLengths translations
|
||||
|
||||
data = {
|
||||
verses = _.map(_.range(translations[0].content.length), (i) -> (
|
||||
_.map(translations, (t) -> t.content[i])
|
||||
))
|
||||
|
||||
{
|
||||
meta: (translation.meta for translation in translations)
|
||||
verses: []
|
||||
verses: verses
|
||||
}
|
||||
|
||||
# columns into rows and rows into columns
|
||||
for i in _.range(translations[0].content.length)
|
||||
data.verses.push(translation.content[i] \
|
||||
for translation in translations)
|
||||
|
||||
data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user