Skip to content

Commit

Permalink
Merge pull request #3911 from openstreetmap/structure-extras
Browse files Browse the repository at this point in the history
Add type and layer subfields below structure radiobutton field
  • Loading branch information
bhousel authored Mar 20, 2017
2 parents 61bd8fc + d1ab5d6 commit 8dc7792
Show file tree
Hide file tree
Showing 10 changed files with 305 additions and 34 deletions.
41 changes: 23 additions & 18 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ button.save.has-count .count::before {
.inspector-hover .checkselect label:last-of-type,
.inspector-hover .preset-input-wrap .label,
.inspector-hover .form-field-multicombo,
.inspector-hover .structure-extras-wrap,
.inspector-hover input,
.inspector-hover label {
background: #ececec;
Expand Down Expand Up @@ -1195,21 +1196,29 @@ button.save.has-count .count::before {
width: 50%;
}

/* preset form access */

.preset-input-wrap .label {
height: 30px;
background: #F6F6F6;
padding: 5px 10px;
}


/* preset form access */
/* preset form cycleway */

.form-field-structure .structure-extras-wrap li,
.form-field-cycleway .preset-input-wrap li,
.form-field-access .preset-input-wrap li {
border-bottom: 1px solid #CCC;
border-bottom: 1px solid #ccc;
}
.form-field-structure .structure-extras-wrap li:last-child,
.form-field-cycleway .preset-input-wrap li:last-child,
.form-field-access .preset-input-wrap li:last-child {
border-bottom: 0;
}

.structure-input-type-wrap input,
.structure-input-layer-wrap input,
.preset-input-cycleway-wrap input,
.preset-input-access-wrap input {
border-radius: 0;
border-width: 0;
Expand All @@ -1220,6 +1229,16 @@ button.save.has-count .count::before {
border-bottom-right-radius: 4px;
}

.structure-extras-wrap {
padding: 10px 10px;
background: #fff;
}
.structure-extras-wrap ul {
border: 1px solid #ccc;
border-radius: 4px;
}


/* preset form multicombo */

.form-field-multicombo {
Expand Down Expand Up @@ -1277,20 +1296,6 @@ button.save.has-count .count::before {
border-radius: 4px !important;
}

/* preset form cycleway */

.form-field-cycleway .preset-input-wrap li {
border-bottom: 1px solid #CCC;
}
.form-field-cycleway .preset-input-wrap li:last-child {
border-bottom: 0;
}

.preset-input-cycleway-wrap input {
border-radius: 0;
border-width: 0;
border-left-width: 1px;
}

/* preset form numbers */

Expand Down
5 changes: 5 additions & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ en:
"yes": "Yes"
"no": "No"
reverser: "Change Direction"
radio:
structure:
type: Type
default: Default
layer: Layer
add: Add
none: None
node: Node
Expand Down
1 change: 1 addition & 0 deletions data/presets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ The complete JSON schema for fields can be found in [`data/presets/schema/field.

**Radio Buttons**
* `radio` - Multiple choice radio button field
* `structureRadio` - Multiple choice structure radio button field, with extra input for bridge/tunnel level

**Special**
* `access` - Block of dropdowns for defining the `access=*` tags on a highway
Expand Down
2 changes: 1 addition & 1 deletion data/presets/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@
}
},
"structure": {
"type": "radio",
"type": "structureRadio",
"keys": [
"bridge",
"tunnel",
Expand Down
2 changes: 1 addition & 1 deletion data/presets/fields/structure.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "radio",
"type": "structureRadio",
"keys": [
"bridge",
"tunnel",
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 @@ -65,6 +65,7 @@
"radio",
"restrictions",
"semiCombo",
"structureRadio",
"tel",
"textarea",
"text",
Expand Down
7 changes: 7 additions & 0 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,13 @@
"no": "No",
"reverser": "Change Direction"
},
"radio": {
"structure": {
"type": "Type",
"default": "Default",
"layer": "Layer"
}
},
"add": "Add",
"none": "None",
"node": "Node",
Expand Down
7 changes: 6 additions & 1 deletion modules/ui/fields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ import {
uiFieldUrl
} from './input';

import {
uiFieldRadio,
uiFieldStructureRadio
} from './radio';

import { uiFieldAccess } from './access';
import { uiFieldAddress } from './address';
import { uiFieldCycleway } from './cycleway';
import { uiFieldLanes } from './lanes';
import { uiFieldLocalized } from './localized';
import { uiFieldMaxspeed } from './maxspeed';
import { uiFieldRadio } from './radio';
import { uiFieldRestrictions } from './restrictions';
import { uiFieldTextarea } from './textarea';
import { uiFieldWikipedia } from './wikipedia';
Expand All @@ -63,6 +67,7 @@ export var uiFields = {
radio: uiFieldRadio,
restrictions: uiFieldRestrictions,
semiCombo: uiFieldSemiCombo,
structureRadio: uiFieldStructureRadio,
tel: uiFieldTel,
text: uiFieldText,
textarea: uiFieldTextarea,
Expand Down
Loading

0 comments on commit 8dc7792

Please sign in to comment.