Module: PublishMyData::SubnavigationHelper

Defined in:
app/helpers/publish_my_data/subnavigation_helper.rb

Instance Method Summary collapse

Instance Method Details

#standard_menu_catalogueObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/publish_my_data/subnavigation_helper.rb', line 11

def standard_menu_catalogue
  {
    title: "Catalogue",
    css_class: "pmd_nav_sub_catalogue",
    target: publish_my_data.datasets_path,
    highlight: "catalogue",
    items: [
      {
        title: "Datasets by theme",
        target: '/themes',
        highlight: "browse"
      }
    ]
  }
end

#standard_menu_docsObject



43
44
45
46
47
48
49
50
51
# File 'app/helpers/publish_my_data/subnavigation_helper.rb', line 43

def standard_menu_docs
  {
    title: "Documentation",
    css_class: "pmd_nav_sub_api",
    target: publish_my_data.api_docs_path,
    highlight: "documentation",
    items: []
  }
end

#standard_menu_pmdObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/helpers/publish_my_data/subnavigation_helper.rb', line 53

def standard_menu_pmd
  {
    title: "PublishMyData",
    css_class: "pmd_nav_sub_pmd",
    target: publish_my_data.about_pmd_path,
    highlight: "about pmd",
    items: [
      {
        title: "Source (Github)",
        target: "http://github.com/Swirrl/publish_my_data",
        highlight: nil
      },
      {
        title: "Swirrl.com",
        target: "http://swirrl.com",
        highlight: nil
      }
    ]
  }
end

#standard_menu_toolsObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/publish_my_data/subnavigation_helper.rb', line 27

def standard_menu_tools
  {
    title: "Tools",
    css_class: "pmd_nav_sub_tools",
    target: publish_my_data.tools_path,
    highlight: "tools",
    items: [
      {
        title: "SPARQL endpoint",
        target: publish_my_data.sparql_endpoint_path,
        highlight: "endpoint"
      }
    ]
  }
end


4
5
6
7
8
9
# File 'app/helpers/publish_my_data/subnavigation_helper.rb', line 4

def submenu_link text, url, highlight_when
  unless (highlight_when.nil?) 
    css_class = highlight_when == @highlight_in_menu ? "pmd_selected" : ""
  end
  link_to text, url, class: css_class
end