Merge branch 'anc_approval_list' of https://github.com/Rulingcom/orbit into anc_approval_list
This commit is contained in:
commit
17635a2cf2
68 files changed
+1997
-1006
No files matched your search
+2
-2
@@ -27,8 +27,8 @@
|
||||
<%= content_tag :div do -%>
|
||||
<% form_tag panel_announcement_back_end_approval_setting_path do %>
|
||||
<%= render :partial => "privilege_user", :locals => {:users => @users_array} %>
|
||||
<div class="form-actions pagination-centered">
|
||||
<%= submit_tag "Update", :class => 'btn' %>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= submit_tag "Update", :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
<%# <br />顯示方式是設定在前台頁面時,資訊所呈現的樣式 %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="form-actions pagination-right">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
|
||||
+20
-2
@@ -1,12 +1,30 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span2"><%= t('bulletin_category.key') %></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table id="bulletin_categorys" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"><%= t('bulletin_category.key') %></th>
|
||||
<th class="span2"></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<th class="span2"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
+22
-18
@@ -4,24 +4,28 @@
|
||||
<%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
|
||||
<% end -%>
|
||||
<td>
|
||||
<% if bulletin.is_top? %>
|
||||
<span class="label label-success"><%= t(:top) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_hot? %>
|
||||
<span class="label label-important"><%= t(:hot) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_pending? %>
|
||||
<span class="label"><%= t(:pending) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_checked? %>
|
||||
<span class="label"><%= t(:passed) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_rejected? %>
|
||||
<span class="label"><%= t(:rejected) %></span>
|
||||
<% end %>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% if bulletin.is_top? %>
|
||||
<span class="label label-success"><%= t(:top) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_hot? %>
|
||||
<span class="label label-important"><%= t(:hot) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_pending? %>
|
||||
<span class="label"><%= t(:pending) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_checked? %>
|
||||
<span class="label"><%= t(:passed) %></span>
|
||||
<% end %>
|
||||
<% if bulletin.is_rejected? %>
|
||||
<span class="label"><%= t(:rejected) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= bulletin.bulletin_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(@bulletin_file, :remote => true, :url => @file_url) do |f| %>
|
||||
<%= form_for @bulletin_file, :url => @file_url, :html => {:id => 'ajaxForm', :multipart => true} do |f| %>
|
||||
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
@@ -38,9 +38,9 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'bulletin_file[bulletin_id]', @bulletin_file.bulletin_id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
<%= hidden_field_tag 'bulletin_file[bulletin_id]', @bulletin_file.bulletin_id %>
|
||||
<a class="btn btn-primary" id='ajax_form_submit'><%= t('submit')%></a>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
+2
-3
@@ -25,12 +25,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'bulletin_link[bulletin_id]', @bulletin_link.bulletin_id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a
|
||||
</div>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -293,7 +293,7 @@
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "bulletin_form" %>
|
||||
<%= javascript_include_tag "inc/jquery.imagesloaded" %>
|
||||
<%= javascript_include_tag "inc/jquery.imagesloaded.js" %>
|
||||
<script>
|
||||
$('#add_bulletin_link a.add').live('click', function(){
|
||||
var new_id = $(this).prev().attr('value');
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<%= f.file_field :file %>
|
||||
<%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:target => '_blank', :title => t(:view)} ) : '' %>
|
||||
<%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
+15
-14
@@ -1,18 +1,19 @@
|
||||
|
||||
<tr id="<%= dom_id list_bulletin_file %>">
|
||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.zh_tw, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.zh_tw} ) : list_bulletin_file.filetitle.zh_tw %></td>
|
||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.en, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.en} ) : list_bulletin_file.filetitle.en %></td>
|
||||
<td>
|
||||
<a href="<%= panel_announcement_back_end_bulletin_file_quick_edit_path(list_bulletin_file) %>#modal-file" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
||||
<span class="action">
|
||||
<%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a href class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil , :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="<%= dom_id list_bulletin_file %>">
|
||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.zh_tw, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.zh_tw} ) : list_bulletin_file.filetitle.zh_tw %></td>
|
||||
<td><%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.en, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.en} ) : list_bulletin_file.filetitle.en %></td>
|
||||
<td>
|
||||
<a href="<%= panel_announcement_back_end_bulletin_file_quick_edit_path(list_bulletin_file) %>#modal-file" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
||||
<span class="action">
|
||||
<%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%= hidden_field_tag :tr, (dom_id list_bulletin_file) %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :_destroy, :value => nil , :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
+15
-19
@@ -1,19 +1,15 @@
|
||||
|
||||
<tr id="<%= dom_id list_bulletin_link %>">
|
||||
<td><%= link_to list_bulletin_link.i18n_variable.zh_tw, list_bulletin_link.url, :target => '_blank' %></td>
|
||||
<td><%= link_to list_bulletin_link.i18n_variable.en, list_bulletin_link.url, :target => '_blank' %></td>
|
||||
<td>
|
||||
<a href="<%= panel_announcement_back_end_bulletin_link_quick_edit_path(list_bulletin_link) %>#modal-link" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
||||
<span class="action">
|
||||
<%= fields_for "bulletin[bulletin_links_attributes][]", list_bulletin_link, :index => list_bulletin_link_counter do |f| %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a href class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil , :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<tr id="<%= dom_id list_bulletin_link %>">
|
||||
<td><%= link_to list_bulletin_link.i18n_variable.zh_tw, list_bulletin_link.url, :target => '_blank' %></td>
|
||||
<td><%= link_to list_bulletin_link.i18n_variable.en, list_bulletin_link.url, :target => '_blank' %></td>
|
||||
<td>
|
||||
<a href="<%= panel_announcement_back_end_bulletin_link_quick_edit_path(list_bulletin_link) %>#modal-link" data-toggle="modal" data-remote="true" class="action"><i class="icon-pencil"></i></a>
|
||||
<span class="action">
|
||||
<%= fields_for "bulletin[bulletin_links_attributes][]", list_bulletin_link, :index => list_bulletin_link_counter do |f| %>
|
||||
<%= f.hidden_field :id %>
|
||||
<%= hidden_field_tag :tr, (dom_id list_bulletin_link) %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<div id="qe-file" class="qe-edit-div">
|
||||
<div id="widget-file">
|
||||
<div class="control-group">
|
||||
<table class="table table-condensed">
|
||||
<table id="bulletin_files" class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Chinese</th>
|
||||
|
||||
+18
-17
@@ -1,24 +1,25 @@
|
||||
<div id="qe-picture" class="qe-edit-div">
|
||||
<div id="widget-picture">
|
||||
<div id="widget-picture clear">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Picture</label>
|
||||
<!--<label class="control-label">Picture</label>-->
|
||||
<div class="control-group">
|
||||
<img class="pull-left upload-picture" src="" />
|
||||
<div class="controls file-upload">
|
||||
<label class="control-label btn" for="input-upload">
|
||||
Browse/選擇檔案
|
||||
<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
|
||||
</label>
|
||||
<span id='fu' class="file-name"></span>
|
||||
<br>
|
||||
<input name='fu' class="input-large" type="text">
|
||||
<br>
|
||||
<% if bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
<%= t('announcement.刪除已上傳檔案') %>
|
||||
<% end %>
|
||||
<div class="controls upload-picture">
|
||||
<img class="pull-left upload-picture" src="" />
|
||||
</div>
|
||||
<div class="controls file-upload input-prepend">
|
||||
<label class="control-label add-on btn" for="input-upload">
|
||||
<%= t(:browse) %>
|
||||
<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
|
||||
</label>
|
||||
<span id='fu' class="file-name"></span>
|
||||
<input name='fu' class="input-medium qe-picture-rename" type="text">
|
||||
<br>
|
||||
<% if bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
<%= t('announcement.刪除已上傳檔案') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+10
-40
@@ -1,44 +1,14 @@
|
||||
<!-- <div id="qe-tags">
|
||||
<div id="widget-tags">
|
||||
<div class="form-horizontal">
|
||||
<div class="control-group error">
|
||||
<label class="control-label" for="tags-zh-tw">
|
||||
Chinese
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input id='tags-zh-tw' class="input-prepend" type="text">
|
||||
<span class="help-inline">Please correct the error</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="tags-en">
|
||||
English
|
||||
</label>
|
||||
<div class="controls">
|
||||
<input id='tags-en' class="input-prepend" type="text">
|
||||
<span class="help-inline">Please correct the error</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<hr>
|
||||
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
|
||||
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
|
||||
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
|
||||
<span class="label label-tags">Default<a href><i class="icon-remove icon-white"></i></a></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div id="qe-tags" class="qe-edit-div">
|
||||
<div id="widget-tags">
|
||||
<div class="form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<div class="form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<div id="bulletin_pagination">
|
||||
<div id="bulletin_pagination" class="paginationFixed">
|
||||
<%= paginate @bulletins, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
|
||||
+28
-29
@@ -3,41 +3,40 @@
|
||||
<%= f.error_messages %>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<div class="title">
|
||||
<%= f.label :name %>
|
||||
<%= @page_context.page.i18n_variable[I18n.locale] %>
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
<%= f.label :name %>
|
||||
<%= @page_context.page.i18n_variable[I18n.locale] %>
|
||||
</div>
|
||||
|
||||
<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| %>
|
||||
<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">
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
|
||||
<div class="title">
|
||||
<%= f.label :context %>
|
||||
<%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea' %>
|
||||
<% end %>
|
||||
<div class="title">
|
||||
<%= f.label :context %>
|
||||
<%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
|
||||
<div id="poststuff">
|
||||
<h1><%= t('page_content.editing_page_content') %></h1>
|
||||
|
||||
<%= form_for @page_context, :url => panel_page_content_back_end_page_context_path(@page_context), :html => {:class => 'clear'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<%#= link_back %>
|
||||
+21
-4
@@ -1,13 +1,30 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span7"><%= t('page_context.name') %></th>
|
||||
<th class="span2"><%= t('page_context.version') %></th>
|
||||
<th class="span2"><%= t('page_context.update_time') %></th>
|
||||
<th class="span2"><%= t('page_context.last_modified') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span7 select"><%= t('page_context.name') %></th>
|
||||
<th class="span1-2"><%= t('page_context.version') %></th>
|
||||
<th class="span1-2"><%= t('page_context.update_time') %></th>
|
||||
<th class="span1-2"><%= t('page_context.last_modified') %></th>
|
||||
<th class="span7"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
+89
-1
@@ -7,14 +7,32 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
||||
|
||||
get_categorys(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_links = WebLink.search(params[:category_id])
|
||||
@web_links = WebLink.all.page(params[:page]).per(10)
|
||||
@web_links = (params[:sort] || @filter) ? get_sorted_and_filtered_web_links : WebLink.all.page(params[:page]).per(10)
|
||||
|
||||
get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render :xml => @web_links }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
@@ -115,5 +133,75 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
||||
module_app = ModuleApp.first(:conditions => {:key => 'web_resource'})
|
||||
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
|
||||
end
|
||||
|
||||
def get_sorted_and_filtered_web_links
|
||||
web_links = WebLink.all
|
||||
case params[:sort]
|
||||
when 'category'
|
||||
category_ids = web_links.distinct(:web_link_category_id)
|
||||
categories = WebLinkCategory.find(category_ids) rescue nil
|
||||
if categories
|
||||
h = Hash.new
|
||||
categories.each { |category| h[category.i18n_variable[I18n.locale]] = category.id }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
sorted_categorys = sorted.collect {|a| web_links.where(:web_link_category_id => a[1]).entries }
|
||||
web_links = sorted_categorys.flatten!
|
||||
end
|
||||
when 'name'
|
||||
h = Array.new
|
||||
web_links.each { |web_link| h << [web_link.name[I18n.locale].downcase, web_link] }
|
||||
sorted = params[:direction].eql?('asc') ? h.sort : h.sort.reverse!
|
||||
web_links = sorted.collect {|a| a[1] }
|
||||
when 'status'
|
||||
web_links = web_links.order_by(:is_top, params[:direction]).order_by(:is_hot, params[:direction]).order_by(:is_hidden, params[:direction]).order_by(:is_pending, params[:direction]).order_by(:is_checked, params[:direction]).order_by(:is_rejected, params[:direction])
|
||||
when 'tags'
|
||||
a = Array.new
|
||||
WebResourceTag.all.order_by(I18n.locale, params[:direction]).each { |tag| a << tag.web_links }
|
||||
a.flatten!
|
||||
a.uniq!
|
||||
tmp = Array.new
|
||||
web_links.where(:tag_ids => []).each { |web_link| tmp << [web_link.name[I18n.locale].downcase, web_link] }
|
||||
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
||||
sorted_names = sorted.collect {|a| a[1] }
|
||||
a = params[:direction].eql?('asc') ? (sorted_names + a) : (a + sorted_names)
|
||||
web_links = a.flatten
|
||||
end
|
||||
# if @filter
|
||||
# @filter.each do |key, value|
|
||||
# case key
|
||||
# when 'status'
|
||||
# a = Array.new
|
||||
# web_links.each do |web_link|
|
||||
# value.each do |v|
|
||||
# case v
|
||||
# when 'pending'
|
||||
# a << web_link if web_link.is_checked.nil?
|
||||
# when 'rejected'
|
||||
# a << web_link if web_link.is_checked.eql?(false)
|
||||
# else
|
||||
# a << web_link if web_link[v]
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# web_links = a.uniq
|
||||
# when 'categories'
|
||||
# a = Array.new
|
||||
# web_links.each do |web_link|
|
||||
# a << web_link if value.include?(web_link.web_link_category.id.to_s)
|
||||
# end
|
||||
# web_links = a.uniq
|
||||
# when 'tags'
|
||||
# a = Array.new
|
||||
# web_links.each do |web_link|
|
||||
# web_link.tags.each do |tag|
|
||||
# a << web_link if value.include?(tag.id.to_s)
|
||||
# end
|
||||
# end
|
||||
# web_links = a.uniq
|
||||
# end if value.size > 0
|
||||
# end
|
||||
# end
|
||||
Kaminari.paginate_array(web_links).page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -60,6 +60,10 @@ class WebLink
|
||||
|
||||
def text
|
||||
@text ||= I18nVariable.first(:conditions => {:key => 'text', :language_value_id => self.id, :language_value_type => self.class}) rescue nil
|
||||
end
|
||||
|
||||
def sorted_tags
|
||||
tags.order_by(I18n.locale, :asc)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
+19
-3
@@ -1,17 +1,33 @@
|
||||
|
||||
|
||||
<%= flash_messages %>
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"><%= t('web_link_category.key') %></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="web_link_categorys" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"><%= t('web_link_category.key') %></th>
|
||||
<th class="span1-2"></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<th class="span1-2"></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class="sort-holder">
|
||||
|
||||
<%= render :partial => 'web_link_category', :collection => @web_link_categorys %>
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<div id="filter" class="subnav">
|
||||
<div class="filters">
|
||||
<div id="sort_headers" class="table-label">
|
||||
<%= render 'sort_headers' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Vendored
+22
-13
@@ -13,9 +13,18 @@
|
||||
<h3 class="widget-title"><i class="icons-star-thin icons-white"></i>Status</h3>
|
||||
<div class="widget-content clear">
|
||||
<div class="controls">
|
||||
<%= f.check_box :is_top %><%= t('top') %>
|
||||
<%= f.check_box :is_hot %><%= t('hot') %>
|
||||
<%= f.check_box :is_hidden %><%= t('hide') %>
|
||||
<%= 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>
|
||||
@@ -27,8 +36,10 @@
|
||||
<h3 class="widget-title"><i class="icons-tag icons-white"></i>Tags</h3>
|
||||
<div class="widget-content clear form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<%= content_tag :label,:class => "checkbox inline" do -%>
|
||||
<%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,12 +97,10 @@
|
||||
</div>
|
||||
|
||||
<!--Post End-->
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr class="sort-header">
|
||||
<th class="sort span1 <%= is_sort_active?('status') %>">
|
||||
<%= link_to (t('web_link.status') + content_tag(:b, nil, :class => is_sort?('status'))).html_safe, panel_web_resource_back_end_web_links_path({:filter => @filter}.merge(sortable('status'))), :class => 'js_history' %>
|
||||
</th>
|
||||
<th class="sort span1 <%= is_sort_active?('category') %>">
|
||||
<%= link_to (t('web_link.category') + content_tag(:b, nil, :class => is_sort?('category'))).html_safe, panel_web_resource_back_end_web_links_path({:filter => @filter}.merge(sortable('category'))), :class => 'js_history' %>
|
||||
</th>
|
||||
<th class="sort span3 <%= is_sort_active?('name') %>">
|
||||
<%= link_to (t('web_link.name') + content_tag(:b, nil, :class => is_sort?('name'))).html_safe, panel_web_resource_back_end_web_links_path({:filter => @filter}.merge(sortable('name'))), :class => 'js_history' %>
|
||||
</th>
|
||||
<th class="sort span2 <%= is_sort_active?('tags') %>">
|
||||
<%= link_to (t('web_link.tags') + content_tag(:b, nil, :class => is_sort?('tags'))).html_safe, panel_web_resource_back_end_web_links_path({:filter => @filter}.merge(sortable('tags'))), :class => 'js_history' %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<tr id="<%= dom_id web_link %>" class="with_action">
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% if web_link.is_top? %>
|
||||
<span class="label label-success"><%= t(:top) %></span>
|
||||
<% end %>
|
||||
<% if web_link.is_hot? %>
|
||||
<span class="label label-important"><%= t(:hot) %></span>
|
||||
<% end %>
|
||||
<% if web_link.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= web_link.web_link_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('web_link.edit'), edit_panel_web_resource_back_end_web_link_path(web_link) %></li>
|
||||
<li><%= link_to t('web_link.delete'), panel_web_resource_back_end_web_link_path(web_link), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% web_link.sorted_tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
|
||||
<tr id="<%= dom_id post %>" class="with_action">
|
||||
<td>
|
||||
<% if post.is_top? %>
|
||||
<span class="label label-success"><%= t(:top) %></span>
|
||||
<% end %>
|
||||
<% if post.is_hot? %>
|
||||
<span class="label label-important"><%= t(:hot) %></span>
|
||||
<% end %>
|
||||
<% if post.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('web_link.edit'), edit_panel_web_resource_back_end_web_link_path(post) %></li>
|
||||
<li><%= link_to t('web_link.delete'), panel_web_resource_back_end_web_link_path(post), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= post.web_link_category.i18n_variable[I18n.locale] %></td>
|
||||
<td>
|
||||
<%= link_to post.name[I18n.locale], panel_web_resource_back_end_web_link_path(post) %>
|
||||
</td>
|
||||
<td>
|
||||
<% post.tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Vendored
+13
-15
@@ -1,23 +1,21 @@
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<%= render 'filter' %>
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"><%= t('web_link.status') %></th>
|
||||
<th class="span1-2"><%= t('web_link.category') %></th>
|
||||
<th class="span1-2"><%= t('web_link.name') %></th>
|
||||
<th class="span1-2"><%= t('web_link.tags') %></th>
|
||||
<th class="span1"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span3"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<% @web_links.each do |post| %>
|
||||
<%= render :partial => 'web_links', :locals => {:post => post} %>
|
||||
<% end %>
|
||||
|
||||
<tbody id="tbody_web_links" class="sort-holder">
|
||||
<%= render :partial => 'web_link', :collection => @web_links %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @web_links %>
|
||||
|
||||
<div id="web_link_pagination" class="paginationFixed">
|
||||
<%= paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
</div>
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||
$("#tbody_web_links").html("<%= j render :partial => 'web_link', :collection => @web_links %>");
|
||||
$("#web_link_pagination").html("<%= j paginate @web_links, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
||||
Vendored
+2
-1
@@ -1,9 +1,10 @@
|
||||
|
||||
<%= 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} %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<%#= link_back %>
|
||||
|
||||
Reference in new issue
Block a user