forked from saurabh/orbit4-5
lot of fixes and experience enhancement
This commit is contained in:
parent
05852ed09f
commit
4415093ce2
|
@ -7,7 +7,7 @@ class Admin::AuthorizationsController < OrbitAdminController
|
||||||
if @module_apps && @module_apps.include?(@module_app)
|
if @module_apps && @module_apps.include?(@module_app)
|
||||||
reload_users
|
reload_users
|
||||||
if (@module_app.categorizable || @module_app.categories.present?)
|
if (@module_app.categorizable || @module_app.categories.present?)
|
||||||
@objects = @module_app.categories rescue nil
|
@objects = @module_app.categories.order_by(:disable.asc) rescue nil
|
||||||
end
|
end
|
||||||
elsif @module_apps && @module_app.key == "authorization"
|
elsif @module_apps && @module_app.key == "authorization"
|
||||||
redirect_to admin_authorizations_path(@module_apps.first.key)
|
redirect_to admin_authorizations_path(@module_apps.first.key)
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Admin::ImportController < OrbitAdminController
|
||||||
msg = "Failed to connect to RSS2 (#{uri.to_s})"
|
msg = "Failed to connect to RSS2 (#{uri.to_s})"
|
||||||
end
|
end
|
||||||
|
|
||||||
render :json=>{"status"=>msg}
|
render :json=>{"status"=>msg}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
def clean_old_data
|
def clean_old_data
|
||||||
|
|
|
@ -290,20 +290,13 @@ class PagesController < ApplicationController
|
||||||
partials = []
|
partials = []
|
||||||
subparts.each do |subpart|
|
subparts.each do |subpart|
|
||||||
if subpart.kind == "module_widget"
|
if subpart.kind == "module_widget"
|
||||||
subpart_categories = []
|
|
||||||
subpart.categories.each do |c|
|
|
||||||
category = Category.find(c) rescue nil
|
|
||||||
if !category.nil? && !category.disable
|
|
||||||
subpart_categories << c
|
|
||||||
end
|
|
||||||
end
|
|
||||||
subpart_categories = ["all"] if subpart_categories.blank?
|
|
||||||
OrbitHelper.set_current_widget subpart
|
OrbitHelper.set_current_widget subpart
|
||||||
OrbitHelper.set_widget_data_count subpart.data_count
|
OrbitHelper.set_widget_data_count subpart.data_count
|
||||||
OrbitHelper.set_widget_module_app subpart.module
|
OrbitHelper.set_widget_module_app subpart.module
|
||||||
OrbitHelper.set_widget_item_url subpart
|
OrbitHelper.set_widget_item_url subpart
|
||||||
OrbitHelper.set_widget_title subpart.title
|
OrbitHelper.set_widget_title subpart.title
|
||||||
OrbitHelper.set_widget_categories subpart_categories || ["all"]
|
OrbitHelper.set_widget_categories subpart.categories || ["all"]
|
||||||
OrbitHelper.set_widget_tags subpart.tags || []
|
OrbitHelper.set_widget_tags subpart.tags || []
|
||||||
custom_value = subpart.custom_string_field || subpart.custom_array_field rescue nil
|
custom_value = subpart.custom_string_field || subpart.custom_array_field rescue nil
|
||||||
if !custom_value.nil?
|
if !custom_value.nil?
|
||||||
|
|
|
@ -280,7 +280,14 @@ module OrbitHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.set_widget_categories(categories)
|
def self.set_widget_categories(categories)
|
||||||
@widget_categories = categories
|
@widget_categories = []
|
||||||
|
categories.each do |c|
|
||||||
|
category = Category.find(c) rescue nil
|
||||||
|
if !category.nil? && !category.disable
|
||||||
|
@widget_categories << c
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@widget_categories = ["all"] if @widget_categories.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.widget_categories
|
def self.widget_categories
|
||||||
|
|
|
@ -49,9 +49,17 @@
|
||||||
<h4 class="pull-left">Sub Managers</h4>
|
<h4 class="pull-left">Sub Managers</h4>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<label>Categories :
|
<label>Categories :
|
||||||
<%= select_tag "anything", options_from_collection_for_select(@objects, "id", "title"), :prompt => "Select Category" if !@objects.nil? %>
|
<%#= select_tag "anything", options_from_collection_for_select(@objects, "id", "title"), :prompt => "Select Category" if !@objects.nil? %>
|
||||||
|
<% if !@objects.nil? %>
|
||||||
|
<select id="anything" name="anything">
|
||||||
|
<option value="">Select Category</option>
|
||||||
|
<% @objects.each do |obj| %>
|
||||||
|
<option value="<%= obj.id %>" <%= obj.disable ? "class=alert-error" : "" %>><%= obj.title %></option>
|
||||||
|
<% end %>
|
||||||
|
</select>
|
||||||
|
<% end %>
|
||||||
</label>
|
</label>
|
||||||
<span id="disabled_message_span" class="alert alert-error pull-right hide">This category is disabled.</span>
|
<span id="disabled_message_span" class="alert alert-error pull-right hide"><%= t(:category_disabled) %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul id="card-list-submanagers" class="checkbox-card clearfix">
|
<ul id="card-list-submanagers" class="checkbox-card clearfix">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% @module_apps.each do |mod| %>
|
<% @module_apps.each do |mod| %>
|
||||||
<%
|
<%
|
||||||
@mod = mod
|
@mod = mod
|
||||||
categories = mod.categories
|
categories = mod.categories.order_by(:disable.asc)
|
||||||
%>
|
%>
|
||||||
<% icon_name = OrbitApp::Module::Registration.find_by_key(mod.key).get_icon_class rescue 'icons-daniel-bruce-2' %>
|
<% icon_name = OrbitApp::Module::Registration.find_by_key(mod.key).get_icon_class rescue 'icons-daniel-bruce-2' %>
|
||||||
<p class="tag-lead lead muted"><i class="<%= icon_name %>"></i> <%= mod.title %> <span class="badge pull-right"><%= categories.count %></span></p>
|
<p class="tag-lead lead muted"><i class="<%= icon_name %>"></i> <%= mod.title %> <span class="badge pull-right"><%= categories.count %></span></p>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="text-error text-center">Category once created, cannot be deleted.</div>
|
<div class="text-error text-center"><%= t(:category_notice) %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><%= t(:close) %></button>
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><%= t(:close) %></button>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="text-error text-center">Category once created, cannot be deleted.</div>
|
<div class="text-error text-center"><%= t(:category_notice) %></div>
|
||||||
<%= label_tag "disable" do %>
|
<%= label_tag "disable" do %>
|
||||||
<%= f.check_box :disable %>
|
<%= f.check_box :disable %>
|
||||||
<%= t(:disable) %>
|
<%= t(:disable) %>
|
||||||
|
|
|
@ -144,3 +144,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#open-orbit-login").on("change",function(){
|
||||||
|
if($(this).is(":checked")){
|
||||||
|
$("#user_user_id").focus();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
|
@ -26,6 +26,8 @@ en:
|
||||||
zh_tw_: Traditional Chinese
|
zh_tw_: Traditional Chinese
|
||||||
zh_cn: Simplified Chinese
|
zh_cn: Simplified Chinese
|
||||||
_locale: English
|
_locale: English
|
||||||
|
category_notice: "Category once created, cannot be deleted."
|
||||||
|
category_disabled: "This category is disabled."
|
||||||
access:
|
access:
|
||||||
denied:
|
denied:
|
||||||
ajax_401_error: "User session has been expired,please login again."
|
ajax_401_error: "User session has been expired,please login again."
|
||||||
|
|
|
@ -5,6 +5,9 @@ zh_tw:
|
||||||
zh_tw_: 繁體中文
|
zh_tw_: 繁體中文
|
||||||
zh_cn: 简体中文
|
zh_cn: 简体中文
|
||||||
en: 英文
|
en: 英文
|
||||||
|
category_notice: 類別一但被建立,就不能刪除喔!
|
||||||
|
category_disabled: 此類別已被關閉
|
||||||
|
|
||||||
access:
|
access:
|
||||||
denied:
|
denied:
|
||||||
ajax_401_error: 使用者已逾時或是登出,請重新登入
|
ajax_401_error: 使用者已逾時或是登出,請重新登入
|
||||||
|
|
Loading…
Reference in New Issue