rbbt-rest 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/rest/common/misc.rb +10 -0
  3. data/lib/rbbt/rest/workflow/jobs.rb +8 -7
  4. data/share/views/compass/app.sass +278 -3
  5. data/share/views/compass/base/color.sass +66 -0
  6. data/share/views/compass/blocks.sass +0 -0
  7. data/share/views/compass/mixins/_blocks.sass +76 -80
  8. data/share/views/compass/mixins/_compass.sass +0 -0
  9. data/share/views/compass/mixins/_hide.sass +76 -1
  10. data/share/views/compass/table.sass +142 -0
  11. data/share/views/compass/variables/colors.sass +7 -0
  12. data/share/views/compass/variables/sizes.sass +5 -0
  13. data/share/views/entity_partials/action_card.haml +5 -5
  14. data/share/views/entity_partials/action_controller.haml +31 -33
  15. data/share/views/entity_partials/entity_card.haml +28 -27
  16. data/share/views/entity_partials/entity_list_card.haml +30 -42
  17. data/share/views/entity_partials/entity_map_card.haml +35 -43
  18. data/share/views/entity_partials/list_container.haml +6 -6
  19. data/share/views/layout.haml +53 -59
  20. data/share/views/layout/coda.haml +1 -0
  21. data/share/views/layout/doctype.haml +8 -0
  22. data/share/views/layout/footer.haml +36 -10
  23. data/share/views/layout/header.haml +47 -0
  24. data/share/views/layout/top_menu.haml +27 -13
  25. data/share/views/partials/form.haml +4 -4
  26. data/share/views/partials/table.haml +2 -1
  27. data/share/views/partials/table/column.haml +8 -9
  28. data/share/views/partials/table/files.haml +2 -2
  29. data/share/views/partials/table/filters.haml +16 -16
  30. data/share/views/partials/table/page.haml +9 -15
  31. data/share/views/public/js/ng-favourites.js +13 -0
  32. data/share/views/public/js/rbbt.aesthetics.js +51 -0
  33. data/share/views/public/js/rbbt.entity.js +62 -0
  34. data/share/views/public/js/rbbt.entity_list.js +54 -0
  35. data/share/views/public/js/rbbt.entity_map.js +52 -0
  36. data/share/views/public/js/rbbt.favourites.js +286 -0
  37. data/share/views/public/js/rbbt.favourites.js.old +195 -0
  38. data/share/views/public/js/rbbt.js +40 -0
  39. data/share/views/public/js/rbbt.knowledge_base.js +24 -0
  40. data/share/views/public/js/rbbt.page.js +32 -0
  41. data/share/views/public/js/rbbt/actions.js +15 -14
  42. data/share/views/public/js/rbbt/table.js +6 -4
  43. data/share/views/tools/cytoscape.haml +310 -0
  44. data/share/views/tools/protein_tool.haml +383 -0
  45. data/share/views/tools/protein_tool/controls.haml +315 -0
  46. metadata +23 -2
@@ -1,62 +1,54 @@
1
1
  - map = card.map
2
2
  - map_id = card.map_id
3
- .entity_map_card(id="#{ map_id.gsub(/\s/,'_') }_card")
3
+ .entity_map_card.very.basic.ui.segment(id="#{ map_id.gsub(/\s/,'_') }_card" data-map=map_id data-type=page_entity_base_type data-column=page_entity_map_column)
4
4
 
5
- .title
5
+ .title.ui.header
6
6
  .name
7
7
  = map.key_field
8
8
  Map
9
9
  .long_name
10
10
  = Misc.humanize map_id
11
11
 
12
- .card
12
+ .content
13
13
 
14
- .sidebar.offcanvas.show
14
+ .info.ui.compact.segment
15
15
  .meta
