mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:24:39 +08:00
Refactor theme fields so they support custom theme defined vars
This paves the way to allowing themes to specify uploads and so on.
This commit is contained in:
@ -67,7 +67,7 @@ JSON
|
||||
|
||||
expect(@theme.theme_fields.length).to eq(3)
|
||||
|
||||
mapped = Hash[*@theme.theme_fields.map{|f| ["#{f.target}-#{f.name}", f.value]}.flatten]
|
||||
mapped = Hash[*@theme.theme_fields.map{|f| ["#{f.target_id}-#{f.name}", f.value]}.flatten]
|
||||
|
||||
expect(mapped["0-header"]).to eq("I AM HEADER")
|
||||
expect(mapped["1-scss"]).to eq("body {color: red;}")
|
||||
@ -101,7 +101,7 @@ JSON
|
||||
expect(scheme.name).to eq("Amazing")
|
||||
expect(scheme.colors.find_by(name: 'love').hex).to eq('eaeaea')
|
||||
|
||||
mapped = Hash[*@theme.theme_fields.map{|f| ["#{f.target}-#{f.name}", f.value]}.flatten]
|
||||
mapped = Hash[*@theme.theme_fields.map{|f| ["#{f.target_id}-#{f.name}", f.value]}.flatten]
|
||||
|
||||
expect(mapped["0-header"]).to eq("I AM UPDATED")
|
||||
expect(mapped["1-scss"]).to eq("body {color: red;}")
|
||||
|
Reference in New Issue
Block a user