~ubuntu-branches/ubuntu/utopic/tdiary/utopic

« back to all changes in this revision

Viewing changes to misc/plugin/ja/category.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# ja/category.rb $Revision: 1.13 $
 
1
# -*- coding: utf-8 -*-
 
2
# ja/category.rb
2
3
#
3
4
# Copyright (c) 2004 Junichiro KITA <kita@kitaj.no-ip.com>
4
5
# Distributed under the GPL
9
10
        mode = info.mode
10
11
        case mode
11
12
        when :year
12
 
                period = "#{info.year}ǯ"
 
13
                period = "#{info.year}年"
13
14
        when :half
14
 
                period = (info.month.to_i == 1 ? "��Ⱦ��" : "��Ⱦ��")
15
 
                period = "#{info.year}ǯ #{period}" if info.year
 
15
                period = (info.month.to_i == 1 ? "上半期" : "下半期")
 
16
                period = "#{info.year}年 #{period}" if info.year
16
17
        when :quarter
17
 
                period = "��#{info.month.to_i}��Ⱦ��"
18
 
                period = "#{info.year}ǯ #{period}" if info.year
 
18
                period = "第#{info.month.to_i}四半期"
 
19
                period = "#{info.year}年 #{period}" if info.year
19
20
        when :month
20
 
                period = "#{info.month.to_i}��"
21
 
                period = "#{info.year}ǯ #{period}" if info.year
 
21
                period = "#{info.month.to_i}月"
 
22
                period = "#{info.year}年 #{period}" if info.year
22
23
        end
23
24
        period = " (#{period})" if period
24
25
 
34
35
        @conf['category.next_quarter'] ||= '($1-$2) >>'
35
36
        @conf['category.prev_month'] ||= '<< ($1-$2)'
36
37
        @conf['category.next_month'] ||= '($1-$2) >>'
37
 
        @conf['category.this_year'] ||= 'ǯ'
38
 
        @conf['category.this_half'] ||= 'Ⱦ��'
39
 
        @conf['category.this_quarter'] ||= '��Ⱦ��'
40
 
        @conf['category.this_month'] ||= '��'
41
 
        @conf['category.all_diary'] ||= '������'
42
 
        @conf['category.all_category'] ||= '�����ƥ���'
43
 
        @conf['category.all'] ||= '������/�����ƥ���'
 
38
        @conf['category.this_year'] ||= '年'
 
39
        @conf['category.this_half'] ||= '半期'
 
40
        @conf['category.this_quarter'] ||= '四半期'
 
41
        @conf['category.this_month'] ||= '月'
 
42
        @conf['category.all_diary'] ||= '全期間'
 
43
        @conf['category.all_category'] ||= '全カテゴリ'
 
44
        @conf['category.all'] ||= '全期間/全カテゴリ'
44
45
end
45
46
category_init_local
46
47
 
47
 
@category_conf_label = '���ƥ���'
 
48
@category_conf_label = 'カテゴリ'
48
49
def category_conf_html
49
50
        r = <<HTML
50
 
<h3 class="subtitle">���ƥ��ꥤ��ǥå����κ���</h3>
 
51
<h3 class="subtitle">カテゴリインデックスの作成</h3>
51
52
<p>
52
 
���ƥ���ε�ǽ�����Ѥ���ˤϥ��ƥ��ꥤ��ǥå����򤢤餫����������Ƥ���ɬ�פ�����ޤ���
53
 
���ƥ��ꥤ��ǥå������������ˤ�
54
 
�ʲ��Υ����å�������Ƥ���OK�ܥ���򲡤��Ƥ���������
 
53
カテゴリの機能を利用するにはカテゴリインデックスをあらかじめ作成しておく必要があります。
 
54
カテゴリインデックスを作成するには
 
55
以下のチェックを入れてからOKボタンを押してください。
55
56
</p>
56
57
<p><label for="category_initialize">
57
 
<input type="checkbox" id="category_initialize" name="category_initialize" value="1">���ƥ��ꥤ��ǥå����κ���
 
58
<input type="checkbox" id="category_initialize" name="category_initialize" value="1">カテゴリインデックスの作成
58
59
</label></p>
59
60
<p>
60
 
�������̤䥵���Ф���ǽ�ˤ���ޤ��������ä�������äǥ���ǥå����κ����Ͻ�λ���ޤ���
 
61
日記の量やサーバの性能にもよりますが、数秒から数十秒でインデックスの作成は終了します。
61
62
</p>
62
63
 
63
 
<h3 class="subtitle">�����Խ����ݡ���</h3>
 
64
<h3 class="subtitle">日記編集サポート</h3>
64
65
<p>
65
 
�����Խ����̤Ρ���ʸ�פβ��˥��ƥ���̾�����ɽ�����뤳�Ȥ��Ǥ��ޤ���
66
 
���ƥ���̾�򥯥�å�����ȡ���ʸ�פˤ��Υ��ƥ���̾����������ޤ�(��JavaScript)��
 
