Project

General

Profile

Patch #36182 » show-notifications-v3.patch

Go MAEDA, 2022-06-24 10:43

View differences:

app/helpers/application_helper.rb
wiki_pages: auto_complete_wiki_pages_path(project_id: project, q: ''),
}
end
def render_top_banner(id: nil, mobile: false)
return if Setting.login_required? && !User.current.logged?
parsed_banner_text = textilizable(Setting.banner_text)
return if parsed_banner_text.blank?
tag.div(id: id, class: "wiki top-banner #{mobile ? 'mobile-show' : 'mobile-hide'}") do
parsed_banner_text
end
end
end
app/views/layouts/base.html.erb
</div>
<%= render_top_banner(id: 'top-banner') %>
<div id="top-menu">
<div id="account">
......
</div>
<div id="content">
<%= render_top_banner(id: 'top-banner-in-content', mobile: true) %>
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
app/views/settings/_general.html.erb
<p><%= setting_text_area :welcome_text, :cols => 60, :rows => 5, :class => 'wiki-edit' %></p>
<%= wikitoolbar_for 'settings_welcome_text' %>
<p><%= setting_text_area :banner_text, :cols => 60, :rows => 5, :class => 'wiki-edit' %></p>
<%= wikitoolbar_for 'settings_banner_text' %>
<p><%= setting_text_field :per_page_options, :size => 20 %>
<em class="info"><%= l(:text_comma_separated) %></em></p>
config/locales/en.yml
setting_app_title: Application title
setting_welcome_text: Welcome text
setting_banner_text: Banner text
setting_default_language: Default language
setting_login_required: Authentication required
setting_self_registration: Self-registration
config/locales/ja.yml
setting_app_title: アプリケーションのタイトル
setting_welcome_text: ウェルカムメッセージ
setting_banner_text: バナーメッセージ
setting_default_language: デフォルトの言語
setting_login_required: 認証が必要
setting_self_registration: ユーザーによるアカウント登録
config/settings.yml
default: Redmine
welcome_text:
default:
banner_text:
default:
login_required:
default: 0
security_notifications: 1
public/stylesheets/application.css
margin-bottom: 15px;
}
/***** Banner *****/
div.top-banner {
padding: 0px 20px;
margin: 0px;
background-color: #dfffdf;
border: 1px solid #9fcf9f;
color: #005f00;
}
/***** Progress bar *****/
table.progress {
border-collapse: collapse;
public/stylesheets/responsive.css
.mobile-hide {display:none;}
.mobile-show {display:initial;}
.top-banner.mobile-show { display: block; }
/* Contextual Buttons */
#content>.contextual {
test/functional/account_controller_test.rb
assert_equal 2, @request.session[:user_id]
end
def test_login_should_not_view_banner_if_required_login
with_settings :banner_text => 'h1. banner text' do
with_settings :login_required => '0' do
get :login
assert_response :success
assert_select '#top-banner h1', text: /banner text/
end
with_settings :login_required => '1' do
get :login
assert_response :success
assert_select '#top-banner', count: 0
end
end
end
def test_login_should_redirect_to_back_url_param
# request.uri is "test.host" in test environment
back_urls = [
(8-8/8)