Compare commits
64 Commits
modules-as
...
storage
Author | SHA1 | Date | |
---|---|---|---|
0725e66261 | |||
3824399f33 | |||
1f88981112 | |||
fcf0725534 | |||
3d8e4fb947 | |||
2028f1ee85 | |||
f950b5b94c | |||
9d4ad377e6 | |||
8086b18879 | |||
b92272afa2 | |||
fc8cd20e7f | |||
509d2781f7 | |||
cdb8e44099 | |||
79b548f9a0 | |||
e72911c67c | |||
7cb200ab04 | |||
55d1c2c446 | |||
807ef6a150 | |||
c8e911640e | |||
da7b996a8b | |||
5085d87f68 | |||
4052fa4b55 | |||
ba65b471b3 | |||
0f479da5ff | |||
a835799e11 | |||
65bb1aa532 | |||
bdf4d86593 | |||
81fcd9e3c1 | |||
5788ce199a | |||
544edddb21 | |||
2989bd34bd | |||
28a05c584c | |||
c8d527dba8 | |||
62d4c0518f | |||
1a6f27f2f6 | |||
6c9353d389 | |||
7ef0626357 | |||
5a2e6277e5 | |||
6558b7a026 | |||
1b0335c069 | |||
18a29d674c | |||
de8ad25b2f | |||
286d131839 | |||
0c59767ef7 | |||
12a49ab66d | |||
c017b80063 | |||
6d81bd7bd8 | |||
44c3e41b81 | |||
fa50a59938 | |||
9a2c72c6a1 | |||
956f9a2635 | |||
1e81b830c4 | |||
db57313165 | |||
cfef9b29b0 | |||
fe2d5fdb2a | |||
75f3a80d31 | |||
645cc6f690 | |||
b9317490fb | |||
85e9916e27 | |||
18d63485c2 | |||
046fad7f57 | |||
6aa09f9fdd | |||
efd363daef | |||
51ed8d41e2 |
71
README.md
71
README.md
@ -1,38 +1,39 @@
|
||||
# Modular Politics for Minetest
|
||||
# Modpol for Minetest
|
||||
|
||||
Modular Politics is an extension that enables diverse governance processes on multi-user platforms. It offers a library that enables users to create or adapt their own modules that add specific governance functionalities.
|
||||
Modpol, short for "modular politics," enables diverse governance processes on multi-user platforms. It offers a library with which users can choose, modify, and create modules that add specific governance functionalities.
|
||||
|
||||
This implementation is a mod for [Minetest](https://minetest.net), a free/open-source voxel game. It is designed to be easily adapted to other multi-user platforms that also employ Lua as an extension language.
|
||||
This implementation is a mod for [Minetest](https://minetest.net), a free/open-source voxel game. It is designed to be adapted to other multi-user platforms that also employ Lua as an extension language.
|
||||
|
||||
## Design philosophy
|
||||
## How to use it
|
||||
|
||||
Modular Politics seeks to implement a theoretical framework, also called "[modular politics](https://metagov.org/modpol)," which proposes these design goals:
|
||||
Modpol is built around groups called *orgs*. At the base is an org with all users in it, called `Root` by default. *Modules* enable people to do things within orgs, such as decide on membership, grant powers to the org, and much more. To get started in Minetest:
|
||||
|
||||
* *Modularity*: Platform operators and community members should have the ability to construct systems by creating, importing, and arranging composable parts together as a coherent whole.
|
||||
* *Expressiveness*: The governance layer should be able to implement as wide a range of processes as possible.
|
||||
* *Portability*: Governance tools developed for one platform should be portable to another platform for reuse and adaptation.
|
||||
* *Interoperability*: Governance systems operating on different platforms and protocols should have the ability to interact with each other, sharing data and influencing each other's processes.
|
||||
* Type the command `/mp`
|
||||
* Select the org `Root`
|
||||
* Choose one of its modules to make new orgs and craft their behavior
|
||||
|
||||
Additionally, Modular Politics seeks to counteract the tendency for "[implicit feudalism](https://ntnsndr.in/ImplicitFeudalism)," according to which rigid, top-down power structures are the norm in online spaces. To this end, some design patterns include:
|
||||

|
||||
|
||||
* *Groups, not roles*: While most platforms assign powers through particular permissions given to individuals, in Modular Politics, power lies in groups (which Modular Politics calls "orgs").
|
||||
* *Consent, not oligarchy*: Rather than assuming that decisions will be made by a few power-holders, the software assumes that consent by all affected users is the norm.
|
||||
* *Inheritance, not blank slates*: When a new group is formed, it inherits the patterns of what preceded it, rather than imagining that it is starting from scratch.
|
||||
Modules can be nested in each other, so one module can rely on another module to accomplish a process. Users might use a module to unilaterally carry out actions in the game, or the module might require a group decision to do so. Users can also change the modules available to users of a given org. There are currently two ways of doing this:
|
||||
|
||||
* Admins can remove modules from the list of modules loaded in `modpol_core/api.lua` and `modpol_minetest/api.lua`. This will make those modules no longer available to any user.
|
||||
* Players can change the modules available in a given org from within the program using the `Change modules` module. Removed modules can be re-added in any org by using `Change modules` again.
|
||||
|
||||
Modpol should give you the ability to do whatever kind of politics you want with your modules. If there is something you would like to do that is not available, [develop a module for it](https://gitlab.com/medlabboulder/modpol/-/wikis/Module-Writing-Guide) (or ask us for help!).
|
||||
|
||||
It is certainly possible to use Modular Politics to replicate practices of implicit feudalism, such as all-powerful admins, but doing so requires extra work to overcome these defaults.
|
||||
|
||||
## Installation in Minetest
|
||||
|
||||
To use this in Minetest, simply install it in your `mods/` or `worldmods/` folder. Minetest will load `init.lua`.
|
||||
|
||||
In the game, open the Modular Politics dashboard with the command `/mp`.
|
||||
In the game, open the Modpol dashboard with the command `/mp`.
|
||||
|
||||
For testing purposes, players with the `privs` privilege (generally admins) can use the `/mp` command, which resets all the orgs and opens a dashboard.
|
||||
For testing purposes, players with the `privs` privilege (generally admins) can use the `/mp` command, which resets all the orgs and opens a dashboard.\
|
||||
|
||||
|
||||
## Standalone Version on the Command Line
|
||||
|
||||
Modular Politics can also be used independently of Minetest as a command-line tool. Currently command-line use of modpol requires a Unix-style system, but it is intended to become more fully platform independent.
|
||||
Modpol can also be used independently of Minetest as a command-line tool. Currently command-line use of modpol requires a Unix-style system, but it is intended to become more fully platform independent.
|
||||
|
||||
The command-line version is in the `modpol` subdirectory. To run the program on Unix systems in CLI mode, install lua or luajit and execute the following in this directory:
|
||||
|
||||
@ -40,21 +41,49 @@ The command-line version is in the `modpol` subdirectory. To run the program on
|
||||
$ lua[jit] login.lua
|
||||
```
|
||||
|
||||
You can also interact with the interpreter by starting it this way:
|
||||
Alternatively, to test arbitrary functions in the interpreter outside of the interactive dashboards, load Modpol's library with:
|
||||
|
||||
```
|
||||
$ lua[jit]
|
||||
> dofile("login.lua")
|
||||
> dofile("modpol_core/modpol.lua")
|
||||
```
|
||||
|
||||
In the interpreter, for a list of global functions and tables, use `modpol.menu()`.
|
||||
|
||||
## Storage
|
||||
|
||||
By default, a data directory named "data" will be created in this directory. `/data` will contain a log file and serialized program data files.
|
||||
The persistent storage method may be chosen in `modpol.lua`. If available, Modpol uses Minetest's built-in StorageRef system for Minetest 5.*. If that is not available, or in CLI mode, data will be stored in a data directory at `modpol_core/data/`. This will contain a log file and serialized program data files.
|
||||
|
||||
Another storage method may be chosen in `modpol.lua`. A StorageRef-based method for Minetest 5.* is included: `storage-mod_storage.lua`.
|
||||
|
||||
## Design philosophy
|
||||
|
||||
Modpol seeks to implement a theoretical framework called "[modular politics](https://metagov.org/modpol)," which proposes these design goals:
|
||||
|
||||
* *Modularity*: Platform operators and community members should have the ability to construct systems by creating, importing, and arranging composable parts together as a coherent whole.
|
||||
* *Expressiveness*: The governance layer should be able to implement as wide a range of processes as possible.
|
||||
* *Portability*: Governance tools developed for one platform should be portable to another platform for reuse and adaptation.
|
||||
* *Interoperability*: Governance systems operating on different platforms and protocols should have the ability to interact with each other, sharing data and influencing each other's processes.
|
||||
|
||||
Additionally, Modpol seeks to counteract the tendency for "[implicit feudalism](https://ntnsndr.in/ImplicitFeudalism)," according to which rigid, top-down power structures are the norm in online spaces. To this end, some design patterns include:
|
||||
|
||||
* *Groups, not roles*: While most platforms assign powers through particular permissions given to individuals, in Modpol, power lies in groups (which Modpol calls "orgs").
|
||||
* *Consent, not oligarchy*: Rather than assuming that decisions will be made by a few power-holders, the software assumes that consent by all affected users is the norm.
|
||||
* *Inheritance, not blank slates*: When a new group is formed, it inherits the patterns of what preceded it, rather than imagining that it is starting from scratch.
|
||||
|
||||
It is certainly possible to use Modpol to replicate practices of implicit feudalism, such as all-powerful admins, but doing so requires extra work to overcome these defaults.
|
||||
|
||||
## Documentation
|
||||
|
||||
Various guides are available at the [GitLab wiki](https://gitlab.com/medlabboulder/modpol/-/wikis/home).
|
||||
|
||||
Read documentation of functions and modules at `docs/doc/index.html`. Documentation was generated using [LDoc](https://stevedonovan.github.io/ldoc/). To generate basic documentation for every page, download `ldoc` and use the following command:
|
||||
|
||||
```
|
||||
$ cd docs/
|
||||
$ ldoc ..
|
||||
```
|
||||
|
||||
This will not generate the same index page and sidebar as the documentation provided; the appropriate structure needs to be added manually.
|
||||
|
||||
## Credits
|
||||
|
||||
|
2
docs/config.ld
Normal file
2
docs/config.ld
Normal file
@ -0,0 +1,2 @@
|
||||
project = 'Modpol'
|
||||
description = 'modpol core'
|
201
docs/doc/index.html
Normal file
201
docs/doc/index.html
Normal file
@ -0,0 +1,201 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="modules/consent.html">consent</a></li>
|
||||
<li><a href="modules/create_token.html">create_token</a></li>
|
||||
<li><a href="modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="modules/join_org.html">join_org</a></li>
|
||||
<li><a href="modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="modules/message_org.html">message_org</a></li>
|
||||
<li><a href="modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="modules/send_token.html">send_token</a></li>
|
||||
<li><a href="modules/module_template.html">module_template</a></li>
|
||||
<li><a href="modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
||||
<h2>modpol core</h2>
|
||||
|
||||
<h2>Modules</h2>
|
||||
<table class="module_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol.interactions.html">modpol.interactions</a></td>
|
||||
<td class="summary">INTERACTIONS.LUA (CLI).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/add_child_org_consent.html">add_child_org_consent</a></td>
|
||||
<td class="summary">Adds a child org.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/change_modules.html">change_modules</a></td>
|
||||
<td class="summary">change_modules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/change_modules.html">change_modules</a></td>
|
||||
<td class="summary">change_modules
|
||||
Depends on consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/consent.html">consent</a></td>
|
||||
<td class="summary">A utility module for checking consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/create_token.html">create_token</a></td>
|
||||
<td class="summary">Create token.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/defer_consent.html">defer_consent</a></td>
|
||||
<td class="summary">Defer consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/display_processes.html">display_processes</a></td>
|
||||
<td class="summary">Display processes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/join_org.html">join_org</a></td>
|
||||
<td class="summary">Adds a user to org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/join_org_consent.html">join_org_consent</a></td>
|
||||
<td class="summary">Join org (consent).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/leave_org.html">leave_org</a></td>
|
||||
<td class="summary">Removes initiator from org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/message_org.html">message_org</a></td>
|
||||
<td class="summary">Messages all org members</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/randomizer.html">randomizer</a></td>
|
||||
<td class="summary">A utility module that outputs a random result from a set of options</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/remove_child_consent.html">remove_child_consent</a></td>
|
||||
<td class="summary">Remove child (consent).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/remove_member_consent.html">remove_member_consent</a></td>
|
||||
<td class="summary">Calls consent to remove member from org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/remove_org.html">remove_org</a></td>
|
||||
<td class="summary">A simple module that removes an org.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/remove_org_consent.html">remove_org_consent</a></td>
|
||||
<td class="summary">Remove org (consent)
|
||||
A simple module that calls a consent process on an org to remove it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/remove_process.html">remove_process</a></td>
|
||||
<td class="summary">Remove a process</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/rename_org_consent.html">rename_org_consent</a></td>
|
||||
<td class="summary">Rename org (consent)
|
||||
A simple module that calls a consent process on an org to rename it.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/send_token.html">send_token</a></td>
|
||||
<td class="summary">Send token.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/module_template.html">module_template</a></td>
|
||||
<td class="summary">Template for module writers.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/tokenomics.html">tokenomics</a></td>
|
||||
<td class="summary">Tokenomics.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol.orgs.base.html">modpol.orgs.base</a></td>
|
||||
<td class="summary">Basic function for orgs</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol.orgs.process.html">modpol.orgs.process</a></td>
|
||||
<td class="summary">Process functions for orgs</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol.util.misc.html">modpol.util.misc</a></td>
|
||||
<td class="summary">Miscellaneous functions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol_minetest.api.html">modpol_minetest.api</a></td>
|
||||
<td class="summary">Script for loading Minetest files</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/priv_to_org.html">priv_to_org</a></td>
|
||||
<td class="summary">Set privilege to org members
|
||||
Allows initiator to grant a priv they have to all members of an org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></td>
|
||||
<td class="summary">INTERACTIONS.LUA (for Minetest)
|
||||
CONTEXTUAL STUFF
|
||||
================</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
303
docs/doc/ldoc.css
Normal file
303
docs/doc/ldoc.css
Normal file
@ -0,0 +1,303 @@
|
||||
/* BEGIN RESET
|
||||
|
||||
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 2.8.2r1
|
||||
*/
|
||||
html {
|
||||
color: #000;
|
||||
background: #FFF;
|
||||
}
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
fieldset,img {
|
||||
border: 0;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
del,ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
li {
|
||||
margin-left: 20px;
|
||||
}
|
||||
caption,th {
|
||||
text-align: left;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
q:before,q:after {
|
||||
content: '';
|
||||
}
|
||||
abbr,acronym {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
sup {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
sub {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
legend {
|
||||
color: #000;
|
||||
}
|
||||
input,button,textarea,select,optgroup,option {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
input,button,textarea,select {*font-size:100%;
|
||||
}
|
||||
/* END RESET */
|
||||
|
||||
body {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
font-family: arial, helvetica, geneva, sans-serif;
|
||||
background-color: #ffffff; margin: 0px;
|
||||
}
|
||||
|
||||
code, tt { font-family: monospace; font-size: 1.1em; }
|
||||
span.parameter { font-family:monospace; }
|
||||
span.parameter:after { content:":"; }
|
||||
span.types:before { content:"("; }
|
||||
span.types:after { content:")"; }
|
||||
.type { font-weight: bold; font-style:italic }
|
||||
|
||||
body, p, td, th { font-size: .95em; line-height: 1.2em;}
|
||||
|
||||
p, ul { margin: 10px 0 0 0px;}
|
||||
|
||||
strong { font-weight: bold;}
|
||||
|
||||
em { font-style: italic;}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 20px 0 20px 0;
|
||||
}
|
||||
h2, h3, h4 { margin: 15px 0 10px 0; }
|
||||
h2 { font-size: 1.25em; }
|
||||
h3 { font-size: 1.15em; }
|
||||
h4 { font-size: 1.06em; }
|
||||
|
||||
a:link { font-weight: bold; color: #004080; text-decoration: none; }
|
||||
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
|
||||
a:link:hover { text-decoration: underline; }
|
||||
|
||||
hr {
|
||||
color:#cccccc;
|
||||
background: #00007f;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
blockquote { margin-left: 3em; }
|
||||
|
||||
ul { list-style-type: disc; }
|
||||
|
||||
p.name {
|
||||
font-family: "Andale Mono", monospace;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: rgb(245, 245, 245);
|
||||
border: 1px solid #C0C0C0; /* silver */
|
||||
padding: 10px;
|
||||
margin: 10px 0 10px 0;
|
||||
overflow: auto;
|
||||
font-family: "Andale Mono", monospace;
|
||||
}
|
||||
|
||||
pre.example {
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
table.index { border: 1px #00007f; }
|
||||
table.index td { text-align: left; vertical-align: top; }
|
||||
|
||||
#container {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
#product {
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#product big {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#main {
|
||||
background-color: #f0f0f0;
|
||||
border-left: 2px solid #cccccc;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
float: left;
|
||||
width: 14em;
|
||||
vertical-align: top;
|
||||
background-color: #f0f0f0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#navigation h2 {
|
||||
background-color:#e7e7e7;
|
||||
font-size:1.1em;
|
||||
color:#000000;
|
||||
text-align: left;
|
||||
padding:0.2em;
|
||||
border-top:1px solid #dddddd;
|
||||
border-bottom:1px solid #dddddd;
|
||||
}
|
||||
|
||||
#navigation ul
|
||||
{
|
||||
font-size:1em;
|
||||
list-style-type: none;
|
||||
margin: 1px 1px 10px 1px;
|
||||
}
|
||||
|
||||
#navigation li {
|
||||
text-indent: -1em;
|
||||
display: block;
|
||||
margin: 3px 0px 0px 22px;
|
||||
}
|
||||
|
||||
#navigation li li a {
|
||||
margin: 0px 3px 0px -1em;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin-left: 14em;
|
||||
padding: 1em;
|
||||
width: 700px;
|
||||
border-left: 2px solid #cccccc;
|
||||
border-right: 2px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#about {
|
||||
clear: both;
|
||||
padding: 5px;
|
||||
border-top: 2px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font: 12pt "Times New Roman", "TimeNR", Times, serif;
|
||||
}
|
||||
a { font-weight: bold; color: #004080; text-decoration: underline; }
|
||||
|
||||
#main {
|
||||
background-color: #ffffff;
|
||||
border-left: 0px;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin-left: 2%;
|
||||
margin-right: 2%;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 1em;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
display: none;
|
||||
}
|
||||
pre.example {
|
||||
font-family: "Andale Mono", monospace;
|
||||
font-size: 10pt;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
}
|
||||
|
||||
table.module_list {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.module_list td {
|
||||
border-width: 1px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
}
|
||||
table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
|
||||
table.module_list td.summary { width: 100%; }
|
||||
|
||||
|
||||
table.function_list {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.function_list td {
|
||||
border-width: 1px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
}
|
||||
table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
|
||||
table.function_list td.summary { width: 100%; }
|
||||
|
||||
ul.nowrap {
|
||||
overflow:auto;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
|
||||
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
|
||||
dl.table h3, dl.function h3 {font-size: .95em;}
|
||||
|
||||
/* stop sublists from having initial vertical space */
|
||||
ul ul { margin-top: 0px; }
|
||||
ol ul { margin-top: 0px; }
|
||||
ol ol { margin-top: 0px; }
|
||||
ul ol { margin-top: 0px; }
|
||||
|
||||
/* make the target distinct; helps when we're navigating to a function */
|
||||
a:target + * {
|
||||
background-color: #FF9;
|
||||
}
|
||||
|
||||
|
||||
/* styles for prettification of source */
|
||||
pre .comment { color: #558817; }
|
||||
pre .constant { color: #a8660d; }
|
||||
pre .escape { color: #844631; }
|
||||
pre .keyword { color: #aa5050; font-weight: bold; }
|
||||
pre .library { color: #0e7c6b; }
|
||||
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
|
||||
pre .string { color: #8080ff; }
|
||||
pre .number { color: #f8660d; }
|
||||
pre .operator { color: #2239a8; font-weight: bold; }
|
||||
pre .preprocessor, pre .prepro { color: #a33243; }
|
||||
pre .global { color: #800080; }
|
||||
pre .user-keyword { color: #800080; }
|
||||
pre .prompt { color: #558817; }
|
||||
pre .url { color: #272fc2; text-decoration: underline; }
|
||||
|
145
docs/doc/modules/add_child_org_consent.html
Normal file
145
docs/doc/modules/add_child_org_consent.html
Normal file
@ -0,0 +1,145 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><strong>add_child_org_consent</strong></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>add_child_org_consent</code></h1>
|
||||
<p>Adds a child org.</p>
|
||||
<p>
|
||||
Depends on `consent`</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate consent for new child org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#create_child_org">create_child_org ()</a></td>
|
||||
<td class="summary">Create a new child orgg</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate consent for new child org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "create_child_org"></a>
|
||||
<strong>create_child_org ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create a new child orgg
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
128
docs/doc/modules/change_modules.html
Normal file
128
docs/doc/modules/change_modules.html
Normal file
@ -0,0 +1,128 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><strong>change_modules</strong></li>
|
||||
<li><strong>change_modules</strong></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>change_modules</code></h1>
|
||||
<p>change_modules
|
||||
Depends on consent</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate change in modules.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate change in modules.
|
||||
Either adds or removes module depending on user input
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
150
docs/doc/modules/consent.html
Normal file
150
docs/doc/modules/consent.html
Normal file
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><strong>consent</strong></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>consent</code></h1>
|
||||
<p>A utility module for checking consent</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#callback">callback (member)</a></td>
|
||||
<td class="summary">Callback</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate consent
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "callback"></a>
|
||||
<strong>callback (member)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Callback
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">member</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
127
docs/doc/modules/create_token.html
Normal file
127
docs/doc/modules/create_token.html
Normal file
@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><strong>create_token</strong></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>create_token</code></h1>
|
||||
<p>Create token.</p>
|
||||
<p>
|
||||
Depends on tokenomics</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#create_toke:initiate">create_toke:initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "create_toke:initiate"></a>
|
||||
<strong>create_toke:initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
190
docs/doc/modules/defer_consent.html
Normal file
190
docs/doc/modules/defer_consent.html
Normal file
@ -0,0 +1,190 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><strong>defer_consent</strong></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>defer_consent</code></h1>
|
||||
<p>Defer consent</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#config">config</a></td>
|
||||
<td class="summary">Config for module</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.modules.defer_consent">modpol.modules.defer_consent</a></td>
|
||||
<td class="summary">(Required) Add to module table</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "config"></a>
|
||||
<strong>config</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Config for module
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">defer_org</span>
|
||||
Name or ID of target org
|
||||
</li>
|
||||
<li><span class="parameter">votes_required</span>
|
||||
Threshold passed on to `consent`
|
||||
</li>
|
||||
<li><span class="parameter">prompt</span>
|
||||
String passed on to `consent`
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.modules.defer_consent"></a>
|
||||
<strong>modpol.modules.defer_consent</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required) Add to module table
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/display_processes.html
Normal file
126
docs/doc/modules/display_processes.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><strong>display_processes</strong></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>display_processes</code></h1>
|
||||
<p>Display processes</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/join_org.html
Normal file
126
docs/doc/modules/join_org.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><strong>join_org</strong></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>join_org</code></h1>
|
||||
<p>Adds a user to org</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Adds the user to the org</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Adds the user to the org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
146
docs/doc/modules/join_org_consent.html
Normal file
146
docs/doc/modules/join_org_consent.html
Normal file
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><strong>join_org_consent</strong></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>join_org_consent</code></h1>
|
||||
<p>Join org (consent).</p>
|
||||
<p>
|
||||
A simple module that calls a consent process on an org to add a member.
|
||||
Depends on the Consent module.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate join org with consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#complete">complete ()</a></td>
|
||||
<td class="summary">Adds member to org, notifies org, and deletes process</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate join org with consent
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "complete"></a>
|
||||
<strong>complete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Adds member to org, notifies org, and deletes process
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/leave_org.html
Normal file
126
docs/doc/modules/leave_org.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><strong>leave_org</strong></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>leave_org</code></h1>
|
||||
<p>Removes initiator from org</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Removes user from org</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Removes user from org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/message_org.html
Normal file
126
docs/doc/modules/message_org.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><strong>message_org</strong></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>message_org</code></h1>
|
||||
<p>Messages all org members</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Allows user to send input message to all org members</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Allows user to send input message to all org members
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
434
docs/doc/modules/modpol.interactions.html
Normal file
434
docs/doc/modules/modpol.interactions.html
Normal file
@ -0,0 +1,434 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><strong>modpol.interactions</strong></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol.interactions</code></h1>
|
||||
<p>INTERACTIONS.LUA (CLI).</p>
|
||||
<p>
|
||||
User interaction functions for Modular Politics
|
||||
Called by modpol.lua</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.dashboard">modpol.interactions.dashboard (user)</a></td>
|
||||
<td class="summary">Output: Display a menu of commands to the user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.org_dashboard">modpol.interactions.org_dashboard (user, org_string)</a></td>
|
||||
<td class="summary">Output: Displays a menu of org-specific commands to the user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.user_dashboard">modpol.interactions.user_dashboard (viewer, user, completion)</a></td>
|
||||
<td class="summary">Function: modpol.interactions.user_dashboard
|
||||
Displays a dashboard about a particular user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.message">modpol.interactions.message (user, message)</a></td>
|
||||
<td class="summary">Prints message to CLI.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.message_user">modpol.interactions.message_user (sender, recipient)</a></td>
|
||||
<td class="summary">Gets and sends a message from one user to another</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.display">modpol.interactions.display (user, title, message, done)</a></td>
|
||||
<td class="summary">Displays complex data to a user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.text_query">modpol.interactions.text_query (User, Query, func)</a></td>
|
||||
<td class="summary">Applies "func" to user input.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.dropdown_query">modpol.interactions.dropdown_query (user, label, options, func)</a></td>
|
||||
<td class="summary">Output: Calls func on choice.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.checkbox_query">modpol.interactions.checkbox_query (user, label, options, func)</a></td>
|
||||
<td class="summary">Allows user to select from a set of options</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.binary_poll_user">modpol.interactions.binary_poll_user (user, question, func)</a></td>
|
||||
<td class="summary">Output: Applies "func" to user input.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.interactions.message_org">modpol.interactions.message_org (initiator, org, message)</a></td>
|
||||
<td class="summary">Output: broadcasts message to all org members</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.interactions.dashboard"></a>
|
||||
<strong>modpol.interactions.dashboard (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Output: Display a menu of commands to the user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.org_dashboard"></a>
|
||||
<strong>modpol.interactions.org_dashboard (user, org_string)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Output: Displays a menu of org-specific commands to the user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">org_string</span>
|
||||
(string or id)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.user_dashboard"></a>
|
||||
<strong>modpol.interactions.user_dashboard (viewer, user, completion)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Function: modpol.interactions.user_dashboard
|
||||
Displays a dashboard about a particular user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">viewer</span>
|
||||
Name of user viewing the dashboard (string)
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
Name of user being viewed (string)
|
||||
</li>
|
||||
<li><span class="parameter">completion</span>
|
||||
Optional function to call on Done button
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.message"></a>
|
||||
<strong>modpol.interactions.message (user, message)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Prints message to CLI.
|
||||
Buttons: message, done
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">message</span>
|
||||
(string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.message_user"></a>
|
||||
<strong>modpol.interactions.message_user (sender, recipient)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Gets and sends a message from one user to another
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">sender</span>
|
||||
Name of user sending (string)
|
||||
</li>
|
||||
<li><span class="parameter">recipient</span>
|
||||
Name of user receiving (string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.display"></a>
|
||||
<strong>modpol.interactions.display (user, title, message, done)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Displays complex data to a user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
Name of target user (string)
|
||||
</li>
|
||||
<li><span class="parameter">title</span>
|
||||
Title of display (string)
|
||||
</li>
|
||||
<li><span class="parameter">message</span>
|
||||
Content of message (string or table of strings)
|
||||
</li>
|
||||
<li><span class="parameter">done</span>
|
||||
Optional function for what happens when user is done
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.text_query"></a>
|
||||
<strong>modpol.interactions.text_query (User, Query, func)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Applies "func" to user input.
|
||||
Func input: user input (string)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">User</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">Query</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">func</span>
|
||||
(function)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.dropdown_query"></a>
|
||||
<strong>modpol.interactions.dropdown_query (user, label, options, func)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Output: Calls func on choice.
|
||||
Func input: choice (string)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">label</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">options</span>
|
||||
(table of strings)
|
||||
</li>
|
||||
<li><span class="parameter">func</span>
|
||||
(choice) (function)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.checkbox_query"></a>
|
||||
<strong>modpol.interactions.checkbox_query (user, label, options, func)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Allows user to select from a set of options
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
Name of user (string)
|
||||
</li>
|
||||
<li><span class="parameter">label</span>
|
||||
Query for user before options (string)
|
||||
</li>
|
||||
<li><span class="parameter">options</span>
|
||||
Table of options and their checked status in the form {{"option_1_string", true}, {"option_2_string", false}}
|
||||
</li>
|
||||
<li><span class="parameter">func</span>
|
||||
Function to be called with param "input", made up of the corrected table in the same format as the param options
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.binary_poll_user"></a>
|
||||
<strong>modpol.interactions.binary_poll_user (user, question, func)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Output: Applies "func" to user input.
|
||||
Func input: user input (string: y/n)
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">question</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">func</span>
|
||||
(function)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.interactions.message_org"></a>
|
||||
<strong>modpol.interactions.message_org (initiator, org, message)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Output: broadcasts message to all org members
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">initiator</span>
|
||||
(string)
|
||||
</li>
|
||||
<li><span class="parameter">org</span>
|
||||
(number or string)
|
||||
</li>
|
||||
<li><span class="parameter">message</span>
|
||||
(string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
476
docs/doc/modules/modpol.orgs.base.html
Normal file
476
docs/doc/modules/modpol.orgs.base.html
Normal file
@ -0,0 +1,476 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><strong>modpol.orgs.base</strong></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol.orgs.base</code></h1>
|
||||
<p>Basic function for orgs</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.get_org">modpol.orgs.get_org (arg)</a></td>
|
||||
<td class="summary">Return org when given its id or name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.list_all">modpol.orgs.list_all ()</a></td>
|
||||
<td class="summary">Return a table list of all org names</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.user_orgs">modpol.orgs.user_orgs (user)</a></td>
|
||||
<td class="summary">Return the orgs of a user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.reset">modpol.orgs.reset ()</a></td>
|
||||
<td class="summary">Deletes all orgs except for the</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.init_instance">modpol.orgs.init_instance ()</a></td>
|
||||
<td class="summary">Initializes the instance (root org)
|
||||
can only be run once, as only one instance can exist</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:record">modpol.orgs:record ()</a></td>
|
||||
<td class="summary">Records a log message to the modpol ledger</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:add_org">modpol.orgs:add_org (name, user)</a></td>
|
||||
<td class="summary">Adds a new sub org to the org it is called on.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:delete">modpol.orgs:delete ()</a></td>
|
||||
<td class="summary">Recursively deletes an org and its suborgs
|
||||
Leaves entry in modpol.orgs.array as a string "removed".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:get_member_index">modpol.orgs:get_member_index (member)</a></td>
|
||||
<td class="summary">Internal function to get the index of a member name</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:add_member">modpol.orgs:add_member (user)</a></td>
|
||||
<td class="summary">Adds a user to an org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:remove_member">modpol.orgs:remove_member (user)</a></td>
|
||||
<td class="summary">Removes a user from an org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:has_member">modpol.orgs:has_member (user)</a></td>
|
||||
<td class="summary">Boolean check whether user is an org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:list_members">modpol.orgs:list_members ()</a></td>
|
||||
<td class="summary"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:get_member_count">modpol.orgs:get_member_count ()</a></td>
|
||||
<td class="summary">Because member list uses lazy deletion, using #org.members will not show an accurate number</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:set_policy">modpol.orgs:set_policy (policy_type, process_type, must_be_member)</a></td>
|
||||
<td class="summary">Adds a new policy to the policy table.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.orgs.get_org"></a>
|
||||
<strong>modpol.orgs.get_org (arg)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return org when given its id or name
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">arg</span>
|
||||
string for name of org or id of org
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
org specified by id or name
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.list_all"></a>
|
||||
<strong>modpol.orgs.list_all ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return a table list of all org names
|
||||
|
||||
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
a table list of all org names
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.user_orgs"></a>
|
||||
<strong>modpol.orgs.user_orgs (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Return the orgs of a user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
string of user name
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
table of strings of org names
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.reset"></a>
|
||||
<strong>modpol.orgs.reset ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Deletes all orgs except for the
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.init_instance"></a>
|
||||
<strong>modpol.orgs.init_instance ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initializes the instance (root org)
|
||||
can only be run once, as only one instance can exist
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:record"></a>
|
||||
<strong>modpol.orgs:record ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Records a log message to the modpol ledger
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:add_org"></a>
|
||||
<strong>modpol.orgs:add_org (name, user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Adds a new sub org to the org it is called on.
|
||||
Ex: instance:add_org('town hall')
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">name</span>
|
||||
(string) name of new org
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
(string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
child org created
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:delete"></a>
|
||||
<strong>modpol.orgs:delete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Recursively deletes an org and its suborgs
|
||||
Leaves entry in modpol.orgs.array as a string "removed".
|
||||
Note: "reason" param was removed, can be added back
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:get_member_index"></a>
|
||||
<strong>modpol.orgs:get_member_index (member)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Internal function to get the index of a member name
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">member</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
index of given member
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:add_member"></a>
|
||||
<strong>modpol.orgs:add_member (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Adds a user to an org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:remove_member"></a>
|
||||
<strong>modpol.orgs:remove_member (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Removes a user from an org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:has_member"></a>
|
||||
<strong>modpol.orgs:has_member (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Boolean check whether user is an org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
true if user is in org, false if not
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:list_members"></a>
|
||||
<strong>modpol.orgs:list_members ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
a table of the names (string) of members
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:get_member_count"></a>
|
||||
<strong>modpol.orgs:get_member_count ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Because member list uses lazy deletion, using #org.members will not show an accurate number
|
||||
|
||||
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
numbers of members
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:set_policy"></a>
|
||||
<strong>modpol.orgs:set_policy (policy_type, process_type, must_be_member)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Adds a new policy to the policy table.
|
||||
Must define the policy type, process associated with it, and whether the request must be made by an org member
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">policy_type</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">process_type</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">must_be_member</span>
|
||||
Boolean
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
349
docs/doc/modules/modpol.orgs.process.html
Normal file
349
docs/doc/modules/modpol.orgs.process.html
Normal file
@ -0,0 +1,349 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><strong>modpol.orgs.process</strong></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol.orgs.process</code></h1>
|
||||
<p>Process functions for orgs</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.call_module">modpol.orgs.call_module (module_slug, intiator, config, result)</a></td>
|
||||
<td class="summary">Call modules</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.get_root_process">modpol.orgs.get_root_process (id)</a></td>
|
||||
<td class="summary">Get the root process of the given id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs.delete_process">modpol.orgs.delete_process (id)</a></td>
|
||||
<td class="summary">Delete the process given id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:delete_process_tree">modpol.orgs:delete_process_tree (id)</a></td>
|
||||
<td class="summary">Delete process tree by id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:add_pending_action">modpol.orgs:add_pending_action (process_id, user, callback)</a></td>
|
||||
<td class="summary">Add a new pending action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:remove_pending_action">modpol.orgs:remove_pending_action (process_id, user)</a></td>
|
||||
<td class="summary">Remove a pending action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:wipe_pending_actions">modpol.orgs:wipe_pending_actions (process_id)</a></td>
|
||||
<td class="summary">Wipe all pending actions for process</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:has_pending_actions">modpol.orgs:has_pending_actions (user)</a></td>
|
||||
<td class="summary">Check if there are pending actions for user</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.orgs:interact">modpol.orgs:interact (process_id, user)</a></td>
|
||||
<td class="summary">Interact a user with given process</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.orgs.call_module"></a>
|
||||
<strong>modpol.orgs.call_module (module_slug, intiator, config, result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Call modules
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">module_slug</span>
|
||||
Same as module name
|
||||
</li>
|
||||
<li><span class="parameter">intiator</span>
|
||||
Initiator for module
|
||||
</li>
|
||||
<li><span class="parameter">config</span>
|
||||
Config for module
|
||||
</li>
|
||||
<li><span class="parameter">result</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.get_root_process"></a>
|
||||
<strong>modpol.orgs.get_root_process (id)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get the root process of the given id
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">id</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
root process
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs.delete_process"></a>
|
||||
<strong>modpol.orgs.delete_process (id)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Delete the process given id
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">id</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:delete_process_tree"></a>
|
||||
<strong>modpol.orgs:delete_process_tree (id)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Delete process tree by id
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">id</span>
|
||||
Id of process tree
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:add_pending_action"></a>
|
||||
<strong>modpol.orgs:add_pending_action (process_id, user, callback)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Add a new pending action
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">process_id</span>
|
||||
Process id
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
User adding the action
|
||||
</li>
|
||||
<li><span class="parameter">callback</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:remove_pending_action"></a>
|
||||
<strong>modpol.orgs:remove_pending_action (process_id, user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove a pending action
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">process_id</span>
|
||||
Process id to be removed
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:wipe_pending_actions"></a>
|
||||
<strong>modpol.orgs:wipe_pending_actions (process_id)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Wipe all pending actions for process
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">process_id</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:has_pending_actions"></a>
|
||||
<strong>modpol.orgs:has_pending_actions (user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Check if there are pending actions for user
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">user</span>
|
||||
User
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
True if there are pending actions for a user, false if not
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.orgs:interact"></a>
|
||||
<strong>modpol.orgs:interact (process_id, user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Interact a user with given process
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">process_id</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
160
docs/doc/modules/modpol.util.misc.html
Normal file
160
docs/doc/modules/modpol.util.misc.html
Normal file
@ -0,0 +1,160 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><strong>modpol.util.misc</strong></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol.util.misc</code></h1>
|
||||
<p>Miscellaneous functions</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.util.copy_table">modpol.util.copy_table (t)</a></td>
|
||||
<td class="summary">Returns a copy of the table inputted</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.util.num_pairs">modpol.util.num_pairs (t)</a></td>
|
||||
<td class="summary">Returns the number of elements in a pairs table</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.util.copy_table"></a>
|
||||
<strong>modpol.util.copy_table (t)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns a copy of the table inputted
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">t</span>
|
||||
table to copy
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
copy of table
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "modpol.util.num_pairs"></a>
|
||||
<strong>modpol.util.num_pairs (t)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns the number of elements in a pairs table
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">t</span>
|
||||
pairs table
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
number of elements in pairs table
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
91
docs/doc/modules/modpol_minetest.api.html
Normal file
91
docs/doc/modules/modpol_minetest.api.html
Normal file
@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><strong>modpol_minetest.api</strong></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol_minetest.api</code></h1>
|
||||
<p>Script for loading Minetest files</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
93
docs/doc/modules/modpol_minetest.overrides.interactions.html
Normal file
93
docs/doc/modules/modpol_minetest.overrides.interactions.html
Normal file
@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><strong>modpol_minetest.overrides.interactions</strong></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>modpol_minetest.overrides.interactions</code></h1>
|
||||
<p>INTERACTIONS.LUA (for Minetest)
|
||||
CONTEXTUAL STUFF
|
||||
================</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
223
docs/doc/modules/module_template.html
Normal file
223
docs/doc/modules/module_template.html
Normal file
@ -0,0 +1,223 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
<li><a href="#Fields">Fields</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><strong>module_template</strong></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>module_template</code></h1>
|
||||
<p>Template for module writers.</p>
|
||||
<p>
|
||||
Short description goes here.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">(Required): Initiate function
|
||||
Modules have access to the following instance variables:
|
||||
<li><code>self.org</code> (the org the module was called in),</li>
|
||||
<li><code>self.initiator</code> (the user that callced the module),</li>
|
||||
<li><code>self.id</code> (the process id of the module instance)</li></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#data">data</a></td>
|
||||
<td class="summary">(Required) Data for module
|
||||
Variables that module uses during the course of a process.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#config">config</a></td>
|
||||
<td class="summary">(Required): Config for module
|
||||
Defines the input parameters to the module initiate function.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#modpol.modules.module_template">modpol.modules.module_template</a></td>
|
||||
<td class="summary">(Required) Add to module table</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required): Initiate function
|
||||
Modules have access to the following instance variables:
|
||||
<li><code>self.org</code> (the org the module was called in),</li>
|
||||
<li><code>self.initiator</code> (the user that callced the module),</li>
|
||||
<li><code>self.id</code> (the process id of the module instance)</li>
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
(optional) Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "data"></a>
|
||||
<strong>data</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required) Data for module
|
||||
Variables that module uses during the course of a process.
|
||||
Can be blank
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "config"></a>
|
||||
<strong>config</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required): Config for module
|
||||
Defines the input parameters to the module initiate function.
|
||||
Can be blank
|
||||
When calling a module from within another module,
|
||||
variables not defined in config will be ignored.
|
||||
Default values set in config can be overridden
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">field_1</span>
|
||||
ex: votes_required, default = 5
|
||||
</li>
|
||||
<li><span class="parameter">field_2</span>
|
||||
ex: voting_type, default = "majority"
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "modpol.modules.module_template"></a>
|
||||
<strong>modpol.modules.module_template</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required) Add to module table
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
127
docs/doc/modules/priv_to_org.html
Normal file
127
docs/doc/modules/priv_to_org.html
Normal file
@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><strong>priv_to_org</strong></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>priv_to_org</code></h1>
|
||||
<p>Set privilege to org members
|
||||
Allows initiator to grant a priv they have to all members of an org</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
144
docs/doc/modules/randomizer.html
Normal file
144
docs/doc/modules/randomizer.html
Normal file
@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><strong>randomizer</strong></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>randomizer</code></h1>
|
||||
<p>A utility module that outputs a random result from a set of options</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#random_loop">random_loop ()</a></td>
|
||||
<td class="summary">Returns result_table</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "random_loop"></a>
|
||||
<strong>random_loop ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns result_table
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
146
docs/doc/modules/remove_child_consent.html
Normal file
146
docs/doc/modules/remove_child_consent.html
Normal file
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><strong>remove_child_consent</strong></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>remove_child_consent</code></h1>
|
||||
<p>Remove child (consent).</p>
|
||||
<p>
|
||||
A simple module that calls a consent process on an org to remove its child.
|
||||
Depends on the Consent module.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Removes a child org with consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#complete">complete ()</a></td>
|
||||
<td class="summary">Complete the remove process</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Removes a child org with consent
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "complete"></a>
|
||||
<strong>complete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Complete the remove process
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
144
docs/doc/modules/remove_member_consent.html
Normal file
144
docs/doc/modules/remove_member_consent.html
Normal file
@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><strong>remove_member_consent</strong></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>remove_member_consent</code></h1>
|
||||
<p>Calls consent to remove member from org</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Removes given member from org</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#complete">complete ()</a></td>
|
||||
<td class="summary">Complete after consent</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Removes given member from org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "complete"></a>
|
||||
<strong>complete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Complete after consent
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/remove_org.html
Normal file
126
docs/doc/modules/remove_org.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><strong>remove_org</strong></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>remove_org</code></h1>
|
||||
<p>A simple module that removes an org.</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Removes org</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Removes org
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
146
docs/doc/modules/remove_org_consent.html
Normal file
146
docs/doc/modules/remove_org_consent.html
Normal file
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><strong>remove_org_consent</strong></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>remove_org_consent</code></h1>
|
||||
<p>Remove org (consent)
|
||||
A simple module that calls a consent process on an org to remove it.</p>
|
||||
<p>
|
||||
Depends on the Consent module.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Remove org if all members consent</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#complete">complete ()</a></td>
|
||||
<td class="summary">Complete after consent</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove org if all members consent
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "complete"></a>
|
||||
<strong>complete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Complete after consent
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
126
docs/doc/modules/remove_process.html
Normal file
126
docs/doc/modules/remove_process.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><strong>remove_process</strong></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>remove_process</code></h1>
|
||||
<p>Remove a process</p>
|
||||
<p></p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
146
docs/doc/modules/rename_org_consent.html
Normal file
146
docs/doc/modules/rename_org_consent.html
Normal file
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><strong>rename_org_consent</strong></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>rename_org_consent</code></h1>
|
||||
<p>Rename org (consent)
|
||||
A simple module that calls a consent process on an org to rename it.</p>
|
||||
<p>
|
||||
Depends on the Consent module.</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Renames the org after consent is reached</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#complete">complete ()</a></td>
|
||||
<td class="summary">Changes the name of the org after consent is reached</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Renames the org after consent is reached
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "complete"></a>
|
||||
<strong>complete ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Changes the name of the org after consent is reached
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
157
docs/doc/modules/send_token.html
Normal file
157
docs/doc/modules/send_token.html
Normal file
@ -0,0 +1,157 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><strong>send_token</strong></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><a href="../modules/tokenomics.html">tokenomics</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>send_token</code></h1>
|
||||
<p>Send token.</p>
|
||||
<p>
|
||||
Depends on tokenomics</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">initiate function</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#data">data</a></td>
|
||||
<td class="summary">(Required) Data for module
|
||||
Variables that module uses during the course of a process
|
||||
Can be blank</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
initiate function
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "data"></a>
|
||||
<strong>data</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(Required) Data for module
|
||||
Variables that module uses during the course of a process
|
||||
Can be blank
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
357
docs/doc/modules/tokenomics.html
Normal file
357
docs/doc/modules/tokenomics.html
Normal file
@ -0,0 +1,357 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>Reference</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="container">
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo"></div>
|
||||
<div id="product_name"><big><b></b></big></div>
|
||||
<div id="product_description"></div>
|
||||
</div> <!-- id="product" -->
|
||||
|
||||
|
||||
<div id="main">
|
||||
|
||||
|
||||
<!-- Menu -->
|
||||
|
||||
<div id="navigation">
|
||||
<br/>
|
||||
<h1>Modpol</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">Index</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/create_token.html">create_token</a></li>
|
||||
<li><a href="../modules/defer_consent.html">defer_consent</a></li>
|
||||
<li><a href="../modules/display_processes.html">display_processes</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/randomizer.html">randomizer</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/remove_process.html">remove_process</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/send_token.html">send_token</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
<li><strong>tokenomics</strong></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
<li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1>Module <code>tokenomics</code></h1>
|
||||
<p>Tokenomics.</p>
|
||||
<p>
|
||||
Depends on consent</p>
|
||||
|
||||
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
|
||||
<td class="summary">Initiate function: creates a token in an org.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#create_token">create_token ()</a></td>
|
||||
<td class="summary">Create token</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#balance">balance (org, token, user)</a></td>
|
||||
<td class="summary">Returns balance.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#change_balance">change_balance (org, token, user, amount)</a></td>
|
||||
<td class="summary">Change balance</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#transfer">transfer (org, token, sender, recipient, amount)</a></td>
|
||||
<td class="summary">Transfer tokens from a sender to recipient</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#treasury_transfer">treasury_transfer (org, token, recipient, amount)</a></td>
|
||||
<td class="summary">Transfer from treasury</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#issue">issue (org, token, amount)</a></td>
|
||||
<td class="summary">Creates new tokens in the org treasury</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#config">config</a></td>
|
||||
<td class="summary">Config for module</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "initiate"></a>
|
||||
<strong>initiate (result)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Initiate function: creates a token in an org.
|
||||
Set up the token data structure.
|
||||
Create an org treasury
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">result</span>
|
||||
(optional) Callback if this module is embedded in other modules
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "create_token"></a>
|
||||
<strong>create_token ()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create token
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "balance"></a>
|
||||
<strong>balance (org, token, user)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Returns balance.
|
||||
If no user, get treasury balance
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">org</span>
|
||||
Name (string) or id (num)
|
||||
</li>
|
||||
<li><span class="parameter">token</span>
|
||||
Slug (string)
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
Name (string)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "change_balance"></a>
|
||||
<strong>change_balance (org, token, user, amount)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Change balance
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">org</span>
|
||||
Org name (string) or id (number)
|
||||
</li>
|
||||
<li><span class="parameter">token</span>
|
||||
Token slug (string)
|
||||
</li>
|
||||
<li><span class="parameter">user</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">amount</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "transfer"></a>
|
||||
<strong>transfer (org, token, sender, recipient, amount)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Transfer tokens from a sender to recipient
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">org</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">token</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">sender</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">recipient</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">amount</span>
|
||||
Positive number
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "treasury_transfer"></a>
|
||||
<strong>treasury_transfer (org, token, recipient, amount)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Transfer from treasury
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">org</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">token</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">recipient</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">amount</span>
|
||||
Can be positive or negative, assumes flow from treasury to recipient
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "issue"></a>
|
||||
<strong>issue (org, token, amount)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Creates new tokens in the org treasury
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">org</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">token</span>
|
||||
|
||||
</li>
|
||||
<li><span class="parameter">amount</span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "config"></a>
|
||||
<strong>config</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Config for module
|
||||
|
||||
|
||||
<h3>Fields:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">consent</span>
|
||||
Require consent to create?
|
||||
</li>
|
||||
<li><span class="parameter">token_variables</span>
|
||||
the data that goes into the token
|
||||
</li>
|
||||
<li><span class="parameter">token_slug</span>
|
||||
A no-spaces slug for the token
|
||||
</li>
|
||||
<li><span class="parameter">initial_treasury</span>
|
||||
Quantity in org treasury
|
||||
</li>
|
||||
<li><span class="parameter">negative_spend</span>
|
||||
Boolean: can users spend negative tokens? (for mutual credit)
|
||||
</li>
|
||||
<li><span class="parameter">balances</span>
|
||||
Table of user balances
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
</html>
|
63
docs/headers_template.html
Normal file
63
docs/headers_template.html
Normal file
@ -0,0 +1,63 @@
|
||||
<h2>Basic Functions</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Core Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="modules/consent.html">consent</a></li>
|
||||
<li><a href="modules/join_org.html">join_org</a></li>
|
||||
<li><a href="modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="modules/message_org.html">message_org</a></li>
|
||||
<li><a href="modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="modules/module_template.html">module_template</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Minetest Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="modules/priv_to_org.html">priv_to_org</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Basic Functions</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
|
||||
<li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
|
||||
<li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
|
||||
<li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
|
||||
<li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Core Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
|
||||
<li><a href="../modules/change_modules.html">change_modules</a></li>
|
||||
<li><a href="../modules/consent.html">consent</a></li>
|
||||
<li><a href="../modules/join_org.html">join_org</a></li>
|
||||
<li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
|
||||
<li><a href="../modules/leave_org.html">leave_org</a></li>
|
||||
<li><a href="../modules/message_org.html">message_org</a></li>
|
||||
<li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
|
||||
<li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
|
||||
<li><a href="../modules/remove_org.html">remove_org</a></li>
|
||||
<li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
|
||||
<li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
|
||||
<li><a href="../modules/module_template.html">module_template</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Minetest Modules</h2>
|
||||
<ul class="nowrap">
|
||||
<li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
|
||||
</ul>
|
BIN
lib/module_list.png
Normal file
BIN
lib/module_list.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
9
mod.conf
9
mod.conf
@ -1,8 +1,7 @@
|
||||
name = modpol
|
||||
title = Modular Politics
|
||||
title = Modpol
|
||||
author = ntnsndr <n@nathanschneider.info>
|
||||
description = A governance layer framework in Lua
|
||||
license = Hippocratic License
|
||||
forum = TBA
|
||||
description = A framework that enables diverse governance processes
|
||||
license = MIT
|
||||
forum = https://forum.minetest.net/viewtopic.php?f=9&t=27598
|
||||
version = 0.1
|
||||
release = 0
|
||||
|
@ -5,19 +5,34 @@ local localdir = modpol.topdir
|
||||
--orgs
|
||||
dofile (localdir .. "/orgs/base.lua")
|
||||
dofile (localdir .. "/orgs/process.lua")
|
||||
dofile (localdir .. "/orgs/users.lua")
|
||||
|
||||
--interactions
|
||||
dofile (localdir .. "/interactions/interactions.lua")
|
||||
|
||||
--modules
|
||||
--TODO make this automatic and directory-based
|
||||
dofile (localdir .. "/modules/add_child_org_consent.lua")
|
||||
dofile (localdir .. "/modules/change_modules.lua")
|
||||
dofile (localdir .. "/modules/consent.lua")
|
||||
dofile (localdir .. "/modules/join_org_consent.lua")
|
||||
dofile (localdir .. "/modules/leave_org.lua")
|
||||
dofile (localdir .. "/modules/remove_child_consent.lua")
|
||||
dofile (localdir .. "/modules/remove_member_consent.lua")
|
||||
dofile (localdir .. "/modules/remove_org_consent.lua")
|
||||
dofile (localdir .. "/modules/remove_org.lua")
|
||||
dofile (localdir .. "/modules/rename_org_consent.lua")
|
||||
dofile (localdir .. "/storage/store-modules.lua")
|
||||
modpol.load_modules(localdir .. "/modules")
|
||||
|
||||
-- dofile (localdir .. "/modules/add_child_org_consent.lua")
|
||||
-- dofile (localdir .. "/modules/add_child_org.lua")
|
||||
-- dofile (localdir .. "/modules/change_modules.lua")
|
||||
-- dofile (localdir .. "/modules/change_policy.lua")
|
||||
-- dofile (localdir .. "/modules/consent.lua")
|
||||
-- dofile (localdir .. "/modules/create_token.lua")
|
||||
-- dofile (localdir .. "/modules/defer_consent.lua")
|
||||
-- dofile (localdir .. "/modules/display_policies.lua")
|
||||
-- dofile (localdir .. "/modules/display_processes.lua")
|
||||
-- dofile (localdir .. "/modules/join_org_consent.lua")
|
||||
-- dofile (localdir .. "/modules/leave_org.lua")
|
||||
-- dofile (localdir .. "/modules/message_org.lua")
|
||||
-- dofile (localdir .. "/modules/randomizer.lua")
|
||||
-- dofile (localdir .. "/modules/remove_child_consent.lua")
|
||||
-- dofile (localdir .. "/modules/remove_member_consent.lua")
|
||||
-- dofile (localdir .. "/modules/remove_org_consent.lua")
|
||||
-- dofile (localdir .. "/modules/remove_org.lua")
|
||||
-- dofile (localdir .. "/modules/remove_process.lua")
|
||||
-- dofile (localdir .. "/modules/rename_org_consent.lua")
|
||||
-- dofile (localdir .. "/modules/send_token.lua")
|
||||
-- dofile (localdir .. "/modules/tokenomics.lua")
|
||||
|
@ -1,18 +1,50 @@
|
||||
-- INTERACTIONS.LUA (CLI)
|
||||
|
||||
--- INTERACTIONS.LUA (CLI).
|
||||
-- User interaction functions for Modular Politics
|
||||
-- Called by modpol.lua
|
||||
-- @module modpol.interactions
|
||||
|
||||
modpol.interactions = {}
|
||||
|
||||
-- UTILITIES
|
||||
-- =========
|
||||
|
||||
--- Output: returns a string listing a module's policies
|
||||
-- @function modpol.interactions.get_policy_string
|
||||
-- @param org (string or number) name or id for the org
|
||||
-- @param module_slug (string)
|
||||
-- @param sep (string) separator string
|
||||
function modpol.interactions.get_policy_string(
|
||||
org, module_slug, sep)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
local this_module = modpol.modules[module_slug]
|
||||
local output = {}
|
||||
if not this_org.policies[module_slug] then
|
||||
return "Module not in org"
|
||||
elseif modpol.util.num_pairs(this_module.config) > 0 then
|
||||
for k, v in pairs(this_module.config) do
|
||||
local this_policy = "[Policy error]"
|
||||
if this_org.policies[module_slug][k] then
|
||||
this_policy =
|
||||
tostring(this_org.policies[module_slug][k])
|
||||
else
|
||||
this_policy = tostring(v)
|
||||
end
|
||||
table.insert(output, k.." - "..this_policy)
|
||||
end
|
||||
return "Policies:\n" .. table.concat(output, sep)
|
||||
else
|
||||
return "No policies"
|
||||
end
|
||||
end
|
||||
|
||||
-- DASHBOARDS
|
||||
-- ==========
|
||||
|
||||
-- Function: modpol.interactions.dashboard(user)
|
||||
-- Params: user (string)
|
||||
--- Output: Display a menu of commands to the user
|
||||
-- @function modpol.interactions.dashboard
|
||||
-- @param user (string)
|
||||
|
||||
-- Q: Should this return a menu of commands relevant to the specific user?
|
||||
-- Output: Displays a menu of commands to the user
|
||||
-- TKTK currently just prints all of modpol---needs major improvement
|
||||
function modpol.interactions.dashboard(user)
|
||||
-- adds user to root org if not already in it
|
||||
@ -22,6 +54,7 @@ function modpol.interactions.dashboard(user)
|
||||
|
||||
local all_users = modpol.instance:list_members()
|
||||
|
||||
print('\n-=< MODPOL DASHBOARD >=-')
|
||||
print('All orgs: (user orgs indicated by *)')
|
||||
for id, org in ipairs(modpol.orgs.array) do
|
||||
if type(org) == "table" then
|
||||
@ -31,25 +64,74 @@ function modpol.interactions.dashboard(user)
|
||||
end
|
||||
end
|
||||
|
||||
-- pending list
|
||||
local user_pending = {}
|
||||
local user_pending_count = 0
|
||||
for k,v in ipairs(modpol.orgs.array) do
|
||||
if v.pending and v.pending[user] then
|
||||
if modpol.util.num_pairs(v.pending[user]) ~= 0 then
|
||||
table.insert(user_pending, v.name)
|
||||
user_pending_count = user_pending_count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print('Pending actions in: '..table.concat(user_pending,', '))
|
||||
|
||||
print('All users: ' .. table.concat(all_users, ', '))
|
||||
print()
|
||||
|
||||
print('Access which org id?')
|
||||
local sel = io.read()
|
||||
print()
|
||||
print("Commands: (O)rg, (U)ser, (R)eset, (Q)uit")
|
||||
|
||||
local sel = io.read()
|
||||
|
||||
if sel == "O" or sel == "o" then
|
||||
print('Access which org id?')
|
||||
sel = io.read()
|
||||
print()
|
||||
if modpol.orgs.array[tonumber(sel)] then
|
||||
local sel_org = modpol.orgs.array[tonumber(sel)].name
|
||||
modpol.interactions.org_dashboard(user, sel_org)
|
||||
else
|
||||
print("Org id not found.")
|
||||
print("Org id not found")
|
||||
modpol.interactions.dashboard(user)
|
||||
end
|
||||
|
||||
elseif sel == "U" or sel == "u" then
|
||||
print("Access which user?")
|
||||
sel = io.read()
|
||||
print()
|
||||
if modpol.instance:has_member(sel) then
|
||||
modpol.interactions.user_dashboard(
|
||||
user, sel,
|
||||
function()
|
||||
modpol.interactions.dashboard(user)
|
||||
end
|
||||
)
|
||||
else
|
||||
print("User name not found")
|
||||
modpol.interactions.dashboard(user)
|
||||
end
|
||||
|
||||
elseif sel == "R" or sel == "r" then
|
||||
modpol.instance.members = {}
|
||||
modpol.orgs.reset()
|
||||
print("Orgs and users reset")
|
||||
modpol.interactions.dashboard(user)
|
||||
|
||||
elseif sel == "Q" or "q" then
|
||||
return
|
||||
|
||||
else
|
||||
print("Invalid input, try again")
|
||||
modpol.interactions.dashboard(user)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Function: modpol.interactions.org_dashboard
|
||||
-- Params: user (string), org_string (string or id)
|
||||
-- Output: Displays a menu of org-specific commands to the user
|
||||
--- Output: Displays a menu of org-specific commands to the user
|
||||
-- @function modpol.interactions.org_dashboard
|
||||
-- @param user (string)
|
||||
-- @param org_string (string or id)
|
||||
function modpol.interactions.org_dashboard(user, org_string)
|
||||
local org = modpol.orgs.get_org(org_string)
|
||||
if not org then return nil end
|
||||
@ -69,31 +151,38 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
table.insert(children, this_child.name)
|
||||
end
|
||||
|
||||
-- list available modules
|
||||
local org_modules = {}
|
||||
for k,v in pairs(org.modules) do
|
||||
if not v.hide then
|
||||
table.insert(org_modules, v.slug)
|
||||
-- prepare modules menu
|
||||
local modules = {}
|
||||
if modpol.modules then
|
||||
for k,v in pairs(modpol.modules) do
|
||||
if not v.hide and -- hide utility modules
|
||||
org.policies[k] then -- org includes it
|
||||
local module_entry = v.slug
|
||||
table.insert(modules, module_entry)
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(modules)
|
||||
|
||||
-- list pending
|
||||
local process_msg = #org.processes .. " total processes"
|
||||
if org.pending[user] then
|
||||
process_msg = process_msg .. " (" .. #org.pending[user] .. " pending)"
|
||||
process_msg = process_msg .. " (" ..
|
||||
modpol.util.num_pairs(org.pending[user]) .. " pending)"
|
||||
else
|
||||
process_msg = process_msg .. " (0 pending)"
|
||||
end
|
||||
|
||||
-- set up output
|
||||
print('\n-=< ORG DASHBOARD >=-')
|
||||
print("Org: " .. org.name)
|
||||
print("Parent: " .. parent)
|
||||
print("Members: " .. table.concat(org.members, ", "))
|
||||
print("Children: " .. table.concat(children, ", "))
|
||||
print("Modules: " .. table.concat(org_modules, ", "))
|
||||
print("Child orgs: " .. table.concat(children, ", "))
|
||||
print("Modules: " .. table.concat(modules, ", "))
|
||||
print("Pending: " .. process_msg)
|
||||
print()
|
||||
print("Commands: (M)odules, (P)ending")
|
||||
print("Commands: (M)odules, (P)ending, (B)ack")
|
||||
|
||||
local sel = io.read()
|
||||
print()
|
||||
@ -103,72 +192,182 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
local module_sel = io.read()
|
||||
print()
|
||||
local module_result = false
|
||||
for k,v in ipairs(org_modules) do
|
||||
for k,v in ipairs(modules) do
|
||||
if v == module_sel then
|
||||
module_result = true
|
||||
end
|
||||
end
|
||||
local module = modpol.modules[module_sel]
|
||||
if module_result then
|
||||
modpol.interactions.binary_poll_user(
|
||||
user,
|
||||
module.name..":\n"..
|
||||
module.desc.."\n"..
|
||||
modpol.interactions.get_policy_string(
|
||||
org.name, module.slug, "\n")..
|
||||
"\n".."Proceed?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
org:call_module(module_sel, user)
|
||||
elseif input == "No" then
|
||||
modpol.interactions.org_dashboard(
|
||||
pname, org.id)
|
||||
end
|
||||
end)
|
||||
else
|
||||
print("Error: Module not found.")
|
||||
modpol.interactions.org_dashboard(user, org.id)
|
||||
end
|
||||
|
||||
elseif sel == 'a' or sel == 'A' then
|
||||
elseif sel == 'p' or sel == 'P' then
|
||||
local processes = {}
|
||||
print("All processes: (* indicates pending)")
|
||||
for k,v in ipairs(org.processes) do
|
||||
for i,v in ipairs(org.processes) do
|
||||
if v ~= "deleted" then
|
||||
local active = ''
|
||||
if org.pending[user] then
|
||||
if org.pending[user][v.id] then
|
||||
active = '*'
|
||||
end
|
||||
end
|
||||
print("["..v.id.."] "..v.slug..active)
|
||||
end
|
||||
end
|
||||
print()
|
||||
print("Interact with which one?")
|
||||
print("Interact with which one (use [id] number)?")
|
||||
local to_interact = io.read()
|
||||
local process = org.processes[tonumber(to_interact)]
|
||||
if not process then return end
|
||||
if not process then
|
||||
modpol.interactions.message(
|
||||
user, "Not a pending process")
|
||||
modpol.interactions.org_dashboard(user, org.id)
|
||||
return
|
||||
end
|
||||
if org:has_pending_actions(user) then
|
||||
if org.pending[user][process.id] then
|
||||
org:interact(process.id, user)
|
||||
end
|
||||
end
|
||||
elseif sel == 'b' or sel == 'B' then
|
||||
modpol.interactions.dashboard(user)
|
||||
else
|
||||
print("Command not found")
|
||||
modpol.interactions.org_dashboard(user, org.name)
|
||||
end
|
||||
end
|
||||
|
||||
-- Function: modpol.interactions.policy_dashboard
|
||||
-- input: user (string), org_id (int), policy (string)
|
||||
-- if policy is nil, enables creating a new policy
|
||||
-- output: opens a dashboard for viewing/editing policy details
|
||||
-- TODO
|
||||
--- Function: modpol.interactions.user_dashboard
|
||||
-- Displays a dashboard about a particular user
|
||||
-- @param viewer Name of user viewing the dashboard (string)
|
||||
-- @param user Name of user being viewed (string)
|
||||
-- @param completion Optional function to call on Done button
|
||||
function modpol.interactions.user_dashboard(viewer, user, completion)
|
||||
local user_orgs = {}
|
||||
local user_modules = {}
|
||||
|
||||
print("\n-=< USER DASHBOARD: "..user.." >=-")
|
||||
print("User's orgs:")
|
||||
for id, org in ipairs(modpol.orgs.array) do
|
||||
if type(org) == "table" then
|
||||
if org:has_member(user) then
|
||||
print(org.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print()
|
||||
print("Commands: (M)essage user, Enter when done")
|
||||
local sel = io.read()
|
||||
|
||||
if sel == "M" or sel == "m" then
|
||||
modpol.interactions.message_user(
|
||||
viewer, user)
|
||||
completion()
|
||||
else
|
||||
completion()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Function: modpol.interactions.message
|
||||
-- input: user (string), message (string)
|
||||
-- output: prints message to CLI
|
||||
|
||||
|
||||
-- INTERACTION PRIMITIVES
|
||||
-- ======================
|
||||
|
||||
--- Prints message to CLI.
|
||||
-- Buttons: message, done
|
||||
-- @function modpol.interactions.message
|
||||
-- @param user (string)
|
||||
-- @param message (string)
|
||||
function modpol.interactions.message(user, message)
|
||||
print(user .. ": " .. message)
|
||||
end
|
||||
|
||||
-- Function: modpol.interactions.text_query
|
||||
-- input: User (string), Query (string), func (function)
|
||||
-- func input: user input (string)
|
||||
-- output: Applies "func" to user input
|
||||
--- Gets and sends a message from one user to another
|
||||
-- @function modpol.interactions.message_user
|
||||
-- @param sender Name of user sending (string)
|
||||
-- @param recipient Name of user receiving (string)
|
||||
function modpol.interactions.message_user(sender, recipient)
|
||||
print("Enter your message for "..recipient..":")
|
||||
local sel = io.read()
|
||||
modpol.interactions.message(
|
||||
recipient,
|
||||
sel.." [from "..sender.."]")
|
||||
end
|
||||
|
||||
|
||||
--- Displays complex data to a user
|
||||
-- @function modpol.interactions.display
|
||||
-- @param user Name of target user (string)
|
||||
-- @param title Title of display (string)
|
||||
-- @param message Content of message (string or table of strings)
|
||||
-- @param done Optional function for what happens when user is done
|
||||
function modpol.interactions.display(user, title, message, completion)
|
||||
local output = ""
|
||||
output = "\n-=< "..title.." >=-\n\n"
|
||||
if type(message) == "table" then
|
||||
output = table.concat(message,"\n")
|
||||
elseif type(message) == "string" then
|
||||
output = message
|
||||
elseif type(message) == "number" then
|
||||
output = message
|
||||
else
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Error: message not typed for display")
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Error: input not typed for display")
|
||||
if completion then completion() else
|
||||
modpol.intereactions.dashboard(user)
|
||||
end
|
||||
end
|
||||
print(message)
|
||||
print("\nEnter to continue")
|
||||
io.read()
|
||||
if completion then completion() else
|
||||
modpol.intereactions.dashboard(user)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Applies "func" to user input.
|
||||
-- Func input: user input (string)
|
||||
-- @function modpol.interactions.text_query
|
||||
-- @param User (string)
|
||||
-- @param Query (string)
|
||||
-- @param func (function)
|
||||
function modpol.interactions.text_query(user, query, func)
|
||||
print(user .. ": " .. query)
|
||||
answer = io.read()
|
||||
func(answer)
|
||||
end
|
||||
|
||||
-- Function: dropdown_query
|
||||
-- input: user (string), label (string), options (table of strings), func(choice) (function)
|
||||
-- func input: choice (string)
|
||||
-- output: calls func on choice
|
||||
--- Output: Calls func on choice.
|
||||
-- Func input: choice (string)
|
||||
-- @function modpol.interactions.dropdown_query
|
||||
-- @param user (string)
|
||||
-- @param label (string)
|
||||
-- @param options (table of strings)
|
||||
-- @param func (choice) (function)
|
||||
function modpol.interactions.dropdown_query(user, label, options, func)
|
||||
-- set up options
|
||||
local options_display = ""
|
||||
@ -204,10 +403,62 @@ function modpol.interactions.dropdown_query(user, label, options, func)
|
||||
end
|
||||
end
|
||||
|
||||
-- Function: modpol.binary_poll_user(user, question)
|
||||
-- Params: user (string), question (string), func (function)
|
||||
-- func input: user input (string: y/n)
|
||||
-- Output: Applies "func" to user input
|
||||
|
||||
--- Allows user to select from a set of options
|
||||
-- @function modpol.interactions.checkbox_query
|
||||
-- @param user Name of user (string)
|
||||
-- @param label Query for user before options (string)
|
||||
-- @param options Table of options and their checked status in the form {{"option_1_string", true}, {"option_2_string", false}}
|
||||
-- @param func Function to be called with param "input", made up of the corrected table in the same format as the param options
|
||||
function modpol.interactions.checkbox_query(
|
||||
user, label, options, func)
|
||||
-- set up options
|
||||
local options_display = ""
|
||||
local options_number = 0
|
||||
for i,v in ipairs(options) do
|
||||
local checked = false
|
||||
if v[2] then checked = true end
|
||||
if checked then
|
||||
checked = "x"
|
||||
else
|
||||
checked = " "
|
||||
end
|
||||
options_display = options_display..i..". ["..
|
||||
checked.."] "..v[1].."\n"
|
||||
options_number = options_number + 1
|
||||
end
|
||||
if options_number == 0 then
|
||||
print("Error: No options given for dropdown")
|
||||
return nil
|
||||
end
|
||||
options_display = options_display..
|
||||
"List comma-separated options to flip (e.g., 1,2,5):"
|
||||
-- begin displaying
|
||||
print(user .. ": " .. label)
|
||||
print(options_display)
|
||||
-- read input and produce output
|
||||
local answer = io.read()
|
||||
local answer_table = {}
|
||||
for match in (answer..","):gmatch("(.-)"..",") do
|
||||
table.insert(answer_table, tonumber(match))
|
||||
end
|
||||
local result_table = modpol.util.copy_table(options)
|
||||
for i,v in ipairs(answer_table) do
|
||||
if result_table[v] then
|
||||
-- flip the boolean on selected options
|
||||
result_table[v][2] = not result_table[v][2]
|
||||
end
|
||||
end
|
||||
func(result_table)
|
||||
end
|
||||
|
||||
|
||||
--- Output: Applies "func" to user input.
|
||||
-- Func input: user input (string: y/n)
|
||||
-- @function modpol.interactions.binary_poll_user
|
||||
-- @param user (string)
|
||||
-- @param question (string)
|
||||
-- @param func (function)
|
||||
function modpol.interactions.binary_poll_user(user, question, func)
|
||||
local query = "Poll for " .. user .. " (y/n): ".. question
|
||||
local answer
|
||||
@ -229,9 +480,11 @@ end
|
||||
-- COMPLEX INTERACTIONS
|
||||
-- ====================
|
||||
|
||||
-- Function: modpol.interactions.message_org
|
||||
-- input: initiator (string), org (number or string), message (string)
|
||||
-- output: broadcasts message to all org members
|
||||
--- Output: broadcasts message to all org members
|
||||
-- @function modpol.interactions.message_org
|
||||
-- @param initiator (string)
|
||||
-- @param org (number or string)
|
||||
-- @param message (string)
|
||||
function modpol.interactions.message_org(initiator, org, message)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
local users = this_org:list_members()
|
||||
@ -245,3 +498,9 @@ end
|
||||
-- output: gets question from initiator, asks all org members, broadcasts answers
|
||||
|
||||
|
||||
-- TESTING
|
||||
|
||||
--testing command
|
||||
function modpol.msg(text)
|
||||
modpol.interactions.message("TEST MSG",text)
|
||||
end
|
||||
|
@ -55,7 +55,7 @@ dofile (topdir .. "/util/misc.lua")
|
||||
-- Select a storage method
|
||||
-- -- preferably, declare this in the init.lua that calls modpol.lua This is the default.
|
||||
-- Works with CLI:
|
||||
modpol.storage_file_path = modpol.storage_file_path or topdir .. "/storage/storage-local.lua"
|
||||
modpol.storage_file_path = modpol.storage_file_path or topdir .. "/storage/unix-storage.lua"
|
||||
-- Works with Minetest 5:
|
||||
--modpol.storage_file_path = modpol.storage_file_path or topdir .. "/storage/storage-mod_storage.lua")
|
||||
|
||||
|
66
modpol_core/modules/add_child_org.lua
Normal file
66
modpol_core/modules/add_child_org.lua
Normal file
@ -0,0 +1,66 @@
|
||||
--- Adds a child org.
|
||||
-- @module add_child_org
|
||||
|
||||
local add_child_org = {
|
||||
name = "Add child org",
|
||||
slug = "add_child_org",
|
||||
desc = "Create a child org in the current one"
|
||||
}
|
||||
add_child_org.data = {
|
||||
child_name = "",
|
||||
result = nil
|
||||
}
|
||||
add_child_org.config = {
|
||||
}
|
||||
|
||||
--- Initiate consent for new child org
|
||||
-- @function add_child_org:initiate(result)
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function add_child_org:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,"Child org name: ",
|
||||
function(input)
|
||||
if input == "" then
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"No name entered for child org")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
elseif modpol.orgs.get_org(input) then
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"Org name already in use")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
self.org:delete_process(self.id)
|
||||
if result then result() end
|
||||
return
|
||||
end
|
||||
self.data.child_name = input
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"Proposed child org: " .. input)
|
||||
-- create the org
|
||||
self:create_child_org()
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Create a new child orgg
|
||||
-- @function add_child_org:create_child_org
|
||||
function add_child_org:create_child_org()
|
||||
self.org:add_org(self.data.child_name, self.initiator)
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,
|
||||
self.org.name,
|
||||
"Created child org "
|
||||
..self.data.child_name)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
modpol.modules.add_child_org = add_child_org
|
@ -1,6 +1,6 @@
|
||||
--- @module add_child_org_consent
|
||||
-- Adds a child org
|
||||
--- Adds a child org.
|
||||
-- Depends on `consent`
|
||||
-- @module add_child_org_consent
|
||||
|
||||
local add_child_org_consent = {
|
||||
name = "Add child org (consent)",
|
||||
@ -14,7 +14,9 @@ add_child_org_consent.data = {
|
||||
add_child_org_consent.config = {
|
||||
}
|
||||
|
||||
-- @function initiate
|
||||
--- Initiate consent for new child org
|
||||
-- @function add_child_org_consent:initiate(result)
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function add_child_org_consent:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,"Child org name: ",
|
||||
@ -26,7 +28,6 @@ function add_child_org_consent:initiate(result)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
self.org:delete_process(self.id)
|
||||
if result then result() end
|
||||
return
|
||||
elseif modpol.orgs.get_org(input) then
|
||||
modpol.interactions.message(
|
||||
@ -43,7 +44,7 @@ function add_child_org_consent:initiate(result)
|
||||
self.initiator,
|
||||
"Proposed child org: " .. input)
|
||||
-- initiate consent process
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -61,15 +62,17 @@ function add_child_org_consent:initiate(result)
|
||||
)
|
||||
end
|
||||
|
||||
--- Create a new child orgg
|
||||
-- @function add_child_org_consent:create_child_org
|
||||
function add_child_org_consent:create_child_org()
|
||||
self.org:add_org(self.data.child_name, self.initiator)
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,
|
||||
self.org.name,
|
||||
"Child org created: "..self.data.child_name)
|
||||
"Consent reached: created child org "
|
||||
..self.data.child_name)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.add_child_org_consent = add_child_org_consent
|
||||
|
178
modpol_core/modules/change_modules-dropdown.lua
Normal file
178
modpol_core/modules/change_modules-dropdown.lua
Normal file
@ -0,0 +1,178 @@
|
||||
--- change_modules
|
||||
-- @module change_modules
|
||||
-- Depends on consent
|
||||
|
||||
local change_modules = {
|
||||
name = "Change modules (consent)",
|
||||
slug = "change_modules",
|
||||
desc = "Add or remove modules from the org with member consent",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
change_modules.data = {
|
||||
result = nil
|
||||
}
|
||||
|
||||
change_modules.config = {
|
||||
}
|
||||
|
||||
--- Change modules initiate
|
||||
-- @function change_modules:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function change_modules:initiate(result)
|
||||
self.data.result = result
|
||||
-- Step 1: add or remove?
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Module change options:",
|
||||
{"Add module","Remove module"},
|
||||
function(input)
|
||||
if input == "Add module" then
|
||||
self:add_module()
|
||||
elseif input == "Remove module" then
|
||||
self:remove_module()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Add a new module
|
||||
-- @function change_modules:add_module
|
||||
function change_modules:add_module()
|
||||
-- prepare module options
|
||||
local available_modules = modpol.util.copy_table(modpol.modules)
|
||||
for k,org_mod in pairs(self.org.modules) do
|
||||
if available_modules[org_mod.slug] then
|
||||
available_modules[org_mod.slug] = nil
|
||||
end end
|
||||
-- present module options
|
||||
local modules_list = {}
|
||||
for k,v in pairs(available_modules) do
|
||||
table.insert(modules_list,v.name)
|
||||
end
|
||||
if #modules_list == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has all modules")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(modules_list)
|
||||
-- now ask which to add
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a module to add:",
|
||||
modules_list,
|
||||
function(mod_choice)
|
||||
-- confirm choice
|
||||
modpol.interactions.binary_poll_user(
|
||||
self.initiator,
|
||||
"Confirm: propose to add module \"" ..
|
||||
mod_choice .. "\"?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
self:propose_change("add",mod_choice)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
else
|
||||
self:add_module()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Remove a module
|
||||
-- @function change_modules:remove_module
|
||||
function change_modules:remove_module()
|
||||
-- prepare module options
|
||||
local available_modules = {}
|
||||
for k,org_mod in pairs(self.org.modules) do
|
||||
if not org_mod.hide then
|
||||
available_modules[org_mod.slug] = modpol.util.copy_table(org_mod)
|
||||
end end
|
||||
local modules_list = {}
|
||||
local modules_count = 0
|
||||
for k,v in pairs(available_modules) do
|
||||
table.insert(modules_list,v.name)
|
||||
modules_count = modules_count + 1
|
||||
end
|
||||
-- abort if no modules to remove
|
||||
if modules_count == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has no modules")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(modules_list)
|
||||
-- now ask which to remove
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a module to remove:",
|
||||
modules_list,
|
||||
function(mod_choice)
|
||||
-- confirm choice
|
||||
modpol.interactions.binary_poll_user(
|
||||
self.initiator,
|
||||
"Confirm: propose to remove module \"" .. mod_choice .. "\"?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
self:propose_change("remove",mod_choice)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
else
|
||||
self:remove_module()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Propose a change.
|
||||
-- Type "add" or "remove"
|
||||
-- @function change_modules:propose_change
|
||||
-- @param type
|
||||
-- @param mod_text
|
||||
function change_modules:propose_change(type, mod_text)
|
||||
self:call_module(
|
||||
"consent",self.initiator,
|
||||
{
|
||||
prompt = "Do you consent to "..type..
|
||||
" this module in org "..self.org.name..
|
||||
":\n"..mod_text,
|
||||
votes_required = #self.org.members
|
||||
},
|
||||
function()
|
||||
if type == "add" then
|
||||
for k,v in pairs(modpol.modules) do
|
||||
if v.name == mod_text then
|
||||
table.insert(self.org.modules,v)
|
||||
end
|
||||
end
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,self.org.id,
|
||||
"Consent reached:\nAdding \""
|
||||
..mod_text.."\" to org "..self.org.name)
|
||||
elseif type == "remove" then
|
||||
local i = 0
|
||||
for k,v in pairs(self.org.modules) do
|
||||
i = i + 1
|
||||
if v.name == mod_text then
|
||||
self.org.modules[k] = nil
|
||||
end
|
||||
end
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,self.org.id,
|
||||
"Consent reached:\nRemoving \""
|
||||
..mod_text.."\" from org "..self.org.name)
|
||||
end
|
||||
end)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
modpol.modules.change_modules = change_modules
|
@ -1,6 +1,6 @@
|
||||
--- change_modules
|
||||
-- @module change_modules
|
||||
-- Depends on consent
|
||||
-- @module change_modules
|
||||
|
||||
local change_modules = {
|
||||
name = "Change modules (consent)",
|
||||
@ -10,162 +10,109 @@ local change_modules = {
|
||||
}
|
||||
|
||||
change_modules.data = {
|
||||
result = nil
|
||||
result = nil,
|
||||
modules_before = {},
|
||||
modules_after = {},
|
||||
summary = "",
|
||||
}
|
||||
|
||||
change_modules.config = {
|
||||
}
|
||||
|
||||
--- Initiate change in modules.
|
||||
-- Either adds or removes module depending on user input
|
||||
-- @function change_modules:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function change_modules:initiate(result)
|
||||
self.data.result = result
|
||||
-- Step 1: add or remove?
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Module change options:",
|
||||
{"Add module","Remove module"},
|
||||
self.data.add_modules = {}
|
||||
self.data.remove_modules = {}
|
||||
local modules_before = {}
|
||||
local modules_after = {}
|
||||
-- generate self.config.modules table
|
||||
for k, module in pairs(modpol.modules) do
|
||||
if not modpol.modules[module.slug].hide then
|
||||
local in_org = false
|
||||
if self.org.policies[module.slug] then
|
||||
in_org = true
|
||||
end
|
||||
table.insert(
|
||||
modules_before,
|
||||
{module.name.." ["..module.slug.."]", in_org})
|
||||
end
|
||||
end
|
||||
-- send query to user
|
||||
modpol.interactions.checkbox_query(
|
||||
self.initiator,
|
||||
"Check the modules to activate in this org:",
|
||||
modules_before,
|
||||
function(input)
|
||||
if input == "Add module" then
|
||||
self:add_module()
|
||||
elseif input == "Remove module" then
|
||||
self:remove_module()
|
||||
-- identify changes
|
||||
modules_after = input
|
||||
for i,v in ipairs(modules_after) do
|
||||
if v[2] ~= modules_before[i][2] then
|
||||
if v[2] then
|
||||
table.insert(self.data.add_modules, v[1])
|
||||
else
|
||||
table.insert(self.data.remove_modules, v[1])
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function change_modules:add_module()
|
||||
-- prepare module options
|
||||
local available_modules = modpol.copy_table(modpol.modules)
|
||||
for k,org_mod in pairs(self.org.modules) do
|
||||
if available_modules[org_mod.slug] then
|
||||
available_modules[org_mod.slug] = nil
|
||||
end end
|
||||
-- present module options
|
||||
local modules_list = {}
|
||||
for k,v in pairs(available_modules) do
|
||||
table.insert(modules_list,v.name)
|
||||
end
|
||||
if #modules_list == 0 then
|
||||
-- abort if no changes
|
||||
if #self.data.add_modules == 0
|
||||
and #self.data.remove_modules == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has all modules")
|
||||
self.initiator, "No module changes proposed")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(modules_list)
|
||||
-- now ask which to add
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a module to add:",
|
||||
modules_list,
|
||||
function(mod_choice)
|
||||
-- confirm choice
|
||||
modpol.interactions.binary_poll_user(
|
||||
-- proceed with consent
|
||||
local query = "Accept module changes in org "..
|
||||
self.org.name.."?"
|
||||
self.data.summary = ""
|
||||
if #self.data.add_modules > 0 then
|
||||
self.data.summary = self.data.summary.."\nAdd: "..
|
||||
table.concat(self.data.add_modules,", ")
|
||||
elseif #self.data.remove_modules > 0 then
|
||||
self.data.summary = "\nRemove: "..
|
||||
table.concat(self.data.remove_modules,", ")
|
||||
end
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
"Confirm: propose to add module \"" ..
|
||||
mod_choice .. "\"?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
self:propose_change("add",mod_choice)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
else
|
||||
self:add_module()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
function change_modules:remove_module()
|
||||
-- prepare module options
|
||||
local available_modules = {}
|
||||
for k,org_mod in pairs(self.org.modules) do
|
||||
if not org_mod.hide then
|
||||
available_modules[org_mod.slug] = modpol.copy_table(org_mod)
|
||||
end end
|
||||
local modules_list = {}
|
||||
local modules_count = 0
|
||||
for k,v in pairs(available_modules) do
|
||||
table.insert(modules_list,v.name)
|
||||
modules_count = modules_count + 1
|
||||
end
|
||||
-- abort if no modules to remove
|
||||
if modules_count == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has no modules")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(modules_list)
|
||||
-- now ask which to remove
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a module to remove:",
|
||||
modules_list,
|
||||
function(mod_choice)
|
||||
-- confirm choice
|
||||
modpol.interactions.binary_poll_user(
|
||||
self.initiator,
|
||||
"Confirm: propose to remove module \"" .. mod_choice .. "\"?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
self:propose_change("remove",mod_choice)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
else
|
||||
self:remove_module()
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- propose_change
|
||||
-- @field type "add" or "remove"
|
||||
function change_modules:propose_change(type, mod_text)
|
||||
self.org:call_module(
|
||||
"consent",self.initiator,
|
||||
{
|
||||
prompt = "Do you consent to "..type..
|
||||
" this module in org "..self.org.name..
|
||||
":\n"..mod_text,
|
||||
prompt = query..self.data.summary,
|
||||
votes_required = #self.org.members
|
||||
},
|
||||
function()
|
||||
if type == "add" then
|
||||
for k,v in pairs(modpol.modules) do
|
||||
if v.name == mod_text then
|
||||
table.insert(self.org.modules,v)
|
||||
end
|
||||
end
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,self.org.id,
|
||||
"Consent reached:\nAdding \""
|
||||
..mod_text.."\" to org "..self.org.name)
|
||||
elseif type == "remove" then
|
||||
modpol.msg("Removing!")
|
||||
local i = 0
|
||||
for k,v in pairs(self.org.modules) do
|
||||
i = i + 1
|
||||
if v.name == mod_text then
|
||||
modpol.msg("got it!")
|
||||
self.org.modules[k] = nil
|
||||
end
|
||||
end
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,self.org.id,
|
||||
"Consent reached:\nRemoving \""
|
||||
..mod_text.."\" from org "..self.org.name)
|
||||
end
|
||||
self:implement_change()
|
||||
end)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
end)
|
||||
end
|
||||
|
||||
function change_modules:implement_change()
|
||||
for i,v in ipairs(self.data.add_modules) do
|
||||
local slug = string.match(v,"%[(.+)%]")
|
||||
self.org.policies[slug] = {}
|
||||
table.sort(self.org.policies)
|
||||
end
|
||||
for i,v in ipairs(self.data.remove_modules) do
|
||||
local slug = string.match(v,"%[(.+)%]")
|
||||
self.org.policies[slug] = nil
|
||||
table.sort(self.org.policies)
|
||||
end
|
||||
-- announce and shut down
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,
|
||||
self.org.id,
|
||||
"Module changes applied to org "..self.org.name..":"..
|
||||
self.data.summary)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.change_modules = change_modules
|
||||
|
110
modpol_core/modules/change_policy.lua
Normal file
110
modpol_core/modules/change_policy.lua
Normal file
@ -0,0 +1,110 @@
|
||||
--- change_policy
|
||||
-- @module change_policy
|
||||
|
||||
local change_policy = {
|
||||
name = "Change policy",
|
||||
slug = "change_policy",
|
||||
desc = "Change a policy in a module",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
change_policy.data = {
|
||||
result = nil
|
||||
}
|
||||
|
||||
change_policy.config = {
|
||||
approval = "none"
|
||||
}
|
||||
|
||||
--- Change modules initiate
|
||||
-- @function change_policy:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function change_policy:initiate(result)
|
||||
-- prepare module options
|
||||
local available_modules = {}
|
||||
for k,org_mod in pairs(modpol.modules) do
|
||||
if not org_mod.hide and
|
||||
self.org.policies[k] then
|
||||
available_modules[org_mod.slug] = modpol.util.copy_table(org_mod)
|
||||
end end
|
||||
local modules_list = {}
|
||||
local modules_count = 0
|
||||
for k,v in pairs(available_modules) do
|
||||
table.insert(modules_list,v.slug)
|
||||
modules_count = modules_count + 1
|
||||
end
|
||||
-- abort if no modules to remove
|
||||
if modules_count == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has no modules")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(modules_list)
|
||||
-- now ask which to remove
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a module to change policies for:",
|
||||
modules_list,
|
||||
function(mod_choice)
|
||||
local this_module = modpol.modules[mod_choice]
|
||||
local module_policies = this_module.config
|
||||
local policy_list = {}
|
||||
for k,v in pairs(module_policies) do
|
||||
table.insert(policy_list, k)
|
||||
end
|
||||
if #policy_list == 0 then
|
||||
-- No policies; abort
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Module has no policy options")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a policy to change:",
|
||||
policy_list,
|
||||
function(policy_choice)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,
|
||||
"Current " .. policy_choice .. " value: " ..
|
||||
tostring(modpol.modules[mod_choice][policy_choice])
|
||||
.. "\nChange value to (be careful!):",
|
||||
function(policy_input)
|
||||
self:approve_change(
|
||||
mod_choice,
|
||||
policy_choice,
|
||||
policy_input)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Propose a change.
|
||||
-- Type "add" or "remove"
|
||||
-- @function change_policy:approve_change
|
||||
-- @param module (string) slug of module
|
||||
-- @param policy (string) policy slug
|
||||
-- @param input (string) input content
|
||||
function change_policy:approve_change(module_slug, policy, input)
|
||||
-- NEED TO ADD APPROVAL CODE for consent, etc.
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"Updating " .. policy .. " policy on module " ..
|
||||
module_slug .. " with: " .. input)
|
||||
self.org.policies[module_slug][policy] = input
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if self.data.result then self.data.result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
|
||||
modpol.modules.change_policy = change_policy
|
@ -1,10 +1,10 @@
|
||||
--- @module consent
|
||||
-- A utility module for checking consent
|
||||
--- A utility module for checking consent
|
||||
-- @module consent
|
||||
|
||||
local consent = {
|
||||
name = "Consent process utility",
|
||||
name = "Consent process",
|
||||
slug = "consent",
|
||||
desc = "A module other modules use for consent decisions",
|
||||
desc = "A utility module other modules use for consent decisions",
|
||||
hide = true
|
||||
}
|
||||
|
||||
@ -17,13 +17,16 @@ consent.config = {
|
||||
votes_required = 1
|
||||
}
|
||||
|
||||
--- Initiate consent
|
||||
-- @function consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function consent:initiate(result)
|
||||
self.data.result = result
|
||||
-- if org is empty, consent is given automatically
|
||||
if self.org:get_member_count() == 0 then
|
||||
if self.data.result then
|
||||
self.data.result() end
|
||||
self.org:wipe_pending_actions(self.id)
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
-- otherwise, create poll
|
||||
for id, member in pairs(self.org.members) do
|
||||
@ -32,6 +35,9 @@ function consent:initiate(result)
|
||||
end
|
||||
end
|
||||
|
||||
--- Callback
|
||||
-- @function consent:callback
|
||||
-- @param member
|
||||
function consent:callback(member)
|
||||
modpol.interactions.binary_poll_user(
|
||||
member,
|
||||
@ -41,14 +47,19 @@ function consent:callback(member)
|
||||
if resp == "Yes" then
|
||||
self.data.votes = self.data.votes + 1
|
||||
end
|
||||
modpol.interactions.message_org(
|
||||
"consent", self.org.id,
|
||||
member.." decided "..resp.." on: "..
|
||||
self.config.prompt.." ("..self.data.votes..
|
||||
"/"..self.config.votes_required..")"
|
||||
)
|
||||
if self.data.votes >= self.config.votes_required then
|
||||
if self.data.result then
|
||||
self.data.result() end
|
||||
self.org:wipe_pending_actions(self.id)
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
modpol.interactions.org_dashboard(
|
||||
member, self.org.name)
|
||||
member, self.org.id)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
49
modpol_core/modules/create_token.lua
Normal file
49
modpol_core/modules/create_token.lua
Normal file
@ -0,0 +1,49 @@
|
||||
--- Create token.
|
||||
-- Depends on tokenomics
|
||||
-- @module create_token
|
||||
|
||||
local create_token = {
|
||||
name = "Create a token (consent)",
|
||||
slug = "create_token",
|
||||
desc = "With org consent, creates an org token",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
create_token.data = {
|
||||
}
|
||||
|
||||
create_token.config = {
|
||||
token_name = ""
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @function create_toke:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function create_token:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,
|
||||
"Token name (alpha-numeric, no spaces):",
|
||||
function(input)
|
||||
self.config.token_name = input
|
||||
self:call_module(
|
||||
"tokenomics",
|
||||
self.initiator,
|
||||
{
|
||||
consent = true,
|
||||
token_slug = self.config.token_name
|
||||
},
|
||||
function(input2)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
if result then result() end
|
||||
-- call this wherever process might end:
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
modpol.modules.create_token = create_token
|
49
modpol_core/modules/defer_consent.lua
Normal file
49
modpol_core/modules/defer_consent.lua
Normal file
@ -0,0 +1,49 @@
|
||||
--- Defer consent
|
||||
-- @module defer_consent
|
||||
|
||||
local defer_consent = {
|
||||
name = "Defer consent",
|
||||
slug = "defer_consent",
|
||||
desc = "Defers consent on a decision to another org",
|
||||
hide = true;
|
||||
}
|
||||
|
||||
defer_consent.data = {
|
||||
}
|
||||
|
||||
--- Config for module
|
||||
-- @field defer_org Name or ID of target org
|
||||
-- @field votes_required Threshold passed on to `consent`
|
||||
-- @field prompt String passed on to `consent`
|
||||
defer_consent.config = {
|
||||
defer_org = "Root",
|
||||
votes_required = 1,
|
||||
prompt = "Do you consent?"
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
-- @function defer_consent:initiate
|
||||
function defer_consent:initiate(result)
|
||||
local defer_org = modpol.orgs.get_org(self.config.defer_org)
|
||||
if not defer_org then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Target org not found, aborting")
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
defer_org:call_module(
|
||||
"consent", self.initiator,
|
||||
{
|
||||
votes_required = self.config.votes_required,
|
||||
prompt = self.config.prompt
|
||||
},
|
||||
function()
|
||||
if result then result() end
|
||||
end)
|
||||
end
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.defer_consent = defer_consent
|
64
modpol_core/modules/display_policies.lua
Normal file
64
modpol_core/modules/display_policies.lua
Normal file
@ -0,0 +1,64 @@
|
||||
--- Display policies
|
||||
-- @module display_policies
|
||||
|
||||
local display_policies = {
|
||||
name = "Display policies",
|
||||
slug = "display_policies",
|
||||
desc = "Presents a detailed list of org policies",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
display_policies.data = {
|
||||
}
|
||||
|
||||
display_policies.config = {
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @function display_policies:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function display_policies:initiate(result)
|
||||
local display_table = {}
|
||||
for k,v in pairs(self.org.policies) do
|
||||
if v then -- check the module is allowed
|
||||
local input = modpol.modules[k].name
|
||||
table.insert(display_table, input)
|
||||
if modpol.modules[k].config then
|
||||
for k2,v2 in pairs(modpol.modules[k].config) do
|
||||
if self.org.policies[k][k2] then
|
||||
v2 = self.org.policies[k][k2]
|
||||
end
|
||||
local v2_string = ""
|
||||
if type(v2) == "string" then
|
||||
v2_string = v2
|
||||
elseif type(v2) == "table"
|
||||
or type(v2) == "number" then
|
||||
v2_string = tostring(v2)
|
||||
else
|
||||
v2_string = "Could not render"
|
||||
end
|
||||
input = k2..": "..v2_string
|
||||
table.insert(display_table, input)
|
||||
end
|
||||
end
|
||||
table.insert(display_table, "---")
|
||||
end
|
||||
end
|
||||
local output = table.concat(display_table,"\n")
|
||||
if #display_table == 0 then
|
||||
output = "No modules found"
|
||||
end
|
||||
modpol.interactions.display(
|
||||
self.initiator,
|
||||
"Policies in org "..self.org.name,
|
||||
output,
|
||||
function()
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
modpol.modules.display_policies = display_policies
|
66
modpol_core/modules/display_processes.lua
Normal file
66
modpol_core/modules/display_processes.lua
Normal file
@ -0,0 +1,66 @@
|
||||
--- Display processes
|
||||
-- @module display_processes
|
||||
|
||||
local display_processes = {
|
||||
name = "Display processes",
|
||||
slug = "display_processes",
|
||||
desc = "Presents a detailed list of org processes",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
display_processes.data = {
|
||||
}
|
||||
|
||||
display_processes.config = {
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @function display_processes:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function display_processes:initiate(result)
|
||||
local display_table = {}
|
||||
for k,v in pairs(self.org.processes) do
|
||||
if v ~= "deleted" then
|
||||
local input = v.id..": "..v.slug
|
||||
table.insert(display_table, input)
|
||||
input = "Org: "..v.org.name..
|
||||
", initiator: "..v.initiator
|
||||
table.insert(display_table, input)
|
||||
if v.config
|
||||
and modpol.util.num_pairs(v.config) > 0 then
|
||||
table.insert(display_table, "Policies:")
|
||||
for k2,v2 in pairs(v.config) do
|
||||
local v2_string = ""
|
||||
if type(v2) == "string" then
|
||||
v2_string = v2
|
||||
elseif type(v2) == "table"
|
||||
or type(v2) == "number" then
|
||||
v2_string = tostring(v2)
|
||||
else
|
||||
v2_string = "Could not render"
|
||||
end
|
||||
input = k2..": "..v2_string
|
||||
table.insert(display_table, input)
|
||||
end
|
||||
end
|
||||
table.insert(display_table, "---")
|
||||
end
|
||||
end
|
||||
local output = table.concat(display_table,"\n")
|
||||
if #display_table == 0 then
|
||||
output = "No processes found"
|
||||
end
|
||||
modpol.interactions.display(
|
||||
self.initiator,
|
||||
"Processes in org "..self.org.name,
|
||||
output,
|
||||
function()
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
modpol.modules.display_processes = display_processes
|
3
modpol_core/modules/ignore.txt
Normal file
3
modpol_core/modules/ignore.txt
Normal file
@ -0,0 +1,3 @@
|
||||
change_modules-dropdown.lua
|
||||
join_org.lua
|
||||
template.lua
|
@ -1,3 +1,5 @@
|
||||
--- Adds a user to org
|
||||
-- @module join_org
|
||||
|
||||
join_org = {}
|
||||
|
||||
@ -7,6 +9,9 @@ join_org.setup = {
|
||||
desc = "If consent process is passed, initiator joins this org."
|
||||
}
|
||||
|
||||
--- Adds the user to the org
|
||||
-- @function join_org.initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function join_org.initiate(result)
|
||||
modpol.interactions.binary_poll_user(
|
||||
initiator,
|
||||
|
@ -1,6 +1,7 @@
|
||||
--- Join org (consent)
|
||||
--- Join org (consent).
|
||||
-- A simple module that calls a consent process on an org to add a member.
|
||||
-- Depends on the Consent module.
|
||||
-- @module join_org_consent
|
||||
|
||||
local join_org_consent = {
|
||||
name = "Join this org (consent)",
|
||||
@ -15,6 +16,9 @@ join_org_consent.data = {
|
||||
join_org_consent.config = {
|
||||
}
|
||||
|
||||
--- Initiate join org with consent
|
||||
-- @function join_org_consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function join_org_consent:initiate(result)
|
||||
if self.org:has_member(self.initiator) then
|
||||
modpol.interactions.message(
|
||||
@ -24,7 +28,7 @@ function join_org_consent:initiate(result)
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
self.data.result = result
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -38,6 +42,8 @@ function join_org_consent:initiate(result)
|
||||
end
|
||||
end
|
||||
|
||||
--- Adds member to org, notifies org, and deletes process
|
||||
-- @function join_org_consent:complete
|
||||
function join_org_consent:complete()
|
||||
self.org:add_member(self.initiator)
|
||||
modpol.interactions.message_org(
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- leave_org
|
||||
--- Removes initiator from org
|
||||
-- @module leave_org
|
||||
|
||||
local leave_org = {
|
||||
@ -13,10 +13,9 @@ leave_org.data = {
|
||||
leave_org.config = {
|
||||
}
|
||||
|
||||
--- (Required): initiate function
|
||||
-- Modules have access to the following instance variables:
|
||||
-- @param result (optional) Callback if this module is embedded in other modules
|
||||
-- @function initiate
|
||||
--- Removes user from org
|
||||
-- @function leave_org:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function leave_org:initiate(result)
|
||||
if self.org == modpol.instance then
|
||||
modpol.interactions.message(
|
||||
@ -35,5 +34,4 @@ function leave_org:initiate(result)
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.leave_org = leave_org
|
||||
|
39
modpol_core/modules/message_org.lua
Normal file
39
modpol_core/modules/message_org.lua
Normal file
@ -0,0 +1,39 @@
|
||||
--- Messages all org members
|
||||
-- @module message_org
|
||||
|
||||
local message_org = {
|
||||
name = "Message org",
|
||||
slug = "message_org",
|
||||
desc = "Send a message to all members of the org",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
message_org.data = {
|
||||
}
|
||||
|
||||
message_org.config = {
|
||||
}
|
||||
|
||||
--- Allows user to send input message to all org members
|
||||
-- @function initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function message_org:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator, "Message to all org members: ",
|
||||
function(input)
|
||||
local message = self.initiator.." to org "..
|
||||
self.org.name..": "..input
|
||||
if input and input ~= "" then
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id, message)
|
||||
end
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
|
||||
end
|
||||
)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
modpol.modules.message_org = message_org
|
53
modpol_core/modules/randomizer.lua
Normal file
53
modpol_core/modules/randomizer.lua
Normal file
@ -0,0 +1,53 @@
|
||||
--- A utility module that outputs a random result from a set of options
|
||||
-- @module randomizer
|
||||
|
||||
local randomizer = {
|
||||
name = "Randomizer",
|
||||
slug = "randomizer",
|
||||
desc = "A utility module other modules use for random decisions",
|
||||
hide = true
|
||||
}
|
||||
|
||||
randomizer.data = {
|
||||
}
|
||||
|
||||
-- options_table should be a table of strings
|
||||
randomizer.config = {
|
||||
options_table = {},
|
||||
num_results = 1,
|
||||
result_table = {}
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @function randomizer:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function randomizer:initiate(result)
|
||||
self.data.result = result
|
||||
self.data.options_table = modpol.util.copy_table(self.config.options_table)
|
||||
-- if options table is empty, randomizer returns that
|
||||
if #self.data.options_table == 0 or self.config.num_results == 0 then
|
||||
if self.data.result then
|
||||
self.data.result({}) end
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
-- otherwise, choose a random result
|
||||
self.random_loop()
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns result_table
|
||||
-- @function randomizer:random_loop
|
||||
function randomizer:random_loop()
|
||||
self.data.results = 0
|
||||
if results == self.config.num_results then
|
||||
self.data.result(self.data.result_table)
|
||||
else
|
||||
math.randomseed(os.time())
|
||||
local index = math.random(self.data.options_table)
|
||||
table.insert(self.data.result_table, self.data.options_table[index])
|
||||
table.remove(self.data.options_table, index)
|
||||
self.data.results = self.data.results + 1
|
||||
end
|
||||
end
|
||||
|
||||
modpol.modules.randomizer = randomizer
|
@ -1,6 +1,7 @@
|
||||
--- Remove child (consent)
|
||||
-- A simple module that calls a consent process on an org to remove its child
|
||||
--- Remove child (consent).
|
||||
-- A simple module that calls a consent process on an org to remove its child.
|
||||
-- Depends on the Consent module.
|
||||
-- @module remove_child_consent
|
||||
|
||||
local remove_child_consent = {
|
||||
name = "Remove child (consent)",
|
||||
@ -16,6 +17,9 @@ remove_child_consent.data = {
|
||||
remove_child_consent.config = {
|
||||
}
|
||||
|
||||
--- Removes a child org with consent
|
||||
-- @function remove_child_consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function remove_child_consent:initiate(result)
|
||||
local children = {}
|
||||
for i,v in ipairs(self.org.children) do
|
||||
@ -38,7 +42,7 @@ function remove_child_consent:initiate(result)
|
||||
children,
|
||||
function(input)
|
||||
self.data.child_to_remove = modpol.orgs.get_org(input)
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -54,6 +58,8 @@ function remove_child_consent:initiate(result)
|
||||
end
|
||||
end
|
||||
|
||||
--- Complete the remove process
|
||||
-- @function remove_child_consent:complete
|
||||
function remove_child_consent:complete()
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.data.child_to_remove.id,
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- remove_member_consent
|
||||
--- Calls consent to remove member from org
|
||||
-- @module remove_member_consent
|
||||
|
||||
local remove_member_consent = {
|
||||
@ -15,6 +15,9 @@ remove_member_consent.data = {
|
||||
remove_member_consent.config = {
|
||||
}
|
||||
|
||||
--- Removes given member from org
|
||||
-- @function remove_member_consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function remove_member_consent:initiate(result)
|
||||
-- Abort if in root org
|
||||
if self.org == modpol.instance then
|
||||
@ -32,7 +35,7 @@ function remove_member_consent:initiate(result)
|
||||
self.org.members,
|
||||
function(input)
|
||||
self.data.member_to_remove = input
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -49,6 +52,8 @@ function remove_member_consent:initiate(result)
|
||||
end
|
||||
end
|
||||
|
||||
--- Complete after consent
|
||||
-- @function remove_member_consent:complete
|
||||
function remove_member_consent:complete()
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id,
|
||||
@ -60,5 +65,4 @@ function remove_member_consent:complete()
|
||||
if self.data.result then self.data.result() end
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.remove_member_consent = remove_member_consent
|
||||
|
@ -1,8 +1,6 @@
|
||||
--- @module Remove Org
|
||||
-- A simple module that removes an org.
|
||||
--- A simple module that removes an org.
|
||||
-- @module remove_org
|
||||
|
||||
|
||||
--- Main module table
|
||||
remove_org = {
|
||||
name = "Remove this org",
|
||||
slug = "remove_org",
|
||||
@ -12,8 +10,9 @@ remove_org = {
|
||||
remove_org.config = {}
|
||||
remove_org.data = {}
|
||||
|
||||
--- Initiate function
|
||||
-- @function initiate
|
||||
--- Removes org
|
||||
-- @function remove_org:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function remove_org:initiate(result)
|
||||
if self.org == modpol.instance then
|
||||
modpol.interactions.message(
|
||||
|
@ -1,6 +1,7 @@
|
||||
--- Remove org (consent)
|
||||
-- A simple module that calls a consent process on an org to remove it.
|
||||
-- Depends on the Consent module.
|
||||
-- @module remove_org_consent
|
||||
|
||||
local remove_org_consent = {
|
||||
name = "Remove this org (consent)",
|
||||
@ -15,6 +16,9 @@ remove_org_consent.data = {
|
||||
remove_org_consent.config = {
|
||||
}
|
||||
|
||||
--- Remove org if all members consent
|
||||
-- @function remove_org_consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function remove_org_consent:initiate(result)
|
||||
if self.org == modpol.instance then
|
||||
modpol.interactions.message(
|
||||
@ -24,7 +28,7 @@ function remove_org_consent:initiate(result)
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
self.data.result = result
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -40,6 +44,8 @@ function remove_org_consent:initiate(result)
|
||||
end
|
||||
end
|
||||
|
||||
--- Complete after consent
|
||||
-- @function remove_org_consent:complete
|
||||
function remove_org_consent:complete()
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id,
|
||||
|
108
modpol_core/modules/remove_process.lua
Normal file
108
modpol_core/modules/remove_process.lua
Normal file
@ -0,0 +1,108 @@
|
||||
--- Remove a process
|
||||
-- @module remove_process
|
||||
|
||||
local remove_process = {
|
||||
name = "Remove process",
|
||||
slug = "remove_process",
|
||||
desc = "User can remove own processes, consent required for those of others",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
remove_process.data = {
|
||||
}
|
||||
|
||||
remove_process.config = {
|
||||
}
|
||||
|
||||
--- Initiate function
|
||||
-- @function remove_process:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function remove_process:initiate(result)
|
||||
-- prepare process options
|
||||
local available_processes = {}
|
||||
for k,process in pairs(self.org.processes) do
|
||||
if process ~= "deleted" then
|
||||
available_processes[process.id] = process
|
||||
end
|
||||
end
|
||||
local process_list = {}
|
||||
local process_count = 0
|
||||
for k,v in pairs(available_processes) do
|
||||
local mine = ""
|
||||
if v.initiator == self.initiator then mine = "*" end
|
||||
table.insert(process_list,"["..v.id.."] "..v.slug..mine)
|
||||
process_count = process_count + 1
|
||||
end
|
||||
-- abort if no processes to remove
|
||||
if process_count == 0 then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Org has no modules")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
end
|
||||
table.sort(process_list)
|
||||
-- now ask which to remove
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator, "Choose a process to remove (* marks yours, no consent required):",
|
||||
process_list,
|
||||
function(process_choice)
|
||||
-- confirm choice
|
||||
local process_id = tonumber(
|
||||
string.match(process_choice, "%d+"))
|
||||
local process_mine = string.match(process_choice,
|
||||
"%*")
|
||||
modpol.interactions.binary_poll_user(
|
||||
self.initiator,
|
||||
"Confirm: Remove process \""..
|
||||
process_choice .. "\"?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
if process_mine then
|
||||
self.org:delete_process_tree(process_id)
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"Removed process: "..process_choice)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
prompt = "Approve removal of process "..process_choice.."?",
|
||||
votes_required = #self.org.members
|
||||
},
|
||||
function(input)
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,
|
||||
self.org.id,
|
||||
"Removing process: "..
|
||||
process_choice)
|
||||
self.org:delete_process_tree(process_id)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
)
|
||||
end
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
else
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
modpol.modules.remove_process = remove_process
|
@ -1,6 +1,7 @@
|
||||
--- Rename org (consent)
|
||||
-- A simple module that calls a consent process on an org to rename it.
|
||||
-- Depends on the Consent module.
|
||||
-- @module rename_org_consent
|
||||
|
||||
local rename_org_consent = {
|
||||
name = "Rename this org (consent)",
|
||||
@ -16,6 +17,9 @@ rename_org_consent.data = {
|
||||
rename_org_consent.config = {
|
||||
}
|
||||
|
||||
--- Renames the org after consent is reached
|
||||
-- @function rename_org_consent:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function rename_org_consent:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,"New org name: ",
|
||||
@ -45,7 +49,7 @@ function rename_org_consent:initiate(result)
|
||||
"Proposed to change name of org " ..
|
||||
self.org.name .. " to " .. input)
|
||||
-- initiate consent process
|
||||
self.org:call_module(
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
@ -63,6 +67,8 @@ function rename_org_consent:initiate(result)
|
||||
)
|
||||
end
|
||||
|
||||
--- Changes the name of the org after consent is reached
|
||||
-- @funciton rename_org_consent
|
||||
function rename_org_consent:complete()
|
||||
modpol.interactions.message_org(
|
||||
self.initiator,
|
||||
|
76
modpol_core/modules/send_token.lua
Normal file
76
modpol_core/modules/send_token.lua
Normal file
@ -0,0 +1,76 @@
|
||||
--- Send token.
|
||||
-- Depends on tokenomics
|
||||
-- @module send_token
|
||||
|
||||
local send_token = {
|
||||
name = "Send tokens",
|
||||
slug = "send_token",
|
||||
desc = "Send tokens to another user",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
--- (Required) Data for module
|
||||
-- Variables that module uses during the course of a process
|
||||
-- Can be blank
|
||||
send_token.data = {
|
||||
}
|
||||
|
||||
send_token.config = {
|
||||
token_name = ""
|
||||
}
|
||||
|
||||
--- initiate function
|
||||
-- @function send_token:initiate
|
||||
-- @param result Callback if this module is embedded in other modules
|
||||
function send_token:initiate(result)
|
||||
local token_list = {}
|
||||
if self.org.tokens then
|
||||
for k,v in pairs(self.org.tokens) do
|
||||
table.insert(token_list, k)
|
||||
end
|
||||
end
|
||||
if token_list == {} then
|
||||
modpol.interactions.message(
|
||||
self.initiator,
|
||||
"No tokens in org")
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
self.org:delete_process(self.id)
|
||||
return
|
||||
else
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator,
|
||||
"Which token do you want to send?",
|
||||
token_list,
|
||||
function(input_token)
|
||||
modpol.interactions.dropdown_query(
|
||||
self.initiator,
|
||||
"Who do you want to send to?",
|
||||
modpol.util.copy_table(self.org.members),
|
||||
function(input_recipient)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator,
|
||||
"How much do you want to give (a number)?",
|
||||
function(input_amount)
|
||||
modpol.modules.tokenomics.transfer(
|
||||
self.org.id,
|
||||
input_token,
|
||||
self.initiator,
|
||||
input_recipient,
|
||||
input_amount
|
||||
)
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.name)
|
||||
-- close process
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
modpol.modules.send_token = send_token
|
@ -1,25 +1,26 @@
|
||||
--- module_template
|
||||
--- Template for module writers.
|
||||
-- Short description goes here.
|
||||
-- @module module_template
|
||||
|
||||
--- (Required): data table containing name and description of the module
|
||||
--- (Required): Data table containing name and description of the module
|
||||
-- @field name "Human-readable name (parens OK, no brackets)"
|
||||
-- @field slug "Same as module class name"
|
||||
-- @field desc "Description of the module"
|
||||
-- @field hide "Whether this is a hidden utility module"
|
||||
-- @field hide Whether this is a hidden utility module
|
||||
local module_template = {
|
||||
name = "Module Human-Readable Name",
|
||||
slug = "template",
|
||||
slug = "module_template",
|
||||
desc = "Description of the module",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
--- (Required) Data for module
|
||||
-- Variables that module uses during the course of a process
|
||||
-- Variables that module uses during the course of a process.
|
||||
-- Can be blank
|
||||
module_template.data = {
|
||||
}
|
||||
|
||||
--- (Required): config for module
|
||||
--- (Required): Config for module
|
||||
-- Defines the input parameters to the module initiate function.
|
||||
-- Can be blank
|
||||
-- When calling a module from within another module,
|
||||
@ -32,21 +33,24 @@ module_template.config = {
|
||||
field_2 = "majority"
|
||||
}
|
||||
|
||||
--- (Required): initiate function
|
||||
--- (Required): Initiate function
|
||||
-- Modules have access to the following instance variables:
|
||||
-- <li><code>self.org</code> (the org the module was called in),</li>
|
||||
-- <li><code>self.initiator</code> (the user that callced the module),</li>
|
||||
-- <li><code>self.id</code> (the process id of the module instance)</li>
|
||||
-- @function module_template:initiate
|
||||
-- @param result (optional) Callback if this module is embedded in other modules
|
||||
-- @function initiate
|
||||
function module_template:initiate(result)
|
||||
-- call interaction functions here!
|
||||
|
||||
-- concluding functions:
|
||||
-- call these wherever process might end;
|
||||
-- first, where appropriate, return users to dashboards.
|
||||
-- second, result:
|
||||
-- may need to put result in self.data.result
|
||||
-- if process ends in another function
|
||||
-- call this when module is successful (not for abort):
|
||||
if result then result() end
|
||||
-- third, delete the process
|
||||
-- call this wherever process might end:
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
|
231
modpol_core/modules/tokenomics.lua
Normal file
231
modpol_core/modules/tokenomics.lua
Normal file
@ -0,0 +1,231 @@
|
||||
--- Tokenomics.
|
||||
-- Depends on consent
|
||||
-- @module tokenomics
|
||||
|
||||
local tokenomics = {
|
||||
name = "Tokenomics",
|
||||
slug = "tokenomics",
|
||||
desc = "A simple library for token economics",
|
||||
hide = true;
|
||||
}
|
||||
|
||||
tokenomics.data = {
|
||||
result = nil
|
||||
}
|
||||
|
||||
--- Config for module
|
||||
-- @field consent Require consent to create?
|
||||
-- @field token_variables the data that goes into the token
|
||||
-- @field token_slug A no-spaces slug for the token
|
||||
-- @field initial_treasury Quantity in org treasury
|
||||
-- @field negative_spend Boolean: can users spend negative tokens? (for mutual credit)
|
||||
-- @field balances Table of user balances
|
||||
tokenomics.config = {
|
||||
consent = false,
|
||||
token_slug = "token",
|
||||
token_variables = {
|
||||
treasury = 0,
|
||||
negative_spend = true,
|
||||
balances = {}
|
||||
}
|
||||
}
|
||||
|
||||
--- Initiate function: creates a token in an org.
|
||||
-- Set up the token data structure.
|
||||
-- Create an org treasury
|
||||
-- @function tokenomics:initiate
|
||||
-- @param result (optional) Callback if this module is embedded in other modules
|
||||
function tokenomics:initiate(result)
|
||||
-- TODO need to create a series of interactions to get the info from users
|
||||
self.data.result = result
|
||||
if self.org.tokens and self.org.tokens[slug] then
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Token slug taken, aborting")
|
||||
self.org:delete_process(self.id)
|
||||
else
|
||||
if self.config.consent then
|
||||
self:call_module(
|
||||
"consent",
|
||||
self.initiator,
|
||||
{
|
||||
prompt = "Create token "..
|
||||
self.config.token_slug.."?",
|
||||
votes_required = #self.org.members
|
||||
},
|
||||
function()
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id,
|
||||
"Consent reached: creating token "..
|
||||
self.config.token_slug)
|
||||
self:create_token()
|
||||
end
|
||||
)
|
||||
else
|
||||
self:create_token()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Create token
|
||||
-- @function tokenomics:create_token
|
||||
function tokenomics:create_token()
|
||||
if not self.org.tokens then self.org.tokens = {} end
|
||||
self.org.tokens[self.config.token_slug] =
|
||||
self.config.token_variables
|
||||
self.org:record("Created token "..self.config.token_slug,
|
||||
self.slug)
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id,
|
||||
"Created token "..self.config.token_slug)
|
||||
if self.data.result then self.data.result() end
|
||||
-- call this wherever process might end:
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
-----------------------------------------
|
||||
-- Utility functions
|
||||
-- all need to account for the fact that some users may not yet have balances
|
||||
-- all need to write to persistent data
|
||||
-- amount can be positive or negative (except transfer)
|
||||
|
||||
--- Returns balance.
|
||||
-- If no user, get treasury balance
|
||||
-- @function tokenomics.balance
|
||||
-- @param org Name (string) or id (num)
|
||||
-- @param token Slug (string)
|
||||
-- @param user Name (string)
|
||||
function tokenomics.balance(org, token, user)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
if not this_org[token] then return nil, "Token not found" end
|
||||
if not user then
|
||||
return this_org[token].treasury
|
||||
end
|
||||
if not this_org[user] then
|
||||
return nil, "User not found"
|
||||
else
|
||||
local user_balance = this_org[token].balances[user]
|
||||
if user_balance then
|
||||
return user_balance
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Change balance
|
||||
-- @function tokenomics.change_balance
|
||||
-- @param org Org name (string) or id (number)
|
||||
-- @param token Token slug (string)
|
||||
-- @param user
|
||||
-- @param amount
|
||||
function tokenomics.change_balance(org, token, user, amount)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
if not this_org then
|
||||
return nil, "Cannot change balance: Org not found"
|
||||
elseif not this_org.tokens then
|
||||
return nil, "Cannot change balance: no tokens found"
|
||||
elseif not this_org.tokens[token] then
|
||||
return nil, "Cannot change balance: token not found"
|
||||
elseif not this_org.members[user] then
|
||||
return nil, "Cannot change balance: user not in org"
|
||||
elseif not tonumber(amount) then
|
||||
return nil, "Cannot change balance: invalid amount"
|
||||
else
|
||||
local old_balance = this_org.tokens[token].balances[user]
|
||||
if not old_balance then old_balance = 0 end
|
||||
local new_balance = old_balance + amount
|
||||
this_org.tokens[token].balances[user] = new_balance
|
||||
local msg = "Your balance of token "..token..
|
||||
" changed from "..old_balance.." to "..new_balance
|
||||
modpol.interactions.message(user, msg)
|
||||
self.org:record(
|
||||
"Changed token balance for "..user,self.slug)
|
||||
end
|
||||
end
|
||||
|
||||
--- Transfer tokens from a sender to recipient
|
||||
-- @function tokenomics.transfer
|
||||
-- @param org
|
||||
-- @param token
|
||||
-- @param sender
|
||||
-- @param recipient
|
||||
-- @param amount Positive number
|
||||
function tokenomics.transfer(org, token, sender, recipient, amount)
|
||||
local sender_balance = tokenomics.balance(org, token, sender)
|
||||
local recipient_balance = tokenomics.balance(org, token, recipient)
|
||||
if not sender_balance or recipient_balance then
|
||||
return nil, "Transfer failed, user not found"
|
||||
else
|
||||
sender_balance = sender_balance - amount
|
||||
recipient_balance = recipient_balance + amount
|
||||
local neg_spend = modpol.orgs.get_org(org).tokens[token].negative_spend
|
||||
if sender_balance < 0 and not neg_spend then
|
||||
return nil, "Transfer failed, negative spend not allowed"
|
||||
else
|
||||
tokenomics.change_balance(
|
||||
org, token, sender, sender_balance)
|
||||
tokenomics.change_balance(
|
||||
org, token, recipient, recipient_balance)
|
||||
return "Transfer complete"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Transfer from treasury
|
||||
-- @function tokenomics.treasury_transfer
|
||||
-- @param org
|
||||
-- @param token
|
||||
-- @param recipient
|
||||
-- @param amount Can be positive or negative, assumes flow from treasury to recipient
|
||||
function tokenomics.treasury_transfer(org, token, recipient, amount)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
if not this_org then
|
||||
return nil, "Cannot transfer treasury: Org not found"
|
||||
elseif not this_org.tokens then
|
||||
return nil, "Cannot transfer treasury: no tokens found"
|
||||
elseif not this_org.tokens[token] then
|
||||
return nil, "Cannot transfer treasury: token not found"
|
||||
elseif not this_org.members[user] then
|
||||
return nil, "Cannot transfer treasury: user not in org"
|
||||
elseif not tonumber(amount) then
|
||||
return nil, "Cannot change balance: invalid amount"
|
||||
else
|
||||
local new_treasury = this_org.tokens[token].treasury - amount
|
||||
local new_recipient_balance = tokenomics.balance(org, token, recipient) + amount
|
||||
if new_treasury < 0 and not this_org.tokens[token].negative_spend then
|
||||
return nil, "Transfer failed, negative spend not allowed"
|
||||
elseif new_recipient_balance < 0 and not this_org.tokens[token].negative_spend then
|
||||
return nil, "Transfer failed, negative spend not allowed"
|
||||
else
|
||||
this_org.tokens[token].treasury = new_treasury
|
||||
self.org:record("Treasury payment",self.slug)
|
||||
tokenomics.change_balance(org, token, recipient, amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Creates new tokens in the org treasury
|
||||
-- @function tokenomics.issue
|
||||
-- @param org
|
||||
-- @param token
|
||||
-- @param amount
|
||||
function tokenomics.issue(org, token, amount)
|
||||
local this_org = modpol.orgs.get_org(org)
|
||||
if not this_org then
|
||||
return nil, "Cannot transfer treasury: Org not found"
|
||||
elseif not this_org.tokens then
|
||||
return nil, "Cannot transfer treasury: no tokens found"
|
||||
elseif not this_org.tokens[token] then
|
||||
return nil, "Cannot transfer treasury: token not found"
|
||||
elseif not tonumber(amount) then
|
||||
return nil, "Cannot change balance: invalid amount"
|
||||
else
|
||||
this_org.tokens[token].treasury =
|
||||
this_org.tokens[token].treasury + amount
|
||||
self.org:record("Issued tokes to treasury","tokenomics")
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------
|
||||
|
||||
modpol.modules.tokenomics = tokenomics
|
@ -1,5 +1,5 @@
|
||||
--- Orgs: Base
|
||||
-- Basic functions for orgs
|
||||
--- Basic function for orgs
|
||||
-- @module modpol.orgs.base
|
||||
|
||||
modpol.orgs = modpol.orgs or
|
||||
{
|
||||
@ -14,17 +14,19 @@ function temp_org()
|
||||
return {
|
||||
id = nil,
|
||||
name = nil,
|
||||
modules = modpol.copy_table(modpol.modules),
|
||||
policies = {},
|
||||
processes = {},
|
||||
pending = {},
|
||||
members = {},
|
||||
parent = nil,
|
||||
children = {}
|
||||
children = {},
|
||||
}
|
||||
end
|
||||
|
||||
-- ==================================================
|
||||
-- returns org when given its id or name
|
||||
--- Return org when given its id or name
|
||||
-- @function modpol.orgs.get_org
|
||||
-- @param arg string for name of org or id of org
|
||||
-- @return org specified by id or name
|
||||
function modpol.orgs.get_org(arg)
|
||||
if type(arg) == 'string' then
|
||||
for id, org in ipairs(modpol.orgs.array) do
|
||||
@ -38,8 +40,9 @@ function modpol.orgs.get_org(arg)
|
||||
return nil
|
||||
end
|
||||
|
||||
-- ===============================================
|
||||
-- returns a table list of all org names
|
||||
--- Return a table list of all org names
|
||||
-- @function modpol.orgs.list_all
|
||||
-- @return a table list of all org names
|
||||
function modpol.orgs.list_all()
|
||||
local org_table
|
||||
for k, v in ipairs(modpol.orgs.array) do
|
||||
@ -54,9 +57,10 @@ function modpol.orgs.list_all()
|
||||
return org_table
|
||||
end
|
||||
|
||||
-- Function: modpol.orgs.user_orgs(user)
|
||||
-- input: user (string)
|
||||
-- output: table of strings of org names
|
||||
--- Return the orgs of a user
|
||||
-- @function modpol.orgs.user_orgs
|
||||
-- @param user string of user name
|
||||
-- @return table of strings of org names
|
||||
function modpol.orgs.user_orgs(user)
|
||||
local all_orgs = modpol.orgs.list_all()
|
||||
local user_orgs = {}
|
||||
@ -69,9 +73,11 @@ function modpol.orgs.user_orgs(user)
|
||||
return user_orgs
|
||||
end
|
||||
|
||||
-- ===========================================
|
||||
-- deletes all orgs except for the instance
|
||||
--- Deletes all orgs except for the
|
||||
-- @function modpol.orgs.reset
|
||||
function modpol.orgs.reset()
|
||||
local instance_members =
|
||||
modpol.util.copy_table(modpol.instance.members)
|
||||
for id, org in ipairs(modpol.orgs.array) do
|
||||
if id > 1 then
|
||||
modpol.orgs.array[id] = "removed"
|
||||
@ -80,15 +86,15 @@ function modpol.orgs.reset()
|
||||
|
||||
modpol.orgs.array[1] = nil
|
||||
modpol.instance = modpol.orgs.init_instance()
|
||||
modpol.instance.members = instance_members
|
||||
|
||||
|
||||
modpol.ocutil.log('Reset all orgs')
|
||||
modpol.ocutil.log('All orgs reset')
|
||||
modpol.orgs:record('Resetting all orgs', 'org_reset')
|
||||
end
|
||||
|
||||
-- ===================================================
|
||||
-- initializes the instance (root org)
|
||||
--- Initializes the instance (root org)
|
||||
-- can only be run once, as only one instance can exist
|
||||
-- @function modpol.orgs.init_instance
|
||||
function modpol.orgs.init_instance()
|
||||
local error_msg
|
||||
if modpol.orgs.array[1] then
|
||||
@ -98,7 +104,10 @@ function modpol.orgs.init_instance()
|
||||
|
||||
local instance = temp_org()
|
||||
instance.id = 1
|
||||
instance.name = "root"
|
||||
instance.name = "Root"
|
||||
for i,v in pairs(modpol.modules) do
|
||||
instance.policies[i] = {}
|
||||
end
|
||||
|
||||
setmetatable(instance, modpol.orgs)
|
||||
|
||||
@ -114,8 +123,8 @@ end
|
||||
|
||||
-- FUNCTIONS BEYOND HERE OPERATE ON ORG OBJECTS
|
||||
|
||||
-- =======================================================
|
||||
-- records a log message to the modpol ledger
|
||||
--- Records a log message to the modpol ledger
|
||||
-- @function modpol.orgs:record
|
||||
function modpol.orgs:record(msg, entry_type)
|
||||
local entry = {
|
||||
timestamp = '',
|
||||
@ -148,10 +157,12 @@ function modpol.orgs:record(msg, entry_type)
|
||||
modpol.store_data()
|
||||
end
|
||||
|
||||
-- ==================================================
|
||||
-- adds a new sub org to the org it is called on
|
||||
-- input: name (string), user (string)
|
||||
-- ex: instance:add_org('town hall')
|
||||
--- Adds a new sub org to the org it is called on.
|
||||
-- Ex: instance:add_org('town hall')
|
||||
-- @function modpol.orgs:add_org
|
||||
-- @param name (string) name of new org
|
||||
-- @param user (string)
|
||||
-- @return child org created
|
||||
function modpol.orgs:add_org(name, user)
|
||||
if self.id == nil then
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':add_org -> add_org can only be called by another org')
|
||||
@ -175,7 +186,7 @@ function modpol.orgs:add_org(name, user)
|
||||
child_org.name = name
|
||||
child_org.parent = self.id
|
||||
child_org.processes = {}
|
||||
child_org.modules = self.modules
|
||||
child_org.policies = modpol.util.copy_table(self.policies)
|
||||
|
||||
setmetatable(child_org, modpol.orgs)
|
||||
|
||||
@ -194,10 +205,10 @@ function modpol.orgs:add_org(name, user)
|
||||
return child_org
|
||||
end
|
||||
|
||||
-- ========================================
|
||||
-- recursively deletes an org and its suborgs
|
||||
-- leaves entry in modpol.orgs.array as a string "removed"
|
||||
-- note: "reason" param was removed, can be added back
|
||||
--- Recursively deletes an org and its suborgs
|
||||
-- Leaves entry in modpol.orgs.array as a string "removed".
|
||||
-- Note: "reason" param was removed, can be added back
|
||||
-- @function modpol.orgs:delete
|
||||
function modpol.orgs:delete()
|
||||
if self.id == 1 then
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':delete -> cannot delete instance')
|
||||
@ -207,7 +218,7 @@ function modpol.orgs:delete()
|
||||
if #self.children > 0 then
|
||||
for i, child_id in pairs(self.children) do
|
||||
local child = modpol.orgs.get_org(child_id)
|
||||
modpol.ocutil.log(child_id, child)
|
||||
modpol.ocutil.log("Deleting child org...")
|
||||
child:delete()
|
||||
end
|
||||
end
|
||||
@ -219,9 +230,10 @@ function modpol.orgs:delete()
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- ===========================================
|
||||
-- internal function to get the index of a member name
|
||||
--- Internal function to get the index of a member name
|
||||
-- @function modpol.orgs:get_member_index
|
||||
-- @param member
|
||||
-- @return index of given member
|
||||
function modpol.orgs:get_member_index(member)
|
||||
for k, v in ipairs(self.members) do
|
||||
if v == member then
|
||||
@ -230,8 +242,9 @@ function modpol.orgs:get_member_index(member)
|
||||
end
|
||||
end
|
||||
|
||||
-- ===========================================
|
||||
-- adds a user to an org
|
||||
--- Adds a user to an org
|
||||
-- @function modpol.orgs:add_member
|
||||
-- @param user
|
||||
function modpol.orgs:add_member(user)
|
||||
for id, name in ipairs(self.members) do
|
||||
if user == name then
|
||||
@ -253,8 +266,9 @@ function modpol.orgs:add_member(user)
|
||||
|
||||
end
|
||||
|
||||
-- =======================================
|
||||
-- removes a user from an org
|
||||
--- Removes a user from an org
|
||||
-- @function modpol.orgs:remove_member
|
||||
-- @param user
|
||||
function modpol.orgs:remove_member(user)
|
||||
-- sets the array index to an empty string so that consecutive list is preserved
|
||||
-- empty spots will get filled in by new members
|
||||
@ -268,8 +282,10 @@ function modpol.orgs:remove_member(user)
|
||||
self:record('Removed member ' .. user, 'del_member')
|
||||
end
|
||||
|
||||
-- ===========================================
|
||||
-- boolean check whether user is an org
|
||||
--- Boolean check whether user is an org
|
||||
-- @function modpol.orgs:has_member
|
||||
-- @param user
|
||||
-- @return true if user is in org, false if not
|
||||
function modpol.orgs:has_member(user)
|
||||
local user_index = self:get_member_index(user)
|
||||
if user_index then
|
||||
@ -279,9 +295,9 @@ function modpol.orgs:has_member(user)
|
||||
end
|
||||
end
|
||||
|
||||
-- ==================================
|
||||
-- Function: modpol.orgs:list_members()
|
||||
-- output: a table of the names (string) of members
|
||||
---
|
||||
-- @function modpol.orgs:list_members()
|
||||
-- @return a table of the names (string) of members
|
||||
function modpol.orgs:list_members()
|
||||
local members = {}
|
||||
for k, v in ipairs(self.members) do
|
||||
@ -290,8 +306,9 @@ function modpol.orgs:list_members()
|
||||
return members
|
||||
end
|
||||
|
||||
-- ==============================
|
||||
-- because member list uses lazy deletion, using #org.members will not show an accurate number
|
||||
--- Because member list uses lazy deletion, using #org.members will not show an accurate number
|
||||
-- @function modpol.orgs:get_member_count
|
||||
-- @return numbers of members
|
||||
function modpol.orgs:get_member_count()
|
||||
local count = 0
|
||||
for k, v in ipairs(self.members) do
|
||||
@ -302,17 +319,3 @@ function modpol.orgs:get_member_count()
|
||||
end
|
||||
return count
|
||||
end
|
||||
-- ====================================
|
||||
-- adds a new policy to the policy table
|
||||
-- must define the policy type, process associated with it, and whether the request must be made by an org member
|
||||
function modpol.orgs:set_policy(policy_type, process_type, must_be_member)
|
||||
local new_policy = {
|
||||
process_type = process_type,
|
||||
must_be_member = must_be_member
|
||||
}
|
||||
self.policies[policy_type] = new_policy
|
||||
modpol.ocutil.log('Added policy for ' .. policy_type .. ' in ' .. self.name)
|
||||
self:record('Added policy for ' .. policy_type, 'set_policy')
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,35 +1,36 @@
|
||||
--- Process functions for orgs
|
||||
-- @module modpol.orgs.process
|
||||
|
||||
function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
--- Call modules
|
||||
-- @function modpol.orgs.call_module
|
||||
-- @param module_slug Same as module name
|
||||
-- @param intiator Initiator for module
|
||||
-- @param config Config for module
|
||||
-- @param result
|
||||
function modpol.orgs:call_module(module_slug, initiator, config, result, parent_id)
|
||||
if not modpol.modules[module_slug] then
|
||||
modpol.ocutil.log('Error in ' .. self.name .. ':call_module -> module "' .. module_slug .. '" not found')
|
||||
return
|
||||
end
|
||||
|
||||
local empty_index = nil
|
||||
-- linear search for empty process slots (lazy deletion)
|
||||
for k, v in ipairs(self.processes) do
|
||||
if v == 'deleted' then
|
||||
empty_index = k
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local index
|
||||
-- attempts to fill empty spots in list, otherwise appends to end
|
||||
if empty_index then
|
||||
index = empty_index
|
||||
else
|
||||
index = #self.processes + 1
|
||||
end
|
||||
local index = #self.processes + 1
|
||||
|
||||
local module = modpol.modules[module_slug]
|
||||
|
||||
-- sets default values for undeclared config variables
|
||||
if #module.config > 0 then
|
||||
-- first applies any relevant org policies
|
||||
-- then overrides with the config values given on input
|
||||
local new_config = {}
|
||||
if modpol.util.num_pairs(module.config) > 0 then
|
||||
for k, v in pairs(module.config) do
|
||||
if config[k] == nil then
|
||||
config[k] = v
|
||||
new_config[k] = v
|
||||
-- overrides with org policies
|
||||
if self.policies[module_slug]
|
||||
and self.policies[module_slug][k] then
|
||||
new_config[k] = self.policies[module_slug][k]
|
||||
end
|
||||
-- overrides with input settings
|
||||
if config and config[k] then
|
||||
new_config[k] = config[k]
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -40,23 +41,74 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
|
||||
initiator = initiator,
|
||||
org = self,
|
||||
id = index,
|
||||
config = config,
|
||||
data = module.data,
|
||||
parent_id = parent_id,
|
||||
children = {},
|
||||
config = modpol.util.copy_table(new_config),
|
||||
data = modpol.util.copy_table(module.data),
|
||||
slug = module_slug
|
||||
}
|
||||
|
||||
-- call module wrapper for modules, passes its id to child process when called
|
||||
function new_process:call_module(module_slug, initiator, config, result)
|
||||
local child_id = self.org:call_module(module_slug, initiator, config, result, self.id)
|
||||
table.insert(self.children, child_id)
|
||||
end
|
||||
|
||||
setmetatable(new_process, new_process.metatable)
|
||||
|
||||
self.processes[index] = new_process
|
||||
self.processes[index]:initiate(result)
|
||||
local msg = "Initiating "..module_slug..
|
||||
" process id "..index.." in org "..self.name
|
||||
|
||||
return index
|
||||
end
|
||||
|
||||
function modpol.orgs:delete_process(id)
|
||||
self.processes[id] = 'deleted'
|
||||
--- Get the root process of the given id
|
||||
-- @function modpol.orgs.get_root_process
|
||||
-- @param id
|
||||
-- @return root process
|
||||
function modpol.orgs:get_root_process(id)
|
||||
local process = self.processes[id]
|
||||
while (process.parent_id) do
|
||||
process = self.processes[process.parent_id]
|
||||
end
|
||||
return process
|
||||
end
|
||||
|
||||
--- Delete the process given id
|
||||
-- @function modpol.orgs.delete_process
|
||||
-- @param id
|
||||
function modpol.orgs:delete_process(id)
|
||||
local process = self.processes[id]
|
||||
if process and process ~= "deleted" then
|
||||
-- recursively deletes any children
|
||||
if #process.children > 0 then
|
||||
for i, child_id in pairs(process.children) do
|
||||
self:delete_process(child_id)
|
||||
end
|
||||
end
|
||||
local msg = "Deleting " .. self.processes[id].slug .. " process id "..id.." in org "..self.name
|
||||
modpol.ocutil.log(msg)
|
||||
self:record(msg, self.processes[id].slug)
|
||||
self:wipe_pending_actions(id)
|
||||
-- sets process to 'deleted' in process table
|
||||
self.processes[id] = 'deleted'
|
||||
end
|
||||
end
|
||||
|
||||
--- Delete process tree by id
|
||||
-- @function modpol.orgs:delete_process_tree
|
||||
-- @param id Id of process tree
|
||||
function modpol.orgs:delete_process_tree(id)
|
||||
self:delete_process(self:get_root_process(id).id)
|
||||
end
|
||||
|
||||
--- Add a new pending action
|
||||
-- @function modpol.orgs:add_pending_action
|
||||
-- @param process_id Process id
|
||||
-- @param user User adding the action
|
||||
-- @param callback
|
||||
function modpol.orgs:add_pending_action(process_id, user, callback)
|
||||
self.pending[user] = self.pending[user] or {}
|
||||
self.pending[user][process_id] = callback
|
||||
@ -64,18 +116,29 @@ function modpol.orgs:add_pending_action(process_id, user, callback)
|
||||
user, "New pending action in org "..self.name)
|
||||
end
|
||||
|
||||
--- Remove a pending action
|
||||
-- @function modpol.orgs:remove_pending_action
|
||||
-- @param process_id Process id to be removed
|
||||
-- @param user
|
||||
function modpol.orgs:remove_pending_action(process_id, user)
|
||||
if self.pending[user] then
|
||||
self.pending[user][process_id] = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Wipe all pending actions for process
|
||||
-- @function modpol.orgs:wipe_pending_actions
|
||||
-- @param process_id
|
||||
function modpol.orgs:wipe_pending_actions(process_id)
|
||||
for user in pairs(self.pending) do
|
||||
self.pending[user][process_id] = nil
|
||||
end
|
||||
end
|
||||
|
||||
--- Check if there are pending actions for user
|
||||
-- @function modpol.orgs:has_pending_actions
|
||||
-- @param user User
|
||||
-- @return True if there are pending actions for a user, false if not
|
||||
function modpol.orgs:has_pending_actions(user)
|
||||
-- next() will return the next pair in a table
|
||||
-- if next() returns nil, the table is empty
|
||||
@ -90,12 +153,23 @@ function modpol.orgs:has_pending_actions(user)
|
||||
end
|
||||
end
|
||||
|
||||
--- Interact a user with given process
|
||||
-- @function modpol.orgs:interact
|
||||
-- @param process_id
|
||||
-- @param user
|
||||
function modpol.orgs:interact(process_id, user)
|
||||
local process = self.processes[process_id]
|
||||
if self.pending[user] then
|
||||
local callback = self.pending[user][process_id]
|
||||
if callback then
|
||||
if callback and process ~= "deleted" then
|
||||
-- get data in case callback ends process
|
||||
local slug = self.processes[process_id].slug
|
||||
-- run callback
|
||||
process[callback](process, user)
|
||||
-- record org data
|
||||
local msg = "Updating "..slug..
|
||||
" process id "..process_id.." in org "..self.name
|
||||
self:record(msg, slug)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
27
modpol_core/orgs/users.lua
Normal file
27
modpol_core/orgs/users.lua
Normal file
@ -0,0 +1,27 @@
|
||||
-- /users.lua
|
||||
-- User-related functions for Modular Politics
|
||||
|
||||
-- ===================================================================
|
||||
-- Function: modpol.list_users
|
||||
-- Params: org
|
||||
-- Outputs: Table of user names
|
||||
--
|
||||
-- This may be overwritten by the platform-specific interface
|
||||
|
||||
modpol.list_users = function(org)
|
||||
local users = {}
|
||||
if (org == nil) then -- no specified org; all players
|
||||
if modpol.orgs["instance"]
|
||||
and modpol.orgs["instance"]["members"] then
|
||||
-- if instance exists and has membership
|
||||
users = modpol.orgs["instance"]["members"]
|
||||
else
|
||||
users = {}
|
||||
end
|
||||
else -- if an org is specified
|
||||
if (modpol.orgs[org] ~= nil) then -- org exists
|
||||
users = modpol.orgs[org]["members"]
|
||||
end
|
||||
end
|
||||
return users
|
||||
end
|
23
modpol_core/storage/store-modules-legacy.lua
Normal file
23
modpol_core/storage/store-modules-legacy.lua
Normal file
@ -0,0 +1,23 @@
|
||||
modpol.load_modules = function(path)
|
||||
dofile (path .. "/add_child_org_consent.lua")
|
||||
dofile (path .. "/add_child_org.lua")
|
||||
dofile (path .. "/change_modules.lua")
|
||||
dofile (path .. "/change_policy.lua")
|
||||
dofile (path .. "/consent.lua")
|
||||
dofile (path .. "/create_token.lua")
|
||||
dofile (path .. "/defer_consent.lua")
|
||||
dofile (path .. "/display_policies.lua")
|
||||
dofile (path .. "/display_processes.lua")
|
||||
dofile (path .. "/join_org_consent.lua")
|
||||
dofile (path .. "/leave_org.lua")
|
||||
dofile (path .. "/message_org.lua")
|
||||
dofile (path .. "/randomizer.lua")
|
||||
dofile (path .. "/remove_child_consent.lua")
|
||||
dofile (path .. "/remove_member_consent.lua")
|
||||
dofile (path .. "/remove_org_consent.lua")
|
||||
dofile (path .. "/remove_org.lua")
|
||||
dofile (path .. "/remove_process.lua")
|
||||
dofile (path .. "/rename_org_consent.lua")
|
||||
dofile (path .. "/send_token.lua")
|
||||
dofile (path .. "/tokenomics.lua")
|
||||
end
|
59
modpol_core/storage/store-modules.lua
Normal file
59
modpol_core/storage/store-modules.lua
Normal file
@ -0,0 +1,59 @@
|
||||
local lfs
|
||||
-- checks if lua file system is installed
|
||||
local using_lfs = pcall(function() lfs = require "lfs" end)
|
||||
|
||||
-- switches to legacy module loading if lfs is not available
|
||||
if using_lfs then
|
||||
|
||||
-- loads file names to ignore into a table
|
||||
function fetch_ignores(module_path)
|
||||
local ignore_list = {}
|
||||
-- checks if ignore.txt exists
|
||||
local f_test = io.open(module_path .. "/ignore.txt", "r")
|
||||
if not f_test then return {} end
|
||||
|
||||
-- puts each line of ignore.txt into the table
|
||||
local f = io.lines(module_path .. "/ignore.txt")
|
||||
for line in f do
|
||||
table.insert(ignore_list, line)
|
||||
end
|
||||
return ignore_list
|
||||
end
|
||||
|
||||
-- checks if a string is in a list
|
||||
function check_list(ignore_list, name)
|
||||
for i, v in ipairs(ignore_list) do
|
||||
if v == name then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
modpol.load_modules = function(module_path)
|
||||
local loaded = 0
|
||||
local ignored = 0
|
||||
local ignores = fetch_ignores(module_path)
|
||||
for file in lfs.dir(module_path) do
|
||||
if file == "." or file == ".." then
|
||||
-- ignoring current and parent directory
|
||||
else
|
||||
-- only looks for .lua files
|
||||
if string.sub(file, -4, -1) == ".lua" then
|
||||
|
||||
-- doesn't load files in the ignore.txt
|
||||
if check_list(ignores, file) then
|
||||
ignored = ignored + 1
|
||||
else
|
||||
dofile(module_path .. "/" .. file)
|
||||
loaded = loaded + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
print(loaded .. " modules loaded (" .. ignored .. " ignored)")
|
||||
end
|
||||
|
||||
else
|
||||
dofile (modpol.topdir .. "/storage/store-modules-legacy.lua")
|
||||
end
|
109
modpol_core/storage/unix-storage.lua
Normal file
109
modpol_core/storage/unix-storage.lua
Normal file
@ -0,0 +1,109 @@
|
||||
-- ===================================================================
|
||||
-- /unix-storage.lua
|
||||
-- Persistent storage in /data using Serpent Serializer
|
||||
-- Unix systems only
|
||||
|
||||
modpol.datadir = modpol.topdir .. "/data"
|
||||
modpol.file_ledger = modpol.datadir .. "/ledger.dat"
|
||||
modpol.file_orgs = modpol.datadir .. "/orgs.dat"
|
||||
|
||||
os.execute ("mkdir -p " .. modpol.datadir)
|
||||
|
||||
modpol.ocutil.setlogdir (modpol.datadir)
|
||||
modpol.ocutil.setlogname ("modpol.log")
|
||||
|
||||
modpol.serpent = {}
|
||||
dofile (modpol.topdir .. "/util/serpent/serpent.lua")
|
||||
|
||||
-- ===================================================================
|
||||
|
||||
local write_file = function(path, data)
|
||||
local file, err
|
||||
file, err = io.open(path, "w")
|
||||
if err then print(err) os.exit(1) end
|
||||
file:write(data)
|
||||
file:close()
|
||||
end
|
||||
|
||||
local read_file = function(path)
|
||||
local file, err
|
||||
file, err = io.open(path, "r")
|
||||
if err then return nil end
|
||||
local data = file:read()
|
||||
file:close()
|
||||
return data
|
||||
end
|
||||
|
||||
-- ===================================================================
|
||||
|
||||
local store_ledger = function(verbose)
|
||||
local serialized_ledger = modpol.serpent.dump(modpol.ledger)
|
||||
write_file(modpol.file_ledger, serialized_ledger)
|
||||
|
||||
local count = 0
|
||||
for _ in pairs(modpol.ledger) do count = count + 1 end
|
||||
|
||||
if verbose then modpol.ocutil.log(count .. " ledger entries stored to disk")
|
||||
end
|
||||
end
|
||||
|
||||
local store_orgs = function(verbose)
|
||||
local serialized_orgs = modpol.serpent.dump(modpol.orgs)
|
||||
write_file(modpol.file_orgs, serialized_orgs)
|
||||
|
||||
local count = 0
|
||||
for _ in pairs(modpol.orgs.array) do count = count + 1 end
|
||||
|
||||
if verbose then modpol.ocutil.log(count .. " orgs stored to disk")
|
||||
end
|
||||
end
|
||||
|
||||
modpol.store_data = function(verbose)
|
||||
store_ledger(verbose)
|
||||
store_orgs(verbose)
|
||||
end
|
||||
|
||||
-- ===================================================================
|
||||
|
||||
local load_ledger = function()
|
||||
local obj = read_file(modpol.file_ledger)
|
||||
if obj ~= nil then
|
||||
local func, err = load(obj)
|
||||
if err then
|
||||
modpol.ocutil.log("Error loading ledger data")
|
||||
os.exit(1)
|
||||
end
|
||||
modpol.ledger = func()
|
||||
|
||||
local count = 0
|
||||
for _ in pairs(modpol.ledger) do count = count + 1 end
|
||||
|
||||
modpol.ocutil.log(count .. " ledger entries loaded from disk")
|
||||
else
|
||||
modpol.ocutil.log("No stored ledger data found")
|
||||
end
|
||||
end
|
||||
|
||||
local load_orgs = function()
|
||||
local obj = read_file(modpol.file_orgs)
|
||||
if obj ~= nil then
|
||||
local func, err = load(obj)
|
||||
if err then
|
||||
modpol.ocutil.log("Error loading org data")
|
||||
os.exit(1)
|
||||
end
|
||||
modpol.orgs = func()
|
||||
|
||||
local count = 0
|
||||
for _ in pairs(modpol.orgs.array) do count = count + 1 end
|
||||
|
||||
modpol.ocutil.log(count .. " orgs loaded from disk")
|
||||
else
|
||||
modpol.ocutil.log("No stored orgs found")
|
||||
end
|
||||
end
|
||||
|
||||
modpol.load_storage = function()
|
||||
load_ledger()
|
||||
load_orgs()
|
||||
end
|
@ -1,9 +1,34 @@
|
||||
--- @function modpol.copy_table
|
||||
-- Returns a copy of the table inputted
|
||||
function modpol.copy_table(t)
|
||||
--- Miscellaneous functions
|
||||
-- @module modpol.util.misc
|
||||
|
||||
modpol.util = {}
|
||||
|
||||
--- Returns a copy of the table inputted
|
||||
-- @function modpol.util.copy_table
|
||||
-- @param t table to copy
|
||||
-- @return copy of table
|
||||
function modpol.util.copy_table(t)
|
||||
local t2 = {}
|
||||
if pairs(t) then
|
||||
for k,v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
t2[k] = modpol.util.copy_table(v)
|
||||
else
|
||||
t2[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
return t2
|
||||
end
|
||||
|
||||
--- Returns the number of elements in a pairs table
|
||||
-- @function modpol.util.num_pairs
|
||||
-- @param t pairs table
|
||||
-- @return number of elements in pairs table
|
||||
function modpol.util.num_pairs(t)
|
||||
local i = 0
|
||||
for k,v in pairs(t) do
|
||||
i = i + 1
|
||||
end
|
||||
return i
|
||||
end
|
||||
|
@ -9,11 +9,7 @@ local localdir = minetest.get_modpath("modpol") .. "/modpol_minetest"
|
||||
|
||||
--overrides
|
||||
dofile (localdir .. "/overrides/interactions.lua")
|
||||
|
||||
--testing command for "singleplayer"
|
||||
function modpol.msg(text)
|
||||
modpol.interactions.message("singleplayer",text)
|
||||
end
|
||||
dofile (localdir .. "/overrides/users.lua")
|
||||
|
||||
-- ===================================================================
|
||||
-- Minetest Chatcommands
|
||||
|
@ -34,8 +34,8 @@ regchat(
|
||||
"mptest", {
|
||||
privs = {privs=true},
|
||||
func = function(user)
|
||||
modpol.instance.members = modpol.list_users()
|
||||
modpol.orgs.reset()
|
||||
modpol.instance:add_member(user)
|
||||
modpol.interactions.dashboard(user)
|
||||
return true, "Reset orgs"
|
||||
end,
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- Set privilege to org members
|
||||
-- @module priv_to_org
|
||||
-- Allows initiator to grant a priv they have to all members of an org
|
||||
-- @module priv_to_org
|
||||
|
||||
local priv_to_org = {
|
||||
name = "Set privilege to org members",
|
||||
@ -14,13 +14,13 @@ priv_to_org.data = {
|
||||
priv_to_org.config = {
|
||||
}
|
||||
|
||||
--- (Required): initiate function
|
||||
-- @param result (optional) Callback if this module is embedded in other modules
|
||||
-- @function initiate
|
||||
--- Initiate function
|
||||
-- @function priv_to_org:initiate
|
||||
-- @param result
|
||||
function priv_to_org:initiate(result)
|
||||
local player_privs = minetest.get_player_privs(self.initiator)
|
||||
-- construct table for display
|
||||
local player_privs_table = {"View..."}
|
||||
local player_privs_table = {}
|
||||
for k,v in pairs(player_privs) do
|
||||
if player_privs[k] then
|
||||
table.insert(player_privs_table,k)
|
||||
@ -31,6 +31,7 @@ function priv_to_org:initiate(result)
|
||||
"Which privilege do you want to share with members of "..self.org.name.."?",
|
||||
player_privs_table,
|
||||
function(input)
|
||||
modpol.interactions.org_dashboard(self.initiator,self.org.id)
|
||||
for i,member in ipairs(self.org.members) do
|
||||
local member_privs = minetest.get_player_privs(member)
|
||||
member_privs[input] = true
|
||||
@ -44,5 +45,4 @@ function priv_to_org:initiate(result)
|
||||
if result then result() end
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.priv_to_org = priv_to_org
|
||||
|
@ -1,5 +1,4 @@
|
||||
-- INTERACTIONS.LUA (for Minetest)
|
||||
|
||||
--- INTERACTIONS.LUA (for Minetest)
|
||||
-- CONTEXTUAL STUFF
|
||||
-- ================
|
||||
|
||||
@ -48,18 +47,33 @@ function modpol.interactions.dashboard(user)
|
||||
local all_orgs = modpol.orgs.list_all()
|
||||
local user_orgs = modpol.orgs.user_orgs(user)
|
||||
local all_users = modpol.instance:list_members()
|
||||
-- pending list
|
||||
local user_pending_count = 0
|
||||
local user_pending = {}
|
||||
for k,v in ipairs(modpol.orgs.array) do
|
||||
if v.pending and v.pending[user] then
|
||||
if modpol.util.num_pairs(v.pending[user]) ~= 0 then
|
||||
table.insert(user_pending, v.name)
|
||||
user_pending_count = user_pending_count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,6]",
|
||||
"label[0.5,0.5;M O D U L A R P O L I T I C S]",
|
||||
"size[10,8]",
|
||||
"hypertext[0.5,0.5;9,1;title;<big>Org dashboard</big>]",
|
||||
"label[0.5,2;All orgs:]",
|
||||
"dropdown[2,1.5;7,0.8;all_orgs;"..formspec_list(all_orgs)..";;]",
|
||||
"dropdown[2.5,1.5;7,0.8;all_orgs;View...,"..formspec_list(all_orgs)..";;]",
|
||||
"label[0.5,3;Your orgs:]",
|
||||
"dropdown[2,2.5;7,0.8;user_orgs;"..formspec_list(user_orgs)..";;]",
|
||||
"dropdown[2.5,2.5;7,0.8;user_orgs;View...,"..formspec_list(user_orgs)..";;]",
|
||||
"label[0.5,4;All users:]",
|
||||
"dropdown[2,3.5;7,0.8;all_users;"..formspec_list(all_users)..";;]",
|
||||
"button_exit[8.5,5;1,0.8;close;Close]",
|
||||
"dropdown[2.5,3.5;7,0.8;all_users;View...,"..formspec_list(all_users)..";;]",
|
||||
"label[0.5,5;Pending ("..user_pending_count.."):]",
|
||||
"dropdown[2.5,4.5;7,0.8;pending;View...,"..formspec_list(user_pending)..";;]",
|
||||
"button[0.5,7;1,0.8;refresh;Refresh]",
|
||||
"button_exit[8.5,7;1,0.8;close;Close]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
-- present to player
|
||||
@ -70,15 +84,26 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
if formname == "modpol:dashboard" then
|
||||
local pname = player:get_player_name()
|
||||
if nil then
|
||||
-- buttons first
|
||||
-- none here right now!
|
||||
|
||||
-- Put all dropdowns at the end
|
||||
elseif fields.close then
|
||||
minetest.close_formspec(pname, formname)
|
||||
elseif fields.all_orgs or fields.user_orgs then
|
||||
local org_name = fields.all_orgs or fields.user_orgs
|
||||
modpol.interactions.org_dashboard(pname, org_name)
|
||||
elseif fields.refresh then
|
||||
modpol.interactions.dashboard(pname)
|
||||
-- Put all dropdowns at the end
|
||||
elseif fields.all_users
|
||||
and fields.all_users ~= "View..." then
|
||||
modpol.interactions.user_dashboard(
|
||||
pname,
|
||||
fields.all_users,
|
||||
function()
|
||||
modpol.interactions.dashboard(pname)
|
||||
end
|
||||
)
|
||||
elseif fields.all_orgs or fields.user_orgs or fields.pending then
|
||||
local org_name = fields.all_orgs or fields.user_orgs or fields.pending
|
||||
if org_name ~= "View..." then
|
||||
modpol.interactions.org_dashboard(
|
||||
pname, org_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
@ -107,6 +132,9 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
if parent then parent = parent.name
|
||||
else parent = "none" end
|
||||
|
||||
-- prepare members menu
|
||||
local members = org.members
|
||||
|
||||
-- prepare children menu
|
||||
local children = {}
|
||||
for k,v in ipairs(org.children) do
|
||||
@ -114,35 +142,34 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
table.insert(children, this_child.name)
|
||||
end
|
||||
table.sort(children)
|
||||
table.insert(children,1,"View...")
|
||||
|
||||
-- prepare modules menu
|
||||
local modules = {}
|
||||
if org.modules then
|
||||
for k,v in pairs(org.modules) do
|
||||
if not v.hide then -- hide utility modules
|
||||
local module_entry = v.name..
|
||||
" ["..v.slug.."]"
|
||||
if modpol.modules then
|
||||
for k,v in pairs(modpol.modules) do
|
||||
if not v.hide and -- hide utility modules
|
||||
org.policies[k] then -- org includes it
|
||||
local module_entry = v.name
|
||||
table.insert(modules, module_entry)
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(modules)
|
||||
table.insert(modules,1,"View...")
|
||||
|
||||
-- prepare pending menu
|
||||
local pending = {}
|
||||
local num_pending = 0
|
||||
if org.pending[user] then
|
||||
for k,v in pairs(org.pending[user]) do
|
||||
if org.processes[k] ~= "deleted" then
|
||||
local pending_string = org.processes[k].name
|
||||
.." ["..k.."]"
|
||||
table.insert(pending, pending_string)
|
||||
num_pending = num_pending + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(pending)
|
||||
table.insert(pending,1,"View...")
|
||||
|
||||
-- set player context
|
||||
local user_context = {}
|
||||
@ -152,17 +179,18 @@ function modpol.interactions.org_dashboard(user, org_string)
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,8]",
|
||||
"label[0.5,0.5;Org: "..
|
||||
minetest.formspec_escape(org.name)..membership_toggle(org.name).."]",
|
||||
"label[0.5,1;Parent: "..parent..membership_toggle(parent).."]",
|
||||
"hypertext[0.5,0.5;9,1;title;<big>Org: <b>"..
|
||||
minetest.formspec_escape(org.name).."</b>"..membership_toggle(org.name).."</big>]",
|
||||
"label[0.5,1.25;Parent: "..parent..membership_toggle(parent).."]",
|
||||
"label[0.5,2;Members:]",
|
||||
"dropdown[2,1.5;7,0.8;user_orgs;"..formspec_list(org.members)..";;]",
|
||||
"label[0.5,3;Children:]",
|
||||
"dropdown[2,2.5;7,0.8;children;"..formspec_list(children)..";;]",
|
||||
"dropdown[2.5,1.5;7,0.8;members;View...,"..formspec_list(members)..";;]",
|
||||
"label[0.5,3;Child orgs:]",
|
||||
"dropdown[2.5,2.5;7,0.8;children;View...,"..formspec_list(children)..";;]",
|
||||
"label[0.5,4;Modules:]",
|
||||
"dropdown[2,3.5;7,0.8;modules;"..formspec_list(modules)..";;]",
|
||||
"dropdown[2.5,3.5;7,0.8;modules;View...,"..formspec_list(modules)..";;]",
|
||||
"label[0.5,5;Pending ("..num_pending.."):]",
|
||||
"dropdown[2,4.5;7,0.8;pending;"..formspec_list(pending)..";;]",
|
||||
"dropdown[2.5,4.5;7,0.8;pending;View...,"..formspec_list(pending)..";;]",
|
||||
"button[0.5,7;1,0.8;refresh;Refresh]",
|
||||
"button[8.5,7;1,0.8;back;Back]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
@ -183,23 +211,46 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
if nil then
|
||||
elseif fields.back then
|
||||
modpol.interactions.dashboard(pname)
|
||||
elseif fields.refresh then
|
||||
modpol.interactions.org_dashboard(pname, org.name)
|
||||
|
||||
-- Put all dropdowns at the end
|
||||
-- Receiving modules
|
||||
elseif fields.members
|
||||
and fields.members ~= "View..." then
|
||||
modpol.interactions.user_dashboard(
|
||||
pname,
|
||||
fields.members,
|
||||
function()
|
||||
modpol.interactions.org_dashboard(
|
||||
pname, org.name)
|
||||
end
|
||||
)
|
||||
elseif fields.modules
|
||||
and fields.modules ~= "View..." then
|
||||
local module = string.match(
|
||||
fields.modules,"%[(.*)%]")
|
||||
local module = nil
|
||||
for k,v in pairs(modpol.modules) do
|
||||
if fields.modules == v.name
|
||||
and org.policies[v.slug] then
|
||||
module = v
|
||||
end end
|
||||
if module then
|
||||
modpol.interactions.binary_poll_user(
|
||||
pname,
|
||||
modpol.modules[module].name..":\n"..
|
||||
modpol.modules[module].desc.."\n"..
|
||||
"Proceed?",
|
||||
module.name..":\n"..
|
||||
module.desc.."\n"..
|
||||
modpol.interactions.get_policy_string(
|
||||
org.name, module.slug, ", ")..
|
||||
"\n".."Proceed?",
|
||||
function(input)
|
||||
if input == "Yes" then
|
||||
org:call_module(module, pname)
|
||||
org:call_module(module.slug, pname)
|
||||
elseif input == "No" then
|
||||
modpol.interactions.org_dashboard(
|
||||
pname, org.id)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Receiving pending
|
||||
elseif fields.pending
|
||||
@ -220,23 +271,66 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
end
|
||||
end)
|
||||
|
||||
--- Function: modpol.interactions.user_dashboard
|
||||
-- Displays a dashboard about a particular user
|
||||
-- @param viewer Name of user viewing the dashboard (string)
|
||||
-- @param user Name of user being viewed (string)
|
||||
-- @param completion Optional function to call on Done button
|
||||
function modpol.interactions.user_dashboard(viewer, user, completion)
|
||||
local user_orgs = modpol.orgs.user_orgs(user)
|
||||
|
||||
-- Function: modpol.interactions.policy_dashboard
|
||||
-- input: user (string), org_id (int), policy (string)
|
||||
-- output: opens a dashboard for viewing/editing policy details
|
||||
-- TODO
|
||||
function modpol.interactions.policy_dashboard(
|
||||
user, org_id, policy)
|
||||
modpol.interactions.message(
|
||||
user,
|
||||
"Not yet implemented: " .. policy)
|
||||
-- set player context
|
||||
local user_context = {}
|
||||
user_context["viewer"] = viewer
|
||||
user_context["user"] = user
|
||||
user_context["completion"] = completion
|
||||
_contexts[viewer] = user_context
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,8]",
|
||||
"hypertext[0.5,0.5;9,1;title;<big>User: <b>"..user.."</b></big>]",
|
||||
"label[0.5,2;User's orgs:]",
|
||||
"dropdown[2.5,1.5;7,0.8;user_orgs;View...,"..formspec_list(user_orgs)..";;]",
|
||||
"button[0.5,7;1.5,0.8;message;Message]",
|
||||
"button_exit[8.5,7;1,0.8;close;Close]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
-- present to player
|
||||
minetest.show_formspec(viewer, "modpol:user_dashboard", formspec_string)
|
||||
end
|
||||
-- receive input
|
||||
minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
if formname == "modpol:user_dashboard" then
|
||||
local contexts = _contexts[player:get_player_name()]
|
||||
-- check fields
|
||||
if nil then
|
||||
elseif fields.message then
|
||||
modpol.interactions.message_user(
|
||||
contexts.viewer, contexts.user
|
||||
)
|
||||
elseif fields.back then
|
||||
if contexts.completion then
|
||||
completion()
|
||||
else
|
||||
modpol.interactions.dashboard(
|
||||
contexts.viewer)
|
||||
end
|
||||
-- dropdown fields
|
||||
elseif fields.user_orgs
|
||||
and fields.user_orgs ~= "View..." then
|
||||
modpol.interactions.org_dashboard(
|
||||
contexts.viewer, fields.user_orgs)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
-- INTERACTION FUNCTIONS
|
||||
-- =====================
|
||||
-- INTERACTION PRIMITIVES
|
||||
-- ======================
|
||||
|
||||
-- Function: modpol.interactions.message
|
||||
-- Produces a brief message to a user
|
||||
-- input: user (string), message (string)
|
||||
-- output: displays message to specified user
|
||||
function modpol.interactions.message(user, message)
|
||||
@ -245,6 +339,72 @@ function modpol.interactions.message(user, message)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Function: modpol.interactions.message_user
|
||||
-- Gets and sends a message from one user to another
|
||||
-- @param sender Name of user sending (string)
|
||||
-- @param recipient Name of user receiving (string)
|
||||
function modpol.interactions.message_user(sender, recipient)
|
||||
modpol.interactions.text_query(
|
||||
sender,
|
||||
"Message for "..recipient..":",
|
||||
function(input)
|
||||
modpol.interactions.message(
|
||||
recipient,
|
||||
input.." [from "..sender.."]")
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--- Function: modpol.interactions.display
|
||||
-- Displays complex data to a user
|
||||
-- @param user Name of target user (string)
|
||||
-- @param title Title of display (string)
|
||||
-- @param message Content of message (string or table of strings)
|
||||
-- @param completion Optional function for what happens when user is done
|
||||
function modpol.interactions.display(
|
||||
user, title, message, completion)
|
||||
-- set up contexts
|
||||
_contexts[user]["completion"] = completion
|
||||
-- set up output
|
||||
local output = ""
|
||||
if type(message) == "table" then
|
||||
output = table.concat(message,"\n")
|
||||
elseif type(message) == "string" then
|
||||
output = message
|
||||
elseif type(message) == "number" then
|
||||
output = message
|
||||
else
|
||||
modpol.interactions.message(
|
||||
self.initiator, "Error: message not typed for display")
|
||||
if completion then completion() else
|
||||
modpol.intereactions.dashboard(user)
|
||||
end
|
||||
return
|
||||
end
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,8]",
|
||||
"label[0.5,0.5;"..title.."]",
|
||||
"hypertext[0.5,1;9,5.5;display;<global background=black margin=10>"..output.."]",
|
||||
"button_exit[8.5,7;1,0.8;done;Done]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
-- present to player
|
||||
minetest.show_formspec(user, "modpol:display", formspec_string)
|
||||
end
|
||||
-- receive fields
|
||||
minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
local pname = player:get_player_name()
|
||||
if formname == "modpol:display" then
|
||||
if fields.done and _contexts[pname].completion then
|
||||
minetest.close_formspec(pname, formname)
|
||||
_contexts[pname].completion()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Function: modpol.interactions.text_query
|
||||
-- Overrides function at modpol/interactions.lua
|
||||
-- input: user (string), query (string), func (function)
|
||||
@ -253,10 +413,10 @@ function modpol.interactions.text_query(user, query, func)
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,4]",
|
||||
"size[10,6]",
|
||||
"label[0.5,1;", minetest.formspec_escape(query), "]",
|
||||
"field[0.5,1.25;9,0.8;input;;]",
|
||||
"button[0.5,2.5;1,0.8;yes;OK]",
|
||||
"field[0.5,3.25;9,0.8;input;;]",
|
||||
"button[0.5,4.5;1,0.8;yes;OK]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
-- present to player
|
||||
@ -289,14 +449,12 @@ end)
|
||||
-- func input: choice (string)
|
||||
-- output: calls func on user choice
|
||||
function modpol.interactions.dropdown_query(user, label, options, func)
|
||||
-- Add "View..." to the top of the list
|
||||
table.insert(options,1,"View...")
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,4]",
|
||||
"label[0.5,1;"..minetest.formspec_escape(label).."]",
|
||||
"dropdown[0.5,1.25;9,0.8;input;"..formspec_list(options)..";;]",
|
||||
"dropdown[0.5,1.25;9,0.8;input;View...,"..formspec_list(options)..";;]",
|
||||
"button[0.5,2.5;1,0.8;cancel;Cancel]",
|
||||
}
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
@ -320,8 +478,7 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
if not choice then
|
||||
-- empty, do nothing
|
||||
elseif func then
|
||||
--not sure if we should close
|
||||
--breaks sequential dropdown_queries:
|
||||
--causes issues with sequential dropdowns
|
||||
--minetest.close_formspec(pname, formname)
|
||||
func(choice)
|
||||
else
|
||||
@ -332,6 +489,82 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
--- Function: modpol.interactions.checkbox_query
|
||||
-- Allows user to select from a set of options
|
||||
-- @param user Name of user (string)
|
||||
-- @param label Query for user before options (string)
|
||||
-- @param options table of options and their checked status in the form {{"option_1_string", true}, {"option_2_string", false}}
|
||||
-- @param func function to be called with param "input", made up of the corrected table in the same format as the param options
|
||||
function modpol.interactions.checkbox_query(
|
||||
user, label, options, func)
|
||||
-- set up formspec
|
||||
-- prepare options
|
||||
local vertical = 0
|
||||
local checkbox_options = {}
|
||||
for i,v in ipairs(options) do
|
||||
local fs_line = ""
|
||||
vertical = i * .5
|
||||
fs_line = "checkbox[0,"..vertical..";checkbox_"..i..";"..
|
||||
minetest.formspec_escape(v[1])..";"..
|
||||
tostring(v[2]).."]"
|
||||
table.insert(checkbox_options, fs_line)
|
||||
end
|
||||
local max = vertical * 4
|
||||
local bar_height = vertical / 2
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[10,8]",
|
||||
"label[0.5,0.5;"..label.."]",
|
||||
"scrollbaroptions[arrows=default;max="..max..";smallstep=10;largestep=100;thumbsize="..bar_height.."]",
|
||||
"scrollbar[9,1;0.3,5.5;vertical;scroller;0]",
|
||||
"scroll_container[0.5,1;9,5.5;scroller;vertical]",
|
||||
}
|
||||
-- insert options
|
||||
for i,v in ipairs(checkbox_options) do
|
||||
table.insert(formspec, v)
|
||||
end
|
||||
table.insert(formspec,"scroll_container_end[]")
|
||||
table.insert(formspec,"button[0.5,7;1.5,0.8;submit;Submit]")
|
||||
table.insert(
|
||||
formspec,"button_exit[8,7;1.5,0.8;cancel;Cancel]")
|
||||
local formspec_string = table.concat(formspec, "")
|
||||
-- present to players
|
||||
minetest.show_formspec(user, "modpol:checkbox_query", formspec_string)
|
||||
-- put func in _contexts
|
||||
if _contexts[user] == nil then _contexts[user] = {} end
|
||||
_contexts[user]["checkbox_query_func"] = func
|
||||
_contexts[user]["checkbox_query_result"] =
|
||||
modpol.util.copy_table(options)
|
||||
end
|
||||
-- receive fields
|
||||
minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
if formname == "modpol:checkbox_query" then
|
||||
local pname = player:get_player_name()
|
||||
-- start checking fields
|
||||
if fields.cancel then
|
||||
minetest.close_formspec(pname, formname)
|
||||
elseif fields.submit then
|
||||
-- send in result
|
||||
minetest.close_formspec(pname, formname)
|
||||
_contexts[pname].checkbox_query_func(
|
||||
_contexts[pname].checkbox_query_result)
|
||||
else
|
||||
for k,v in pairs(fields) do
|
||||
-- identify checkbox actions and flip bool
|
||||
if string.find(k,"checkbox_") then
|
||||
local index = tonumber(
|
||||
string.match(k,"%d+"))
|
||||
_contexts[pname].checkbox_query_result[index][2] =
|
||||
not _contexts[pname].checkbox_query_result[index][2]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
-- Function: modpol.binary_poll_user(user, question, function)
|
||||
-- Overrides function at modpol/interactions.lua
|
||||
-- Params: user (string), question (string), func (function)
|
||||
@ -341,10 +574,10 @@ function modpol.interactions.binary_poll_user(user, question, func)
|
||||
-- set up formspec
|
||||
local formspec = {
|
||||
"formspec_version[4]",
|
||||
"size[8,4]",
|
||||
"size[8,6]",
|
||||
"label[0.375,0.5;",minetest.formspec_escape(question), "]",
|
||||
"button[1,2.5;1,0.8;yes;Yes]",
|
||||
"button[2,2.5;1,0.8;no;No]",
|
||||
"button[1,5;1,0.8;yes;Yes]",
|
||||
"button[2,5;1,0.8;no;No]",
|
||||
--TODO can we enable text wrapping?
|
||||
--TODO we could use scroll boxes to contain the text
|
||||
}
|
||||
@ -369,3 +602,10 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
||||
minetest.close_formspec(pname, formname)
|
||||
end
|
||||
end)
|
||||
|
||||
-- TESTING
|
||||
|
||||
--testing command for "singleplayer"
|
||||
function modpol.msg(text)
|
||||
modpol.interactions.message("singleplayer",text)
|
||||
end
|
||||
|
20
modpol_minetest/overrides/users.lua
Normal file
20
modpol_minetest/overrides/users.lua
Normal file
@ -0,0 +1,20 @@
|
||||
-- ===================================================================
|
||||
--- Overwrites function at /users.lua.
|
||||
-- if nil, lists instance members; if an org name, lists its members
|
||||
-- @function modpol.list_users
|
||||
-- @param org
|
||||
-- @return a table with names of players currently in the game
|
||||
modpol.list_users = function(org)
|
||||
local users = {}
|
||||
if (org == nil) then -- no specified org; all players
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
table.insert(users,name)
|
||||
end
|
||||
else -- if an org is specified
|
||||
if (modpol.orgs[org] ~= nil) then -- org exists
|
||||
users = modpol.orgs[org]["members"]
|
||||
end
|
||||
end
|
||||
return users
|
||||
end
|
Reference in New Issue
Block a user