Skip to content

Commit

Permalink
show original. modify rss
Browse files Browse the repository at this point in the history
  • Loading branch information
ktat committed Aug 7, 2012
1 parent b7f7b13 commit 527f5bc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/PJP/Web/Dispatcher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ get '/func/*' => sub {
if ($version && $html) {
return $c->render(
'pod.tt' => {
has_original => ($html =~m{class="original"} ? 1 : 0),
body => mark_raw($html),
title => "$name 【perldoc.jp】",
'PodVersion' => "perl-$version",
Expand Down Expand Up @@ -264,6 +265,7 @@ get '/docs/{path:articles/.+\.html}' => sub {
return $c->render('pod.tt',
{
is_article => 1,
has_original => ($html =~ m{class="original"} ? 1 : 0),
body => mark_raw( $html ),
distvname => $pod->{distvname},
package => $pod->{package},
Expand Down Expand Up @@ -292,6 +294,7 @@ get '/docs/{path:(modules|perl|articles)/.+\.pod}' => sub {
return $c->render(
'pod.tt' => {
is_article => ($p->{path} =~m{articles} ? 1 : 0),
has_original => ($pod->{html} =~ m{class="original"} ? 1 : 0),
body => mark_raw( $pod->{html} ),
others => \@others,
distvname => $pod->{distvname},
Expand Down
2 changes: 1 addition & 1 deletion script/create_recent.pl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ sub create_rss {
$rss->add_item(
title => $module->{name},
link => "http://perldoc.jp/" . $module->{path},
description => "$module->{name}" . ($module->{version} ? "($module->{version})": '') . "が、$module->{author} により commit されました。",
description => ($module->{in} ? "$module->{in}の" : '') . "$module->{name}" . ($module->{version} ? "($module->{version})": '') . "が、$module->{author} により commit されました。",
pubDate => $datetime->strftime("%a, %d %b %Y %H:%M:%S +0900"),
);
}
Expand Down
2 changes: 2 additions & 0 deletions static/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ dd {
/* line 70, ../../scss/_class.scss */
.original {
display: none;
background-color:#eee;
padding: 5px;
}

/* line 74, ../../scss/_class.scss */
Expand Down
3 changes: 3 additions & 0 deletions tmpl/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

<link rel="shortcut icon" href="/favicon.ico" />
<script src="/static/prettify/prettify.js" type="text/javascript"></script>
[% IF use_jquery %]
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
[% END %]
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
<script type="text/javascript">
var _gaq = _gaq || [];
Expand Down
10 changes: 9 additions & 1 deletion tmpl/pod.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[% WRAPPER 'layout.html' %]
[% WRAPPER 'layout.html' WITH use_jquery = 1 %]

<div class="content">
<div class="PodPage">
Expand Down Expand Up @@ -32,6 +32,14 @@
[% IF repository=="module-pod-jp" %]
<div class="Edit"><a href="https://github.com/perldoc-jp/module-pod-jp/blob/master/docs/[% path %]">edit on github</a></div>
[% END %]
[% IF has_original %]
<script>
var display_original = false;
</script>
<div>
<a href="#" onclick="$('.original').css('display', display_original ? 'none' : 'block'); display_original = display_original ? false : true; return false;">原文を表示/隠す</a>
</div>
[% END %]
</div>

[% IF is_old %]
Expand Down

0 comments on commit 527f5bc

Please sign in to comment.