lib/ezframe/editor.rb in ezframe-0.1.1 vs lib/ezframe/editor.rb in ezframe-0.2.0
- old
+ new
@@ -82,21 +82,21 @@
def make_edit_form(command = :edit)
@id = get_id
table = []
matrix = @column_set.map do |column|
form = column.form
- table.push Ht.p([ Ht.small_text(column.label), form ]) if form
+ table.push Ht.p([ Ht.small(column.label), form ]) if form
end
send_button = Ht.button(child: Message[:edit_finish_button_label], class: %w[btn], event: "on=click:url=#{make_base_url(@id)}/#{command}:with=form")
table.push(send_button)
return Ht.table(Ht.tr(table))
end
#--------------------------------------------------------------------------------------------------------
# 検索
def public_search_post
- mylog "public_search_post: #{@parsed_body.inspect}"
+ Logger.info "public_search_post: #{@parsed_body.inspect}"
sch_keys = @search_keys || @column_set.keys
word = @params["word"]
pattern = "%#{word}%"
pattern_a = sch_keys.map {|key| Sequel.like(key, pattern) }
data_a = @dataset.where(Sequel.|(*pattern_a)).all
@@ -105,11 +105,11 @@
show_base_template(title: Message[:search_result_page_title], body: Html.convert(layout))
end
# 詳細表示
def show_detail_page
- mylog "show_detail_page: #{@request.params.inspect}"
+ Logger.info "show_detail_page: #{@request.params.inspect}"
id = get_id(@class_snake)
unless @column_set.set_from_db(id)
return show_message_page("no data", "data is not defined: #{id}")
end
layout = main_layout(center: make_detail_table)
@@ -126,11 +126,11 @@
edit_btn = nil
if @column_edit_mode
edit_btn = edit_button(column)
edit_btn[:event] = "on=click:branch=edit_column:key=#{column.key}" if edit_btn
end
- table.push(Ht.p(class: %w[hover-button-box], child: [ Ht.small_text(column.label), column.view, edit_btn ].compact))
+ table.push(Ht.p(class: %w[hover-button-box], child: [ Ht.small(column.label), column.view, edit_btn ].compact))
end
unless @column_edit_mode
edit_btn = Ht.button(class: %w[btn], child: [ Ht.icon("edit"), Message[:edit_button_label] ], event: "on=click:url=#{make_base_url(@id)}/edit")
table.push(edit_btn)
end
@@ -144,11 +144,11 @@
# URLからのIDの取得
def get_id(class_name = nil)
class_name ||= @class_snake
params = @request.env['url_params']
return nil unless params
- # mylog "get_id: #{params.inspect}, #{class_name}"
+ # Logger.info "get_id: #{params.inspect}, #{class_name}"
return params[class_name.to_sym]
end
# 値の更新
def update_value
@@ -157,16 +157,16 @@
end
# ラベル付きで1カラムのviewを表示
def show_label_view(key)
col = @column_set[key]
- Ht.span([Ht.small_text(col.label), col.view(force: true)])
+ Ht.span([Ht.small(col.label), col.view(force: true)])
end
# ラベル付きで1カラムのformを表示
def show_label_edit(key)
col = @column_set[key]
- Ht.span([Ht.small_text(col.label), col.form(force: true)])
+ Ht.span([Ht.small(col.label), col.form(force: true)])
end
# エラーページの表示
def show_message_page(title, body)
return show_base_template(title: title, body: Html.convert(body))