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

Add multiselect preset #3080

Merged
merged 17 commits into from
Apr 30, 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
73 changes: 70 additions & 3 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ ul li { list-style: none;}
.al { left: 0; }
.ar { right: 0; }

input.hide,
div.hide,
form.hide,
button.hide,
Expand Down Expand Up @@ -1018,7 +1019,7 @@ button.save.has-count .count::before {
}

.form-label button {
border-left: 1px solid #CCC;
border-left: 1px solid #ccc;
width: 10%;
height: 100%;
border-radius: 0;
Expand All @@ -1041,7 +1042,7 @@ button.save.has-count .count::before {
.form-field > input,
.form-field > textarea,
.form-field .preset-input-wrap {
border: 1px solid #CCC;
border: 1px solid #ccc;
min-height: 30px;
border-top: 0;
border-radius: 0 0 4px 4px;
Expand All @@ -1053,23 +1054,30 @@ button.save.has-count .count::before {
}

.inspector-border {
border-bottom: 1px solid #CCC
border-bottom: 1px solid #ccc
}

/* Preset form (hover mode) */

.inspector-hover .checkselect label:last-of-type,
.inspector-hover .preset-input-wrap .label,
.inspector-hover .form-field-multicombo,
.inspector-hover input,
.inspector-hover label {
background: #ececec;
}

.inspector-hover a,
.inspector-hover .form-field-multicombo .chips,
.inspector-hover .checkselect label:last-of-type {
color: #666;
}

.inspector-hover .form-field-multicombo .chips {
background: #eee;
border: 1px solid #ccc;
}

/* hide and remove from layout */
.inspector-hidden,
.inspector-hover label input[type="checkbox"],
Expand All @@ -1078,6 +1086,7 @@ button.save.has-count .count::before {
.inspector-hover .toggle-list label span,
.inspector-hover .inspector-inner .add-tag,
.inspector-hover .inspector-inner .add-relation,
.inspector-hover .form-field-multicombo .combobox-input,
.inspector-hover .toggle-list label.remove .icon {
height: 0;
width: 0;
Expand All @@ -1093,6 +1102,7 @@ button.save.has-count .count::before {
.inspector-hover .combobox-caret,
.inspector-hover .entity-editor-pane .header button,
.inspector-hover .spin-control,
.inspector-hover .form-field-multicombo .chips .remove,
.inspector-hover .hide-toggle:before,
.inspector-hover .more-fields,
.inspector-hover .form-label-button-wrap,
Expand Down Expand Up @@ -1193,6 +1203,63 @@ button.save.has-count .count::before {
border-bottom-right-radius: 4px;
}

/* preset form multicombo */

.form-field-multicombo {
border: 1px solid #cfcfcf;
border-top: 0px;
padding: 5px 0 5px 10px;
background: #fff;
display: block;
border-radius: 0 0 4px 4px;
overflow: hidden;
}

.form-field-multicombo:focus {
border-bottom: 0px;
}

.form-field-multicombo.active {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}

.form-field-multicombo li {
background-color: #eff2f7;
border: 1px solid #ccd5e3;
border-radius: 4px;
line-height: 25px;
display: inline-block;
padding: 2px 5px;
margin: 3px;
height: 30px;
}

.form-field-multicombo a {
font-family: Arial, Helvetica, sans-serif !important;
font-size: 16px !important;
line-height: 24px;
float: right;
margin: 1px 0 0 5px;
padding: 0;
cursor: pointer;
color: #a6b4ce;
}

.form-field-multicombo input {
border: 1px solid #ddd;
width: 100px;
margin: 3px;
}

.form-field-multicombo .combobox-caret {
margin: 3px 3px 3px -30px;
}

.form-field-multicombo input:focus {
border-radius: 4px !important;
}

/* preset form cycleway */

.form-field-cycleway .preset-input-wrap li {
Expand Down
1 change: 1 addition & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ en:
check:
"yes": "Yes"
"no": "No"
add: Add
none: None
node: Node
way: Way
Expand Down
29 changes: 3 additions & 26 deletions data/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -773,32 +773,9 @@ en:
railway:
# 'railway=*'
label: Type
recycling/cans:
# 'recycling:cans=*'
label: Accepts Cans
recycling/clothes:
# 'recycling:clothes=*'
label: Accepts Clothes
recycling/glass:
# 'recycling:glass=*'
label: Accepts Glass
recycling/glass_bottles:
# 'recycling:glass_bottles=*'
label: Accepts Glass Bottles
recycling/paper:
# 'recycling:paper=*'
label: Accepts Paper
recycling/plastic:
# 'recycling:plastic=*'
label: Accepts Plastic
recycling/type:
# 'recycling_type=*'
label: Recycling Type
options:
# recycling_type=centre
centre: Recycling Center
# recycling_type=container
container: Container
recycling_accepts:
# 'recycling:=*'
label: Accepts
ref:
# 'ref=*'
label: Reference
Expand Down
44 changes: 4 additions & 40 deletions data/presets/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -1020,46 +1020,10 @@
"type": "typeCombo",
"label": "Type"
},
"recycling/cans": {
"key": "recycling:cans",
"type": "check",
"label": "Accepts Cans"
},
"recycling/clothes": {
"key": "recycling:clothes",
"type": "check",
"label": "Accepts Clothes"
},
"recycling/glass": {
"key": "recycling:glass",
"type": "check",
"label": "Accepts Glass"
},
"recycling/glass_bottles": {
"key": "recycling:glass_bottles",
"type": "check",
"label": "Accepts Glass Bottles"
},
"recycling/paper": {
"key": "recycling:paper",
"type": "check",
"label": "Accepts Paper"
},
"recycling/plastic": {
"key": "recycling:plastic",
"type": "check",
"label": "Accepts Plastic"
},
"recycling/type": {
"key": "recycling_type",
"type": "combo",
"label": "Recycling Type",
"strings": {
"options": {
"container": "Container",
"centre": "Recycling Center"
}
}
"recycling_accepts": {
"key": "recycling:",
"type": "multiCombo",
"label": "Accepts"
},
"ref": {
"key": "ref",
Expand Down
5 changes: 0 additions & 5 deletions data/presets/fields/recycling/cans.json

This file was deleted.

5 changes: 0 additions & 5 deletions data/presets/fields/recycling/clothes.json

This file was deleted.

5 changes: 0 additions & 5 deletions data/presets/fields/recycling/glass.json

This file was deleted.

5 changes: 0 additions & 5 deletions data/presets/fields/recycling/glass_bottles.json

This file was deleted.

5 changes: 0 additions & 5 deletions data/presets/fields/recycling/paper.json

This file was deleted.

5 changes: 0 additions & 5 deletions data/presets/fields/recycling/plastic.json

This file was deleted.

11 changes: 0 additions & 11 deletions data/presets/fields/recycling/type.json

This file was deleted.

5 changes: 5 additions & 0 deletions data/presets/fields/recycling_accepts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"key": "recycling:",
"type": "multiCombo",
"label": "Accepts"
}
8 changes: 1 addition & 7 deletions data/presets/presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1581,13 +1581,7 @@
"fields": [
"operator",
"address",
"recycling/type",
"recycling/cans",
"recycling/glass_bottles",
"recycling/paper",
"recycling/glass",
"recycling/plastic",
"recycling/clothes"
"recycling_accepts"
],
"geometry": [
"point",
Expand Down
8 changes: 1 addition & 7 deletions data/presets/presets/amenity/recycling.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"fields": [
"operator",
"address",
"recycling/type",
"recycling/cans",
"recycling/glass_bottles",
"recycling/paper",
"recycling/glass",
"recycling/plastic",
"recycling/clothes"
"recycling_accepts"
],
"geometry": [
"point",
Expand Down
1 change: 1 addition & 0 deletions data/presets/schema/field.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"defaultcheck",
"text",
"maxspeed",
"multiCombo",
"number",
"tel",
"email",
Expand Down
27 changes: 3 additions & 24 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
"yes": "Yes",
"no": "No"
},
"add": "Add",
"none": "None",
"node": "Node",
"way": "Way",
Expand Down Expand Up @@ -1280,30 +1281,8 @@
"railway": {
"label": "Type"
},
"recycling/cans": {
"label": "Accepts Cans"
},
"recycling/clothes": {
"label": "Accepts Clothes"
},
"recycling/glass": {
"label": "Accepts Glass"
},
"recycling/glass_bottles": {
"label": "Accepts Glass Bottles"
},
"recycling/paper": {
"label": "Accepts Paper"
},
"recycling/plastic": {
"label": "Accepts Plastic"
},
"recycling/type": {
"label": "Recycling Type",
"options": {
"container": "Container",
"centre": "Recycling Center"
}
"recycling_accepts": {
"label": "Accepts"
},
"ref": {
"label": "Reference"
Expand Down
Loading