Copropiedad Integral | Development update

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@kit.andres·
0.000 HBD
Copropiedad Integral | Development update
#### Repository

[Copropiedad Integral repository](https://github.com/augustakingfoundation/copropiedadintegral_web)

A condo is a type of real estate divided into several units that are each separately owned, surrounded by common areas jointly owned.

**Copropiedad Integral** has been created to provide condos (condominiums, horizontal property, co-properties) managers with the necessary tools to manage administration and communication with co-owners  and leaseholders in a simple and safe way. Development version is available [here](https://copropiedadintegral.com).

### New Features

#### Unit form update.

The unit form has two embed [formsets](https://docs.djangoproject.com/en/2.0/topics/forms/formsets/). A formset to save and update owners data, and a formset to save and update leaseholders data. Although, a unit can have several owners, only one must have assigned as the main owner, and in the same way it must work for the leaseholders. A unit can have several registered leaseholders, only one must be assigned like the main leaseholder. This will make it easier to manage the data update and the owners and leaseholders notification, avoiding to send the same notification about a unit to multiple registered emails. Previously, the main owner and the main leaseholder were assigned by selecting the first element in the formset. In this development update, this has bee changed.

The `is_main` field has been added to the owners formset. In the Python side, this field is a Boolean field in the model, and is a Checkbox in the form. But checkboxes some times are not nice for the frontend. So, this field has been hidden, a  `button` element has been added to the form, and by using JS, click actions on this button change the `is_main` checkbox value. In the following image we can find this new button called *"Main owner"*. There is a button for each form in the owner formset.

<center>
![Screen Shot 2018-07-06 at 3.57.37 PM.png](https://cdn.steemitimages.com/DQmcy2cAbNTFXnTcdqsTXsmHWK1AobWGbmMws4UEbThw25f/Screen%20Shot%202018-07-06%20at%203.57.37%20PM.png)
</center>

Users must select one owner as "*main owner*" of the unit, but they only can select one. So, Backend (Python side) and frontend(Javascript) validations were implemented. It is necessary to be sure to control this requirement, since if in a unit there are two main owners registered, or none, errors will appear in the future. When users click on the "Main owner" button, the other buttons will be disabled.

<center>
![ezgif.com-video-to-gif.gif](https://cdn.steemitimages.com/DQmQvA75Tz1qys65BcQfgBVp9WpkhEbioaFMZcQEyryaFYd/ezgif.com-video-to-gif.gif)
</center>

For the Leaseholders formset, the "*is_main*" field works in the same way that for the Owner formset, the same methodology and the same validations were added to the leaseholders formset.

As I said previously, some times the checkboxes are not very nice in the frontend. For this reason,  the "delete" checkbox in the owner formset and in the leaseholders formset has been hidden, and, in the same way that works for the "is_main" checkbox, a `button` element has been added and is used to manage the "delete" checkbox value by using JS. Previously, the "delete" input looked like this (a checkbox at the end of the form):

<center>
![Screen Shot 2018-07-06 at 3.39.00 PM.png](https://cdn.steemitimages.com/DQmXB3izQnCs6tqrNy48jHamckxvbgTphkQxjLLpsQ8FqVL/Screen%20Shot%202018-07-06%20at%203.39.00%20PM.png)
</center>

Now, the input value can be changed by clicking the "*Delete*" button:

<center>
![ezgif.com-video-to-gif (1).gif](https://cdn.steemitimages.com/DQmZbPpfTDuohYcD8nKaqz8XswyaFtAps8Xgmcu2nXKdU1U/ezgif.com-video-to-gif%20(1).gif)
</center>

if I must say that there is something of Django with which I do not feel very comfortable working, is with formsets, they have always presented difficulties for me, but, the Django formset is a great functionality to manage multiple forms of the same instance in a simple post request.

> Code changes related to this update can be found in this [PULL REQUEST](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/30), and in this [PULL REQUEST](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/31).

#### Residents administration.

A way to allow administrators to manage the residents registered in each unit (Apartment, house, office) has been added. Administrators can create multiple *"Emergency contacts"* for each resident.

In the unit detail page, it's now available the *Residentes* module. Condo administrators can now register residents for each unit by clicking the "Register resident" button:

<center>
![Screen Shot 2018-07-06 at 5.25.57 PM.png](https://cdn.steemitimages.com/DQmVJ8EcLEejyPdkJ7Z4HCUwMGRJHCCqNmArudjbnFqmCNe/Screen%20Shot%202018-07-06%20at%205.25.57%20PM.png)
</center>

The following form is displayed:

<center>
![Screen Shot 2018-07-06 at 5.43.51 PM.png](https://cdn.steemitimages.com/DQmeHSMH3xUfkjjhMExeyHDUcDUCZW9RP44xwDq46AwAFUY/Screen%20Shot%202018-07-06%20at%205.43.51%20PM.png)
</center>

As you can see, we have another Django formset here. This formset is used to manage the creation of multiple *Emergency contact* assigned to a resident.  The [https://github.com/xdan/datetimepicker](https://github.com/xdan/datetimepicker) library has been integrated to allow users enter the value of the birthdate field in a very simple way.

<center>
![Screen Shot 2018-07-06 at 5.41.17 PM.png](https://cdn.steemitimages.com/DQmdxTkZAfL3perAsXp9MtKfgXZUviKamLsaubJHz8Nc7bC/Screen%20Shot%202018-07-06%20at%205.41.17%20PM.png)
</center>

In the unit detail page, we can find the list of registered residents:

<center>
![Screen Shot 2018-07-06 at 5.52.06 PM.png](https://cdn.steemitimages.com/DQmQ5vkX8BGMHi5fazj9A1E6GSvPwzGLZzGjk9QbUqtNjrH/Screen%20Shot%202018-07-06%20at%205.52.06%20PM.png)
</center>

By clicking the "Detail" button, the resident detail view is displayed:

<center>
![Screen Shot 2018-07-06 at 5.53.41 PM.png](https://cdn.steemitimages.com/DQmXCSA7PFGYo1or3KxcFLJgnqgg7Arj5uAUjwifPAuo8eT/Screen%20Shot%202018-07-06%20at%205.53.41%20PM.png)
</center>

By clicking the "Edit" button, the resident object will be instanced in the same form (create form) and users will be able to update all information about a resident.

By clicking the "Delete" button, users will be redirected to a confirm page, where they must select it they are sure that want to delete the selected resident:

<center>
![Screen Shot 2018-07-06 at 5.55.53 PM.png](https://cdn.steemitimages.com/DQmYoZLXQwHND2BHBgs1rnwYdUCd4Piw9AWLBgKYK3PKQue/Screen%20Shot%202018-07-06%20at%205.55.53%20PM.png)
</center>

> Detailed code changes related to this functionality can be found in this [PULL REQUEST](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/32)

> English translation for these new functionalities can be found in this [PR](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/33)

***
#### GitHub Account
[https://github.com/aaquirogal](https://github.com/aaquirogal)
[PR 1](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/30/files)
[PR 2](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/31/files)
[PR 3](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/32/files)
[PR 4](https://github.com/augustakingfoundation/copropiedadintegral_web/pull/33/files)

***

#### Roadmap

With the help of the company [http://www.servisolucionesph.com/](http://www.servisolucionesph.com/), we have designed a group of basic functionalities to implement in next days:

1. ~~parking information.~~
2. ~~pet information management.~~
3.  ~~Vehicles information management.~~
4.  ~~Domestic worker information management.~~
5. ~~Authorized visitors information management.~~
6. Owner and leaseholders data update.
7. Make a reservation for rent Social Hall or Auditoriums.
8. Generate financial and administrative reports for consultation at the Ordinary or Extraordinary Assembly.
9. Information Documents (Cleaning Awareness, Recycling Campaigns, Portfolio Collection, documents of Coexistence).
10. Attach fixed documents of the co-ownership for permanent consultation (Coexistence Manual, Horizontal Property Regulation, Administration Attention Schedules, Rental Schedules, Rental Costs ...).
11. Providers database.
12. Online voting.
13. Sending of Mass Collection Accounts through e-mail.
14. ~~Residents administration.~~
15. Condo roles.

#### How to contribute?

**Copropiedad Integral** has been developed using the [Django framework](https://www.djangoproject.com/). You can fork the project, and run it locally is very easy. Follow the steps described in the [open source repository](https://github.com/augustakingfoundation/copropiedadintegral_web) installation guide. The project has been configured using [Docker](https://docker.com/). you only need to install Docker and follow these steps.

If you want to contribute, please join my [Discord](https://discordapp.com/channels/402510099957940224/410645961153445888)

***
Have happy days ✌
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,