16
- .map_management
17
- %ul
18
- %li
19
- = reveal "Rename" do
20
- %form.rename
21
- %label New name
22
- %input(name='rename' value=map_id)
23
- %input(type='submit')
24
-
25
- - if %w(pvalue p.value p-value pvalues p.values p-values).include? map.fields.first.downcase.gsub(/\s/,'')
26
- %li
27
- - url = add_GET_param(@fullpath, '_format', 'pvalue_score')
28
- %a.ensembl(href=url) Pvalue score
29
-
30
- - if Gene == Entity.formats[map.key_field]
31
- - if map.key_field != "Ensembl Gene ID"
32
- %li
33
- - url = add_GET_param(@fullpath, '_format', 'ensembl')
34
- %a.ensembl(href=url) Ensembl
35
- - if map.key_field != "Associated Gene Name"
36
- %li
37
- - url = add_GET_param(@fullpath, '_format', 'name')
38
- %a.name(href=url) Name
39
- - if "Rank" == map.fields.first
40
- %li
41
- - url = add_GET_param(@fullpath, '_format', 'invert_ranks')
42
- %a.invert_ranks(href=url) Invert ranks
43
- - else
44
- %li
45
- - url = add_GET_param(@fullpath, '_format', 'ranks')
46
- %a.ranks(href=url) Ranks
47
- - if NumericValue == Entity.formats[map.fields.first] or (map.entity_templates[map.fields.first] and map.entity_templates[map.fields.first].annotation_types.include? NumericValue)
48
- %li
49
- - $page_entity_base_type = page_entity_base_type
50
- - $page_entity_map_column = page_entity_map_column
51
- = reveal :rank_products, :title => "Rank Product" do
52
- = action_parameters nil, :class => 'rank_products' do
53
- - input :map, :select, "Select map to use", nil, :html_options => {:class => 'favourite_maps', :type => $page_entity_base_type, :column => $page_entity_map_column}
16
+ .map_management.ui.buttons
17
+ = reveal "Rename", nil, :class => 'ui small button' do
18
+ %form.rename
19
+ %label New name
20
+ %input(name='rename' value=map_id)
21
+ %input(type='submit')
22
+
23
+ - if %w(pvalue p.value p-value pvalues p.values p-values).include? map.fields.first.downcase.gsub(/\s/,'')
24
+ - url = add_GET_param(@fullpath, '_format', 'pvalue_score')
25
+ %a.ui.small.button(href=url) Pvalue score
26
+
27
+ - if Gene == Entity.formats[map.key_field]
28
+ - if map.key_field != "Ensembl Gene ID"
29
+ - url = add_GET_param(@fullpath, '_format', 'ensembl')
30
+ %a.ensembl.ui.small.button(href=url) Ensembl
31
+ - if map.key_field != "Associated Gene Name"
32
+ - url = add_GET_param(@fullpath, '_format', 'name')
33
+ %a.name.ui.small.button(href=url) Name
34
+ - if "Rank" == map.fields.first
35
+ - url = add_GET_param(@fullpath, '_format', 'invert_ranks')
36
+ %a.invert_ranks.ui.small.button(href=url) Invert ranks
37
+ - else
38
+ - url = add_GET_param(@fullpath, '_format', 'ranks')
39
+ %a.ranks.ui.small.button(href=url) Ranks
40
+ - if NumericValue == Entity.formats[map.fields.first] or (map.entity_templates[map.fields.first] and map.entity_templates[map.fields.first].annotation_types.include? NumericValue)
41
+ - $page_entity_base_type = page_entity_base_type
42
+ - $page_entity_map_column = page_entity_map_column
43
+ = reveal :rank_products, nil, :title => "Rank Product", :class => 'ui small button' do
44
+ = action_parameters nil, :class => 'rank_products' do
45
+ - input :map, :select, "Select map to use", nil, :html_options => {:class => 'favourite_maps', :type => $page_entity_base_type, :column => $page_entity_map_column}
54
46
 
55
47
 
56
48
 
57
49
  .content
58
50
  .description
59
- = table do
51
+ = table :class => 'ui collapsing table' do
60
52
  - map
61
53
  - if card.action_controller
62
54
  .actions
@@ -1,15 +1,15 @@
1
- %dl.rbbt_accordion
1
+ .entity_list.ui.styled.accordion
2
2
  - container.lists.each do |id, list, text, options|
3
3
  - if Proc === list
4
4
  = fragment do
5
5
  - list = list.call
6
6
  - next if list.nil?
7
- %dt.next
7
+ .title
8
8
  = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
9
9
  %span.title
10
10
  - title = text || id
11
11
  = title.sub('--', '—').sub('->', '⇨')
12
- %dd
12
+ .content
13
13
  - if (defined? force and force) or list.length < 500
14
14
  - if list.respond_to? :link
15
15
  = list.link * ", "
@@ -23,18 +23,18 @@
23
23
  = list * ", "
24
24
  - else
25
25
  - if list.empty?
26
- %dt
26
+ .title
27
27
  = 0
28
28
  %span.title
29
29
  - title = text || id
30
30
  = title.sub('--', '&#8212;').sub('->', '&#8680;')
31
31
  - else
32
- %dt.next
32
+ .title
33
33
  = list.respond_to?(:list_link) ? list.list_link(:length, id) : list.length
34
34
  %span.title
35
35
  - title = text || id
36
36
  = title.sub('--', '&#8212;').sub('->', '&#8680;')
37
- %dd
37
+ .content
38
38
  - if (defined? force and force) or list.length < 500
