Skip to content
This repository was archived by the owner on Mar 8, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3245e7e
Add require-sources instance setting
chrismytton Jan 26, 2015
58b801f
Add source fields to person edit page
chrismytton Jan 26, 2015
cf68642
Add toggle for sources popup
chrismytton Jan 26, 2015
9f74fc7
Filter out blank values before saving field_sources
chrismytton Jan 26, 2015
c5b7938
Add field source to view page
chrismytton Jan 26, 2015
12c13ca
Add source fields to organization
chrismytton Jan 26, 2015
7e0dad5
Don't save field_sources as multilingual
chrismytton Feb 5, 2015
b4452bf
clean up person/organization editing read-mode/edit-mode elements
zarino Mar 2, 2015
b8ef529
First iteration of new two-template source element layout.
zarino Mar 2, 2015
305fc40
styling for .field-with-metadata and existing membership .delete buttons
zarino Mar 3, 2015
046b002
css tweak: use .glyphicon-space-after rather than manually adding margin
zarino Mar 3, 2015
b3a00e0
fix typo in membership source form handling
zarino Mar 3, 2015
cabcf22
source UI for other_names
zarino Mar 3, 2015
ca2fda8
source UI for organization memberships
zarino Mar 3, 2015
07218b2
source UI for person summaries
zarino Mar 3, 2015
7094997
source UI for birth_date/death_date/founding_date/dissolution_date
zarino Mar 3, 2015
b823234
source UI for organization parent_id
zarino Mar 3, 2015
76c5d8a
source UI for posts
zarino Mar 3, 2015
5e4cdf7
source UI for links
zarino Mar 3, 2015
a0a6049
source UI for contact_details
zarino Mar 3, 2015
a9088e0
source UI for sources
zarino Mar 3, 2015
740a1d5
whoops, add source UI to contact/view.html
zarino Mar 3, 2015
734b00b
source UI for person/form.html sources
zarino Mar 3, 2015
6762d22
source UI for identifiers
zarino Mar 3, 2015
df02fe2
fix typo in previous commit
zarino Mar 3, 2015
1a459c1
increase spacing between list items in edit forms
zarino Mar 3, 2015
4e4af2a
fix indentifier/identifier typo
zarino Mar 3, 2015
29de685
source UI for person/organization/post names
zarino Mar 3, 2015
c7efd08
source UI for secondary header properties
zarino Mar 3, 2015
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
7 changes: 7 additions & 0 deletions instance-app/views/contact/edit-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="contact_details">
<% _.each( contact_details, function (item, i) { %>
<li>
<%= render( 'contact/edit.html', { item: item, sourceText: object.get('field_sources.contact_details.' + i), i: i }) %>
</li>
<% }); %>
</ul>
34 changes: 25 additions & 9 deletions instance-app/views/contact/edit.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
<input type="hidden" id="contact_id_<%= i %>" name="contact_details[<%= i %>][id]" value="<%- contact._id || '' %>">
<label for="contact_label_<%= i %>">Label (e.g. 'Office Address', 'Twitter Account', 'Work Phone Number', etc.)</label>
<input type="text" id="contact_label_<%= i %>" name="contact_details[<%= i %>][label]" value="<%- contact.label || '' %>">
<div class="field-with-metadata">
<input type="hidden" id="contact_id_<%= i %>" name="contact_details[<%= i %>][id]" value="<%- item._id || '' %>">

<label for="contact_type_<%= i %>">Type (e.g. 'twitter', 'facebook', 'cell', 'address', 'fax', etc.)</label>
<input type="text" id="contact_type_<%= i %>" name="contact_details[<%= i %>][type]" value="<%- contact.type || '' %>">
<p>
<label for="contact_label_<%= i %>">Label (e.g. 'Office Address', 'Twitter Account', 'Work Phone Number', etc.)</label>
<input type="text" class="form-control" id="contact_label_<%= i %>" name="contact_details[<%= i %>][label]" value="<%- item.label || '' %>">

<label for="contact_value_<%= i %>">Value (e.g. a phone number, a Twitter or Facebook username, an address, etc.)</label>
<input type="text" id="contact_value_<%= i %>" name="contact_details[<%= i %>][value]" value="<%- contact.value || '' %>">
<p>
<label for="contact_type_<%= i %>">Type (e.g. 'twitter', 'facebook', 'cell', 'address', 'fax', etc.)</label>
<input type="text" class="form-control" id="contact_type_<%= i %>" name="contact_details[<%= i %>][type]" value="<%- item.type || '' %>">
</p>

