Modify layout

This commit is contained in:
Bernie Chiu 2013-11-20 15:16:48 +08:00
parent 3445cb8e69
commit 9933db4fb5
4 changed files with 26 additions and 26 deletions

View File

@ -1,22 +1,22 @@
<br/>
<h2><%= t('feed.channel') %></h2>
<legend><h3 style="margin-left: 10px;"><%= t('feed.channel') %></h3></legend>
<fieldset style="margin-left: -50px;">
<div class="control-group">
<label class="control-label" for=""><%= t('feed.enter')+" RSS "+t('feed.name')%></label>
<label class="control-label" for="inputName"><%= t('feed.enter') + " RSS " + t('feed.name')%>:</label>
<div class="controls">
<%= f.text_field :name, :class=>'span4', :placeholder => 'RSS '+t('feed.name')%>
<%= f.text_field :name, :class => 'span4', :placeholder => 'RSS ' + t('feed.name'), :id => "inputName" %>
</div>
</div>
<div class="control-group">
<label class="control-label" for=""><%= t('feed.enter')+" RSS URL" %></label>
<label class="control-label" for="inputURL"><%= t('feed.enter') + " RSS URL" %>:</label>
<div class="controls">
<%= f.text_field :link, :class=>'span4', :placeholder => 'RSS URL'%>
<%= f.text_field :link, :class => 'span4', :placeholder => 'RSS URL', :id => "inputURL"%>
</div>
</div>
<div class="control-group">
<div class="controls">
<%= f.submit t("submit"), :class=>"btn" %>
<%= f.submit t("submit"), :class => "btn btn-primary" %>
</div>
</div>
</fieldset>

View File

@ -1,7 +1,6 @@
<br/>
<h3><%= t('feed.channel') %></h3>
<table class="table main-list">
<thead>
<tr><th><h3><%= t('feed.channel') %></h3></th></tr>
<tr>
<th class="span4"><%= t('RSS') %></th>
<%if is_manager? %>
@ -16,12 +15,13 @@
<td><%= feed.name %></td>
<%if is_manager? %>
<td><%= link_to t('feed.edit'), edit_panel_feed_back_end_feed_path(feed) %></td>
<td><%= link_to t('feed.cancel'), panel_feed_back_end_feed_path(feed), method: :delete , :confirm => t(:sure?) %></td>
<td><%= link_to t('feed.cancel'), panel_feed_back_end_feed_path(feed), method: :delete, confirm: t(:sure?) %></td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<%if is_manager? %>
<br />
<%= link_to t('feed.new'), new_panel_feed_back_end_feed_path, :class => "btn btn-primary pull-right", :id => "create_event_btn", :ref => "add-btn" %>
<% end %>

View File

@ -3,10 +3,10 @@ require 'rss'
require 'mongo'
#base on your DB
# Change this according to local DB
DB_BASE_NAME = "production_0"
#create a hash rss site list from mongodb
# Create a hash rss site list from mongodb
db = Mongo::Connection.new("localhost", 27017).db("#{DB_BASE_NAME}")
SITES = Hash[ db["announcement_feeds"].find().entries.collect {|f| [ f["name"], f["link"] ]} ]
@ -18,7 +18,7 @@ recent_feed = {}
SITES.each do |name, url|
open("http://#{url}/panel/announcement/front_end/bulletins.rss?inner=true") do |rss|
# Giving false parameter is for skipping irregular format of the RSS
# Giving 'false' parameter is for skipping irregular format of the RSS
feed = RSS::Parser.parse(rss, false)
feed.items.each do |item|