Sha256: cce7986a511dacb702f5569d1cdc5987d5403068226af9457c61e31bd161855f
Contents?: true
Size: 1.92 KB
Versions: 4
Compression:
Stored size: 1.92 KB
Contents
# encoding: UTF-8 # Copyright 2011 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 ApplicationHelper def iqvoc_default_rdf_namespaces Iqvoc.rdf_namespaces.merge({ :default => root_url(:format => nil, :lang => nil, :trailing_slash => true).gsub(/\/\/$/, "/"), # gsub because of a Rails bug :-( :coll => collections_url(:trailing_slash => true, :lang => nil, :format => nil), :schema => controller.schema_url(:format => nil, :anchor => "", :lang => nil) }) end def options_for_language_select(selected = nil) locales_collection = Iqvoc.available_languages.map { |l| [l, l] } options_for_select(locales_collection, selected) end def user_details(user) "#{user.name} (#{user.telephone_number})" end # Formats a list ob items or returns a remark if no items where given def item_listing(items, &block) return content_tag :p, "-", :class => 'term-unavailable' if items.empty? content_tag :ul, :class => "entity_list" do items.map do |item| content_tag :li, :class => (items.last == item ? "last-child" : "") do block.call(item) end end.join("\n").html_safe end end def error_messages_for(object) if object.errors.any? content_tag :ul, :class => "flash_error error_list" do object.errors.full_messages.each do |msg| concat(content_tag(:li, msg)) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
iqvoc-3.5.3 | app/helpers/application_helper.rb |
iqvoc-3.5.2 | app/helpers/application_helper.rb |
iqvoc-3.5.1 | app/helpers/application_helper.rb |
iqvoc-3.5.0 | app/helpers/application_helper.rb |