39
39
  - if list.respond_to? :link
40
40
  = list.link * ", "
@@ -1,78 +1,34 @@
1
- !!!
2
- / paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
3
- /[if lt IE 7 ] <html class=\"ie6\" lang=\"en\">
4
- /[if IE 7 ] <html class=\"ie7\" lang=\"en\">
5
- /[if IE 8 ] <html class=\"ie8\" lang=\"en\">
6
- /[if IE 9 ] <html class=\"ie9\" lang=\"en\">
7
- /[if (gt IE 9)|!(IE)] <!--> <html lang=\"en\">
1
+ = partial_render('layout/doctype')
8
2
 
9
3
  %head
10
- %meta{ :charset => "utf-8" }/
4
+ = partial_render('layout/header')
11
5
 
12
- %meta(name="viewport" content="width=device-width, initial-scale=1.0")
6
+ :sass
13
7
 
14
- %link{:rel => "icon", :type => "image/gif", :href => "/favicon.gif"}/
15
-
16
- %title= $title
17
-
18
- // Semantic-ui
19
-
20
- - record_css '/stylesheets/app'
21
-
22
- - record_css '/plugins/foundation-icons/foundation-icons.css'
23
- - record_css '/plugins/semantic-ui/dist/semantic.min.css'
24
-
25
- - record_css '/stylesheets/layout'
26
- - record_css '/stylesheets/layout'
27
- - record_css '/stylesheets/responsive'
28
- - record_css '/stylesheets/text'
29
- - record_css '/stylesheets/cards'
30
- - record_css '/stylesheets/elements'
31
- - record_css '/stylesheets/menu'
32
- - record_css '/stylesheets/color'
33
-
34
- = serve_css
35
-
36
- // Third party frameworks
37
-
38
- - record_js '/js/defer'
39
- - record_js "/plugins/underscore/js/underscore.js"
40
-
41
- = serve_js
42
-
43
- - %w(jquery-2.1.1 jquery.cookie jquery.form).each do |jquery_file|
44
- - record_js File.join('/plugins/jquery/js/', jquery_file)
45
-
46
- - record_js '/plugins/jquery-ui/js/jquery-ui-1.8.14.custom.min.js'
47
- - record_js '/plugins/jquery.tablesorter/jquery.tablesorter.min.js'
48
- - record_js '/plugins/jquery.scrollTo/jquery.scrollTo'
49
- - record_js '/plugins/semantic-ui/dist/semantic.min.js'
50
-
51
- - %w(helpers _md5 _ajax_replace _ellipsis).each do |file|
52
- - record_js "/js-find/#{ file }"
53
-
54
- - %w(dom_update workflow fragment menu favourites page_type modal reveal actions table list map hide).each do |file|
55
- - record_js "/js-find/rbbt/#{ file }"
56
-
57
- - record_js "/js-find/app"
8
+ .favourite
9
+ > .item:empty
10
+ display: none
11
+ .dropdown.item .dropdown.item
12
+ i.icon.dropdown
13
+ margin-right: -10px !important
58
14
 
59
15
  %body.preload
60
16
 
