# This file is part of NIT ( http://www.nitlanguage.org ). # # Copyright 2014 Alexis Laferrière # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # View and controller of Tnitter module action import nitcorn import json import model import database # Path to the Sqlite3 database fun tnitter_db_path: String do return "tnitter.db" redef class Session # User logged in var user: nullable String = null end # Main Tnitter Action class TnitterWeb super Action # Header on pages served by this `Action` # # Keywords to `Text::replace`: # * `%app_path%` is the main URL to reach this `Action` # * `%nav_right%` is the pulled right part of the header, used for login form var header = """ """ # Template of the pages served by this `Action` # # Keywords to `Text::replace`: # * The `%header%`, first thing in the `` # * The main page `%content%` within a `
` var template = """ Tnitter %header%
%content%
""" # Custom JavaScript code added within a `