From 17d3d3332abfa7adea8b8cf0fc84e282eb357799 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sat, 2 Feb 2019 18:33:01 -0800
Subject: [PATCH 01/14] rebuild
From 5e577a688c02220e1588fb4b4150fad2600f41e0 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sun, 3 Feb 2019 00:42:15 -0800
Subject: [PATCH 02/14] Include genus with species name in select box
---
lib/treelib/taxonomy/taxonomy.ex | 3 ++-
lib/treelib_web/controllers/admin_contributor_controller.ex | 4 ++--
lib/treelib_web/views/admin_contributor_view.ex | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/treelib/taxonomy/taxonomy.ex b/lib/treelib/taxonomy/taxonomy.ex
index f886439..81a98e8 100644
--- a/lib/treelib/taxonomy/taxonomy.ex
+++ b/lib/treelib/taxonomy/taxonomy.ex
@@ -71,7 +71,8 @@ defmodule Treelib.Taxonomy do
"""
def get_species_list do
Species.active
- |> select([s], %{id: s.id, name: s.name})
+ |> join(:inner, [s], g in Genus, s.genus_id == g.id)
+ |> select([s,g], %{id: s.id, name: s.name, genus_name: g.name })
|> order_by([p], asc: p.name)
|> Repo.all
end
diff --git a/lib/treelib_web/controllers/admin_contributor_controller.ex b/lib/treelib_web/controllers/admin_contributor_controller.ex
index e125fc2..12be61d 100644
--- a/lib/treelib_web/controllers/admin_contributor_controller.ex
+++ b/lib/treelib_web/controllers/admin_contributor_controller.ex
@@ -19,7 +19,7 @@ defmodule TreelibWeb.AdminContributorController do
with {:ok, _current_user} <- auth_admin(conn) do
contributor =
%Contributor{}
- |> Treelib.Repo.preload(:species)
+ |> Treelib.Repo.preload([species: [:genus]])
changeset = Contributions.change_contributor(contributor)
render(conn, "new.html", contributor: contributor, changeset: changeset)
@@ -39,7 +39,7 @@ defmodule TreelibWeb.AdminContributorController do
{:error, %Ecto.Changeset{} = changeset} ->
contributor =
%Contributor{}
- |> Treelib.Repo.preload(:species)
+ |> Treelib.Repo.preload([species: [:genus]])
render(conn, "new.html", contributor: contributor, changeset: changeset)
end
else
diff --git a/lib/treelib_web/views/admin_contributor_view.ex b/lib/treelib_web/views/admin_contributor_view.ex
index 1ede8ec..85efed0 100644
--- a/lib/treelib_web/views/admin_contributor_view.ex
+++ b/lib/treelib_web/views/admin_contributor_view.ex
@@ -1,3 +1,4 @@
+require IEx
defmodule TreelibWeb.AdminContributorView do
use TreelibWeb, :view
@@ -5,7 +6,7 @@ defmodule TreelibWeb.AdminContributorView do
defp formatted_species_list do
Taxonomy.get_species_list()
|> Enum.map( fn s ->
- {s[:name], s[:id]}
+ {"#{s[:genus_name]} #{s[:name]}", s[:id]}
end)
end
end
From 2b12dc4f982ee63958eaf6a1efac603bad817190 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sun, 3 Feb 2019 09:33:43 -0800
Subject: [PATCH 03/14] Set on_replace rule for deleting assoc
---
lib/treelib/contributions/contributor.ex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/treelib/contributions/contributor.ex b/lib/treelib/contributions/contributor.ex
index 3e1cf54..0643f70 100644
--- a/lib/treelib/contributions/contributor.ex
+++ b/lib/treelib/contributions/contributor.ex
@@ -16,7 +16,7 @@ defmodule Treelib.Contributions.Contributor do
field :species_ids, {:array, :integer}, virtual: true
- many_to_many :species, Species, join_through: "contributors_species"
+ many_to_many :species, Species, join_through: "contributors_species", on_replace: :delete
timestamps()
end
From 294fa4362e2b0aa8ae25a1fa5571d532d7fcdd6a Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sun, 3 Feb 2019 11:43:03 -0800
Subject: [PATCH 04/14] Move jquery and select2 from cdn to static assets
---
assets/assets/css/select2.min.css | 1 +
assets/assets/js/jquery-git.min.js | 2 ++
assets/assets/js/select2.min.js | 1 +
lib/treelib_web/templates/admin_contributor/form.html.eex | 6 +++---
4 files changed, 7 insertions(+), 3 deletions(-)
create mode 100644 assets/assets/css/select2.min.css
create mode 100644 assets/assets/js/jquery-git.min.js
create mode 100644 assets/assets/js/select2.min.js
diff --git a/assets/assets/css/select2.min.css b/assets/assets/css/select2.min.css
new file mode 100644
index 0000000..1e2c9bf
--- /dev/null
+++ b/assets/assets/css/select2.min.css
@@ -0,0 +1 @@
+.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
diff --git a/assets/assets/js/jquery-git.min.js b/assets/assets/js/jquery-git.min.js
new file mode 100644
index 0000000..e798554
--- /dev/null
+++ b/assets/assets/js/jquery-git.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.3.2-pre | (c) JS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.3.2-pre 5bdc85b82b84e5459462ddad9002f22d1ce74f21",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+R+")"+R+"*"),z=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){T()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(t=H.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){L={apply:t.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,n,r){var i,o,a,s,u,l,c,f=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:m)!==C&&T(t),t=t||C,E)){if(11!==p&&(u=J.exec(e)))if(i=u[1]){if(9===p){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return L.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&d.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(i)),n}if(d.qsa&&!A[e+" "]&&(!y||!y.test(e))){if(1!==p)f=t,c=e;else if("object"!==t.nodeName.toLowerCase()){(s=t.getAttribute("id"))?s=s.replace(te,ne):t.setAttribute("id",s=k),o=(l=h(e)).length;while(o--)l[o]="#"+s+" "+ve(l[o]);c=l.join(","),f=K.test(e)&&ge(t.parentNode)||t}if(c)try{return L.apply(n,f.querySelectorAll(c)),n}catch(e){}finally{s===k&&t.removeAttribute("id")}}}return g(e.replace(F,"$1"),t,n,r)}function ae(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function se(e){return e[k]=!0,e}function ue(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pe(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function de(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ie(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function he(a){return se(function(o){return o=+o,se(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=oe.support={},i=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},T=oe.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",re,!1):n.attachEvent&&n.attachEvent("onunload",re)),d.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ue(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=Q.test(C.getElementsByClassName),d.getById=ue(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(Z,ee);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=Q.test(C.querySelectorAll))&&(ue(function(e){a.appendChild(e).innerHTML=" ",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+k+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML=" ";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+R+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=Q.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ue(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=Q.test(a.compareDocumentPosition),v=t||Q.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&v(m,e)?-1:t===C||t.ownerDocument===m&&v(m,t)?1:u?O(u,e)-O(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?O(u,e)-O(u,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),t=t.replace(z,"='$1']"),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=oe.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?k.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;nx",v.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ae(){try{return E.activeElement}catch(e){}}function Ne(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ne(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Q.get(t);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Q.hasData(e)&&Q.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||k.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,je=/
-
-
+
+
+ " rel="stylesheet" />
From a0acfa68daaf9d8648e17dbad8d7e00916608d25 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sun, 3 Feb 2019 22:04:25 -0800
Subject: [PATCH 09/14] Revamp search button on home page
---
assets/jsx/homepage.jsx | 4 +++-
assets/scss/_home.scss | 15 +++++++++++++--
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/assets/jsx/homepage.jsx b/assets/jsx/homepage.jsx
index dc89eb3..e5363d0 100644
--- a/assets/jsx/homepage.jsx
+++ b/assets/jsx/homepage.jsx
@@ -16,7 +16,9 @@ export default class Home extends React.Component {
A high-quality tree database for educators, students and lay persons.
diff --git a/assets/scss/_home.scss b/assets/scss/_home.scss
index 6ef62a3..2f38fa2 100644
--- a/assets/scss/_home.scss
+++ b/assets/scss/_home.scss
@@ -47,12 +47,23 @@
a {
border-radius: 3px;
border: 2px solid white;
- padding: 5px;
+ padding: 7px;
&:hover {
border-width: 3px;
- text-decoration: underline;
+ i {
+ font-size: 2.7rem;
+ }
+ padding: 9px;
}
+ -webkit-transition: padding 0.15s; /* Safari */
+ transition: padding 0.15s;
+ }
+ i {
+ font-size: 2.5rem;
+ padding: 0 7px 0 0px;
+ -webkit-transition: font-size 0.12s; /* Safari */
+ transition: font-size 0.12s;
}
}
.photoBanner {
From ce4283e52a951aaf7fb4e521029c7e0df1a731cd Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Sun, 3 Feb 2019 22:05:10 -0800
Subject: [PATCH 10/14] Convert tabs to spaces
---
assets/scss/_home.scss | 156 ++++++++++++++++++++---------------------
1 file changed, 78 insertions(+), 78 deletions(-)
diff --git a/assets/scss/_home.scss b/assets/scss/_home.scss
index 2f38fa2..5c1e829 100644
--- a/assets/scss/_home.scss
+++ b/assets/scss/_home.scss
@@ -1,83 +1,83 @@
.homePage {
- .section {
- padding: 20px 8% 20px 8%;
- }
- .banner {
- min-height: $banner-height;
- font-size: 2.8rem;
- position: relative;
- .innerBanner {
- background-color: rgba(20,20,20,0.6);
- height: 100%;
- width: 94%;
- padding: 0 3% 0 3%;
- position: absolute;
- text-align: center;
- > * {
- display: inline-block;
- vertical-align: middle;
- }
- .helper {
- height: 100%;
- }
- }
+ .section {
+ padding: 20px 8% 20px 8%;
+ }
+ .banner {
+ min-height: $banner-height;
+ font-size: 2.8rem;
+ position: relative;
+ .innerBanner {
+ background-color: rgba(20,20,20,0.6);
+ height: 100%;
+ width: 94%;
+ padding: 0 3% 0 3%;
+ position: absolute;
+ text-align: center;
+ > * {
+ display: inline-block;
+ vertical-align: middle;
+ }
+ .helper {
+ height: 100%;
+ }
+ }
- &:first-child {
- background-image: url("/images/cogyria-1.jpg");
- }
- &:nth-child(2n){
- background-image: url("/images/cogyria-2.jpg");
- }
- &:nth-child(3n){
- background-image: url("/images/cogyria-3.jpg");
- }
- background-repeat: no-repeat;
- background-position: left top;
- background-attachment: fixed;
- background-size: cover;
+ &:first-child {
+ background-image: url("/images/cogyria-1.jpg");
+ }
+ &:nth-child(2n){
+ background-image: url("/images/cogyria-2.jpg");
+ }
+ &:nth-child(3n){
+ background-image: url("/images/cogyria-3.jpg");
+ }
+ background-repeat: no-repeat;
+ background-position: left top;
+ background-attachment: fixed;
+ background-size: cover;
- * {
- color: white;
- }
- }
- .searchButton {
- cursor: pointer;
- text-align:center;
- margin-top: 1.2em;
- a {
- border-radius: 3px;
- border: 2px solid white;
- padding: 7px;
+ * {
+ color: white;
+ }
+ }
+ .searchButton {
+ cursor: pointer;
+ text-align:center;
+ margin-top: 1.2em;
+ a {
+ border-radius: 3px;
+ border: 2px solid white;
+ padding: 7px;
- &:hover {
- border-width: 3px;
- i {
- font-size: 2.7rem;
- }
- padding: 9px;
- }
- -webkit-transition: padding 0.15s; /* Safari */
- transition: padding 0.15s;
- }
- i {
- font-size: 2.5rem;
- padding: 0 7px 0 0px;
- -webkit-transition: font-size 0.12s; /* Safari */
- transition: font-size 0.12s;
- }
- }
- .photoBanner {
- text-align: center;
- > div {display: inline-block;}
+ &:hover {
+ border-width: 3px;
+ i {
+ font-size: 2.7rem;
+ }
+ padding: 9px;
+ }
+ -webkit-transition: padding 0.15s; /* Safari */
+ transition: padding 0.15s;
+ }
+ i {
+ font-size: 2.5rem;
+ padding: 0 7px 0 0px;
+ -webkit-transition: font-size 0.12s; /* Safari */
+ transition: font-size 0.12s;
+ }
+ }
+ .photoBanner {
+ text-align: center;
+ > div {display: inline-block;}
- img {
- display: inline-block;
- margin: 10px;
- border: 1px solid #BBB;
- &:hover {
- border: 2px #1467eb solid;
- margin: 9px;
- }
- }
- }
-}
\ No newline at end of file
+ img {
+ display: inline-block;
+ margin: 10px;
+ border: 1px solid #BBB;
+ &:hover {
+ border: 2px #1467eb solid;
+ margin: 9px;
+ }
+ }
+ }
+}
From b46a8f6f001368d32692b2e841449932d83a4d72 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Mon, 4 Feb 2019 10:22:51 -0800
Subject: [PATCH 11/14] Copy typo updates
---
assets/jsx/aboutpage.jsx | 2 +-
assets/jsx/homepage.jsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/assets/jsx/aboutpage.jsx b/assets/jsx/aboutpage.jsx
index 5009085..93bfdaa 100644
--- a/assets/jsx/aboutpage.jsx
+++ b/assets/jsx/aboutpage.jsx
@@ -116,7 +116,7 @@ export default class About extends React.Component {
Blake is an industry manager, botanist and photographer with over 30 years in the forestry industry, specifically with government and industry between Canada and Japan.
- He is a member of the International Dendrology Society (a UK-based global group of professors and scientists dedicated to the study and teaching about woody plants) and the American Coniferous Society.
+ He is a member of the International Dendrology Society (a UK-based global group of professors and scientists dedicated to the study and teaching about woody plants) and the American Conifer Society.
diff --git a/assets/jsx/homepage.jsx b/assets/jsx/homepage.jsx
index e5363d0..486389b 100644
--- a/assets/jsx/homepage.jsx
+++ b/assets/jsx/homepage.jsx
@@ -48,7 +48,7 @@ export default class Home extends React.Component {
- Make use of the site from any platform or device with access to an internet browser. Whether projecting in a classroom or studying from a phone while walking around a park, TreeLib aims to accessible everywhere. Want to develop a specific format for your class? Contact us to develop scripts and picture series to fit your needs.
+ Make use of the site from any platform or device with access to an internet browser. Whether projecting in a classroom or studying from a phone while walking around a park, TreeLib aims to be accessible everywhere. Want to develop a specific format for your class? Contact us to develop scripts and picture series to fit your needs.
From 2581fcf30d1c1b2d1de68564c03de90d1145bd34 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Mon, 4 Feb 2019 11:20:25 -0800
Subject: [PATCH 12/14] Apply consistent capitalization on about page headers
---
assets/jsx/aboutpage.jsx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/assets/jsx/aboutpage.jsx b/assets/jsx/aboutpage.jsx
index 93bfdaa..385c20e 100644
--- a/assets/jsx/aboutpage.jsx
+++ b/assets/jsx/aboutpage.jsx
@@ -15,12 +15,14 @@ export default class About extends React.Component {
-
+
About the site
TreeLib 's dendrology collection boasts {pg.count.genera} genera and {pg.count.species} species and continues to grow. Origins of the collection can roughly be broken down into:
@@ -45,7 +47,7 @@ export default class About extends React.Component {
-
Species Hierarchy
+
Species hierarchy
All species are arranged by Taxonomic Hierarchy, beginning with Family, which is further divided into Genus and finally into Species.
From cf8f083ebf6587b663450b4fe188527614fa1126 Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Mon, 4 Feb 2019 11:32:47 -0800
Subject: [PATCH 13/14] Include the genus name with species name on admin
contrib index page
---
assets/scss/_admin_general.scss | 5 +++--
lib/treelib/contributions/contributions.ex | 2 +-
lib/treelib_web/templates/admin_contributor/index.html.eex | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/assets/scss/_admin_general.scss b/assets/scss/_admin_general.scss
index 13752e2..0c9cbb4 100644
--- a/assets/scss/_admin_general.scss
+++ b/assets/scss/_admin_general.scss
@@ -237,11 +237,12 @@ table.responsive {
table.admin {
.action {
- display: inline-block;
+ display: block;
min-width: 50px;
border: 0;
padding: 0.7rem;
border-radius: 2px;
+ margin: 3px;
color: white;
background-color: #888;
@@ -270,4 +271,4 @@ table.admin {
&:hover {
background-color: $color-first-4;
}
-}
\ No newline at end of file
+}
diff --git a/lib/treelib/contributions/contributions.ex b/lib/treelib/contributions/contributions.ex
index bd6701d..16e49ed 100644
--- a/lib/treelib/contributions/contributions.ex
+++ b/lib/treelib/contributions/contributions.ex
@@ -20,7 +20,7 @@ defmodule Treelib.Contributions do
def list_contributors do
Contributor.active
|> Repo.all
- |> Repo.preload(:species)
+ |> Repo.preload(species: [:genus])
end
@doc """
diff --git a/lib/treelib_web/templates/admin_contributor/index.html.eex b/lib/treelib_web/templates/admin_contributor/index.html.eex
index ef489d9..92f946a 100644
--- a/lib/treelib_web/templates/admin_contributor/index.html.eex
+++ b/lib/treelib_web/templates/admin_contributor/index.html.eex
@@ -27,7 +27,7 @@
<%= for species <- contributor.species do %>
- <%= link species.name, to: Routes.species_path(@conn, :edit, species) %>
+ <%= link "#{species.genus.name} #{species.name}", to: Routes.species_path(@conn, :edit, species) %>
<% end %>
From 8571695b8750ddf7ee6c3a57d4489f3590dab1ce Mon Sep 17 00:00:00 2001
From: Nathan Willson
Date: Mon, 4 Feb 2019 11:43:27 -0800
Subject: [PATCH 14/14] Include genus name with species on admin contributor
show page
---
lib/treelib/contributions/contributions.ex | 2 +-
lib/treelib_web/templates/admin_contributor/show.html.eex | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/treelib/contributions/contributions.ex b/lib/treelib/contributions/contributions.ex
index 16e49ed..25c8ff2 100644
--- a/lib/treelib/contributions/contributions.ex
+++ b/lib/treelib/contributions/contributions.ex
@@ -39,7 +39,7 @@ defmodule Treelib.Contributions do
"""
def get_contributor!(id) do
Repo.get!(Contributor, id)
- |> Repo.preload(:species)
+ |> Repo.preload(species: [:genus])
end
@doc """
diff --git a/lib/treelib_web/templates/admin_contributor/show.html.eex b/lib/treelib_web/templates/admin_contributor/show.html.eex
index 9486d8e..25f4530 100644
--- a/lib/treelib_web/templates/admin_contributor/show.html.eex
+++ b/lib/treelib_web/templates/admin_contributor/show.html.eex
@@ -13,7 +13,7 @@
Species
<%= for species <- @contributor.species do %>
- <%= link species.name, to: Routes.species_path(@conn, :edit, species) %>
+ <%= link "#{species.genus.name} #{species.name}", to: Routes.species_path(@conn, :edit, species) %>
<% end %>