Skip to content

Commit

Permalink
Implemented location adding/editing/deleting for SMap. (#1475)
Browse files Browse the repository at this point in the history
- updated django-leaflet version.
- removed l.draw and switched to l.editable
- geometry styling moved to separate file
- added location editing forms to routes to allow for ajax interception
- removed location popups
  • Loading branch information
linzjax committed May 18, 2017
1 parent 75992a6 commit dc74558
Show file tree
Hide file tree
Showing 28 changed files with 5,262 additions and 1,338 deletions.
1 change: 1 addition & 0 deletions cadasta/core/static/css/leaflet.toolbar.css

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

257 changes: 254 additions & 3 deletions cadasta/core/static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ main.container-fluid {
}

#project-single #page-content main.show-sidebar,
#organization-single #page-content main.show-sidebar {
#organization-single #page-content main.show-sidebar {
margin-left: 100px;
}

Expand All @@ -235,7 +235,7 @@ main.container-fluid {
padding-bottom: 0;
}
#project-single #page-content main,
#organization-single #page-content main,
#organization-single #page-content main,
#project-single #page-content main.show-sidebar,
#organization-single #page-content main.show-sidebar,
#organization-single #page-content main {
Expand All @@ -244,6 +244,257 @@ main.container-fluid {
}
}

.content-single {
position: absolute;
top: 0;
left: 0;
bottom: 0;
z-index: 900;
padding: 0;
overflow: hidden;
overflow-y: scroll;
height: 100%;
height: -webkit-calc(100% - 30px);
height: -moz-calc(100% - 30px);
height: calc(100% - 30px);
> .row { // for map to expand need height
height: 100%;
margin-right: 0;
}
h2 {
color: $brand-darkblue;
text-transform: uppercase;
margin-top: 0;
padding-bottom: 6px;
text-shadow: none;
&.short { // provides room for admin buttons on right
width: 70%;
}
a {
color: #0e305e;
text-decoration: none;
}
a:hover {
color: #2e51a3;
}
}
h3 {
font-family: $font-family-sans-serif-alt;
text-transform: uppercase;
font-weight: 300;
letter-spacing: 0;
color: #0e305e;
}
h4 span.small { // small entity title above link in results tables
font-size: 11px;
color: $gray-medium;
display: block;
text-transform: uppercase;
padding-bottom: 2px;
font-weight: normal;
letter-spacing: 0;
}
.divider-thick {
border-top: solid 7px $table-border-color;
margin: 20px auto;
}
.btn-block {
margin: 24px auto;
}
.page-title {
padding-bottom: 0;
padding-top: 0;
.top-btn{
margin-top: 0;
}
}
.map { // main panel map
height: 100%;
min-height: 100%;
padding-right: 0;
#project-map, #id_extent_map, #id_extents_extent_map {
height: 100%;
min-height: 100%;
}
}
#id_geometry_map {
height: 100%;
min-height: 100%;
}
.main-text {
padding: 30px 40px 50px 50px;
}
.detail { // right panel detail
height: 100%;
min-height: 100%;
position: relative;
background: #fff;
margin: 0 auto;
padding: 24px;
overflow-x: hidden;
overflow-y: auto;
-webkit-box-shadow: 0 0 6px rgba(0,0,0,.3);
-moz-box-shadow: 0 0 6px rgba(0,0,0,.3);
box-shadow: 0 0 6px rgba(0,0,0,.3);
z-index: 300;
.more-menu {
width: auto !important;
}
.org-logo { // large org logo
margin: 10px auto 20px;
float: none;
text-align: center;
img {
width: 90%;
max-width: 200px;
}
}
ul.list-divider li { // lists with lines between
border-bottom: 1px solid $table-border-color;
padding: 12px 2px;
&:last-child {
border-bottom: 0;
padding-bottom: 6px;
}
&.linked:hover {
cursor: pointer;
background-color: $table-bg-hover;
}
}
.nav-tabs {
li > a {
font-size: 13px;
padding: 10px;
}
li.active > a, li.active > a:hover, li.active > a:focus {
border-color: $table-border-color;
border-bottom-color: transparent;
}
}
section > p:first-child {
padding-top: 20px;
}
h4 {
font-family: $font-family-sans-serif-alt;
text-transform: uppercase;
opacity: 0.8;
letter-spacing: 0;
padding-top: 10px;
}
.glyphicon-globe, .glyphicon-envelope, .glyphicon-earphone { // url and contacts in overview
opacity: 0.7;
padding-right: 12px;
}
dl.contacts { // contacts in overview
dt {
border-top: dotted 1px $table-border-color;
padding-top: 10px;
padding-bottom: 6px;
padding-left: 30px;
&:first-child {
border-top: none;
padding-top: 0;
}
}
dd {
padding-bottom: 10px;
padding-left: 30px;
a {
display: block;
font-size: 13px;
padding-bottom: 4px;
}
}
}
}
.row-height .detail { // columns fixed to match heights like org overview
padding-top: 0;
}
.detail-edit { // edit on right
background: $body-bg;
.panel-footer {
background: transparent;
}
}
.panel { // content box in main panel
border: 1px solid $table-border-color;
clear: both;
.panel-heading {
background: transparent;
h3 {
margin: 4px auto;
}
}
.panel-body {
> h3 {
margin-bottom: 10px;
margin-top: 4px;
padding-bottom: 10px;
border-bottom: solid 1px $gray-light;
}
.top-add {
margin-bottom: -30px;
}
}
.panel-footer {
background: lighten($body-bg, 2%);
}
.panel-buttons { // holds buttons at bottom of panels containing forms
padding: 20px 15px;
.btn {
min-width: 110px;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
}
.nav-tabs {
margin-bottom: 20px;
}
}

body.map .content-single {
overflow-y: hidden;
}

@media (max-width: $screen-sm-max) {
.content-single {
position: relative;
.map {
height: 360px;
min-height: 360px;
}
.main-text {
padding: 15px;
}
}
}

@media (max-width: $screen-xs-max) {
.content-single {
.panel {
.panel-buttons .btn {
width: 100%;
margin-bottom: 10px;
margin-right: 0;
}
.panel-body {
font-size: 12px;
}
}
.detail {
.nav-tabs li > a {
font-size: 12px;
}
.tab-content {
font-size: 12px;
}
}
}
}

/* =Table for sort and filter
-------------------------------------------------------------- */

Expand Down Expand Up @@ -428,7 +679,7 @@ table#select-list {
font-size: 12px;
}
.form-control {
padding: 6px;
padding: 6px;
}
}

