add files
|
1 |
<% |
2 |
my $dbi = app->dbi; |
|
3 |
my $op = param('op') // ''; |
|
4 |
my $book_id = param('book-id'); |
|
5 |
|
|
improve design
|
6 |
my $books = $dbi->model('book')->select(['id', 'short_name'])->all; |
add files
|
7 |
|
improve design
|
8 |
my $content; |
9 |
if ($book_id) { |
|
10 |
$content = $dbi->model('book')->select( |
|
11 |
'content', |
|
12 |
where => {id => $book_id} |
|
13 |
)->value; |
|
14 |
} |
|
add files
|
15 |
%> |
16 | ||
17 | ||
18 |
% layout 'common'; |
|
19 | ||
20 |
<div id="container"> |
|
21 | ||
22 |
<div id="boxA"> |
|
23 |
<h1>口語訳聖書オンライン語句検索</h1> |
|
24 |
</div> |
|
25 | ||
26 |
<div id="boxB"> |
|
27 |
<div style="margin-bottom:5px"> |
|
28 |
<%= text_field 'word' , style => "width:160px"%> |
|
29 |
<button style="width:50px;padding:2px;">検索</button> |
|
30 |
</div> |
|
31 |
<div style="margin-bottom:10px;"> |
|
improve design
|
32 |
<a href="<%= url_for('/') %>" style="color:blue">聖書</a> |
add files
|
33 |
</div> |
34 |
<div style="border:1px solid gray;width:218px;height:400px;overflow:auto;padding:5px"> |
|
35 |
<ul style="list-style-type:none"> |
|
36 |
% for my $book (@$books) { |
|
improve design
|
37 |
<li><a class="book" id="<%= "book-$book->{id}" %>" href="<%= url_for->query('book-id' => $book->{id}) %>"><%= $book->{short_name} %></a></li> |
add files
|
38 |
% } |
39 |
</ul> |
|
40 |
</div> |
|
41 |
</div> |
|
42 | ||
43 |
<div id="boxC"> |
|
44 |
<p> |
|
45 |
% if ($book_id) { |
|
improve design
|
46 |
%== $content |
add files
|
47 |
% } |
48 |
</p> |
|
49 |
</div> |
|
50 | ||
51 | ||
52 |
<div id="boxD"> |
|
improve design
|
53 |
<div style="border-top:1px solid #AAAAAA;padding-top:10px;"> |
54 |
This site is create by |
|
55 |
<a href="http://d.hatena.ne.jp/perlcodesample">Perl</a> + |
|
56 |
<a href="http://d.hatena.ne.jp/perlcodesample/20140319/1395203665">Mojolicious</a>. |
|
57 |
Auther is <a href="https://twitter.com/yukikimoto2">Yuki kimoto</a>. |
|
58 |
</div> |
|
add files
|
59 |
</div> |
60 |
</div> |