# This file is part of NIT ( http://www.nitlanguage.org ). # # 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 # Shows a meetup and allows to modify its participants module meetup import opportunity_model import boilerplate import welcome import template # Shows a meetup and allows to modify its participants class OpportunityMeetupPage super OpportunityPage # Meetup the page is supposed to show var meetup: nullable Meetup = null init from_id(id: String) do var db = new OpportunityDB.open("opportunity") meetup = db.find_meetup_by_id(id) db.close end init do header.page_js = """ function change_answer(ele){ var e = document.getElementById(ele.id); var i = e.innerHTML; var ans = true; if(i === "
" t.add " | Participating | " for i in answers(db) do t.add "" t.add i.to_s t.add " | " end t.add "" for i in participants(db) do t.add "
---|---|---|
" t.add i.to_s t.add " | " for j,k in i.answers do t.add """||
""" for i in answers(db) do t.add " |