File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ def related_materials
6161 Material . where ( id : provider_material_ids | material_ids )
6262 end
6363
64+ def full_title
65+ return title if title == 'EMBL-EBI'
66+ t = title
67+ t = 'UK' if title == 'United Kingdom'
68+ I18n . t ( 'nodes.full_title' , title : t )
69+ end
70+
6471 def self . load_from_hash ( hash , verbose : false )
6572 hash [ "nodes" ] . map do |node_data |
6673 node = Node . find_or_initialize_by ( name : node_data [ "name" ] )
Original file line number Diff line number Diff line change 875875 hints :
876876 hide_child_nodes : Ticking this box will hide child nodes from the diagram until their parent node is clicked.
877877 public : Un-ticking this box will hide this workflow from anyone who isn't the creator or a collaborator.
878+ nodes :
879+ full_title : ' ELIXIR %{title}'
878880 menu :
879881 user :
880882 my_profile : ' My profile'
Original file line number Diff line number Diff line change @@ -121,6 +121,13 @@ class NodeTest < ActiveSupport::TestCase
121121 assert node . valid?
122122 end
123123
124+ test 'full title' do
125+ assert_equal 'ELIXIR Sweden' , Node . new ( title : 'Sweden' ) . full_title
126+ assert_equal 'ELIXIR UK' , Node . new ( title : 'United Kingdom' ) . full_title
127+ assert_equal 'EMBL-EBI' , Node . new ( title : 'EMBL-EBI' ) . full_title
128+ assert_equal 'ELIXIR Westeros' , nodes ( :westeros ) . full_title
129+ end
130+
124131 private
125132
126133 def node_data_hash
You can’t perform that action at this time.
0 commit comments