Expand Down
78 changes: 76 additions & 2 deletions cadasta/core/static/css/maps.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#mapid {
height: 100%;
#mapid {
height: 100%;
z-index: 1;
}

Expand Down Expand Up @@ -116,3 +116,77 @@ label[for="id_extents-location"] {
display: none;
}

/* =LocationEditor
-------------------------------------------------------------- */

.leaflet-toolbar-icon {
cursor: pointer;
cursor: hand;
}

.cadasta-toolbar {
color: #000 !important;
background-image: url('/static/img/spritesheet.png');
background-repeat: no-repeat;
}

.draw-polygon {
background-position: -31px -2px;
}

.draw-polyline {
background-position: -2px -2px;
}

.draw-rectangle {
background-position: -62px -2px;
}

.draw-marker {
background-position: -122px -2px;
}

.edit-action span, .delete-action span {
color: #464646 !important;
}

.leaflet-subtoolbar {
height: 28px !important;
}

.leaflet-subtoolbar li:last-child a {
border-radius: 0px 4px 4px 0px;
}

.leaflet-control-toolbar .smap-edit-disable {
color: #D8D8D8 !important;
}

.editor-tooltip {
display: inline;
position: absolute;
background: #666;
color: white;
opacity: 0.8;
padding: 5px;
border: 1px solid #999;
font-family: sans-serif;
line-height: 15px;
font-size: 12px;
z-index: 1000;
overflow: visible;
border-radius: 5px;
margin-left: 20px;
margin-top: -30px;
white-space: nowrap;
}

.editor-tooltip:before {
border-right: 7px solid #666;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
content: '';
position: absolute;
top: 7px;
left: -6px;
}
Binary file added cadasta/core/static/img/spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dc74558

Please sign in to comment.