Skip to content

Commit

Permalink
Merge pull request #189 from Cadasta/feature/project-edit
Browse files Browse the repository at this point in the history
Adds Project Edit UI
  • Loading branch information
ian-ross committed May 16, 2016
2 parents a85207f + acabdad commit e49a0c2
Show file tree
Hide file tree
Showing 42 changed files with 1,700 additions and 387 deletions.
67 changes: 17 additions & 50 deletions cadasta/core/static/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cadasta/core/static/css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cadasta/core/static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@import "bootstrap-sass/assets/stylesheets/bootstrap/dropdowns";
@import "wizard";
@import "reg";
@import "toggle";
@import "geolocate";
@import "widgets";

/* =Fonts
-------------------------------------------------------------- */
Expand Down
50 changes: 0 additions & 50 deletions cadasta/core/static/css/toggle.scss

This file was deleted.

20 changes: 20 additions & 0 deletions cadasta/core/static/css/widgets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.public-private-widget > label {
display: block;
}

.public-private-widget {
& > div {
width: 60px;
float: left;
text-align: center;
margin-right: 15px;
}
& > div:nth-child(2) {
width: 40px;
text-align: right;
}
& > div:last-child {
width: 40px;
text-align: left;
}
}
3 changes: 3 additions & 0 deletions cadasta/organization/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
ROLE_CHOICES = (('PU', _('Project User')),
('DC', _('Data Collector')),
('PM', _('Project Manager')))

ACCESS_CHOICES = [("public", _("Public")),
("private", _("Private"))]
22 changes: 22 additions & 0 deletions cadasta/organization/fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.forms import ChoiceField, CharField
from .widgets import ProjectRoleWidget, PublicPrivateToggle


class ProjectRoleField(ChoiceField):
def __init__(self, user, *args, **kwargs):
super().__init__(*args, **kwargs)
self.user = user
choices = kwargs.get('choices', ())
self.widget = ProjectRoleWidget(user=user, choices=choices)


class PublicPrivateField(CharField):
def __init__(self, *args, **kwargs):
super().__init__(widget=PublicPrivateToggle, *args, **kwargs)

def clean(self, value):
if value:
value = 'private'
else:
value = 'public'
return value
Loading

0 comments on commit e49a0c2

Please sign in to comment.