-# このページ内専用のjavascriptでjQueryオブジェクトを参照したい場合この関数に記述
:javascript
local_initialize_functions.push(function($) {
$("[data-toggle=tooltip]").tooltip({
animation: false,
container: "body",
});
// セレクトボタン設定
$(".selectpicker").selectpicker({
container: "body",
width: "100%"
});
});
%form(action="/settings" method="POST")
%input(type="hidden" name="view_invisible" value="#{@view_invisible ? 1 : 0}")
.navbar.navbar-default.navbar-fixed-top(role="navigation")
.container
.navbar-header
%button.navbar-toggle(type="button")
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand(href="#" data-move-to="top") Narou.rb WEB UI
.collapse.navbar-collapse
%ul.nav.navbar-nav
%li.active
%a(href="/settings") 環境設定
%li
%a(href="/help") ヘルプ
%li
%a(href="/") 戻る
.navbar-form.navbar-left
%input.btn.btn-info(type="submit" value="設定を保存" style="margin-left: 50px")
%p#queue-text.navbar-text.navbar-right(data-toggle="tooltip" title="キューに積まれた処理の数" data-placement="bottom")
%span.glyphicon.glyphicon-inbox
%span#queue 0
.container.container-main.theme-showcase(role="main")
- @setting_variables.each do |scope, variables|
- inventory = Inventory.load("#{scope}_setting", scope)
- unless @view_invisible
-# 隠しパラメータは配列の最初の方に集めておく
-# (リストの最後に隠しパラメータがあると、リストの最下部の表示が切れるため)
- variables = variables.select { |_, v| v[:invisible] }.merge(variables.reject { |_, v| v[:invisible] })
%p.panel-settings-link
- if scope == :local
goto Global Variables
・
置換設定
- else
goto Local Variables
・
置換設定
.panel.panel-primary.panel-settings
.panel-heading{id: scope} #{scope.capitalize} Variables
.panel-body.list-group-item-info
・各コマンドの設定の変更が出来ます
- if scope == :local
- if @view_invisible
・default.* 系の設定は個別の変換設定で未設定の項目の挙動を指定することが出来ます
・force.* 系の設定は個別設定、default.* 等の設定を無視して反映されるようになります
・default_args.* 系の設定は、各種コマンドのオプションを省略した場合に使用されるオプションを指定出来ます
- else
・Global な設定はユーザープロファイルに保存され、すべての narou コマンドで使われます
- if @view_invisible
・隠しオプションを非表示にするにはここをクリック
- else
・隠しオプションを表示するにはここをクリック
.list-group
- variables.each do |name, value|
- item = inventory[name]
- unless @view_invisible
- if value[:invisible]
- if value[:type] == :boolean
- hidden_value = convert_boolean_to_on_off(item)
- else
- hidden_value = item
%input{type:"hidden", name:name, value:hidden_value}
- next
- message = Narou::SETTING_VARIABLES_WEBUI_MESSAGES[name] || value[:help]
- message = message.strip.gsub("\n", "
")
- error_style = {class: "has-error", style: "background-color:#f2dede"}
.list-group-item.form-group{@error_list[name] ? error_style : {}}
%h4.list-group-item-heading #{name}
.list-group-item-text
- case value[:type]
- when :boolean
- if name =~ /^(force|default)\./
.switch-toggle.well.switch-3
%label(for="#{name}-nil")
未設定
%label(for="#{name}-false")
しない
%label(for="#{name}-true")
する
%a.btn.btn-primary
- else
%label.switch-light.well
- if name == "over18"
%span
%span いいえ
%span はい
- else
%span
%span しない
%span する
%a.btn.btn-primary
- when :select
%div.input-style
%select{name: name, class: "selectpicker show-tick"}
%option(value="") 未設定
- value[:select_keys].each_with_index do |key, index|
%option{selected: item == key, value: key}
= value[:select_summaries][index]
- when :multiple
%div.input-style
%select{name: "#{name}[]", class: "selectpicker", multiple: true, title: "未設定"}
- selected_items = item.to_s.split(",")
- value[:select_keys].each_with_index do |key, index|
%option{selected: selected_items.include?(key), value: key}
= value[:select_summaries][index]
- else
%input{type:"text", name:name, value:item, class:"form-control",
placeholder:Helper.variable_type_to_description(value[:type]).strip }
%p
= message != "" ? message : " "
- if @error_list[name]
%p.alert-danger
= @error_list[name]
.clear
%p.panel-settings-link
goto Local Variables
・
Global Variables
- @replace_panel_var = { title: "全小説対象の置換設定",
panel_class: "panel-primary",
body_class: "list-group-item-info",
body: ["・全ての小説に対する置換設定を行うことが出来ます",
"・変更を反映させるには再度変換を実行する必要があります"] }
= haml :edit_replace_txt
%input(type="submit" value="設定を保存" class="btn btn-info" style="float:none")