Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship modal, scrollbar bug fix, hide org logo #455

Merged
merged 1 commit into from
Jul 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions cadasta/core/static/css/main.css

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

2 changes: 1 addition & 1 deletion cadasta/core/static/css/main.css.map

Large diffs are not rendered by default.

48 changes: 38 additions & 10 deletions cadasta/core/static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ body, #cadasta {
height: 100%;
min-height: 100%;
margin: 0;
overflow: scroll;
overflow: auto;
}

#cadasta {
Expand Down Expand Up @@ -259,10 +259,11 @@ header {
}
}

#dashboard .header,
#project-single .header,
#project-wizard .header,
#organization-single .header {
position: absolute;
position: fixed;
}

/* =User links & links in registration
Expand Down Expand Up @@ -617,11 +618,12 @@ main.container-fluid {
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%;
height: -webkit-calc(100% - 30px);
height: -moz-calc(100% - 30px);
height: calc(100% - 30px);
margin-right: 0;
}
h2 {
Expand Down Expand Up @@ -676,7 +678,7 @@ main.container-fluid {
margin: 0 auto;
padding: 24px;
overflow-x: hidden;
overflow-y: scroll;
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);
Expand Down Expand Up @@ -755,6 +757,10 @@ main.container-fluid {
}
}

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

@media (max-width: $screen-sm-max) {
.content-single {
position: relative;
Expand Down Expand Up @@ -904,6 +910,11 @@ table.table-location { // location details in map area
}
}

table#select-list {
border-bottom-width: 1px;
margin-bottom: 0;
}

@media (max-width: $screen-sm-max) {
table {
overflow-x: auto;
Expand All @@ -919,7 +930,8 @@ div.org-logo {
}

.org-text {
margin-left: 160px;
// margin-left: 160px; adjusted until upload field is added
margin-left: 0;
}

.member-pic {
Expand Down Expand Up @@ -980,6 +992,10 @@ img.org-logo, img#org-logo {
max-height: 50px;
}

#organizations .table div.org-logo {
display: none; // hidden until upload field is added
}

@media (max-width: $screen-xs-max) {
img.org-logo, img#org-logo {
max-width: 80px;
Expand Down Expand Up @@ -1043,7 +1059,7 @@ img.org-logo, img#org-logo {
}

button#add-contact,
button#add_btn { // below contacts table and party table
button#add-party { // below contacts table and party table
padding: 0;
}

Expand All @@ -1069,6 +1085,18 @@ button#add_btn { // below contacts table and party table
}
}

div.add-btn-btm { // add party link at bottom of table
padding: 10px 24px;
text-align: left;
border-bottom: 3px solid $table-border-color;
margin-bottom: 20px;
}

#new-item {
background: $body-bg;
padding: 20px 20px 0 20px;
}

.more-menu {
float: left;
font-size: 24px;
Expand Down Expand Up @@ -1168,7 +1196,7 @@ button#add_btn { // below contacts table and party table
min-width: 100px;
}
}
button#add-contact, button#add_btn {
button#add-contact, button#add-party {
background: transparent;
color: $link-color !important;
border: 0;
Expand Down Expand Up @@ -1205,4 +1233,4 @@ ul.errorlist {
display: block;
text-transform: uppercase;
padding-bottom: 2px;
}
}
6 changes: 3 additions & 3 deletions cadasta/core/static/js/rel_new_item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$('button#add_btn').click(function() {
var val = $('#new_enitity_field').val();
$('#new_enitity_field').val((val === 'on' ? '' : 'on'));
$('button#add-party').click(function() {
var val = $('#new_entity_field').val();
$('#new_entity_field').val((val === 'on' ? '' : 'on'));
});
4 changes: 2 additions & 2 deletions cadasta/core/static/js/rel_tenure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$('button#add_btn').click(function() {
$('table#select-list').toggleClass('hidden');
$('button#add-party').click(function() {
$('div#select-party').toggleClass('hidden');
$('div#new-item').toggleClass('hidden');
});

Expand Down
12 changes: 6 additions & 6 deletions cadasta/spatial/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class NewEntityWidgetTest(TestCase):
def test_render_value(self):
widget = NewEntityWidget()
expected = (
'<button class="btn btn-block btn-primary"'
' id="add_btn" type="button">Add new party</button>'
'<input id="new_enitity_field" type="hidden"'
'<button class="btn btn-link"'
' id="add-party" type="button">Add party</button>'
'<input id="new_entity_field" type="hidden"'
' name="name" value="value">'
)
rendered = widget.render(name='name', value='value')
Expand All @@ -36,9 +36,9 @@ def test_render_value(self):
def test_render_no_value(self):
widget = NewEntityWidget()
expected = (
'<button class="btn btn-block btn-primary"'
' id="add_btn" type="button">Add new party</button>'
'<input id="new_enitity_field" type="hidden"'
'<button class="btn btn-link"'
' id="add-party" type="button">Add party</button>'
'<input id="new_entity_field" type="hidden"'
' name="name" value="">'
)
rendered = widget.render(name='name', value=None)
Expand Down
6 changes: 3 additions & 3 deletions cadasta/spatial/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class Media:

def render(self, name, value, attrs={}):
html = (
'<button class="btn btn-block btn-primary"'
' id="add_btn" type="button">Add new party</button>'
'<input id="new_enitity_field" type="hidden"'
'<button class="btn btn-link"'
' id="add-party" type="button">Add party</button>'
'<input id="new_entity_field" type="hidden"'
' name="{name}" value="{value}">'
)

Expand Down
2 changes: 1 addition & 1 deletion cadasta/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{% endif %}
{% block extra_head %}{% endblock %}
</head>
<body id="{% block top-nav %}{% endblock %}" class="{% block body-class %}{% endblock %}">
<body id="{% block top-nav %}{% endblock %}" class="page{% block body-class %}{% endblock %}">
<div id="cadasta">
<!-- Site header -->
<header class="header" role="banner">
Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/core/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "core/base.html" %}

{% block top-nav %}dashboard{% endblock %}
{% block body-class %} map{% endblock %}

{% block title %} | Dashboard{% endblock %}

Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/organization/project_add_extents.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% load i18n %}

{% block page_title %}| Draw map{% endblock %}
{% block body-class %} map{% endblock %}

{% block extra_head %}
{% leaflet_css plugins="draw,forms" %}
Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/organization/project_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
{% endblock %}

{% block page_title %}Overview | {% endblock %}
{% block body-class %} map{% endblock %}
{% block left-nav %}overview{% endblock %}

{% block content %}
Expand Down
2 changes: 2 additions & 0 deletions cadasta/templates/organization/project_edit_geometry.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{% load leaflet_tags %}

{% block page_title %}Edit project location | {% endblock %}
{% block body-class %} map{% endblock %}


{% block extra_head %}
{% leaflet_css plugins="draw,forms" %}
Expand Down
2 changes: 2 additions & 0 deletions cadasta/templates/spatial/location_add.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "organization/project_wrapper.html" %}
{% load i18n %}
{% load widget_tweaks %}

{% block body-class %} map{% endblock %}
{% block left-nav %}map{% endblock %}

{% load staticfiles %}
Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/spatial/location_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% load staticfiles %}

{% block page_title %}Edit location | {% endblock %}
{% block body-class %} map{% endblock %}

{% block extra_head %}
{% leaflet_css plugins="draw,forms" %}
Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/spatial/location_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load i18n %}

{% block page_title %}Project Map | {% endblock %}
{% block body-class %} map{% endblock %}
{% block left-nav %}map{% endblock %}

{% load leaflet_tags %}
Expand Down
1 change: 1 addition & 0 deletions cadasta/templates/spatial/location_wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load i18n %}

{% block left-nav %}map{% endblock %}
{% block body-class %} map{% endblock %}

{% load leaflet_tags %}
{% load staticfiles %}
Expand Down
Loading