archive and web_resouce for new ui

Conflicts:
	app/assets/stylesheets/lib/main-forms.css
This commit is contained in:
Spen authored and chris committed 2013-07-22 18:14:33 +08:00
1 parent 1ba1703e90
commit 5d3bc07488
30 files changed
+1531 -620

No files matched your search

+42 -21
View File
@@ -1,69 +1,90 @@
/* General style with default layout */
.o-links {}
.o-links-group {
.o-links .o-links-group {
margin: 20px 0 0 0;
padding: 20px 0 0 0;
border-top: dashed 1px #EEE;
}
.o-links-group:first-child {
.o-links .o-links-group:first-child {
margin: 0;
padding: 0;
border: 0;
}
.o-links-category {
.o-links .o-links-category {
padding-bottom: 16px;
border-bottom: solid 2px #CCC;
font-weight: bold;
font-size: 1.2em;
}
.o-links-content {}
.o-links-content > ul {
.o-links .o-links-content {}
.o-links .o-links-content > ul {
margin: 0;
padding: 0;
list-style: none;
}
.o-links-content > ul > li {}
.o-links-list {}
.o-links-list > ul {}
.o-links-list > ul > li {
.o-links .o-links-content > ul > li {
margin-bottom: 30px;
}
.o-links .o-links-list {}
.o-links .o-links-list > ul {}
.o-links .o-links-list > ul > li {
padding: 10px 0 0 0;
margin: 10px 0 0 0;
border-top: solid 1px #eee;
}
.o-links-list > ul > li:first-child {
.o-links .o-links-list > ul > li:first-child {
padding: 0;
margin: 0;
border: 0;
}
.o-links-title {}
.o-links-link {
.o-links .o-links-title {}
.o-links .o-links-link {
font-weight: bold;
}
.o-links-link:hover {}
.o-links-description {}
.o-links .o-links-link:hover {}
.o-links .o-links-description {
margin: 12px 0;
font-size: 0.85em;
line-height: 1.5em;
}
.o-links .o-links-hot {
background-color: #D83131;
border-radius: 3px;
color: #FFFFFF;
display: inline-block;
font-size: 11px;
font-weight: normal;
line-height: 20px;
margin: 0 0 0 8px;
padding: 0 4px;
vertical-align: top;
}
/* Tag list */
.o-links-tag-list {
.o-links .o-links-tag-list {
margin: 0 0 16px 0;
}
.o-links-tag-list ul {
.o-links .o-links-tag-list ul {
margin: 0 -4px;
padding: 0;
list-style: none;
}
.o-links-tag-list ul:after {
.o-links .o-links-tag-list ul:after {
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.o-links-tag-list li {
.o-links .o-links-tag-list li {
float: left;
margin: 0 4px 8px 4px;
}
.o-links-tag {
.o-links .o-links-tag {
display: block;
border: solid 1px #ccc;
padding: 2px 6px;
padding: 4px;
font-size: 0.85em;
}
.o-links-tag:hover {}
.o-links .o-links-tag:hover {}
@@ -1,50 +1,68 @@
class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
include OrbitControllerLib::DivisionForDisable
# include OrbitControllerLib::DivisionForDisable
# before_filter :for_app_manager,:except => [:index,:show]
before_filter :force_order_for_visitor,:only=>[:index]
before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,:except => [:index]
before_filter :only => [ :new,:edit,:update,:create] do |controller|
controller.get_categorys('WebLinkCategory')
# before_filter :only => [ :new,:edit,:update,:create] do |controller|
# controller.get_categorys('WebLinkCategory')
# end
before_filter :only => [ :new, :create, :edit, :update ] do |controller|
@categories = get_categories_for_form
end
def index
@tags = get_tags
@categories = get_categories_for_index
@statuses = get_statuses
category_ids = @categories.collect{|t| t.id}
get_categorys("WebLinkCategory",params[:web_link_category_id])
@filter = params[:filter]
new_filter = params[:new_filter]
if @filter && params[:clear]
@filter.delete(params[:type])
elsif @filter && new_filter
if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
@filter[new_filter[:type]].delete(new_filter[:id].to_s)
elsif @filter.has_key?(new_filter[:type])
@filter[new_filter[:type]] << new_filter[:id].to_s
else
@filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
end
elsif new_filter
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
end
@web_link_categories = get_categories_for_index("WebLinkCategory")
@web_link_category_ids = @web_link_categories.collect{|t| t.id.to_s} + [nil]
# @web_links = WebLink.search(params[:category_id])
#@web_links = (params[:sort] || @filter) ? get_sorted_and_filtered_web_links : WebLink.all.page(params[:page]).per(10)
@web_links = (params[:sort] || @filter) ? get_sorted_and_filtered("web_link",:web_link_category_id.in => @web_link_category_ids) : get_viewable("web_link",:web_link_category_id.in => @web_link_category_ids)
@tags = get_tags
@web_links = get_sorted_and_filtered("web_link", :category_id.in => category_ids)
respond_to do |format|
format.html # index.html.erb
format.js { }
format.xml { render :xml => @web_links }
format.js
end
end
# def index
# get_categorys("WebLinkCategory",params[:web_link_category_id])
# @filter = params[:filter]
# new_filter = params[:new_filter]
# if @filter && params[:clear]
# @filter.delete(params[:type])
# elsif @filter && new_filter
# if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s)
# @filter[new_filter[:type]].delete(new_filter[:id].to_s)
# elsif @filter.has_key?(new_filter[:type])
# @filter[new_filter[:type]] << new_filter[:id].to_s
# else
# @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]})
# end
# elsif new_filter
# @filter = {new_filter[:type] => [new_filter[:id].to_s]}
# end
# @web_link_categories = get_categories_for_index("WebLinkCategory")
# @web_link_category_ids = @web_link_categories.collect{|t| t.id.to_s} + [nil]
# # @web_links = WebLink.search(params[:category_id])
# #@web_links = (params[:sort] || @filter) ? get_sorted_and_filtered_web_links : WebLink.all.page(params[:page]).per(10)
# @web_links = (params[:sort] || @filter) ? get_sorted_and_filtered("web_link",:web_link_category_id.in => @web_link_category_ids) : get_viewable("web_link",:web_link_category_id.in => @web_link_category_ids)
# @tags = get_tags
# respond_to do |format|
# format.html # index.html.erb
# format.xml { render :xml => @web_links }
# format.js
# end
# end
# GET /web_links/1
# GET /web_links/1.xml
def show
@@ -58,7 +76,13 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
# GET /web_links/new
# GET /web_links/new.xml
def new
@web_link = WebLink.new
if(session[:in_validate_object].blank?)
@web_link = WebLink.new
else
@web_link = session[:in_validate_object]
session[:in_validate_object] = {}
end
@tags = get_tags
respond_to do |format|
@@ -70,7 +94,11 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
# GET /web_links/1/edit
def edit
@web_link = WebLink.find(params[:id])
@tags = get_tags
if !current_user.admin?
redirect_to :action => :index
else
@tags = get_tags
end
end
# POST /web_links
@@ -17,24 +17,45 @@ class Panel::WebResource::FrontEnd::WebLinksController < OrbitWidgetController
if @item.frontend_data_count
@page_num = @item.frontend_data_count
else
@page_num = 0
@page_num = 4
end
date_now = Time.now
@archive_file_categorys = WebLinkCategory.all
# @web_link_categorys = get_categories_for_index
if !params[:category_id].blank?
@web_links = WebLink.all.can_display.any_in(:web_link_category_id => params[:category_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
@web_link_categorys = WebLinkCategory.any_in(:_id => params[:category_id]).excludes('disable' => true)
elsif !params[:tag_id].blank?
@web_links = WebLink.all.can_display.any_in(:tagged_ids => params[:tag_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
get_categorys
@web_link_categorys = @module_app.categories.enabled.any_in(:_id => params[:category_id])
else
@web_links = WebLink.all.can_display.merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
@web_link_categorys = @module_app.categories.enabled
end
@web_link_datas = Array.new
@web_link_categorys.each do |wlcg|
if !params[:category_id].blank? && !params[:tag_id].blank?
@web_links = WebLink.all.can_display.where(:category_id.in => [wlcg.id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :created_at )
elsif !params[:category_id].blank?
@web_links = WebLink.all.can_display.where(:category_id.in => [wlcg.id]).desc( :is_top, :created_at )
elsif !params[:tag_id].blank?
@web_links = WebLink.all.can_display.where(:category_id => wlcg.id, :tagged_ids.in => params[:tag_id]).desc( :is_top, :created_at )
else
@web_links = WebLink.all.can_display.where(:category_id => wlcg.id).desc( :is_top, :created_at )
end
web_link_datas = Array.new
@web_links.each do |wl|
web_link_datas << {
"title" => wl.title,
"is_hot" => (!wl.is_hot.blank? ? '1' : ''),
"context" => wl.context,
"url" => wl.url
} if !wl.blank?
end
@web_link_datas << { "title" => wlcg.title, "web_links" => web_link_datas } if !@web_links.blank?
get_categorys
end
end
@@ -1,4 +1,5 @@
class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController
def initialize
super
@app_title = 'web_resource'
@@ -30,14 +31,38 @@ class Panel::WebResource::Widget::WebLinksController < OrbitWidgetController
date_now = Time.now
if !params[:category_id].blank?
@web_links = WebLink.all.can_display.any_in(:web_link_category_id => params[:category_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
@web_link_categorys = WebLinkCategory.any_in(:_id => params[:category_id]).excludes('disable' => true)
elsif !params[:tag_id].blank?
@web_links = WebLink.all.can_display.any_in(:tagged_ids => params[:tag_id]).merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
get_categorys
@web_link_categorys = @module_app.categories.enabled.any_in(:_id => params[:category_id])
else
@web_links = WebLink.all.can_display.merge(WebLinkCategory.excludes('disable' => true)).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
get_categorys
@web_link_categorys = @module_app.categories.enabled
end
@web_link_datas = Array.new
@web_link_categorys.each do |wlcg|
if !params[:category_id].blank? && !params[:tag_id].blank?
@web_links = WebLink.all.can_display.where(:category_id.in => [wlcg.id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
elsif !params[:category_id].blank?
@web_links = WebLink.all.can_display.where(:category_id.in => [wlcg.id]).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
elsif !params[:tag_id].blank?
@web_links = WebLink.all.can_display.where(:category_id => wlcg.id, :tagged_ids.in => params[:tag_id]).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
else
@web_links = WebLink.all.can_display.where(:category_id => wlcg.id).desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num)
end
web_link_datas = Array.new
@web_links.each do |wl|
web_link_datas << {
"title" => wl.title,
"is_hot" => (!wl.is_hot.blank? ? '1' : ''),
"context" => wl.context,
"url" => wl.url
} if !wl.blank?
end
@web_link_datas << { "title" => wlcg.title, "web_links" => web_link_datas } if !@web_links.blank?
end
end
@@ -1,12 +1,14 @@
# encoding: utf-8
class WebLink
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include Sunspot::Mongo
include OrbitCategory::Categorizable
include OrbitModel::LanguageRestrict
include OrbitModel::Status
include OrbitModel::TimeFrame
include OrbitTag::Taggable
field :title, localize: true
@@ -14,9 +16,9 @@ class WebLink
field :url, localize: true
field :create_user_id
field :update_user_id
field :update_user_id, :class_name => "User"
belongs_to :web_link_category
# belongs_to :web_link_category
before_save :clean_tags
@@ -1,112 +1,152 @@
<div id= "poststuff">
<% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<% end %>
<%= f.error_messages %>
<!--Widget start-->
<div id="sub-wiget">
<div id="widget-status" class="widget-box widget-size-300">
<div class="widget-action clear tip" title="Setting the announcement state">
<a class="action"><i class="icon-exclamation-sign icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icons-star"></i><%= t(:status) %></h3>
<div class="widget-content clear">
<div class="controls">
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= f.check_box :is_top %>
<%= t('top') %>
<% end -%>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= f.check_box :is_hot %>
<%= t('hot') %>
<% end -%>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= f.check_box :is_hidden %>
<%= t('hide') %>
<% end -%>
</div>
</div>
</div>
<!-- Input Area -->
<div class="input-area">
<div id="widget-tags" class="widget-box widget-size-300">
<div class="widget-action clear tip" title="Setting">
<a class="action"><i class="icon-cog icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag"></i><%= t('nccu.tags') %></h3>
<div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%>
<%= tag.name %>
<%= hidden_field_tag 'web_link[tag_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
</div>
<!--Wiget End-->
<!--Post Start-->
<!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<% if show_form_status_field(@web_link) %>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<% end %>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
<div id="post-body">
<div id="post-body-content" class="clear">
<%= f.label :category ,t(:category)%>
<%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.title, t.id ]} %>
<ul class="nav nav-tabs">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
<% end %>
</ul>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :name , t('nccu.link_name') %>
<%= f.fields_for :title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@web_link.title_translations[locale] rescue nil) %>
<% end %>
</div>
<!-- Module -->
<div class="tab-content module-area">
<div class="title">
<%= f.label :describe, t(:description) %>
<%= f.fields_for :context_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_area locale, :style=>"width:100%", :value => (@web_link.context_translations[locale] rescue nil) %>
<% end %>
</div>
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<div class="title">
<%= f.label :url , t(:url) %>
<%= f.fields_for :url_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@web_link.url_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- Category -->
<div class="control-group">
<label class="control-label muted"><%= t(:category) %></label>
<div class="controls">
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
</div>
</div>
<% end %>
</div>
</div>
<!--Post End-->
</div>
</div>
<div class="form-actions">
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</div>
<!-- Status Module -->
<% if show_form_status_field(@web_link) %>
<div class="tab-pane fade" id="status">
<!-- Status -->
<div class="control-group">
<label class="control-label muted"><%= t(:status) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn <%= 'active' if @web_link.is_top? %>">
<%= f.check_box :is_top %> <%= t(:top) %>
</label>
<label class="checkbox inline btn <%= 'active' if @web_link.is_hot? %>">
<%= f.check_box :is_hot %> <%= t(:hot) %>
</label>
<label class="checkbox inline btn <%= 'active' if @web_link.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @web_link.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'web_link[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t(:title) %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@web_link.title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- Context-->
<div class="control-group input-title">
<label class="control-label muted"><%= t(:description) %></label>
<div class="controls">
<%= f.fields_for :context_translations do |f| %>
<%= f.text_area locale, rows: 5, class: "input-block-level", value: (@web_link.context_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- Url-->
<div class="control-group input-title">
<label class="control-label muted"><%= t(:url) %></label>
<div class="controls">
<%= f.fields_for :url_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t(:url), value: (@web_link.url_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
@@ -1,5 +1,5 @@
<h1><%= t('web_link.editing_web_resource') %></h1>
<%= form_for @web_link, :url => panel_web_resource_back_end_web_link_path(@web_link), :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= form_for @web_link, url: panel_web_resource_back_end_web_link_path(@web_link), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>
@@ -1,22 +1,49 @@
<%= render 'filter' %>
<table class="table main-list">
<thead>
<tr>
<th class="span1"></th>
<th class="span1"></th>
<th class="span2"></th>
<th class="span3"></th>
<th class="span2"></th>
</tr>
</thead>
<tbody id="tbody_web_links" class="sort-holder">
<%= render :partial => 'web_link', :collection => @web_links %>
</tbody>
</table>
<% set_default_index do
objects @web_links
filterable
sortable
quick_edit_link type: 'edit',
link: 'edit_panel_web_resource_back_end_web_link_path'
quick_edit_link type: 'detail'
quick_edit_link type: 'delete',
link: 'panel_web_resource_back_end_web_link_path'
field type: 'status',
db_field: @statuses,
translation: 'status',
hide: 'phone',
sort: 'status',
header_class: 'span2'
field type: 'associated',
associated_value: 'title',
db_field: 'category',
translation: 'category',
hide: 'phone',
sort: 'category',
header_class: 'span2'
field type: 'field',
db_field: 'title',
translation: 'title',
sort: 'title',
link: 'panel_web_resource_front_end_web_link_path',
quick_edit: true,
header_class: 'span5'
field type: 'tags',
db_field: 'tags',
translation: 'tags',
hide: 'all',
sort: 'tags'
filter_field type: 'array',
values: @statuses,
translation: 'status'
filter_field type: 'objects',
values: @categories,
translation: 'category',
object_field: 'title'
filter_field type: 'objects',
values: @tags,
translation: 'tags',
object_field: 'name'
footer link: 'new_panel_web_resource_back_end_web_link_path'
end %>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_panel_web_resource_back_end_web_link_path, :class => 'btn btn-primary pull-right' if (is_manager? rescue nil) %>
<div id="web_link_pagination" class="paginationFixed">
<%= paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div>
</div>
<%= render 'admin/default_index/index' %>
@@ -1,10 +1,5 @@
<%= flash_messages %>
<div id="poststuff">
<h1><%= t('web_link.new_web_resource') %></h1>
<%= form_for @web_link, :url => panel_web_resource_back_end_web_links_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= form_for @web_link, url: panel_web_resource_back_end_web_links_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>
</div>
<%#= link_back %>
@@ -4,17 +4,18 @@
<div class="o-links-content">
<ul>
<% @web_link_categorys.each do |wlcg| %>
<% if wlcg.web_links.count > 0 %>
<% @web_link_datas.each do |wlcg| %>
<li>
<h3 class="o-links-category"><%= wlcg.title rescue nil%></h3>
<h3 class="o-links-category"><%= wlcg["title"] rescue nil%></h3>
<div class="o-links-list">
<ul>
<% wlcg.web_links.can_display.desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num).each do |post| %>
<% wlcg["web_links"].each do |post| %>
<li>
<%= link_to post.title, post.url, {:target => '_blank', :title => post.title, :class=>"o-links-title"} %>
<div class="o-links-description"><%= post.context %></div>
<%= link_to post["title"], post["url"], {:target => '_blank', :title => post["title"], :class=>"o-links-title"} %>
<% if !post["is_hot"].blank? %><span class="o-links-hot"><%= t('hot')%></span><% end %>
<div class="o-links-description"><%= post["context"] %></div>
</li>
<% end %>
@@ -23,12 +24,11 @@
</li>
<% end %>
<% end %>
</ul>
</div>
</div>
<%= paginate @web_links, :param_name => :page_main, :params => {:inner => false}%>
<%#= paginate @web_links, :param_name => :page_main, :params => {:inner => false}%>
<%= stylesheet_link_tag "web_resource/links" %>
@@ -2,17 +2,18 @@
<div class="o-links-content">
<ul>
<% @web_link_categorys.each do |wlcg| %>
<% if wlcg.web_links.count > 0 %>
<% @web_link_datas.each do |wlcg| %>
<li>
<h3 class="o-links-category"><%= wlcg.title rescue nil%></h3>
<h3 class="o-links-category"><%= wlcg["title"] rescue nil%></h3>
<div class="o-links-list">
<ul>
<% wlcg.web_links.can_display.desc( :is_top, :created_at ).page( params[:page_main] ).per(@page_num).each do |post| %>
<% wlcg["web_links"].each do |post| %>
<li>
<%= link_to post.title, post.url, {:target => '_blank', :title => post.title, :class=>"o-links-title"} %>
<div class="o-links-description"><%= post.context %></div>
<%= link_to post["title"], post["url"], {:target => '_blank', :title => post["title"], :class=>"o-links-title"} %>
<% if !post["is_hot"].blank? %><span class="o-links-hot"><%= t('hot')%></span><% end %>
<div class="o-links-description"><%= post["context"] %></div>
</li>
<% end %>
@@ -21,7 +22,6 @@
</li>
<% end %>
<% end %>
</ul>
</div>
+4 -12
View File
@@ -16,9 +16,8 @@ module WebResource
end
end
taggable
authorizable
categorizable
taggable
widgets do
@@ -38,7 +37,7 @@ module WebResource
side_bar do
head_label_i18n 'link',:icon_class=>"icons-link"
available_for [:admin,:guest,:manager,:sub_manager]
active_for_controllers ({:private=>['web_links', 'web_link_categorys']})
active_for_controllers ({:private=>['web_links', 'web_link_categorys','module_tags', 'categories']})
active_for_object_auth ['WebLinkCategory']
head_link_path "panel_web_resource_back_end_web_links_path"
@@ -54,11 +53,10 @@ module WebResource
:priority=>2,
:active_for_action=>{:web_links=>:new},
:available_for => [:sub_manager]
context_link 'categories',
:link_path=>"panel_web_resource_back_end_web_link_categorys_path" ,
:link_path=>"admin_module_app_categories_path(get_module_app)" ,
:priority=>3,
:active_for_action=>{:web_link_categorys=>:index},
:active_for_category => 'WebResource',
:available_for => [:manager]
context_link 'tags',
@@ -66,12 +64,6 @@ module WebResource
:priority=>4,
:active_for_tag => 'WebResource',
:available_for => [:manager]
context_link 'module_authorization',
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'WebResource'}))",
:priority=>6,
:active_for_app_auth => 'web_resource',
:available_for => [:admin]
end
end
end