Skip to content

Instantly share code, notes, and snippets.

@fero23
Last active February 3, 2016 19:08
Show Gist options
  • Save fero23/0c8a49cbc82406f12269 to your computer and use it in GitHub Desktop.
Save fero23/0c8a49cbc82406f12269 to your computer and use it in GitHub Desktop.
Proof of concept of a new language
model Person {
uid: string(100),
name: string(200),
last_name: string(200),
birth_date: datetime
}
model Book {
name: string(200)
}
model Author extends Person;
actor Librarian extends Person {
start_date: datetime
}
add many to many relation Reservation for Person and Book;
add rule Librarian creates many Reservation;
view New for Person {
tag for uid with value "User ID:",
text input uid for uid,
tag for name with value "Name:",
text input name for name,
tag for last_name with value "Last name:",
text input last_name for last_name,
tag for birth_date with value "Birth date:",
datetime selector birth_date for birth_date,
button with value "Guardar" on click save
}
view Update for Person(id) {
span info with value $"Edit personal info of user {uid} ({name} {last_name})",
tag for name with value "Name:",
text input name for name,
tag for last_name with value "Last name:",
text input last_name for last_name,
tag for birth_date with value "Birth date:",
datetime selector birth_date for birth_date,
button with value "Actualizar" on click update(id)
}
view Reactive {
block {
span with value $"{:value}"
},
text input value for string(200)
}
style for all views of Person {
width: 50%,
align: center,
[text input], [tag]: {
align: left,
width: 50%,
border-radius: 10px
}
}
style for Update of Person {
:info: {
font-weight: bold,
align: center
}
}
style for New of Person {
[button]: {
color: gray;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment