Permalink
Browse files

new css

  • Loading branch information...
sitoto
sitoto committed Apr 19, 2012
1 parent cef9882 commit d1c5dca9af6bae01bd98a0ff5e95560d0e09ec77
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -288,12 +288,36 @@ body > header {
.index_bg {
background: url(/assets/index_center.jpg) left top repeat-y;
}
+.list_bg {
+margin: 0 auto;
+width: 894px;
+padding: 0 8px 50px 0;
+border-left: 4px solid #ECEFF1;
+border-right: 4px solid #ECEFF1;
+background: white;
+min-height: 450px;
+_height: auto;
+overflow: hidden;
+position: relative;
+//background: url(/assets/list_center.jpg) left top repeat-y;
+}
.title_r {
margin: 10px 3px 10px 8px;
border-bottom: 1px dashed #DDD;
font-size: 14px;
text-indent: 2px;
}
+table thead th {
+ font-size: 75%;
+background: #C3D9FF;
+font-weight: bold;
+}
+table tbody tr.even td {
+background: #E5ECF9;
+}
+table tbody tr.odd td {
+background: #FFFFFF;
+}
// Footer
body > footer {
@@ -442,17 +466,8 @@ ul.cai{
}
#top{
- height: 61px;
- overflow: hidden;
position: relative;
- background: url(/assets/l1.png) left top no-repeat;
- a.logo {
- width: 200px;
- height: 61px;
- position: absolute;
- left: 0;
- top: 0;
- }
+ background: url(/assets/lehazi.png) left top no-repeat;
}
#search{
margin-top: 0px;
@@ -9,6 +9,7 @@
width:330px;height:85px;position:absolute;left:0;top:0;
}
.right_info{
+ font-size: 75%;
float:right;padding:10px 0 0 0;color:#333;text-align:right;
li{
float:left;line-height:19px;*line-height:22px;_line-height:19px;display:block;padding:0 0 0 9px;position:relative;
@@ -119,7 +120,9 @@ position: relative;
#wrapper{min-width:910px;padding-top:10px;overflow:hidden;}
#container{margin:0 auto;width:910px;overflow:hidden;position:relative;}
#content,#content1{float:left;width:620px;overflow:hidden;}#content1{padding-left:5px;}
-#sidebar,#sidebar1{float:right;width:250px;padding:15px 20px 0 15px;overflow:hidden;}
+#sidebar,#sidebar1{float:right;width:250px;padding:15px 20px 0 15px;overflow:hidden;font-size:75%;
+ a { color: #266392; }
+}
#sidebar1{width:285px;padding:0;}
#sidebar h1{float:left;width:209px;height:25px;padding:8px 0 0 11px;margin:30px 0 20px 0;overflow:hidden;background-position:0 -440px;}#sidebar h1 b{float:left;width:70px;height:18px;overflow:hidden;}
#sidebar h1 b.microblog{background-position:0 -482px;}
@@ -3,9 +3,7 @@ class Admin::ReportsController < AdminController
# GET /reports.json
def index
@reports = Report.all
- @topic_num = Topic.count
- @page_num = PageUrl.count
- @pagenot_num = PageUrl.where("status != 1").count
+ @page_status = PageUrl.find_by_sql("SELECT `status`, count(`status`) as count FROM `page_urls` GROUP BY `status` ")
@nottopic = PageUrl.find_by_sql("SELECT count(id) as pagenum, topic_id FROM `page_urls` WHERE `status` != 1 GROUP BY topic_id limit 50")
respond_to do |format|
@@ -1,5 +1,6 @@
#encoding: utf-8
class PuController < ApplicationController
+
def index
if params[:p_id]
p_id = params[:p_id]
@@ -2,7 +2,35 @@
class PvController < ApplicationController
layout 'april'
def index
- 'try'
+ p_id = params[:p_id]
+ page_id = params[:page]
+ @topic = Topic.find(p_id)
+ @page_urls = PageUrl.select("id").where("topic_id = ? and status = 1 and count > 0 ", @topic.id)
+ #page_url_ids = []
+ page_url_ids = @page_urls.collect { |p| p.id }.join(',')
+
+
+ if @topic.section_id.eql?(1)
+ #@posts = TiebaPost.where("page_url_id in (#{page_url_ids.to_sentence(:two_words_connector => ',', :last_word_connector => ',')})").order("page_url_id").page(page_id)
+ @posts = TiebaPost.where("page_url_id in (#{page_url_ids})").order("page_url_id").page(page_id)
+ #@posts = TiebaPost.find_all_by_page_url_id(page_url_ids, :order => "page_url_id").page(page_id)
+ #@posts = PageUrl.find_by_topic_id(p_id).tieba_posts.page(page_id)
+ elsif @topic.section_id.eql?(2)
+ @posts = TianyaPost.where("page_url_id in (#{page_url_ids})").order("page_url_id").page(page_id)
+ elsif @topic.section_id.eql?(3)
+ @posts = DoubanPost.where("page_url_id in (#{page_url_ids})").order("page_url_id").page(page_id)
+ end
+
+ @temp_topics = Topic.where("section_id = ?", @topic.section_id).order("id DESC").limit(10)
+
+ #for seo
+ breadcrumb :list, "贴吧" if @topic.section_id == 1
+ breadcrumb :list, "天涯论坛" if @topic.section_id == 2
+ breadcrumb :list, "豆瓣小组" if @topic.section_id == 3
+
+ meta :title => @topic.title.strip ,
+ :description => "#{ @topic.title}_脱水版本,作者:#{ @topic.author},第#{params[:page]}页,摘要:#{@posts.first.content.strip.truncate(255)}" ,
+ :keywords => @topic.author
end
end
@@ -1,8 +1,12 @@
#encoding: utf-8
module ApplicationHelper
+ @@id = 1
+
def logo
image_tag 'l1.png',:alt=>"乐哈网,看楼主,脱水吧,脱水工具"
end
+
+
def message
gotonextpage = '无楼主贴! &nbsp;<span id="spnCount"></span>&nbsp;秒后 自动翻到下一页。 返回<a href="/p/' << params[:p_id] << '">目录页</a>。
<script type="text/javascript">
@@ -1,10 +1,11 @@
<%- title "最近更新的帖子列表." -%>
+<div class="list_bg">
-<section class="post-list">
<%- if @topics && @topics.length > 0 -%>
<%= render(:partial => "share/list", :object => @topics) %>
<%= paginate @topics, :outer_window => 4, :inner_window => 4 -%>
<%- else -%>
<p>没有内容。.</p>
<%- end -%>
-</section>
+
+</div>
@@ -1,35 +1,28 @@
<h2>
- 数据库情况
+ 采集页情况
</h2>
<p>
- 共计帖子数量:<%= @topic_num %><br/>
- 共计页数量:<%= @page_num %><br/>
- 未采集页数量:<%= @pagenot_num %><br/>
- 未采集比重:<%= 100 * @pagenot_num/@page_num %>%<br/>
-</p>
-<h2>
- 采集任务 <%= link_to '采集下列的页面', new_admin_report_path %>
-</h2>
-<p>
- <table>
- <tbody>
- <tr>
- <th>序号</th>
- <th>编号</th>
- <th>未采集页</th>
- </tr>
- <% @nottopic.each_with_index do |n, i| %>
+<table>
+ <tbody>
<tr>
- <td><%= i %></td>
- <td><%= n.topic_id %></td>
- <td><%= n.pagenum %> </td>
+ <th>状态</th>
+ <th>数量</th>
</tr>
+ <% if @page_status && @page_status.length > 0 %>
+ <% @page_status.each do |p| %>
+ <tr>
+ <td><%= p.status %></td>
+ <td><%= p.count %></td>
+ </tr>
+ <% end %>
<% end %>
- </tbody>
+ </tbody>
</table>
</p>
-
-
+<h2>
+ 采集任务
+</h2>
+<%= link_to '新建采集任务', new_admin_report_path %>
<table>
<tr>
<th>Name</th>
@@ -61,7 +54,24 @@
</tr>
<% end %>
</table>
+<%= link_to 'New Report', new_admin_report_path %>
<br />
-
-<%= link_to 'New Report', new_admin_report_path %>
+<p>
+ <table>
+ <tbody>
+ <tr>
+ <th>序号</th>
+ <th>编号</th>
+ <th>未采集页</th>
+ </tr>
+ <% @nottopic.each_with_index do |n, i| %>
+ <tr>
+ <td><%= i %></td>
+ <td><%= n.topic_id %></td>
+ <td><%= n.pagenum %> </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+</p>
@@ -1,10 +1,10 @@
<%- title "作者:#{params[:name]}文章列表." -%>
-<section class="post-list">
+<div class="list_bg">
<%- if @topics && @topics.length > 0 -%>
<%= render(:partial => "share/list", :object => @topics) %>
<%= paginate @topics, :outer_window => 4, :inner_window => 4 -%>
<%- else -%>
<p>没有内容。.</p>
<%- end -%>
-</section>
+</div>
@@ -1,10 +1,10 @@
<%- title "#{params[:name]}目录文章列表." -%>
-<section class="post-list">
+<div class="list_bg">
<%- if @topics && @topics.length > 0 -%>
<%= render(:partial => "share/list", :object => @topics) %>
<%= paginate @topics, :outer_window => 4, :inner_window => 4 -%>
<%- else -%>
<p>没有内容。.</p>
<%- end -%>
-</section>
+</div>
@@ -1,10 +1,10 @@
<%- title "豆瓣话题脱水帖子列表." -%>
-<section class="post-list">
+<div class="list_bg">
<%- if @topics && @topics.length > 0 -%>
<%= render(:partial => "share/list", :object => @topics) %>
<%= paginate @topics, :outer_window => 4, :inner_window => 4 -%>
<%- else -%>
<p>没有内容。.</p>
<%- end -%>
-</section>
+</div>
@@ -1,9 +1,9 @@
<%- title "回复最多帖子列表." -%>
-<section class="post-list">
+<div class="list_bg">
<%- if @topics && @topics.length > 0 -%>
<%= render(:partial => "share/list", :object => @topics) %>
<%- else -%>
<p>没有内容。.</p>
<%- end -%>
-</section>
+</div>
@@ -17,5 +17,37 @@
<% end -%>
<% end -%>
<%= next_page_tag -%>
+ <% @@id += 1
+ @@id = 1 if @@id > 100%>
+
+ 直接到<input type="text" maxlength="5" size="3" id="<%= "page#{@@id}" %>" />页
+ <input type="submit" onclick="<%= "page#{@@id}()" %>" value="Goto"/>
+ <script type="text/javascript">
+ function <%= "page#{@@id}()" %>
+ {
+ page = document.all('<%= "page#{@@id}" %>').value ;
+ total = <%= num_pages %> ;
+ if(isNaN(page))
+ {
+ alert('请输入一个数值!');
+ return;
+ }
+
+ else
+ {
+ page =parseInt(page);
+ if(page < 1 || page > total)
+ {
+ alert('请输入一个在 1 和 ' + total + '之间的值!');
+ return;
+ }
+ }
+ //document.location.href(page)
+ //var link = '#{@template.url_for(url_options("_page"))}'
+ var new_link = page; //link.replace("_page", page)
+ window.location.assign(new_link)
+ }
+ </script>
+
</nav>
<%- end -%>
Oops, something went wrong.

0 comments on commit d1c5dca

Please sign in to comment.