Module: WelcomeHelper

Defined in:
frontend/app/helpers/welcome_helper.rb

Instance Method Summary collapse

Instance Method Details

#database_warning(info = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'frontend/app/helpers/welcome_helper.rb', line 3

def database_warning(info = {})
  if session["user"]
    if info.has_key?("databaseProductName") && info["databaseProductName"].include?("Derby")
      flash[:warning] = I18n.t("database_warning.message")
    end
  end
end

#no_repo_messageObject



11
12
13
14
15
16
17
18
19
# File 'frontend/app/helpers/welcome_helper.rb', line 11

def no_repo_message
  if session[:user] && @repositories.length === 0
    if user_can?('create_repository')
      flash.now[:info] = I18n.t("repository._frontend.messages.create_first_repository")
    else
      flash.now[:info] = I18n.t("repository._frontend.messages.no_access_to_repositories")
    end
  end
end

#welcome_messageObject



21
22
23
24
25
26
27
# File 'frontend/app/helpers/welcome_helper.rb', line 21

def welcome_message
  if session["user"]
    return "<p>#{ I18n.t 'welcome.message_logged_in' }</p>".html_safe
  else
    return "<p>#{ I18n.t 'welcome.message' }</p>".html_safe
  end
end