Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/edit.html', { field: 'field_sources[birth_date]', value: person.get('field_sources.birth_date') }) %>
Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/edit.html', { field: 'field_sources[death_date]', value: person.get('field_sources.death_date') }) %>
This organization must have a name
+ <%= render('field_source/edit.html', { field: 'field_sources[name]', value: organization.get('field_sources.name') }) %>
@@ -25,6 +26,7 @@
What type of organization is <%- organization.name %>?
<% } %>
+ <%= render('field_source/edit.html', { field: 'field_sources[classification]', value: organization.get('field_sources.classification') }) %>
Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/edit.html', { field: 'field_sources[founding_date]', value: organization.get('field_sources.founding_date') }) %>
@@ -98,6 +103,7 @@
<%- organization.dissolution_date || '' %>
Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/edit.html', { field: 'field_sources[dissolution_date]', value: organization.get('field_sources.dissolution_date') }) %>
@@ -108,6 +114,7 @@
<% if (validMembership(membership, organization.id)) { %>
Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/view.html', { value: organization.get('field_sources.founding_date') }) %>
@@ -143,6 +147,7 @@
<%- organization.dissolution_date || '' %>
Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ <%= render('field_source/view.html', { value: organization.get('field_sources.dissolution_date') }) %>
From 7e0dad582eb07db3ffebbb0df363bb489fa51a47 Mon Sep 17 00:00:00 2001
From: Chris Mytton
Date: Thu, 5 Feb 2015 17:33:11 +0000
Subject: [PATCH 07/29] Don't save field_sources as multilingual
---
lib/apps/generic_document.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/apps/generic_document.js b/lib/apps/generic_document.js
index dbf769e8..233de9ea 100644
--- a/lib/apps/generic_document.js
+++ b/lib/apps/generic_document.js
@@ -158,7 +158,7 @@ module.exports = function (opts) {
if ( !item && !body[field] ) {
return;
}
- if ( ['other_names', 'identifiers', 'links', 'contact_details', 'sources'].indexOf(field) != -1 ) {
+ if ( ['other_names', 'identifiers', 'links', 'contact_details', 'sources', 'field_sources'].indexOf(field) != -1 ) {
if ( _.isArray(body[field]) && body[field].length ) {
var new_item = [];
if ( _.isArray(item) && item.length ) {
From b4452bf0a25200a05f76f26babf7c47245b07d00 Mon Sep 17 00:00:00 2001
From: Zarino Zappia
Date: Mon, 2 Mar 2015 16:34:54 +0000
Subject: [PATCH 08/29] clean up person/organization editing
read-mode/edit-mode elements
At some point in the recent past, we switched from having read-mode
and edit-mode elements next to each other, interspersed around the
page, to having all the edit-mode elements in a separate template
and collected at the end of the page, away from the read-mode ones.
But many of the old read-mode and edit-mode elements were left in
the templates, despite never actually being shown to users.
This commit removes all the ones I could find. There might be more,
but it's a start.
---
instance-app/views/organization/form.html | 69 ++---------------------
instance-app/views/organization/view.html | 16 ------
instance-app/views/person/form.html | 43 --------------
instance-app/views/person/view.html | 66 ++++++++++------------
4 files changed, 33 insertions(+), 161 deletions(-)
diff --git a/instance-app/views/organization/form.html b/instance-app/views/organization/form.html
index 784ca8d3..69cc6d02 100644
--- a/instance-app/views/organization/form.html
+++ b/instance-app/views/organization/form.html
@@ -7,29 +7,17 @@
-
- <%- organization.name %>
-
-
- This organization must have a name
+ This organization must have a name
<%= render('field_source/edit.html', { field: 'field_sources[name]', value: organization.get('field_sources.name') }) %>
-
- <% if (organization.classification) { %>
- <%- organization.classification %>
-
- <% } else { %>
- What type of organization is <%- organization.name %>?
- <% } %>
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
<%= render('field_source/edit.html', { field: 'field_sources[founding_date]', value: organization.get('field_sources.founding_date') }) %>
-
<%- organization.dissolution_date || '' %>
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
<%= render('field_source/edit.html', { field: 'field_sources[dissolution_date]', value: organization.get('field_sources.dissolution_date') }) %>
@@ -125,12 +98,6 @@
- <% if (!posts.length) { %>
-
- Add posts
- Organizations in PopIt can have pre-defined posts that members can then fill.
-
- <% } %>
<% _.each( posts, function ( post ) { %>
@@ -144,13 +111,6 @@
- <% if (!organization.links.length) { %>
-
- Add links to websites
- If this organization has a website, or any online profile pages, you can add them here.
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
-
<%= render('field_source/view.html', { value: organization.get('field_sources.founding_date') }) %>
<%- organization.dissolution_date || '' %>
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
-
<%= render('field_source/view.html', { value: organization.get('field_sources.dissolution_date') }) %>
<%= render('disclaimer.html' )%>
From b8ef5290ff45bf461a10ca0795c555279d2ec867 Mon Sep 17 00:00:00 2001
From: Zarino Zappia
Date: Mon, 2 Mar 2015 17:29:51 +0000
Subject: [PATCH 09/29] First iteration of new two-template source element
layout.
By separating the "Show source" button from the source "display" popup,
we get more flexibilty over how the items are nested, which will come
in useful for the crazy floating in the person/organization header.
Separating the two elements requires the passing of some shared ID,
so the JavaScript knows which buttons and popups to wire together.
I wonder whether we could use the "field" attribute already passed
to display-editing.html, instead of generating our own separate
"sourceID" attribute?
---
instance-app/views/field_source/display-editing.html | 5 +++++
instance-app/views/field_source/display.html | 7 +++++++
instance-app/views/field_source/trigger-editing.html | 7 +++++++
instance-app/views/field_source/trigger.html | 7 +++++++
instance-app/views/membership/list-item.html | 4 +++-
instance-app/views/membership/new.html | 3 +++
instance-app/views/person/form.html | 3 +--
instance-app/views/person/view.html | 3 +--
public/js/augmenters/source-field.js | 7 +++----
public/sass/_people-and-organizations.scss | 7 +++----
10 files changed, 40 insertions(+), 13 deletions(-)
create mode 100644 instance-app/views/field_source/display-editing.html
create mode 100644 instance-app/views/field_source/display.html
create mode 100644 instance-app/views/field_source/trigger-editing.html
create mode 100644 instance-app/views/field_source/trigger.html
diff --git a/instance-app/views/field_source/display-editing.html b/instance-app/views/field_source/display-editing.html
new file mode 100644
index 00000000..e67dcb09
--- /dev/null
+++ b/instance-app/views/field_source/display-editing.html
@@ -0,0 +1,5 @@
+<% if (popit.setting('require-sources')) { %>
+
+
+
+<% } %>
diff --git a/instance-app/views/field_source/display.html b/instance-app/views/field_source/display.html
new file mode 100644
index 00000000..7e49ce8e
--- /dev/null
+++ b/instance-app/views/field_source/display.html
@@ -0,0 +1,7 @@
+<% if (popit.setting('require-sources')) { %>
+ <% if (sourceText) { %>
+
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
- <%= render('field_source/edit.html', { field: 'field_sources[founding_date]', value: organization.get('field_sources.founding_date') }) %>
+
+
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
- <%= render('field_source/edit.html', { field: 'field_sources[dissolution_date]', value: organization.get('field_sources.dissolution_date') }) %>
+
+
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
- <%= render('field_source/edit.html', { field: 'field_sources[birth_date]', value: person.get('field_sources.birth_date') }) %>
+
+
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+
-
- Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
- <%= render('field_source/edit.html', { field: 'field_sources[death_date]', value: person.get('field_sources.death_date') }) %>
+
+
+ Dates should be in YYYY, YYYY-MM or YYYY-MM-DD format
+
-
- This organization must have a name
- <%= render('field_source/edit.html', { field: 'field_sources[name]', value: organization.get('field_sources.name') }) %>
+
-
- This person must have a name
- <%= render('field_source/edit.html', { field: 'field_sources[name]', value: person.get('field_sources.name') }) %>
+