base_language: en-us

entities:

  AbstractJurisdiction:

    title:
      Abstract Jurisdiction

    description:
      It is a template which produces any human jurisdiction

    type:
      Jurisdiction

    tile:

      menu:
        topbar:
          settings:
            title: Settings
            page: this.settings
          laws:
            title: Laws
            page: this.laws
          people:
            title: People
            page: this.lists.citizen

      abstract: true

      forms:
        settings:

            tabs:

              general:
                title: General
                icon: cog
                fieldsets:
                  pictures:
                    title: Profile Images
                    direction: horizontal
                    fields:
                      ava:
                        value: this.ava
                        input: picture
                        size: 1200x1200
                        button: Edit Profile Photo
                      bg:
                        value: this.bg
                        input: picture
                        size: 2300x800
                        button: Edit Cover Photo
                  info:
                    title: Profile Info
                    direction: vertical
                    fields:
                      title:
                        value: this.title
                        label: Public Name
                        input: text
                      link:
                        value: this.link
                        label: Public Address
                        input: link
                      description:
                        value: this.description
                        label: Description
                        input: text
                      link_to_laws:
                        value: this.profile.link_to_laws
                        label: Link to Laws
                        input: url

              officials:
                title: Officials
                icon: people
                fieldsets:
                  legislators_and_judges:
                    direction: horizontal
                    fields:
                      legislators:
                        value: this.roles.legislators
                        input: selectMultipleProfiles
                        filter: type=human | type=bot
                      judges:
                        value: this.roles.judges
                        input: selectMultipleProfiles
                        filter: type=human | type=bot
                    decoration:
                      - horizontal_row
                  host:
                    direction: horizontal
                    fields:
                      host:
                        value: this.roles.host
                        input: selectMultipleProfiles
                        filter: type=human | type=bot

      lists:

        citizen:
          title: Citizen
          roles:
            - citizen.active
        cases:
          title: Cases
          roles:
            - case.active
        officials:
          title: Officials
          roles:
            - judge.active
            - legislator.active

      roles_spec:

        _registered:
          types: human
          status_spec:
            active:
              permissions:
                - join

        legislator:
          count: unlimited
          types: human
          status_spec:
            invite:
              permissions:
                - acceptRole
                - declineRole
            active:
              group: officials
              permissions:
                - updateProfile
                - updateRoles
                - inviteToRole
                - publishJurisdiction
                - leave
                - resign

        judge:
          count: unlimited
          types:
            - human
            - bot
          status_spec:
            invite:
              permissions:
                - acceptRole
                - declineRole
            active:
              group: officials
              permissions:
                - leave
                - resign

        host:
          count: unlimited
          types:
            - human
            - bot
          status_spec:
            invite:
              permissions:
                - acceptRole
                - declineRole
            active:
              group: officials
              permissions:
                - acceptJoinRequest
                - declineJoinRequest
                - leave
                - resign

        citizen:
          count: unlimited
          types:
            - human
            - bot
          status_spec:
            request:
              permissions:
                - cancelJoin
            active:
              permissions:
                - leave
                - resign

        case:
          count: unlimited
          types:
            - case
          status_spec:
            - draft
            - active

      actions:

        join:
          assert:
            and:
              - EQUAL this.status active
              - self.roles.humanity.human.active
              - NO self.roles.this
          code:
              - CREATE_ROLE self this.roles.citizen.request args

        cancelJoin:
          assert:
            and:
              - EQUAL this.status active
              - self.roles.this.citizen.request
            code:
              - DELETE_ROLE self.roles.this.citizen.request

        acceptRole:
        declineRole:
        leave:
        cancelselfRole:

        # legislators
        updateProfile:
        updateRoles:
        inviteToRole:
        publishJurisdiction:

        # hostess
        acceptJoinRequest:
        declineJoinRequest:

        # citizen
        createDraftCase: