liquid_feedback_frontend

changeset 338:79d8e2d35021

Fixed broken html titles
author bsw
date Tue Feb 28 18:58:29 2012 +0100 (2012-02-28)
parents 4f8058e4d7db
children f8481330f4c2
files app/main/_filter_view/36_html_title.lua
line diff
     1.1 --- a/app/main/_filter_view/36_html_title.lua	Tue Feb 28 18:48:20 2012 +0100
     1.2 +++ b/app/main/_filter_view/36_html_title.lua	Tue Feb 28 18:58:29 2012 +0100
     1.3 @@ -5,73 +5,31 @@
     1.4  
     1.5  -- add ":" to prefix
     1.6  if app.html_title.prefix then
     1.7 -	app.html_title.prefix = app.html_title.prefix .. ": " 
     1.8 -	app.html_title.prefix = encode.html( app.html_title.prefix )
     1.9 +  app.html_title.prefix = app.html_title.prefix .. ": " 
    1.10 +  app.html_title.prefix = encode.html( app.html_title.prefix )
    1.11  end
    1.12  
    1.13  -- add "-" to title 
    1.14  if app.html_title.title then
    1.15 -	app.html_title.title = app.html_title.title .. " - " 
    1.16 -	app.html_title.title = encode.html( app.html_title.title )
    1.17 --- or pull from <h1>title<h1> 
    1.18 --- but only if it does not contain config.app_title
    1.19 --- (otherwise config.app_title would appear twice in title)
    1.20 -elseif slot.get_content( "title" ) ~= encode.html( config.app_title ) then
    1.21 -  -- replace all html from the title first
    1.22 -	app.html_title.title = string.gsub(slot.get_content( "title" ), "</?[A-Za-z][A-Za-z0-9:_%-]*[^>]*>", ""):gsub("%s+", " ") .. " - "
    1.23 +  app.html_title.title = app.html_title.title .. " - " 
    1.24 +  app.html_title.title = encode.html( app.html_title.title )
    1.25 +
    1.26  end
    1.27  
    1.28  -- add "-" to subtitle
    1.29  if app.html_title.subtitle then
    1.30 -	app.html_title.subtitle = app.html_title.subtitle .. " - " 
    1.31 -	app.html_title.subtitle = encode.html( app.html_title.subtitle )
    1.32 +  app.html_title.subtitle = app.html_title.subtitle .. " - " 
    1.33 +  app.html_title.subtitle = encode.html( app.html_title.subtitle )
    1.34  end
    1.35  
    1.36  
    1.37 ---slot.put_into("html_title", encode.html( config.app_title ) )
    1.38  slot.put_into("html_title", 
    1.39 -	( app.html_title.prefix or "" )
    1.40 -	..
    1.41 -	( app.html_title.title  or "" )
    1.42 -	..
    1.43 -	( app.html_title.subtitle or "" )
    1.44 -	..
    1.45 -	config.app_title
    1.46 +  ( app.html_title.prefix or "" )
    1.47 +  ..
    1.48 +  ( app.html_title.title  or "" )
    1.49 +  ..
    1.50 +  ( app.html_title.subtitle or "" )
    1.51 +  ..
    1.52 +  config.app_title
    1.53  )
    1.54  
    1.55 -
    1.56 ---[[
    1.57 -
    1.58 -[prefix: ]main - [subtitle - ]appname
    1.59 -
    1.60 -
    1.61 -Aktueller Entwurf:
    1.62 -	Pro BGE - Initiative #33 - Liquidfeedback PP Dtl.
    1.63 -Anregungen zu: Pro BGE - Initiative #33 - Liquidfeedback PP Dtl.
    1.64 -Entwurfshistorie zu: Pro BGE - Initiative #33 - Liquidfeedback PP Dtl.
    1.65 -Details zu: Pro BGE - Initiative #33 - Liquidfeedback PP Dtl.
    1.66 -
    1.67 -Thema #34 - Liquidfeedback Dtl.
    1.68 -
    1.69 -
    1.70 -Themenbereiche - Liquidfeedback Dtl
    1.71 -
    1.72 -Wirtschaft & Soziales - Themenbereich - Liquidfeedback Piratenpartei Deutschland
    1.73 -Wirtschaft & Soziales - Liquidfeedback Piratenpartei Deutschland
    1.74 -
    1.75 -Standard proceeding - Regelwerk - Piratenpartei Deutschland
    1.76 -
    1.77 -Registrierung - Piratenpartei Deutschland
    1.78 -
    1.79 -
    1.80 -Mitgliederliste - Piratenpartei Deutschland
    1.81 -
    1.82 -Administrator - Mitglied - Piratenpartei Deutschland
    1.83 -
    1.84 -
    1.85 -
    1.86 ---]]
    1.87 -
    1.88 ---slot.put_into("html_title", slot.get_content("title") .. config.app.html_title)
    1.89 ---print (slot.get_content("title"))
    1.90 ---exit()

Impressum / About Us