66
日記編集画面の「本文」の下にカテゴリ名を一覧表示することができます。
 
67
カテゴリ名をクリックすると「本文」にそのカテゴリ名が挿入されます(要JavaScript)。
67
68
</p>
68
69
<p>
69
70
<select name="category.edit_support">
70
 
<option value="true"#{" selected" if @conf['category.edit_support']}>ɽ������</option>
71
 
<option value="false"#{" selected" unless @conf['category.edit_support']}>ɽ�����ʤ�</option>
 
71
<option value="true"#{" selected" if @conf['category.edit_support']}>表示する</option>
 
72
<option value="false"#{" selected" unless @conf['category.edit_support']}>表示しない</option>
72
73
</select>
73
74
</p>
74
75
 
75
 
<h3 class="subtitle">ɽ�����֤ν������</h3>
 
76
<h3 class="subtitle">表示期間の初期状態</h3>
76
77
<p>
77
 
���ƥ���ɽ�����̤�ɽ���������Ρ��ǽ��ɽ�����֤���ꤷ�ޤ���
 
78
カテゴリ表示画面を表示した時の、最初の表示期間を指定します。
78
79
</p>
79
80
<p>
80
81
<select name="category.period">
81
82
HTML
82
83
        [
83
 
                ['��', 'month', false],
84
 
                ['��Ⱦ��', 'quarter', true],
85
 
                ['Ⱦ��', 'half', false],
86
 
                ['ǯ', 'year', false],
87
 
                ['������', 'all', false],
 
84
                ['月', 'month', false],
 
85
                ['四半期', 'quarter', true],
 
86
                ['半期', 'half', false],
 
87
                ['年', 'year', false],
 
88
                ['全日記', 'all', false],
88
89
        ].each do |text, value, default|
89
90
                selected = @conf["category.period"] ? @conf["category.period"] == value : default
90
91
                r << <<HTML
95
96
</select>
96
97
</p>
97
98
 
98
 
<h3 class="subtitle">�إå�</h3>
 
99
<h3 class="subtitle">ヘッダ</h3>
99
100
<p>
100
 
���̾�����ɽ������ʸ�Ϥ���ꤷ�ޤ���
101
 
��&lt;%= category_navi %&gt;�פǡ����ƥ�����ò������ʥӥ��������ܥ����ɽ�����뤳�Ȥ��Ǥ��ޤ���
102
 
�ޤ���&lt;%= category_list%&gt;�פǥ��ƥ���̾������ɽ�����뤳�Ȥ��Ǥ��ޤ���
103
 
����¾���Ƽ�ץ饰�����HTML�򵭽ҤǤ��ޤ���
 
101
画面上部に表示する文章を指定します。
 
102
「&lt;%= category_navi %&gt;」で、カテゴリに特化したナビゲーションボタンを表示することができます。
 
103
また「&lt;%= category_list%&gt;」でカテゴリ名一覧を表示することができます。
 
104
その他,各種プラグインやHTMLを記述できます。
104
105
</p>
105
106
 
106
 
<h4>�إå�1</h4>
107
 
<p>�ʥӥ��������ܥ���Τ�������ɽ������ޤ���</p>
 
107
<h4>ヘッダ1</h4>
 
108
<p>ナビゲーションボタンのすぐ下に表示されます。</p>
108
109
<p><textarea name="category.header1" cols="60" rows="5">#{h @conf['category.header1']}</textarea></p>
109
110
 
110
 
<h4>�إå�2</h4>
111
 
<p>H1�Τ�������ɽ������ޤ���</p>
 
111
<h4>ヘッダ2</h4>
 
112
<p>H1のすぐ下に表示されます。</p>
112
113
<p><textarea name="category.header2" cols="60" rows="5">#{h @conf['category.header2']}</textarea></p>
113
114
 
114
 
<h3 class="subtitle">�ܥ����٥�</h3>
 
115
<h3 class="subtitle">ボタンラベル</h3>
115
116
<p>
116
 
�ʥӥ��������ܥ���Υ�٥����ꤷ�ޤ���
117
 
��٥����$1��$2�ϡ����줾���ǯ�סַ�פ�ɽ�����ͤ��ִ�����ޤ���
 
117
ナビゲーションボタンのラベルを指定します。
 
118
ラベル中の$1と$2は,それぞれ「年」「月」を表す数値で置換されます。
118
119
</p>
119
120
<table border="0">
120
 
<tr><th>�ܥ���̾</th><th>��٥�</th><th>����ץ�</th></tr>
 
