diff --git a/calexium_lib b/calexium_lib index daf7d84..89e465d 160000 --- a/calexium_lib +++ b/calexium_lib @@ -1 +1 @@ -Subproject commit daf7d84b972b0f4ef2a35fcf9b48101417a7110d +Subproject commit 89e465d6f9d8461c1168c798ab69ddcdea5ae832 diff --git a/hayamiki.aproj b/hayamiki.aproj index cc71370..c41f8dd 100644 --- a/hayamiki.aproj +++ b/hayamiki.aproj @@ -482,6 +482,7 @@ + diff --git a/src/generation/columns.anubis b/src/generation/columns.anubis index b8165f7..5637c8c 100644 --- a/src/generation/columns.anubis +++ b/src/generation/columns.anubis @@ -7,6 +7,7 @@ */ read system/string.anubis +read tools/list.anubis read hayamiki_lib/types/model/columns.anubis read fields.anubis @@ -226,7 +227,17 @@ public define Maybe(String) foreign_key(app,foreign_table) then success("foreign_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")"), integer_field then success("integer(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), //TODO make choices selection if need - char_field(choices,_) then success("text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), + char_field(choices,_) then + if choices is + { + no_choice then success("text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), + text_choices(choices_list) then + //if choice list is NOT empty we construct the possible choices selector + if length(choices_list) > 0 then + success("choices_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_choices_selector_"+to_lower(type_name)+"_"+name+"), "+to_Anubis_source(help)+")") + else + success("text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")") + } text_field then success("text_area(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")") }. diff --git a/src/generation/create_table.anubis b/src/generation/create_table.anubis index 77b2f13..a9f4d8c 100644 --- a/src/generation/create_table.anubis +++ b/src/generation/create_table.anubis @@ -3,7 +3,30 @@ * User: フランスのトトロ aka (David RENÉ) * Date: 24/01/2016 * Time: 18:13 - * © Calexium + +Hayamiki is Copyright © 2016 by Calexium +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. */ diff --git a/src/generation/files.anubis b/src/generation/files.anubis index da2409e..d8a3898 100644 --- a/src/generation/files.anubis +++ b/src/generation/files.anubis @@ -20,6 +20,7 @@ read generation/types.anubis read generation/create_table.anubis read generation/menu.anubis read generation/fn_delete.anubis +read generation/choices_selector.anubis read check.anubis define Maybe(One) @@ -57,9 +58,10 @@ define Maybe(One) if generate_delete(strm, table) is { failure then failure, success(_) then if generate_show_string(strm, table) is { failure then failure, success(_) then if generate_selector(strm, table) is { failure then failure, success(_) then + if generate_choices_selector(strm, table) is { failure then failure, success(_) then if generate_VT_all_view(strm, table) is { failure then failure, success(_) then if generate_VT_edit(strm, table) is { failure then failure, success(_) then - success(unique)}}}}}}}}}}}}} + success(unique)}}}}}}}}}}}}}} }. define One -- libgit2 0.21.4