2022-09-01 02:42:50 +00:00
|
|
|
<% tmp = render_view %>
|
|
|
|
<% @params = @index_controller.instance_variable_get(:@params) rescue {}
|
|
|
|
@enable_search_flag = @index_controller.instance_variable_get(:@enable_search_flag) rescue false
|
|
|
|
%>
|
|
|
|
|
2022-02-27 04:58:52 +00:00
|
|
|
<% if @enable_search_flag %>
|
2020-03-01 07:49:01 +00:00
|
|
|
<style type="text/css">
|
|
|
|
#category_select_box{
|
|
|
|
margin: 0;
|
|
|
|
background: linear-gradient(0deg, #515fff, #ff3e3e);
|
|
|
|
color: white;
|
|
|
|
outline: 0;
|
|
|
|
border-radius: 0.9em;
|
|
|
|
}
|
|
|
|
#category_select_box>option{
|
|
|
|
background: #5640dd;
|
|
|
|
}
|
|
|
|
input.search_box{
|
|
|
|
margin: 0;
|
|
|
|
background: #a2c3df;
|
2020-05-20 13:42:13 +00:00
|
|
|
font-weight: bold;
|
|
|
|
color: #00008b;
|
2020-03-01 07:49:01 +00:00
|
|
|
border-radius: 0.7em;
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
input.search_box[type='submit']:hover{
|
|
|
|
background: #9100ff;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
input.search_box[type='submit']:active{
|
|
|
|
background: #7201ff;
|
|
|
|
color: white;
|
|
|
|
}
|
2020-05-20 13:42:13 +00:00
|
|
|
input.search_box::-webkit-input-placeholder {
|
|
|
|
color: #aa58e8;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
input.search_box:-moz-placeholder {
|
|
|
|
color: #aa58e8;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
input.search_box::-moz-placeholder {
|
|
|
|
color: #aa58e8;
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2020-03-01 07:49:01 +00:00
|
|
|
</style>
|
|
|
|
<form>
|
2022-09-01 02:42:50 +00:00
|
|
|
<% cats = Array(@page.categories)
|
2020-03-01 07:49:01 +00:00
|
|
|
if cats.include? 'all'
|
|
|
|
cats = ModuleApp.where(key: 'announcement').first.categories
|
|
|
|
else
|
|
|
|
cats = cats.map{|v| Category.where(id: v).first}.compact
|
|
|
|
end
|
2022-09-01 02:57:00 +00:00
|
|
|
all_cat = [[t('announcement.select_prompt'),'all'],[t('announcement.all'),'all']]
|
2020-03-01 07:49:01 +00:00
|
|
|
%>
|
2020-05-20 13:42:13 +00:00
|
|
|
<div class="search_widget" style="display: flex;flex-wrap: wrap;font-size: 1.1em;">
|
2022-09-01 02:57:00 +00:00
|
|
|
<%= select_tag('category',options_for_select(all_cat.concat(cats.map{|v| [v.title,v.id.to_s]}),:selected => @params['category'].to_s),:id=>"category_select_box") %>
|
2022-02-27 04:58:52 +00:00
|
|
|
<input class="search_box" type="text" name="keywords" value="<%= @params['keywords'].to_s.gsub(/\"/,'') %>" placeholder="<%= t('announcement.keywords') %>">
|
2020-07-01 10:05:59 +00:00
|
|
|
<div style="display: flex;flex-wrap: wrap;">
|
|
|
|
<div class="default_picker">
|
2022-02-27 04:58:52 +00:00
|
|
|
<input class="search_box" type="text" name="stime" value="<%= @params['stime'].to_s.gsub(/\"/,'') %>" placeholder="<%= t('announcement.stime') %>" data-format="yyyy/mm/dd">
|
2020-07-01 10:05:59 +00:00
|
|
|
</div>
|
|
|
|
~
|
|
|
|
<div class="default_picker">
|
2022-02-27 04:58:52 +00:00
|
|
|
<input class="search_box" type="text" name="etime" value="<%= @params['etime'].to_s.gsub(/\"/,'') %>" placeholder="<%= t('announcement.etime') %>" data-format="yyyy/mm/dd">
|
2020-07-01 10:05:59 +00:00
|
|
|
</div>
|
2020-05-20 13:42:13 +00:00
|
|
|
</div>
|
2020-07-01 10:05:59 +00:00
|
|
|
<input type="hidden" name="authenticity_token" value="<%= (0...46).map { ('a'..'z').to_a[rand(26)] }.join %>">
|
2020-03-01 07:49:01 +00:00
|
|
|
<input class="search_box" type="submit" value="<%= t('announcement.search') %>">
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<% end %>
|
2022-09-01 02:42:50 +00:00
|
|
|
<%= tmp %>
|