121
<tr><th>ボタン名</th><th>ラベル</th><th>サンプル</th></tr>
121
122
HTML
122
123
        [
123
 
                ['��ǯ', 'category.prev_year'],
124
 
                ['��ǯ', 'category.next_year'],
125
 
                ['����Ⱦǯ', 'category.prev_half'],
126
 
                ['����Ⱦǯ', 'category.next_half'],
127
 
                ['����Ⱦ��', 'category.prev_quarter'],
128
 
                ['����Ⱦ��', 'category.next_quarter'],
129
 
                ['���', 'category.prev_month'],
130
 
                ['���', 'category.next_month'],
131
 
                ['��ǯ', 'category.this_year'],
132
 
                ['��Ⱦ��', 'category.this_half'],
133
 
                ['����Ⱦ��', 'category.this_quarter'],
134
 
                ['����', 'category.this_month'],
135
 
                ['������', 'category.all_diary'],
136
 
                ['�����ƥ���', 'category.all_category'],
137
 
                ['������/�����ƥ���', 'category.all'],
 
124
                ['前年', 'category.prev_year'],
 
125
                ['翌年', 'category.next_year'],
 
126
                ['前の半年', 'category.prev_half'],
 
127
                ['次の半年', 'category.next_half'],
 
128
                ['前四半期', 'category.prev_quarter'],
 
129
                ['次四半期', 'category.next_quarter'],
 
130
                ['先月', 'category.prev_month'],
 
131
                ['翌月', 'category.next_month'],
 
132
                ['今年', 'category.this_year'],
 
133
                ['現半期', 'category.this_half'],
 
134
                ['現四半期', 'category.this_quarter'],
 
135
                ['今月', 'category.this_month'],
 
136
                ['全日記', 'category.all_diary'],
 
137
                ['全カテゴリ', 'category.all_category'],
 
138
                ['全日記/全カテゴリ', 'category.all'],
138
139
        ].each do |button, name|
139
140
                r << <<HTML
140
141
<tr>
141
142
        <td>#{button}</td>
142
143
        <td><input type="text" name="#{name}" value="#{h @conf[name]}" size="30"></td>
143
 
        <td><p><span class="adminmenu"><a>#{@conf[name].sub(/\$1/, "2007").sub(/\$2/, "2")}</a></span></p></td>
 
144
        <td><p><span class="adminmenu"><a>#{h @conf[name].sub(/\$1/, "2007").sub(/\$2/, "2")}</a></span></p></td>
144
145
</tr>
145
146
HTML
146
147
        end
149
150
HTML
150
151
end
151
152
 
152
 
@category_icon_none_label = '��������ʤ�'
153
 
@category_icon_conf_label = '���ƥ��ꥢ������'
 
153
@category_icon_none_label = 'アイコンなし'
 
154
@category_icon_conf_label = 'カテゴリアイコン'
154
155
def category_icon_conf_html
155
156
        r = ''
156
157
        unless @conf.secure
157
158
                r << <<HTML
158
 
<h3 class="subtitle">���ƥ��ꥢ��������֤����</h3>
 
159
<h3 class="subtitle">カテゴリアイコンの置き場所</h3>
159
160
<p>
160
 
���ƥ��ꥢ�������Ѥβ�������¸����Ƥ���ǥ��쥯�ȥ�Ȥ���URL����ꤷ�ޤ���
 
161
カテゴリアイコン用の画像が保存されているディレクトリとそのURLを指定します。
161
162
</p>
162
163
<p>
163
164
<dl>
164
 
<dt>�ǥ��쥯�ȥ�:</dt>
 
165
<dt>ディレクトリ:</dt>
165
166
<dd><input name="category.icon_dir" value="#{h @category_icon_dir}" size="30"></dd>
166
167
<dt>URL:</dt>
167
168
<dd><input name="category.icon_url" value="#{h @category_icon_url}" size="30"></dd>
179
180
                str << %Q|</td>\n\t</tr>\n|
180
181
        end
181
182
        r << <<HTML
182
 
<h3 class="subtitle">���ƥ��ꥢ������</h3>
 
183
<h3 class="subtitle">カテゴリアイコン</h3>
183
184
<p>
184
 
�ƥ��ƥ���Υ��������ɥ��åץ�����ꥹ�Ȥ������򤷤ޤ���
 
185
各カテゴリのアイコンをドロップダウンリストから選択します。
185
186
<p>
186
187
<table>
187
 
        <tr><th>���ƥ���</th><th>��������</th></tr>
 
188
        <tr><th>カテゴリ</th><th>アイコン</th></tr>
188
189
#{str}
189
190
</table>
190
191
</p>
191
192
<hr>
192
 
<h3 class="subtitle">�������󥵥�ץ�</h3>
 
193
<h3 class="subtitle">アイコンサンプル</h3>
193
194
<p>
194
 
�����ǽ�ʥ�����������Ǥ���
195
 
��������˥ޥ�������������碌��ȥ�������Υե�����̾���ݥåץ��å�ɽ������ޤ���
 
195
選択可能なアイコン一覧です.
 
196
アイコンにマウスカーソルを合わせるとアイコンのファイル名がポップアップ表示されます。
196
197
</p>
197
198
<p>
198
199
#{category_icon_sample}
201
202
        r
202
203
end
203
204
 
 
205
# Local Variables:
 
206
# mode: ruby
 
207
# indent-tabs-mode: t
 
208
# tab-width: 3
 
209
# ruby-indent-level: 3
 
210
# End:
204
211
# vim: ts=3