Changes in bulletins widget and front-end, add categories to link
This commit is contained in:
parent
81bb3120ca
commit
7f9a7edc98
2
Gemfile
2
Gemfile
|
@ -20,7 +20,7 @@ gem 'rubyzip'
|
||||||
gem 'sinatra'
|
gem 'sinatra'
|
||||||
gem 'sprockets'
|
gem 'sprockets'
|
||||||
gem 'tinymce-rails'
|
gem 'tinymce-rails'
|
||||||
gem 'therubyracer'
|
# gem 'therubyracer'
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
# in production environments by default.
|
# in production environments by default.
|
||||||
|
|
|
@ -179,8 +179,6 @@ GEM
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
subexec (0.2.1)
|
subexec (0.2.1)
|
||||||
therubyracer (0.9.9)
|
|
||||||
libv8 (~> 3.3.10)
|
|
||||||
thor (0.14.6)
|
thor (0.14.6)
|
||||||
tilt (1.3.3)
|
tilt (1.3.3)
|
||||||
tinymce-rails (3.4.8)
|
tinymce-rails (3.4.8)
|
||||||
|
@ -236,7 +234,6 @@ DEPENDENCIES
|
||||||
sinatra
|
sinatra
|
||||||
spork
|
spork
|
||||||
sprockets
|
sprockets
|
||||||
therubyracer
|
|
||||||
tinymce-rails
|
tinymce-rails
|
||||||
uglifier
|
uglifier
|
||||||
watchr
|
watchr
|
||||||
|
|
|
@ -45,7 +45,11 @@ class PagesController < ApplicationController
|
||||||
|
|
||||||
def get_item
|
def get_item
|
||||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
|
if params[:category_id]
|
||||||
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
|
||||||
|
else
|
||||||
|
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
<td><%= post.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||||
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %>
|
<td><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
|
||||||
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= post.postdate %></td>
|
<td><%= post.postdate %></td>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<% @bulletins.each do |bulletin| %>
|
<% @bulletins.each do |bulletin| %>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin) %>
|
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id) %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<% @bulletins.each do |post| %>
|
<% @bulletins.each do |post| %>
|
||||||
<li>
|
<li>
|
||||||
<div class="news_img"><%= image_tag(post.image.url, :size => "290x130") if post.image.file %></div>
|
<div class="news_img"><%= image_tag(post.image.url, :size => "290x130") if post.image.file %></div>
|
||||||
<h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post) %></h3>
|
<h3 class="h3 news_title"><%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %></h3>
|
||||||
<p class="news_wrap"><%= post.subtitle[I18n.locale] %></p>
|
<p class="news_wrap"><%= post.subtitle[I18n.locale] %></p>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Reference in New Issue