Sha256: a929de026e1177dfbb4adffdea4d2a1243b532ccb8e5849455fb65e7043a238f

Contents?: true

Size: 1.41 KB

Versions: 14

Compression:

Stored size: 1.41 KB

Contents

# encoding: UTF-8

# Copyright 2011-2013 innoQ Deutschland GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module DashboardHelper
  def sorting_controls_for(name)
    content_tag :div, class: 'sorting-controls' do
      link_to(icon('arrow-circle-o-up', 'sorting-arrow'),
        dashboard_path(order: 'asc', by: name.to_s)) +
        link_to(icon('arrow-circle-o-down', 'sorting-arrow'),
        dashboard_path(order: 'desc', by: name.to_s))
    end
  end

  def consistency_status(item)
    css, msg = if item.publishable?
      ['valid', '✓']
    else
      ['invalid', '✗']
    end

    content_tag :span, raw(msg), class: css
  end

  def link_to_dashboard_item(item)
    if item.is_a?(Label::Base)
      item.published? ? label_path(id: item.origin) : label_path(published: 0, id: item.origin)
    else
      item.published? ? concept_path(id: item.origin) : concept_path(published: 0, id: item.origin)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
iqvoc-4.11.1 app/helpers/dashboard_helper.rb
iqvoc-4.11.0 app/helpers/dashboard_helper.rb
iqvoc-4.10.0 app/helpers/dashboard_helper.rb
iqvoc-4.9.0 app/helpers/dashboard_helper.rb
iqvoc-4.8.2 app/helpers/dashboard_helper.rb
iqvoc-4.8.1 app/helpers/dashboard_helper.rb
iqvoc-4.8.0 app/helpers/dashboard_helper.rb
iqvoc-4.7.0 app/helpers/dashboard_helper.rb
iqvoc-4.6.1 app/helpers/dashboard_helper.rb
iqvoc-4.5.2 app/helpers/dashboard_helper.rb
iqvoc-4.6.0 app/helpers/dashboard_helper.rb
iqvoc-4.5.1 app/helpers/dashboard_helper.rb
iqvoc-4.5.0 app/helpers/dashboard_helper.rb
iqvoc-4.4.0 app/helpers/dashboard_helper.rb