local esc = minetest.formspec_escape
local title, text = '', ''

local lectern_formspec =
   'size[11,8]'..
   'no_prepend[]'..
   'bgcolor[#080808BB;true]'..
   'background[0,0;11,8;furniture_lectern_formspec.png]'

function furniture.lectern_edit_sign(title, content)
   local formspec =
      lectern_formspec..
      'field[0.5,1;7.5,0;title;'..esc('Title:')..';'..esc(title) .. ']' ..
      'label[0.25,1.1;Body:]'..
      'textarea[0.5,1.5;10.6,5.5;content;;'..esc(content)..']' ..
      'button_exit[4,6.5;4,1;save;Save]'
   return formspec
end

function furniture.lectern_view_sign(title, content)
   local formspec =
      lectern_formspec..
      'hypertext[0,0;11,1;;<center><style color=black size=40>'..esc(title)..'</style></center>]'..
      'textarea[0.5,1.5;10.6,6.5;;;'..esc(content)..']'
   return formspec
end

local news_stand_formspec =
   'formspec_version[3]'..
   'size[11,10]'..
   'bgcolor[#080808BB;true]'..
   'background[0,0;11,10;furniture_news_stand_fs_bg.png]'

function furniture.news_stand_edit(title, content)
   local formspec =
      news_stand_formspec..
      'field[0.5,.5;4,.6;title;'..esc('Title:')..';'..esc(title) .. ']' ..
      'label[0.5,1.25;Body:]'..
      'textarea[0.5,1.5;10,7.5;content;;'..esc(content)..']' ..
      'button_exit[3.5,9;4,1;save;Save]'
   return formspec
end

function furniture.news_stand_view(title, content)
   local formspec =
      news_stand_formspec..
      'hypertext[0,.2;11,1;;<center><style color=black size=40>~~'..title..'~~</style></center>]'..
      'textarea[.25,1.5;10.5,8.5;;;'..content..']'
   return formspec
end