<label for="contact_note_<%= i %>">Note</label>
<input type="text" id="contact_note_<%= i %>" name="contact_details[<%= i %>][note]" value="<%- contact.note || '' %>">
<p>
<label for="contact_value_<%= i %>">Value (e.g. a phone number, a Twitter or Facebook username, an address, etc.)</label>
<input type="text" class="form-control" id="contact_value_<%= i %>" name="contact_details[<%= i %>][value]" value="<%- item.value || '' %>">
</p>

<p>
<label for="contact_note_<%= i %>">Note</label>
<input type="text" class="form-control" id="contact_note_<%= i %>" name="contact_details[<%= i %>][note]" value="<%- item.note || '' %>">
</p>

<div class="field-with-metadata__metadata">
<a class="other_name-delete"><span class="glyphicon glyphicon-trash glyphicon-space-after"></span>Delete</a>
<%= render( 'field_source/trigger-editing.html', { sourceText: sourceText, sourceID: 'source-contact_detail-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display-editing.html', { sourceText: sourceText, sourceID: 'source-contact_detail-' + item.id, field: 'field_sources[contact_details][' + i + ']' } )%>
8 changes: 0 additions & 8 deletions instance-app/views/contact/list.html

This file was deleted.

7 changes: 7 additions & 0 deletions instance-app/views/contact/view-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="contact_details">
<% _.each( contact_details, function (item, i) { %>
<li>
<%= render( 'contact/view.html', { item: item, sourceText: object.get('field_sources.contact_details.' + i) }) %>
</li>
<% }); %>
</ul>
25 changes: 6 additions & 19 deletions instance-app/views/contact/view.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="view-mode">
<div class="field-with-metadata">
<strong>
<% if (item.label) { %>
<%- item.label %> (<%- item.type %>):
Expand All @@ -10,22 +10,9 @@
<% if (item.note) { %>
<span class="text-muted">(<%- item.note %>)</span>
<% } %>
</div>
<div class="edit-mode edit-group">
<a class="delete"><span class="glyphicon glyphicon-ban-circle glyphicon-space-after"></span>Delete</a>
<a class="edit contact-edit"><span class="glyphicon glyphicon-pencil glyphicon-space-after"></span>Edit</a>
<strong>
<% if (item.label) { %>
<%- item.label %> (<%- item.type %>):
<% } else { %>
<%- item.type %>:
<% } %>
</strong>
<%- item.value %>
<% if (item.note) { %>
<span class="text-muted">(<%- item.note %>)</span>
<% } %>
</div>



<div class="field-with-metadata__metadata">
<%= render( 'field_source/trigger.html', { sourceText: sourceText, sourceID: 'source-contact-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display.html', { sourceText: sourceText, sourceID: 'source-contact-' + item.id } )%>
5 changes: 5 additions & 0 deletions instance-app/views/field_source/display-editing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if (popit.setting('require-sources')) { %>
<div class="js-source__popup source__popup" id="<%- sourceID %>">
<input class="source__input" type="url" name="<%- field %>" value="<%- sourceText %>">
</div>
<% } %>
7 changes: 7 additions & 0 deletions instance-app/views/field_source/display.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if (popit.setting('require-sources')) { %>
<% if (sourceText) { %>
<div class="source__popup" id="<%- sourceID %>">
<%- sourceText %>
</div>
<% } %>
<% } %>
12 changes: 12 additions & 0 deletions instance-app/views/field_source/edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% if (popit.setting('require-sources')) { %>
<div class="source source--editing">
<% if (value) { %>
<a class="js-source__link source__link source__link--has-source">Change source</a>
<% } else { %>
<a class="js-source__link source__link source__link--no-source">Add source</a>
<% } %>
<div class="js-source__popup source__popup">
<input class="source__input" type="url" name="<%- field %>" value="<%- value %>">
</div>
</div>
<% } %>
7 changes: 7 additions & 0 deletions instance-app/views/field_source/trigger-editing.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if (popit.setting('require-sources')) { %>
<% if (sourceText) { %>
<a class="js-source__link source__link source__link--has-source" href="#<%- sourceID %>">Change source</a>
<% } else { %>
<a class="js-source__link source__link source__link--no-source" href="#<%- sourceID %>">Add source</a>
<% } %>
<% } %>
7 changes: 7 additions & 0 deletions instance-app/views/field_source/trigger.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if (popit.setting('require-sources')) { %>
<% if (sourceText) { %>
<a class="js-source__link source__link source__link--has-source" href="#<%- sourceID %>">Show source</a>
<% } else { %>
<span class="js-source__link source__link source__link--no-source">No source</span>
<% } %>
<% } %>
12 changes: 12 additions & 0 deletions instance-app/views/field_source/view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% if (popit.setting('require-sources')) { %>
<div class="source">
<% if (value) { %>
<a class="js-source__link source__link source__link--has-source">Show source</a>
<% } else { %>
<a class="js-source__link source__link source__link--no-source">No source</a>
<% } %>
<div class="js-source__popup source__popup">
<span class="source__url"><%- value %></span>
</div>
</div>
<% } %>
7 changes: 7 additions & 0 deletions instance-app/views/identifier/edit-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="identifiers">
<% _.each( identifiers, function (item, i) { %>
<li>
<%= render( 'identifier/edit.html', { item: item, sourceText: object.get('field_sources.identifiers.' + i), i: i }) %>
</li>
<% }); %>
</ul>
23 changes: 18 additions & 5 deletions instance-app/views/identifier/edit.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<input type="hidden" id="identifier_id_<%= i %>" name="identifiers[<%= i %>][id]" value="<%- identifier._id || '' %>">
<label for="identifier_identifier_<%= i %>">Identifier</label>
<input id="identifier_identifier_<%= i %>" name="identifiers[<%= i %>][identifier]" value="<%- identifier.identifier || '' %>">
<div class="field-with-metadata">
<input type="hidden" id="identifier_id_<%= i %>" name="identifiers[<%= i %>][id]" value="<%- identifier._id || '' %>">

<label for="identifier_scheme_<%= i %>">Schema</label>
<input id="identifier_scheme_<%= i %>" name="identifiers[<%= i %>][scheme]" value="<%- identifier.scheme || '' %>">
<p>
<label for="identifier_identifier_<%= i %>">Identifier</label>
<input class="form-control" id="identifier_identifier_<%= i %>" name="identifiers[<%= i %>][identifier]" value="<%- identifier.identifier || '' %>">
</p>

<p>
<label for="identifier_scheme_<%= i %>">Schema</label>
<input class="form-control" id="identifier_scheme_<%= i %>" name="identifiers[<%= i %>][scheme]" value="<%- identifier.scheme || '' %>">
</p>

<div class="field-with-metadata__metadata">
<a class="other_name-delete"><span class="glyphicon glyphicon-trash glyphicon-space-after"></span>Delete</a>
<%= render( 'field_source/trigger-editing.html', { sourceText: sourceText, sourceID: 'source-identifier-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display-editing.html', { sourceText: sourceText, sourceID: 'source-identifier-' + item.id, field: 'field_sources[identifiers][' + i + ']' } )%>
8 changes: 0 additions & 8 deletions instance-app/views/identifier/list.html

This file was deleted.

7 changes: 7 additions & 0 deletions instance-app/views/identifier/view-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="identifiers">
<% _.each( identifiers, function (item, i) { %>
<li>
<%= render( 'identifier/view.html', { item: item, sourceText: object.get('field_sources.identifiers.' + i) }) %>
</li>
<% }); %>
</ul>
15 changes: 6 additions & 9 deletions instance-app/views/identifier/view.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<div class="view-mode">
<% if (item.scheme) { %>
<strong><%- item.scheme %>:</strong>
<% } %>
<%- item.identifier %>
</div>
<div class="edit-mode edit-group">
<a class="delete"><span class="glyphicon glyphicon-ban-circle glyphicon-space-after"></span>Delete</a>
<a class="edit identifier-edit"><span class="glyphicon glyphicon-pencil glyphicon-space-after"></span>Edit</a>
<div class="field-with-metadata">
<% if (item.scheme) { %>
<strong><%- item.scheme %>:</strong>
<% } %>
<%- item.identifier %>

<div class="field-with-metadata__metadata">
<%= render( 'field_source/trigger.html', { sourceText: sourceText, sourceID: 'source-identifier-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display.html', { sourceText: sourceText, sourceID: 'source-identifier-' + item.id } )%>
7 changes: 7 additions & 0 deletions instance-app/views/link/edit-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="links">
<% _.each( links, function (item, i) { %>
<li>
<%= render( 'link/edit.html', { item: item, sourceText: object.get('field_sources.links.' + i), i: i }) %>
</li>
<% }); %>
</ul>
23 changes: 18 additions & 5 deletions instance-app/views/link/edit.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<input type="hidden" id="link_id_<%= i %>" name="links[<%= i %>][id]" value="<%- link._id|| '' %>">
<label for="link_url_<%= i %>">Url</label>
<input type="text" id="link_url_<%= i %>" name="links[<%= i %>][url]" value="<%- link.url || '' %>">
<div class="field-with-metadata">
<input type="hidden" id="link_id_<%= i %>" name="links[<%= i %>][id]" value="<%- item._id|| '' %>">

<label for="link_note_<%= i %>">Note</label>
<input type="text" id="link_note_<%= i %>" name="links[<%= i %>][note]" value="<%- link.note || '' %>">
<p>
<label for="link_url_<%= i %>">Url</label>
<input type="text" class="form-control" id="link_url_<%= i %>" name="links[<%= i %>][url]" value="<%- item.url || '' %>">
</p>

<p>
<label for="link_note_<%= i %>">Note</label>
<input type="text" class="form-control" id="link_note_<%= i %>" name="links[<%= i %>][note]" value="<%- item.note || '' %>">
</p>

<div class="field-with-metadata__metadata">
<a class="other_name-delete"><span class="glyphicon glyphicon-trash glyphicon-space-after"></span>Delete</a>
<%= render( 'field_source/trigger-editing.html', { sourceText: sourceText, sourceID: 'source-link-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display-editing.html', { sourceText: sourceText, sourceID: 'source-link-' + item.id, field: 'field_sources[links][' + i + ']' } )%>
8 changes: 0 additions & 8 deletions instance-app/views/link/list.html

This file was deleted.

7 changes: 7 additions & 0 deletions instance-app/views/link/view-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="links">
<% _.each( links, function (item, i) { %>
<li>
<%= render( 'link/view.html', { item: item, sourceText: object.get('field_sources.links.' + i) }) %>
</li>
<% }); %>
</ul>
14 changes: 5 additions & 9 deletions instance-app/views/link/view.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<div class="view-mode">
<strong>
<%- item.note %>:
</strong>
<a href="<%- item.url %>"><%- item.url %></a>
</div>
<div class="edit-mode edit-group">
<a class="delete"><span class="glyphicon glyphicon-ban-circle glyphicon-space-after"></span>Delete</a>
<a class="edit link-edit"><span class="glyphicon glyphicon-pencil glyphicon-space-after"></span>Edit</a>
<div class="field-with-metadata">
<strong>
<%- item.note %>:
</strong>
<a href="<%- item.url %>"><%- item.url %></a>
<div class="field-with-metadata__metadata">
<%= render( 'field_source/trigger.html', { sourceText: sourceText, sourceID: 'source-link-' + item.id } )%>
</div>
</div>
<%= render( 'field_source/display.html', { sourceText: sourceText, sourceID: 'source-link-' + item.id } )%>
7 changes: 5 additions & 2 deletions instance-app/views/membership/list-item.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="view-mode">
<div class="field-with-metadata">
<%= render( 'membership/list-item-content.html', { membership: membership, member: member, organization: organization, type: type } ) %>
<span class="entity-little-edit-icon entity-enter-edit-mode"></span>
<div class="field-with-metadata__metadata">
<%= render( 'field_source/trigger.html', { sourceText: sourceText, sourceID: 'source-membership-' + membership.id } )%>
</div>
</div>
<%= render( 'field_source/display.html', { sourceText: sourceText, sourceID: 'source-membership-' + membership.id } )%>
9 changes: 7 additions & 2 deletions instance-app/views/membership/new.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="edit-group">
<div class="edit-group field-with-metadata">
<% if (membership.id) { %>
<input type="hidden" name="memberships[<%= i %>][id]" value="<%- membership.id %>">
<% } %>
Expand Down Expand Up @@ -55,5 +55,10 @@
representing <input type="text" class="form-control" name="memberships[<%= i %>][area][name]">
<% } %>
<% } %>
<a class="btn btn-sm membership__delete delete-membership"><span class="glyphicon glyphicon-trash"></span> Delete</a>
<div class="field-with-metadata__metadata">
<a class="membership__delete delete-membership"><span class="glyphicon glyphicon-trash glyphicon-space-after"></span>Delete</a>
<%= render( 'field_source/trigger-editing.html', { sourceText: sourceText, sourceID: 'source-membership-' + membership.id } )%>
</div>
</div>

<%= render( 'field_source/display-editing.html', { sourceText: sourceText, sourceID: 'source-membership-' + membership.id, field: 'field_sources[membership][' + i + ']' } )%>
Loading