Plain view
This commit is contained in:
parent
005e228a0d
commit
a7dc293f93
24
II/Render.pm
24
II/Render.pm
@ -63,7 +63,7 @@ sub out {
|
||||
}
|
||||
|
||||
sub echo_mes {
|
||||
my ( $self, $echo ) = @_;
|
||||
my ( $self, $echo, $view ) = @_;
|
||||
my $db = $self->{_db};
|
||||
my $t = $self->{_template};
|
||||
|
||||
@ -71,17 +71,25 @@ sub echo_mes {
|
||||
|
||||
# Render header
|
||||
my $render = $t->head("ii :: $echo");
|
||||
$render .= "<a href=/new?echo=$echo>Новое сообщение</a>";
|
||||
$render .= $t->echo($echo);
|
||||
|
||||
my $count = 0;
|
||||
while ( $count < @post ) {
|
||||
if ($view eq 'thread') {
|
||||
while ( $count < @post ) {
|
||||
|
||||
# Render post
|
||||
if ( !( @post[$count]->{subg} =~ /Re.+/ ) ) {
|
||||
$render .= $t->tree( @post[$count] );
|
||||
# Render post
|
||||
if ( !( @post[$count]->{subg} =~ /Re.+/ ) ) {
|
||||
$render .= $t->tree( @post[$count] );
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
while ( $count < @post ) {
|
||||
$render .= $t->post( @post[$count] );
|
||||
$count++;
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
$render .= $t->foot();
|
||||
|
||||
|
10
II/T.pm
10
II/T.pm
@ -19,6 +19,16 @@ sub head {
|
||||
return $t->output;
|
||||
}
|
||||
|
||||
sub echo {
|
||||
my ($self, $echo) = @_;
|
||||
|
||||
my $e = HTML::Template->new(filename => 't/echo.html');
|
||||
|
||||
$e->param(ECHO => $echo);
|
||||
|
||||
return $e->output();
|
||||
}
|
||||
|
||||
sub index {
|
||||
my ( $self, $echoareas ) = @_;
|
||||
my $i = HTML::Template->new( filename => 't/index.html' );
|
||||
|
@ -8,7 +8,7 @@ Plack/Perl web client for ii network
|
||||
* SQL::Abstract;
|
||||
* DBD::SQlite;
|
||||
* Plack;
|
||||
* HTML::Tempplate;
|
||||
* HTML::Template;
|
||||
* LWP;
|
||||
|
||||
**Only GNU/Linux is supported**
|
||||
|
8
t/echo.html
Normal file
8
t/echo.html
Normal file
@ -0,0 +1,8 @@
|
||||
<div class=view_change>
|
||||
Вид: 
|
||||
<a href=/e?echo=<TMPL_VAR NAME=ECHO>&view=plain>[плоский]</a> 
|
||||
<a href=/e?echo=<TMPL_VAR NAME=ECHO>&view=thread>[по темам]</a> 
|
||||
<div class=new_mes>
|
||||
<a href=/new?echo=<TMPL_VAR NAME=ECHO>>[Новое сообщение]</a>
|
||||
</div>
|
||||
</div>
|
15
t/head.html
15
t/head.html
@ -98,6 +98,21 @@
|
||||
}
|
||||
.answer a:visited {
|
||||
color: #222;
|
||||
}
|
||||
.view_change {
|
||||
top: 0em;
|
||||
position: relative;
|
||||
margin-left: 15%;
|
||||
margin-right: 15%;
|
||||
}
|
||||
.view_change a {
|
||||
color: #222;
|
||||
}
|
||||
.view_change a:visited {
|
||||
color: #222;
|
||||
}
|
||||
.new_mes {
|
||||
position: relative;
|
||||
}
|
||||
</STYLE>
|
||||
<body>
|
||||
|
@ -1 +1 @@
|
||||
<a href=/e?echo=<TMPL_VAR NAME=ECHO>><TMPL_VAR NAME=ECHO></a><br>
|
||||
<a href=/e?echo=<TMPL_VAR NAME=ECHO>&view=thread><TMPL_VAR NAME=ECHO></a><br>
|
Loading…
Reference in New Issue
Block a user