61
17
  /{{{ TOP MENU
62
18
  /------------
63
- #top_menu
19
+ #top_menu.main.ui.menu.fixed
64
20
  = partial_render('layout/top_menu')
65
21
 
66
- /{{{ MODAL
67
- /---------
68
- #modal
69
-
70
22
  /{{{ CONTENT
71
23
  /-----------
72
- #content
24
+ #content.ui.main.container.top.attached
73
25
  - @reload_page = false
74
26
  = yield
75
27
 
28
+ /{{{ MODAL
29
+ /---------
30
+ #modal.ui.modal
31
+
76
32
  /{{{ FOOTER
77
33
  /----------
78
34
  #footer
@@ -81,4 +37,42 @@
81
37
  /{{{ CODA
82
38
  /--------
83
39
  #coda
40
+ = link_js "http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.28/mithril.min.js"
41
+ -# ["/js-find/rbbt", "/js-find/rbbt.page", "/js-find/rbbt.entity", "/js-find/rbbt.entity_list", "/js-find/rbbt.knowledge_base", "/js-find/rbbt.favourites"].each do |file|
42
+ - record_js file
84
43
  =partial_render('layout/coda')
44
+
45
+
46
+ :deferjs
47
+ function gene_name(name){
48
+ return new Entity({type: "Gene", id: name, name: name, format: "Associated Gene Name", info: { organism: "Hsa/feb2014" }})
49
+ }
50
+
51
+ function entity_link(entity){
52
+ return m('a', {href: entity.url()}, entity.name)
53
+ }
54
+
55
+ function entity_item(entity){
56
+ return m('li', entity_link(entity))
57
+ }
58
+
59
+ function entity_list(list){
60
+ return m('ul.entity_list', list.map(entity_item))
61
+ }
62
+
63
+ function draw_entity_list(list){
64
+ var content_elem = $('#content')[0]
65
+ var content = [m("p", {style: 'padding: 3em'}, entity_list(list))]
66
+ return m.render(content_elem, content)
67
+ }
68
+
69
+ function debug(name){
70
+ gene = gene_name(name)
71
+ gene.children("tfacts@genomics").then(draw_entity_list)
72
+ gene.parents("tfacts@genomics").then(draw_entity_list)
73
+ }
74
+
75
+ require_js(["/js-find/rbbt", "/js-find/rbbt.entity", "/js-find/rbbt.entity_list", "/js-find/rbbt.entity_map", "/js-find/rbbt.knowledge_base", "/js-find/rbbt.page", "/js-find/rbbt.aesthetics", "/js-find/rbbt.favourites"], function(){
76
+ //debug("TP53")
77
+ })
78
+
@@ -1,3 +1,4 @@
1
+ = link_js "http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.28/mithril.min.js"
1
2
  = serve_js
2
3
  :javascript
3
4
  var main_url = window.location.toString();
@@ -0,0 +1,8 @@
1
+ !!!
2
+ / paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
3
+ /[if lt IE 7 ] <html class=\"ie6\" lang=\"en\">
4
+ /[if IE 7 ] <html class=\"ie7\" lang=\"en\">
5
+ /[if IE 8 ] <html class=\"ie8\" lang=\"en\">
6
+ /[if IE 9 ] <html class=\"ie9\" lang=\"en\">
7
+ /[if (gt IE 9)|!(IE)] <!--> <html lang=\"en\">
8
+
@@ -1,10 +1,36 @@
1
- .logo
2
- %a.image(href="http://www.cnio.es/")
3
- %img(src="http://www.cnio.es/img/comunes/header/cnio.gif")
4
- .address
5
- %span.center CNIO. Centro Nacional de Investigaciones Oncologicas (Spanish National Cancer Research Center)
6
- %span.group Structural Computational Biology Group
7
- %span.address C/ Melchor Fernandez Almagro, 3, E-28029 Madrid
8
- .contact
9
- %span.who miguel.vazquez
10
- %span.where cnio.es
1
+ :sass
2
+
3
+ #footer
4
+ border: none !important
5
+ padding: 0px !important
6
+ margin: 0px !important
7
+ .card
8
+ width: 100%
9
+ height: 100%
10
+ .contact
11
+ &:before
12
+ content: "Contact: "
13
+ font-weight: bold
14
+ span.where:before
15
+ content: " at "
16
+ .image
17
+ font-size: 0px
18
+ img
19
+ width: 100%
20
+ .image, .content
21
+ float: left
22
+ .ui.card
23
+ .image
24
+ %a.image(href="http://www.cnio.es/")
25
+ %img(src="http://www.cnio.es/img/comunes/header/cnio.gif")
26
+ .content
27
+ .header
28
+ CNIO. Centro Nacional de Investigaciones Oncologicas (Spanish National Cancer Research Center)
29
+ .description
30
+ %br/
31
+ %span.group Structural Computational Biology Group
32
+ %br/
33
+ %span.address C/ Melchor Fernandez Almagro, 3, E-28029 Madrid
34
+ .meta.contact
35
+ %span.who miguel.vazquez
36
+ %span.where cnio.es
@@ -0,0 +1,47 @@
1
+ %meta{ :charset => "utf-8" }/
2
+
3
+ %meta(name="viewport" content="width=device-width, initial-scale=1.0")
4
+
5
+ %link{:rel => "icon", :type => "image/gif", :href => "/favicon.gif"}/
6
+
7
+ %title= $title
8
+
9
+ // Semantic-ui
10
+
11
+ -# record_css '/stylesheets/app'
12
+
13
+ -# record_css '/plugins/foundation-icons/foundation-icons.css'
14
+ - record_css '/plugins/semantic-ui/dist/semantic.min.css'
15
+
16
+ -# record_css '/stylesheets/layout'
17
+ -# record_css '/stylesheets/responsive'
18
+ -# record_css '/stylesheets/text'
19
+ -# record_css '/stylesheets/cards'
20
+ -# record_css '/stylesheets/elements'
21
+ -# record_css '/stylesheets/menu'
22
+ -# record_css '/stylesheets/color'
23
+
24
+ = serve_css
25
+
26
+ // Third party frameworks
27
+
28
+ - record_js '/js/defer'
29
+ - record_js "/plugins/underscore/js/underscore.js"
30
+
31
+ = serve_js
32
+
33
+ - %w(jquery-2.1.1 jquery.cookie jquery.form).each do |jquery_file|
34
+ - record_js File.join('/plugins/jquery/js/', jquery_file)
35
+
36
+ - record_js '/plugins/jquery-ui/js/jquery-ui-1.8.14.custom.min.js'
37
+ - record_js '/plugins/jquery.tablesorter/jquery.tablesorter.min.js'
38
+ - record_js '/plugins/jquery.scrollTo/jquery.scrollTo'
39
+ - record_js '/plugins/semantic-ui/dist/semantic.min.js'
40
+
41
+ - %w(helpers _md5 _ajax_replace _ellipsis).each do |file|
42
+ - record_js "/js-find/#{ file }"
43
+
44
+ - %w(dom_update workflow fragment menu favourites page_type modal reveal actions table list map hide).each do |file|
45
+ - record_js "/js-find/rbbt/#{ file }"
46
+
47
+ - record_js "/js-find/app"
@@ -1,20 +1,34 @@
1
- .title
2
- %a(href='/')= $title
1
+ %a.title.item(href='/')= $title
3
2
 
4
- .reload
5
- %i.general.fi-refresh
3
+ %span.favourite
6
4
 
7
- .container
5
+ %a.item.reload.right(href='#')
6
+ %i.icon.repeat
8
7
 
8
+ %a.item.login.right(href='/login')
9
+ %i.icon.user
10
+ - if user
11
+ = user
9
12
 
10
- - if user
11
- .favourites.hide(hide-title="Favs")
12
- = partial_render('layout/top_menu/favourites')
13
+ %a.item.right(href='/help') Help
13
14
 
14
- .user.hide(hide-title="User")
15
- = partial_render('layout/top_menu/user')
15
+ - if defined? Sinatra::RbbtRESTWorkflow and Sinatra::RbbtRESTWorkflow::WORKFLOWS
16
+ - expoted_workflows = Sinatra::RbbtRESTWorkflow::WORKFLOWS.collect do |workflow|
17
+ - next if workflow.asynchronous_exports.empty? and workflow.synchronous_exports.empty? and workflow.exec_exports.empty?
18
+ - workflow
16
19
 
17
- - if settings.respond_to?(:finder) and settings.finder and settings.finder.instances.any?
18
- .find.hide(hide-title="Find")
19
- = partial_render('layout/top_menu/finder')
20
+ - expoted_workflows.compact!
21
+ - if expoted_workflows.any?
22
+ .item.right(style='padding:0px')
23
+ .ui.menu
24
+ .ui.dropdown.item
25
+ %i.icon.dropdown
26
+ Workflows
27
+ .menu
28
+ - expoted_workflows.each do |workflow|
29
+ %a.item(href='#{'/' + workflow.to_s}')= workflow.to_s
20
30
 
31
+ - if settings.respond_to?(:finder) and settings.finder and settings.finder.instances.any?
32
+ .finder.right.item
33
+ %form.collapse(action='/find' method="POST")
34
+ %input(type="search" name="term" placeholder='Search')
@@ -12,7 +12,7 @@
12
12
  =description
13
13
  %hr
14
14
 
15
- %form(class=klass action=action method=method id=id enctype=enctype)
15
+ %form.ui.form(class=klass action=action method=method id=id enctype=enctype)
16
16
 
17
17
  - inputs = consume_parameter(:inputs, info) || []
18
18
  - types = consume_parameter(:input_types, info) || {}
@@ -24,14 +24,14 @@
24
24
  - inputs.each do |input|
25
25
  - input_id = id.nil? ? nil : id + "__" << input.to_s
26
26
  - hide = (options[input] != nil and options[input][:hide])
27
- %div(class="input #{types[input]} #{input} #{hide ? 'hide' : ''}")
27
+ %div(class="input field #{types[input]} #{input} #{hide ? 'hide' : ''}")
28
28
  - input_options = options[input]
29
29
  - input_options = input_options.dup unless input_options.nil?
30
30
  != form_input(input, types[input], defaults[input], values[input], descriptions[input], input_id, input_options)
31
31
 
32
32
 
33
- .input.submit
34
- %input(type="submit")
33
+ .input.field.submit
34
+ %input.ui.submit.button(type="submit")
35
35
  - if klass =~ /workflow_task/
36
36
  %input.jobname(type='text' name='jobname' placeholder='optional job name')
37
37
  %select.format(name="_format")