rbbt-views 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rbbt/workflow/rest.rb +365 -95
- data/lib/rbbt/workflow/rest/client.rb +2 -0
- data/lib/rbbt/workflow/rest/entity.rb +82 -76
- data/lib/rbbt/workflow/rest/finder.rb +78 -0
- data/lib/rbbt/workflow/rest/helpers.rb +288 -47
- data/lib/rbbt/workflow/rest/notes.rb +125 -0
- data/lib/rbbt/workflow/rest/render.rb +280 -240
- data/lib/rbbt/workflow/rest/util.rb +47 -31
- data/share/views/compass/_base.sass +0 -8
- data/share/views/compass/colors.sass +10 -0
- data/share/views/compass/colors/ventana_azul.sass +5 -0
- data/share/views/compass/compass.config +2 -1
- data/share/views/compass/details.sass +50 -0
- data/share/views/compass/dom.sass +64 -0
- data/share/views/compass/embedded.sass +111 -0
- data/share/views/compass/entities.sass +8 -0
- data/share/views/compass/error.sass +13 -0
- data/share/views/compass/finder.sass +42 -0
- data/share/views/compass/fonts.sass +8 -0
- data/share/views/compass/form.sass +49 -1
- data/share/views/compass/header.sass +68 -0
- data/share/views/compass/{main.sass → helpers.sass} +53 -21
- data/share/views/compass/layout.sass +31 -199
- data/share/views/compass/lists.sass +128 -0
- data/share/views/compass/menu.sass +35 -0
- data/share/views/compass/notes.sass +52 -0
- data/share/views/compass/sizes.sass +8 -0
- data/share/views/compass/tables.sass +22 -0
- data/share/views/compass/wait.sass +9 -0
- data/share/views/edit_list.haml +41 -30
- data/share/views/entity/GOTerm.haml +4 -3
- data/share/views/entity/Gene.haml +8 -1
- data/share/views/entity/GenomicMutation.haml +4 -1
- data/share/views/entity/KeggPathway.haml +1 -1
- data/share/views/entity/MutatedIsoform.haml +68 -11
- data/share/views/entity/NCIBioCartaPathway.haml +2 -3
- data/share/views/entity/NCINaturePathway.haml +3 -3
- data/share/views/entity/NCIReactomePathway.haml +2 -3
- data/share/views/entity/PfamDomain.haml +2 -0
- data/share/views/entity/Transcript.haml +10 -0
- data/share/views/entity_list/Default.haml +4 -0
- data/share/views/entity_list/Default/compare_to_other_lists.haml +41 -0
- data/share/views/entity_list/Default/entity_links.haml +6 -0
- data/share/views/entity_list/Default/find_in_other_lists.haml +36 -0
- data/share/views/error.haml +6 -1
- data/share/views/find.haml +10 -0
- data/share/views/form.haml +1 -1
- data/share/views/info.haml +1 -1
- data/share/views/js/_action_setup.js +250 -0
- data/share/views/js/_basic.js +269 -0
- data/share/views/js/_cytoscape.js +44 -0
- data/share/views/js/_details.js +239 -0
- data/share/views/js/_dom_updates.js +384 -0
- data/share/views/js/_embedded.js +95 -0
- data/share/views/js/_images.js +20 -0
- data/share/views/js/_layout.js +21 -0
- data/share/views/js/_lists.js +224 -0
- data/share/views/js/_table.js +36 -0
- data/share/views/js/_workflow.js +42 -0
- data/share/views/js/app.js +0 -570
- data/share/views/js/fix_tablesorter_scientific.js +25 -0
- data/share/views/js/json2.js +487 -0
- data/share/views/layout.haml +8 -98
- data/share/views/notes.haml +15 -0
- data/share/views/partials/_form.haml +22 -7
- data/share/views/partials/_job_control.haml +8 -8
- data/share/views/partials/_list_control.haml +32 -0
- data/share/views/partials/_list_header.haml +6 -0
- data/share/views/partials/_note_list.haml +64 -0
- data/share/views/partials/_result_table.haml +12 -7
- data/share/views/partials/_result_table_controls.haml +11 -5
- data/share/views/partials/_table.haml +24 -6
- data/share/views/partials/layout/_coda.haml +10 -0
- data/share/views/partials/layout/_details.haml +25 -0
- data/share/views/partials/layout/_head.haml +22 -0
- data/share/views/partials/layout/_header.haml +29 -0
- data/share/views/partials/layout/_menu.haml +20 -0
- data/share/views/partials/layout/_resources.haml +41 -0
- data/share/views/public/background.png +0 -0
- data/share/views/public/plugins/cytoscape-web/LICENSE.txt +504 -0
- data/share/views/public/plugins/cytoscape-web/README.txt +213 -0
- data/share/views/public/plugins/cytoscape-web/js/AC_OETags.js +1 -0
- data/share/views/public/plugins/cytoscape-web/js/cytoscapeweb.js +1 -0
- data/share/views/public/plugins/cytoscape-web/js/json2.js +1 -0
- data/share/views/public/plugins/cytoscape-web/swf/CytoscapeWeb.swf +0 -0
- data/share/views/public/plugins/cytoscape-web/swf/playerProductInstall.swf +0 -0
- data/share/views/public/plugins/fancybox/CHANGELOG.md +68 -0
- data/share/views/public/plugins/fancybox/README.md +220 -0
- data/share/views/public/plugins/fancybox/css/blank.gif +0 -0
- data/share/views/public/plugins/fancybox/css/fancybox_loading.gif +0 -0
- data/share/views/public/plugins/fancybox/css/fancybox_sprite.png +0 -0
- data/share/views/public/plugins/fancybox/css/jquery.fancybox.css +234 -0
- data/share/views/public/plugins/fancybox/helpers/fancybox_buttons.png +0 -0
- data/share/views/public/plugins/fancybox/helpers/jquery.fancybox-buttons.css +85 -0
- data/share/views/public/plugins/fancybox/helpers/jquery.fancybox-buttons.js +115 -0
- data/share/views/public/plugins/fancybox/helpers/jquery.fancybox-media.js +85 -0
- data/share/views/public/plugins/fancybox/helpers/jquery.fancybox-thumbs.css +54 -0
- data/share/views/public/plugins/fancybox/helpers/jquery.fancybox-thumbs.js +157 -0
- data/share/views/public/plugins/fancybox/js/jquery.fancybox.js +1463 -0
- data/share/views/public/plugins/fancybox/js/jquery.mousewheel-3.0.6.pack.js +13 -0
- data/share/views/public/plugins/fancybox/lib/jquery-1.7.2.min.js +4 -0
- data/share/views/public/plugins/featuredimagezoomer/css/featuredimagezoomer.css +8 -0
- data/share/views/public/plugins/featuredimagezoomer/images/spinningred.gif +0 -0
- data/share/views/public/plugins/featuredimagezoomer/js/featuredimagezoomer.js +245 -0
- data/share/views/public/plugins/jquery-ui.hitarea.js +173 -0
- data/share/views/public/plugins/jquery/js/jquery-1.8.0.min.js +2 -0
- data/share/views/public/plugins/tablesorter/addons/pager/jquery.tablesorter.pager.css +25 -0
- data/share/views/public/plugins/tablesorter/addons/pager/jquery.tablesorter.pager.js +184 -0
- data/share/views/public/plugins/tablesorter/build.xml +26 -0
- data/share/views/public/plugins/tablesorter/build/ParseMaster.js +106 -0
- data/share/views/public/plugins/tablesorter/build/js.jar +0 -0
- data/share/views/public/plugins/tablesorter/build/jsmin.js +316 -0
- data/share/views/public/plugins/tablesorter/build/min.js +5 -0
- data/share/views/public/plugins/tablesorter/build/pack.js +5 -0
- data/share/views/public/plugins/tablesorter/build/packer.js +316 -0
- data/share/views/public/plugins/tablesorter/build/writeFile.js +19 -0
- data/share/views/public/plugins/tablesorter/changelog +41 -0
- data/share/views/public/plugins/tablesorter/docs/assets/ajax-content.html +43 -0
- data/share/views/public/plugins/tablesorter/docs/css/jq.css +29 -0
- data/share/views/public/plugins/tablesorter/docs/example-ajax.html +119 -0
- data/share/views/public/plugins/tablesorter/docs/example-empty-table.html +75 -0
- data/share/views/public/plugins/tablesorter/docs/example-extending-defaults.html +109 -0
- data/share/views/public/plugins/tablesorter/docs/example-meta-headers.html +108 -0
- data/share/views/public/plugins/tablesorter/docs/example-meta-parsers.html +105 -0
- data/share/views/public/plugins/tablesorter/docs/example-meta-sort-list.html +107 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-debug.html +116 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-digits.html +106 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-sort-force.html +107 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-sort-key.html +108 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-sort-list.html +108 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-sort-order.html +108 -0
- data/share/views/public/plugins/tablesorter/docs/example-option-text-extraction.html +85 -0
- data/share/views/public/plugins/tablesorter/docs/example-options-headers.html +118 -0
- data/share/views/public/plugins/tablesorter/docs/example-pager.html +329 -0
- data/share/views/public/plugins/tablesorter/docs/example-parsers.html +112 -0
- data/share/views/public/plugins/tablesorter/docs/example-trigger-sort.html +113 -0
- data/share/views/public/plugins/tablesorter/docs/example-triggers.html +336 -0
- data/share/views/public/plugins/tablesorter/docs/example-update-cell.html +118 -0
- data/share/views/public/plugins/tablesorter/docs/example-widgets.html +383 -0
- data/share/views/public/plugins/tablesorter/docs/img/external.png +0 -0
- data/share/views/public/plugins/tablesorter/docs/index.html +576 -0
- data/share/views/public/plugins/tablesorter/docs/js/docs.js +23 -0
- data/share/views/public/plugins/tablesorter/docs/js/examples.js +29 -0
- data/share/views/public/plugins/tablesorter/jquery-latest.js +154 -0
- data/share/views/public/plugins/tablesorter/jquery.metadata.js +122 -0
- data/share/views/public/plugins/tablesorter/jquery.tablesorter.js +1031 -0
- data/share/views/public/plugins/tablesorter/jquery.tablesorter.min.js +4 -0
- data/share/views/public/plugins/tablesorter/tests/assets/ajax-content.html +28 -0
- data/share/views/public/plugins/tablesorter/tests/cell.metadata.html +112 -0
- data/share/views/public/plugins/tablesorter/tests/checkbox.html +117 -0
- data/share/views/public/plugins/tablesorter/tests/colspan.html +149 -0
- data/share/views/public/plugins/tablesorter/tests/demo.html +353 -0
- data/share/views/public/plugins/tablesorter/tests/index.html +22 -0
- data/share/views/public/plugins/tablesorter/tests/large.html +30 -0
- data/share/views/public/plugins/tablesorter/tests/lockedOrder.html +355 -0
- data/share/views/public/plugins/tablesorter/tests/metadata.html +320 -0
- data/share/views/public/plugins/tablesorter/tests/multiple-headers.html +67 -0
- data/share/views/public/plugins/tablesorter/tests/pager.html +553 -0
- data/share/views/public/plugins/tablesorter/themes/blue/asc.gif +0 -0
- data/share/views/public/plugins/tablesorter/themes/blue/bg.gif +0 -0
- data/share/views/public/plugins/tablesorter/themes/blue/blue.zip +0 -0
- data/share/views/public/plugins/tablesorter/themes/blue/desc.gif +0 -0
- data/share/views/public/plugins/tablesorter/themes/blue/style.css +39 -0
- data/share/views/public/plugins/tablesorter/themes/green/asc.png +0 -0
- data/share/views/public/plugins/tablesorter/themes/green/bg.png +0 -0
- data/share/views/public/plugins/tablesorter/themes/green/desc.png +0 -0
- data/share/views/public/plugins/tablesorter/themes/green/green.zip +0 -0
- data/share/views/public/plugins/tablesorter/themes/green/style.css +39 -0
- data/share/views/public/plugins/wz_jsgraphics.js +1108 -0
- data/share/views/public/tmp/foo +0 -0
- data/share/views/result.haml +6 -1
- data/share/views/step_error.haml +5 -0
- data/share/views/user_lists.haml +8 -7
- data/share/views/wait.haml +40 -2
- metadata +302 -106
- data/share/views/compass/screen.sass +0 -8
- data/share/views/public/plugins/jquery/js/jquery-1.6.2.min.js +0 -18
data/share/views/layout.haml
CHANGED
@@ -1,114 +1,24 @@
|
|
1
|
+
- title = $title || "Workflow Explorer"
|
1
2
|
!!!
|
2
3
|
!!! XML
|
3
4
|
!!! Strict
|
4
5
|
%html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", 'xml:lang' => "en" }
|
5
6
|
%head
|
6
|
-
|
7
|
-
%meta(http-equiv="refresh" content=@rbbt_refresh)
|
7
|
+
= workflow_partial('partials/layout/_head', :title => title)
|
8
8
|
|
9
|
-
- if defined? step and Step === step
|
10
|
-
- title = "#{step.task.name} [#{step.status}]"
|
11
|
-
- else
|
12
|
-
- title = $title || "Workflow Explorer"
|
13
|
-
%title
|
14
|
-
= title
|
15
|
-
%link{:rel => "shortcut icon", :type => "image/png", :href => "/favicon.gif"}/
|
16
|
-
|
17
|
-
|
18
|
-
%meta{'http-equiv'=>"Content-Type", :content=>"text/html; charset=UTF-8"}/
|
19
|
-
%meta{'http-equiv'=>"Content-Language", :content=>"en-us"}/
|
20
|
-
|
21
|
-
|
22
|
-
%link{:href=>"/stylesheets/layout.css", :rel=>"stylesheet", :type=>"text/css"}/
|
23
|
-
%link{:href=>"/stylesheets/app.css", :rel=>"stylesheet", :type=>"text/css"}/
|
24
|
-
|
25
|
-
%script{:src => '/plugins/jquery/js/jquery-1.6.2.min.js', :type => 'text/javascript'}
|
26
|
-
%script{:src => '/plugins/jquery/js/jquery.form.js', :type => 'text/javascript'}
|
27
|
-
%script{:src => '/plugins/jquery/js/jquery.cookie.js', :type => 'text/javascript'}
|
28
|
-
%script{:src => '/plugins/jmol/Jmol.js', :type => 'text/javascript'}
|
29
|
-
|
30
|
-
-# %link{:href=>"/plugins/jquery-ui/css/custom-theme/jquery-ui-1.8.14.custom.css", :rel=>"stylesheet", :type=>"text/css"}/
|
31
|
-
-# %script{:src => '/plugins/jquery-ui/js/jquery-ui-1.8.14.custom.min.js', :type => 'text/javascript'}
|
32
|
-
|
33
|
-
%script{:src => '/js/app.js', :type => 'text/javascript'}
|
34
9
|
%body
|
35
|
-
|
36
|
-
%h1
|
37
|
-
%a(href="/")= title
|
38
|
-
%span.login
|
39
|
-
- if session[:user]
|
40
|
-
==Logged in as:
|
41
|
-
%span.user== #{session[:user]}
|
42
|
-
\.
|
43
|
-
%a(href="/logout") logout
|
44
|
-
- else
|
45
|
-
Not logged in
|
46
|
-
%a(href="/login") login
|
47
|
-
%span.list_dropdown
|
48
|
-
%a(href='#lists') Loaded Entity Lists
|
10
|
+
= workflow_partial('partials/layout/_header', :title => title)
|
49
11
|
|
50
12
|
- unless $nomenu
|
51
|
-
|
52
|
-
- if session.include?(:context) and Hash === session[:context] and session[:context].collect{|w,t| t.values}.flatten.any?
|
53
|
-
#context
|
54
|
-
%h2 Context Jobs
|
55
|
-
= workflow_partial('partials/_context_control', nil, nil, locals)
|
56
|
-
|
57
|
-
%h2 Workflows
|
58
|
-
|
59
|
-
- WorkflowREST.workflows.each do |workflow|
|
60
|
-
%h3.workflow_title(target=workflow)= workflow.to_s
|
61
|
-
%div.workflow_menu(id=workflow)
|
62
|
-
%a.replace(href="/#{workflow.to_s}")
|
63
|
-
#footer
|
64
|
-
%p Structural Computational Biology Group
|
13
|
+
= workflow_partial('partials/layout/_menu')
|
65
14
|
|
66
|
-
|
67
|
-
|
68
|
-
%p Spanish National Cancer Research Centre (CNIO). C/ Melchor Fernández Almagro, 3, E-28029 Madrid Spain
|
69
|
-
|
70
|
-
#content{:style => ($nomenu ? "width:100%" : "")}
|
15
|
+
#content{:style => ($nomenu ? "width:100%" : "float:left")}
|
16
|
+
#lists
|
71
17
|
#main
|
72
18
|
= yield
|
73
|
-
|
74
|
-
%ul
|
75
|
-
%li
|
76
|
-
%a.button(href="#" id="hide_details") hide
|
77
|
-
%li
|
78
|
-
%a.button(href="#" id="toggle_expand_details") toggle
|
79
|
-
%li
|
80
|
-
%a.button(href="#" id="back_details") back
|
81
|
-
#details
|
82
|
-
|
83
|
-
#lists
|
84
|
-
|
85
|
-
:javascript
|
86
|
-
|
87
|
-
$('h3.workflow_title').click(function(){
|
88
|
-
var target = $(this).attr('target');
|
89
|
-
$('div#' + target).toggle();
|
90
|
-
})
|
91
|
-
|
92
|
-
rbbt_action_setup();
|
93
|
-
|
94
|
-
hide_details();
|
95
|
-
|
96
|
-
$('#hide_details').click(hide_details);
|
97
|
-
$('#toggle_expand_details').click(toggle_expand_details);
|
98
|
-
$('#back_details').click(back_details);
|
99
|
-
|
100
|
-
var details_history = [];
|
101
|
-
|
102
|
-
$('span.list_dropdown > a').click(function(){ $('#lists').toggle(); return false})
|
19
|
+
= workflow_partial('partials/layout/_details')
|
103
20
|
|
104
|
-
|
105
|
-
if (_saved_lists == null){ _saved_lists = []; }
|
21
|
+
= workflow_partial('partials/layout/_coda')
|
106
22
|
|
107
|
-
update_list_viewer();
|
108
23
|
|
109
|
-
$.each(_saved_lists, function(type, lists){
|
110
|
-
$.each(lists, function(id, list){
|
111
|
-
add_entity_list(type, list)
|
112
|
-
})
|
113
|
-
})
|
114
24
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
:markdown
|
2
|
+
|
3
|
+
Notes use [Markdown](http://daringfireball.net/projects/markdown/syntax)
|
4
|
+
see [this link](http://support.mashery.com/docs/customizing_your_portal/Markdown_Cheat_Sheet/) for
|
5
|
+
a cheat sheet.
|
6
|
+
|
7
|
+
Additionally you can write 'Gene GENENAME' to make a link to that gene, or 'KEGG:"Pathway name"' for a link
|
8
|
+
to a given pathway in KEGG.
|
9
|
+
|
10
|
+
%form(method='post')
|
11
|
+
#markup
|
12
|
+
- text = preserve do
|
13
|
+
= markup
|
14
|
+
%textarea(name="markup" style="width:80%;height:300px")= text
|
15
|
+
%input(type='submit')
|
@@ -1,6 +1,15 @@
|
|
1
1
|
- input_descriptions ||= {}
|
2
2
|
- input_defaults ||= {}
|
3
3
|
- input_types ||= {}
|
4
|
+
- input_labels ||= {}
|
5
|
+
- input_options ||= {}
|
6
|
+
|
7
|
+
- if defined? select_options
|
8
|
+
- input_options = {}
|
9
|
+
- select_options.each do |t,o|
|
10
|
+
- input_options[t] ||= {}
|
11
|
+
- input_options[t][:select_options] = o
|
12
|
+
|
4
13
|
- values ||= {}
|
5
14
|
- jobname ||= false
|
6
15
|
- email ||= false
|
@@ -9,23 +18,26 @@
|
|
9
18
|
- action ||= ''
|
10
19
|
- klass ||= ''
|
11
20
|
- enctype = method == 'post' ? "multipart/form-data" : ""
|
12
|
-
|
21
|
+
-# input_html_options ||= {}
|
22
|
+
- id ||= nil
|
13
23
|
|
14
24
|
%form(class=klass action=action method=method id=id enctype=enctype)
|
15
25
|
- if inputs.empty?
|
16
26
|
%input(type="hidden" name="noinputs" value="noinputs")
|
17
27
|
|
18
28
|
- inputs.each do |name|
|
19
|
-
- input_id =
|
29
|
+
- input_id = (id and not id.empty?) ? [id, name.to_s] * "_" : nil
|
20
30
|
- input_type = input_types[name]
|
31
|
+
- input_label = input_labels[name]
|
21
32
|
- default = input_defaults[name]
|
22
|
-
- value = values[name]
|
33
|
+
- value = values[name]
|
34
|
+
- value = default if value.nil?
|
23
35
|
- description = input_descriptions[name]
|
24
|
-
-
|
36
|
+
- options = input_options.nil? ? nil : input_options[name]
|
25
37
|
- hide = hide_inputs.include? name
|
26
|
-
=
|
38
|
+
= form_input(input_type, name, :id => input_id, :input_options => options, :label => input_label, :value => value, :default => default, :description => description, :default => default, :hide => hide)
|
27
39
|
|
28
|
-
%div.
|
40
|
+
%div.form_submit
|
29
41
|
- if jobname
|
30
42
|
%span.jobname(id="jobname_#{id}")
|
31
43
|
Optional Job Name
|
@@ -34,5 +46,8 @@
|
|
34
46
|
Email
|
35
47
|
%input(class="email" name="email" id="email_#{id}")
|
36
48
|
|
37
|
-
|
49
|
+
- if id and not id.empty?
|
50
|
+
%input(type="submit" id="submit_#{id}")
|
51
|
+
- else
|
52
|
+
%input(type="submit")
|
38
53
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
%ul.job_control
|
2
2
|
%li
|
3
|
-
%a(href="/#{[workflow, task, jobname] * "/"}")= clean_jobname jobname
|
3
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}")= clean_jobname jobname
|
4
4
|
%li
|
5
|
-
%a.POST(href="/context/#{[workflow, task, jobname] * "/"}") context
|
5
|
+
%a.POST(href="/context/#{[workflow.to_s, task, jobname] * "/"}") context
|
6
6
|
%li
|
7
|
-
%a(href="/#{[workflow, task, jobname] * "/"}?_format=raw") raw
|
7
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}?_format=raw") raw
|
8
8
|
%li
|
9
|
-
%a(href="/#{[workflow, task, jobname] * "/"}?_format=json") json
|
9
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}?_format=json") json
|
10
10
|
%li
|
11
|
-
%a(href="/#{[workflow, task, jobname] * "/"}/info") info
|
11
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}/info") info
|
12
12
|
%li
|
13
|
-
%a(href="/#{[workflow, task, jobname] * "/"}/files") files
|
13
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}/files") files
|
14
14
|
%li
|
15
|
-
%a(href="/#{[workflow, task, jobname] * "/"}/dependencies") dependencies
|
15
|
+
%a(href="/#{[workflow.to_s, task, jobname] * "/"}/dependencies") dependencies
|
16
16
|
%li
|
17
|
-
%a.DELETE(href="/#{[workflow, task, jobname] * "/"}") delete
|
17
|
+
%a.DELETE(href="/#{[workflow.to_s, task, jobname] * "/"}") delete
|
@@ -0,0 +1,32 @@
|
|
1
|
+
%ul.list_control
|
2
|
+
%li
|
3
|
+
%a.load_entity_list(href='#load_entity_list' attr-list=id attr-list-type=entity_type)== load
|
4
|
+
%li
|
5
|
+
%a.edit_entity_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/edit/#{ id }" attr-list=id attr-list-type=entity_type)== edit
|
6
|
+
|
7
|
+
- if ! locals[:saved_already]
|
8
|
+
%li
|
9
|
+
%a.POST.save_entity_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/copy/#{ id }?new_id=#{ id }" attr-list=id attr-list-type=entity_type)== save
|
10
|
+
|
11
|
+
%li
|
12
|
+
%a.DELETE.delete_entity_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/#{ id }" attr-list=id attr-list-type=entity_type)== delete
|
13
|
+
%li
|
14
|
+
\---
|
15
|
+
%li
|
16
|
+
%a.json_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/#{ id }?_format=json" attr-list=id attr-list-type=entity_type)== json
|
17
|
+
%li
|
18
|
+
%a.tsv_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/#{ id }?_format=tsv " attr-list=id attr-list-type=entity_type)== tsv
|
19
|
+
%li
|
20
|
+
%a.literal_list(href="/entity_list/#{ format ? [entity_type, format] * ":" : entity_type }/#{ id }?_format=literal " attr-list=id attr-list-type=entity_type)== literal
|
21
|
+
|
22
|
+
%li
|
23
|
+
\---
|
24
|
+
|
25
|
+
%li
|
26
|
+
%a.compare_list(href="#" attr-list=id attr-list-type=entity_type)== compare
|
27
|
+
|
28
|
+
%li
|
29
|
+
%a.rename_list(href="#" attr-list=id attr-list-type=entity_type)== rename
|
30
|
+
%input.rename_list(attr-list=id)
|
31
|
+
|
32
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
- entity_types = {}
|
2
|
+
- news = nil
|
3
|
+
- notes.each do |note, url|
|
4
|
+
- type_of_page, format, *rest = note.sub(/^shared\//, '').split('/')
|
5
|
+
- if format.nil?
|
6
|
+
- news = [note,url]
|
7
|
+
- next
|
8
|
+
- entity_type, format = format.split(":")
|
9
|
+
- entity_types[entity_type] ||= {}
|
10
|
+
- entity_types[entity_type][type_of_page] ||= []
|
11
|
+
- entity_types[entity_type][type_of_page] << [note, url, rest]
|
12
|
+
|
13
|
+
|
14
|
+
- shared_notes = shared_notes(user)
|
15
|
+
%dl.notes
|
16
|
+
- if news
|
17
|
+
%div.news
|
18
|
+
- note, url = news
|
19
|
+
- path, param_string = url.split(/\?/)
|
20
|
+
- param_string ||= ""
|
21
|
+
- params = Misc.GET_params2hash(param_string)
|
22
|
+
- if not shared
|
23
|
+
%ul.note_controls(shared='#{shared_notes.include? note}')
|
24
|
+
%li.share
|
25
|
+
%a.share_note(href="#{url.sub("/notes", "/notes/share")}") share
|
26
|
+
%li.unshare
|
27
|
+
%a.unshare_note(href="#{url.sub("/notes", "/notes/unshare")}") unshare
|
28
|
+
%a(href=url)
|
29
|
+
== News
|
30
|
+
%div.sneak_peek= get_notes_markup(path.sub('/notes','').sub(/shared\/\w+\//,'/'), params, (shared ? shared_user : user), shared).gsub(/[^\w,.!?:\s]/,'')
|
31
|
+
|
32
|
+
- entity_types.each do |entity_type, types_of_pages|
|
33
|
+
%dt= entity_type
|
34
|
+
%dd
|
35
|
+
%ul.note_list
|
36
|
+
- types_of_pages.each do |type_of_page, list|
|
37
|
+
- list.each do |note, url, rest|
|
38
|
+
%li
|
39
|
+
- path, param_string = url.split(/\?/)
|
40
|
+
- param_string ||= ""
|
41
|
+
- params = Misc.GET_params2hash(param_string)
|
42
|
+
- if not shared
|
43
|
+
%ul.note_controls(shared='#{shared_notes.include? note}')
|
44
|
+
%li.share
|
45
|
+
%a.share_note(href="#{url.sub("/notes", "/notes/share")}") share
|
46
|
+
%li.unshare
|
47
|
+
%a.unshare_note(href="#{url.sub("/notes", "/notes/unshare")}") unshare
|
48
|
+
%a(href=url)
|
49
|
+
- case type_of_page.to_s
|
50
|
+
- when "entity"
|
51
|
+
- entity = rest.first.sub(/\?.*/,'')
|
52
|
+
- type_of_page, format, *rest = note.split('/')
|
53
|
+
- format = format.split(":").last
|
54
|
+
- Misc.prepare_entity(entity, format.gsub('+', ' '), params)
|
55
|
+
== Entity '#{entity.respond_to?(:name)? entity.name : entity }'
|
56
|
+
- when "entity_list_action"
|
57
|
+
== List Action '#{rest.first}': #{rest[1..-1].join("/").sub(/\?.*/,'')}
|
58
|
+
- when "entity_action"
|
59
|
+
== Action '#{rest.first}': #{rest[1..-1].join("/").sub(/\?.*/,'')}
|
60
|
+
- when "entity_list"
|
61
|
+
== List: #{rest.join("/").sub(/\?.*/,'')}
|
62
|
+
%span.note= CGI.unescape(param_string.gsub('&', ', '))
|
63
|
+
%div.sneak_peek= get_notes_markup(path.sub('/notes','').sub(/shared\/\w+\//,'/'), params, (shared ? shared_user : user), shared).gsub(/[^\w,.!?:\s]/,'')
|
64
|
+
|
@@ -1,18 +1,23 @@
|
|
1
1
|
- id = locals.include?(:task) ? "results_tsv_table_#{locals[:task]}" : "NONE"
|
2
2
|
- klass = "results_tsv_table"
|
3
|
+
|
4
|
+
- locals[:result] = locals[:step].run if (not locals.include? :result and locals.include? :step)
|
5
|
+
- result = locals[:result]
|
6
|
+
|
3
7
|
- rows, total = process_result(result, locals)
|
4
8
|
|
5
9
|
- if result.key_field == "ID"
|
6
10
|
- header = result.fields
|
7
11
|
- else
|
8
12
|
- header = result.all_fields
|
9
|
-
-
|
10
|
-
|
11
|
-
|
12
|
-
-
|
13
|
-
|
14
|
-
-
|
15
|
-
|
13
|
+
- locals[:add_id] = true
|
14
|
+
- case
|
15
|
+
- when result.type == :single
|
16
|
+
- rows = rows.collect{|k,v| [k, NamedArray.setup([v], result.fields, k, result.entity_options)]}
|
17
|
+
- when result.type == :flat
|
18
|
+
- rows = rows.collect{|k,v| [k, NamedArray.setup([v], result.fields, k, result.entity_options)]}
|
19
|
+
- else
|
20
|
+
- rows = rows.collect{|k,v| [k, NamedArray.setup(v, result.fields, k, result.entity_options)]}
|
16
21
|
|
17
22
|
|
18
23
|
= workflow_partial('partials/_table', workflow, task, locals.merge(:header => header, :id => id, :klass => klass, :rows => rows, :total => total))
|
@@ -1,23 +1,29 @@
|
|
1
1
|
|
2
|
+
- key_field = header.first
|
3
|
+
|
2
4
|
- if locals.include? :_page and not locals[:_page].nil?
|
3
5
|
- pfield, page, size = parse_page(locals[:_page])
|
4
6
|
- else
|
5
|
-
- pfield, page, size = [
|
7
|
+
- pfield, page, size = [key_field, 1, 25]
|
6
8
|
|
7
9
|
- if locals.include? :_filter and not locals[:_filter].nil?
|
8
10
|
- ffield, query = locals[:_filter].split "~"
|
9
11
|
- else
|
10
|
-
- ffield, query = [
|
12
|
+
- ffield, query = [key_field, ""]
|
11
13
|
|
12
14
|
- total ||= result.size
|
13
15
|
- max = total / size.to_i + 1
|
14
16
|
- page = page.to_i
|
15
17
|
- page = max if page > max
|
16
18
|
- page = - max if page < - max
|
19
|
+
- page_params ||= {}
|
17
20
|
|
18
21
|
%form.table_controls(method='get')
|
22
|
+
- page_params.each do |key,value|
|
23
|
+
%input(type="hidden" name=key value=value)
|
19
24
|
|
20
|
-
|
25
|
+
|
26
|
+
.input_section
|
21
27
|
%h3 Subset
|
22
28
|
Query:
|
23
29
|
%input.fquery(name="_fquery" value=query)
|
@@ -29,7 +35,7 @@
|
|
29
35
|
- else
|
30
36
|
%option(value=f)= f
|
31
37
|
|
32
|
-
|
38
|
+
.input_section
|
33
39
|
%h3 Sort
|
34
40
|
Field:
|
35
41
|
%select.pfield(name='_pfield')
|
@@ -42,7 +48,7 @@
|
|
42
48
|
%input.change_page(type='submit' value="Desc" name="_paginate")
|
43
49
|
%input.change_page(type='submit' value="Asc" name="_paginate")
|
44
50
|
|
45
|
-
|
51
|
+
.input_section
|
46
52
|
%h3 Navigate
|
47
53
|
Page:
|
48
54
|
%input.pnum(name="_pnum" value=page)
|
@@ -1,8 +1,19 @@
|
|
1
|
-
- klass = locals[:klass]
|
1
|
+
- klass = locals[:klass] || locals[:class]
|
2
2
|
- id = locals[:id]
|
3
3
|
- header = locals[:header]
|
4
4
|
- rows = locals[:rows]
|
5
5
|
- total = locals[:total]
|
6
|
+
- add_id = locals[:add_id]
|
7
|
+
- paginate = locals[:paginate]
|
8
|
+
- paginate = true if paginate.nil? and locals.include? :result
|
9
|
+
|
10
|
+
- if locals.include? :step
|
11
|
+
- step = locals[:step]
|
12
|
+
- rows ||= step.load
|
13
|
+
- if add_id
|
14
|
+
- header ||= rows.all_fields
|
15
|
+
- else
|
16
|
+
- header ||= rows.fields
|
6
17
|
|
7
18
|
%table(class=klass id=id)
|
8
19
|
|
@@ -12,19 +23,25 @@
|
|
12
23
|
- header.each do |field|
|
13
24
|
%th(class=field)= field
|
14
25
|
|
15
|
-
|
16
26
|
-# BODY
|
17
27
|
%tbody
|
18
|
-
- rows.each do |id,
|
28
|
+
- rows.each do |id,values|
|
19
29
|
%tr(id=id)
|
20
30
|
- if Array === values
|
31
|
+
- if add_id
|
32
|
+
- values.unshift id
|
33
|
+
- values.fields = [header.first] + values.fields if values.respond_to?(:fields) and not values.fields.nil?
|
34
|
+
|
21
35
|
- values.each do |value|
|
22
|
-
- value = value.link if value.respond_to? :link
|
36
|
+
- value = value.link if Annotated === value and value.respond_to? :rbbt_id and value.respond_to? :link and not (Array === value and not (Annotated === value.first))
|
23
37
|
- type = value.respond_to?(:format)? value.format : ""
|
24
38
|
- if Array === value
|
25
39
|
%td(class=type)= value * ", "
|
26
40
|
- else
|
27
41
|
%td(class=type)= value
|
42
|
+
- if add_id
|
43
|
+
- values.shift
|
44
|
+
- values.fields = values.fields[1..-1] if values.respond_to?(:fields)
|
28
45
|
- else
|
29
46
|
- value = value.link if value.respond_to? :link
|
30
47
|
- type = value.respond_to?(:format)? value.format : ""
|
@@ -32,8 +49,9 @@
|
|
32
49
|
|
33
50
|
|
34
51
|
-# FOOT (paginate)
|
35
|
-
- if
|
52
|
+
- if paginate
|
36
53
|
%tfoot
|
37
54
|
%tr
|
38
55
|
%th(colspan="#{header.length}")
|
39
|
-
|
56
|
+
|
57
|
+
= workflow_partial('partials/_result_table_controls', workflow, task, locals.merge(:fields => header, :total => total, :page_params => locals[:page_params]))
|