forked from saurabh/orbit4-5
Announcement email and log user login/logout and update orbit initialize script and some fixes
This commit is contained in:
parent
e63a027c2a
commit
e5e7a18bd8
|
@ -0,0 +1,7 @@
|
||||||
|
class Admin::MemberSelectsController < OrbitAdminController
|
||||||
|
layout :false
|
||||||
|
|
||||||
|
def select_emails
|
||||||
|
@roles = Role.all
|
||||||
|
end
|
||||||
|
end
|
|
@ -35,7 +35,7 @@ class Admin::SitesController < OrbitAdminController
|
||||||
|
|
||||||
@mail_crons = Email.can_deliver.desc(:created_at)
|
@mail_crons = Email.can_deliver.desc(:created_at)
|
||||||
|
|
||||||
@mail_cron_logs = EmailLog.desc(:created_at).page(params[:page]).per(10)
|
@mail_cron_logs = EmailLog.desc(:created_at).page(params[:mail_log_page]).per(10)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
|
@ -43,6 +43,13 @@ class Admin::SitesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete_mail_log
|
||||||
|
if params[:ids]
|
||||||
|
EmailLog.any_in(:_id => params[:ids]).destroy
|
||||||
|
end
|
||||||
|
redirect_to :action => "system_info", :format => 'js'
|
||||||
|
end
|
||||||
|
|
||||||
def preference
|
def preference
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,21 @@ class ApplicationController < ActionController::Base
|
||||||
current_user.nil? and !current_site.frontend_open
|
current_user.nil? and !current_site.frontend_open
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def log_user_action
|
||||||
|
unless (request.filtered_parameters['action'].eql? "system_info") and (request.filtered_parameters['controller'].eql? "admin/sites")
|
||||||
|
log = UserAction.new
|
||||||
|
log.action = request.filtered_parameters['action']
|
||||||
|
log.controller = request.filtered_parameters['controller']
|
||||||
|
log.request_path = request.original_fullpath
|
||||||
|
log.request_method = request.request_method
|
||||||
|
log.remote_ip = request.remote_ip
|
||||||
|
log.referer = request.referer
|
||||||
|
log.save
|
||||||
|
|
||||||
|
current_user.user_actions << log
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
|
|
|
@ -50,21 +50,4 @@ class OrbitAdminController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def log_user_action
|
|
||||||
unless (request.filtered_parameters['action'].eql? "system_info") and (request.filtered_parameters['controller'].eql? "admin/sites")
|
|
||||||
log = UserAction.new
|
|
||||||
log.action = request.filtered_parameters['action']
|
|
||||||
log.controller = request.filtered_parameters['controller']
|
|
||||||
log.request_path = request.original_fullpath
|
|
||||||
log.request_method = request.request_method
|
|
||||||
log.remote_ip = request.remote_ip
|
|
||||||
log.referer = request.referer
|
|
||||||
log.save
|
|
||||||
|
|
||||||
current_user.user_actions << log
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,6 +24,7 @@ class SessionsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
log_user_action
|
||||||
session[:user_id] = nil
|
session[:user_id] = nil
|
||||||
redirect_to root_url, :notice => "Logged out!"
|
redirect_to root_url, :notice => "Logged out!"
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,12 +66,14 @@ module OrbitHelper
|
||||||
if p.categories == widget_categories
|
if p.categories == widget_categories
|
||||||
finalpage = p
|
finalpage = p
|
||||||
end
|
end
|
||||||
|
break if !finalpage.nil?
|
||||||
end
|
end
|
||||||
if finalpage.nil?
|
if finalpage.nil?
|
||||||
pages.each do |p|
|
pages.each do |p|
|
||||||
if self.array_include(p.categories, widget_categories)
|
if self.array_include(p.categories, widget_categories)
|
||||||
finalpage = p
|
finalpage = p
|
||||||
end
|
end
|
||||||
|
break if !finalpage.nil?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
finalpage = pages.first if finalpage.nil?
|
finalpage = pages.first if finalpage.nil?
|
||||||
|
|
|
@ -62,9 +62,6 @@ class OrbitMailer < ActionMailer::Base
|
||||||
|
|
||||||
mail_log.save
|
mail_log.save
|
||||||
|
|
||||||
email.is_sent = true
|
|
||||||
email.save
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -29,6 +29,8 @@ class Email
|
||||||
|
|
||||||
def self.deliver_all
|
def self.deliver_all
|
||||||
Email.can_deliver.each do |email|
|
Email.can_deliver.each do |email|
|
||||||
|
email.is_sent = true
|
||||||
|
email.save
|
||||||
OrbitMailer.set_mail(email).deliver
|
OrbitMailer.set_mail(email).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="item-menu">
|
<div class="item-menu">
|
||||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), pages_edit_view_path(:id => node.id.to_s), class: "view-page open-slide tip", title: "View", data: {title: node.name} if node.class.to_s.eql?('Page') %>
|
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), pages_edit_view_path(:id => node.id.to_s), class: "view-page open-slide tip", title: "View", data: {title: node.name} if node.class.to_s.eql?('Page') %>
|
||||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), edit_page_path(node.id), class: "open-slide tip page edit", title: "Edit Page", data: {title: "Edit Page"} if node.class.to_s.downcase.eql?("page") && !node.root? %>
|
|
||||||
<%# elsif node.class.to_s.downcase.eql?("link") %>
|
<%# elsif node.class.to_s.downcase.eql?("link") %>
|
||||||
<%#= link_to content_tag(:i, nil, class: "icon-edit"), "#link", class: "open-slide tip link edit", title: t('editing.link'), data: {title: t('editing.link'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations).merge(node.urls)} %>
|
<%#= link_to content_tag(:i, nil, class: "icon-edit"), "#link", class: "open-slide tip link edit", title: t('editing.link'), data: {title: t('editing.link'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations).merge(node.urls)} %>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<% unless name.eql? "sitemap" %>
|
<% unless name.eql? "sitemap" %>
|
||||||
|
<%= link_to content_tag(:i, nil, class: "icon-edit"), edit_page_path(node.id), class: "open-slide tip page edit", title: "Edit Page", data: {title: "Edit Page"} if node.class.to_s.downcase.eql?("page") && !node.root? %>
|
||||||
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), new_page_path(:parent_page => node.id.to_s), class: "open-slide tip page", title: "Add Page", data: {title: "Add Page", id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') && level < 3 %>
|
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), new_page_path(:parent_page => node.id.to_s), class: "open-slide tip page", title: "Add Page", data: {title: "Add Page", id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') && level < 3 %>
|
||||||
<%#= link_to content_tag(:i, nil, class: "icon-link"), "#link", class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') %>
|
<%#= link_to content_tag(:i, nil, class: "icon-link"), "#link", class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') %>
|
||||||
<%= link_to content_tag(:i, nil, class: "icon-trash"), page_path(node.id),:method => :delete,:remote => true, "data-confirm" => "Are you sure ?", class: "delete tip", title: "Delete", data: {title: "Delete"} unless node.root? %>
|
<%= link_to content_tag(:i, nil, class: "icon-trash"), page_path(node.id),:method => :delete,:remote => true, "data-confirm" => "Are you sure ?", class: "delete tip", title: "Delete", data: {title: "Delete"} unless node.root? %>
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
<% content_for :page_specific_javascript do -%>
|
||||||
|
<%= javascript_include_tag "lib/jquery.nanoscroller" %>
|
||||||
|
<% end -%>
|
||||||
|
<% content_for :page_specific_css do -%>
|
||||||
|
<%= stylesheet_link_tag "member_select" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div id="selected_email_users" class="selected_users">
|
||||||
|
<% email_members.each do |email_member| %>
|
||||||
|
<span class="alert alert-info selected_user" id="<%= email_member.id %>">
|
||||||
|
<span class='close remove_user' onclick='removeUser($(this))'>x</span>
|
||||||
|
<%= email_member.name %>
|
||||||
|
<%= hidden_field_tag field, email_member.id %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<a class="btn btn-primary btn-small select_user_modal"><%= t(:add) %></a>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var mail_users = Array();
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$.each($(".selected_user"),function(){
|
||||||
|
mail_users.push($(this).attr("id"));
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".select_user_modal").click(function(){
|
||||||
|
if($("#select_user").length==0) {
|
||||||
|
$("#main-wrap").after("<span id='select_user'></span>");
|
||||||
|
}
|
||||||
|
$.get("<%= admin_select_emails_path %>",function(modal){
|
||||||
|
$("#select_user").html(modal);
|
||||||
|
updateModal();
|
||||||
|
$("#member-filter").modal();
|
||||||
|
$('#member-filter').on('shown', function() {
|
||||||
|
$(".nano").nanoScroller();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var addByRole = function(role){
|
||||||
|
$.each($("#r_"+role+" .check-item"), function(){
|
||||||
|
mail_users.push($(this).find("input[type='checkbox']").val());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var removeUser = function(user){
|
||||||
|
mail_users = $.grep(mail_users, function(value) {return value != $(user).parent().attr('id');});
|
||||||
|
$(user).parent().remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
var updateUsers = function(){
|
||||||
|
$.each($(".role_field input:checked"), function(){
|
||||||
|
addByRole($(this).val());
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#selected_email_users").html("");
|
||||||
|
mail_users = $.unique(mail_users);
|
||||||
|
|
||||||
|
$.each(mail_users, function(i, user_id){
|
||||||
|
var username = $("input[value='"+user_id+"']").parent().find(".user-name").html();
|
||||||
|
$("#selected_email_users").append(
|
||||||
|
" <span class='alert alert-info selected_user' id='"+user_id+"'>"+
|
||||||
|
"<span class='close remove_user' onclick='removeUser($(this))'>x</span>"+
|
||||||
|
username+
|
||||||
|
"<input type='hidden' name='<%= field %>' value='"+user_id+"' >"+
|
||||||
|
"</span>"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var updateModal = function(){
|
||||||
|
$.each($("#selected_email_users .selected_user"),function(){
|
||||||
|
var user_id = $(this).attr('id');
|
||||||
|
$("input[value='"+user_id+"']").parent("li").hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.checkbox-card').click(function(){
|
||||||
|
var user_id = $(this).find("input[type='checkbox']").val();
|
||||||
|
$(this).children(".check-item").toggleClass("active");
|
||||||
|
if($(this).children(".check-item").hasClass("active")){
|
||||||
|
mail_users.push(user_id);
|
||||||
|
}else{
|
||||||
|
mail_users = $.grep(mail_users, function(value) {return value != user_id;});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,78 +0,0 @@
|
||||||
<div id="member-filter" class="modal hide fade">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
||||||
<h3><%= t('list.user') %></h3>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="tabbable tabs-left">
|
|
||||||
<div class="nano">
|
|
||||||
<div class="content">
|
|
||||||
<ul class="nav nav-pills nav-stacked">
|
|
||||||
<li class="active"><a href="#all" data-toggle="tab"><%= t('list.role') %></a></li>
|
|
||||||
<% @sorted_users.each_key do |role| %>
|
|
||||||
<li class=""><a href="#r_<%= role.id %>" data-toggle="tab"><%= role.title %></a></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tab-content">
|
|
||||||
<div class="tab-pane fade in active" id="all">
|
|
||||||
<%= form_tag role_form_url, remote: true do %>
|
|
||||||
<fieldset>
|
|
||||||
<% @sorted_users.each_key do |role| %>
|
|
||||||
<label class="checkbox inline">
|
|
||||||
<%= check_box_tag 'role_ids[]', role.id , false %> <%= role.title %>
|
|
||||||
</label>
|
|
||||||
<% end %>
|
|
||||||
</fieldset>
|
|
||||||
<div class="form-actions">
|
|
||||||
<button type="button" class="btn" data-dismiss="modal"><%= t(:cancel) %></button>
|
|
||||||
<%= submit_tag t(:submit), class: "btn btn-primary" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% @sorted_users.each do |role, users| %>
|
|
||||||
<div class="tab-pane fade" id="r_<%= role.id %>">
|
|
||||||
<%= form_tag user_form_url, remote: true do %>
|
|
||||||
<fieldset class="clearfix">
|
|
||||||
<div class="member-filter-result nano">
|
|
||||||
<div class="content">
|
|
||||||
<ul class="checkbox-card clearfix">
|
|
||||||
<% users.each do |user| %>
|
|
||||||
<li class="check-item">
|
|
||||||
<label>
|
|
||||||
<%= image_tag (user.member_profile.avatar.file ? user.member_profile.avatar : "menber-pic.png"), class: "user-pic" %>
|
|
||||||
<span class="user-name"><%= user.member_profile.name %></span>
|
|
||||||
</label>
|
|
||||||
<%= check_box_tag 'user_ids[]', user.id , false %>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-actions condition">
|
|
||||||
<button type="button" class="btn" data-dismiss="modal"><%= t(:cancel) %></button>
|
|
||||||
<%= submit_tag t(:submit), class: "btn btn-primary" %>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
$(".modal").on("hidden", function () {
|
|
||||||
$("#select_user").remove();
|
|
||||||
});
|
|
||||||
$('#member-filter').on('shown', function() {
|
|
||||||
$('#member-filter').off('shown')
|
|
||||||
$(this).find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
|
||||||
$(this).find('.checkbox-card').cardCheck();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<div id="member-filter" class="modal hide fade">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h3><%= t('list.user') %></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="tabbable tabs-left">
|
||||||
|
<div class="nano">
|
||||||
|
<div class="content">
|
||||||
|
<ul class="nav nav-pills nav-stacked">
|
||||||
|
<li class="active"><a href="#all" data-toggle="tab"><%= t('list.role') %></a></li>
|
||||||
|
<% @roles.each do |role| %>
|
||||||
|
<li class=""><a href="#r_<%= role.id %>" data-toggle="tab"><%= role.title %></a></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane fade in active" id="all">
|
||||||
|
<form>
|
||||||
|
<fieldset class="role_field">
|
||||||
|
<% @roles.each do |role| %>
|
||||||
|
<label class="checkbox inline">
|
||||||
|
<%= check_box_tag 'email_role_ids[]', role.id, false %> <%= role.title %>
|
||||||
|
</label>
|
||||||
|
<% end %>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% @roles.each do |role| %>
|
||||||
|
<div class="tab-pane fade" id="r_<%= role.id %>">
|
||||||
|
<form>
|
||||||
|
<fieldset class="clearfix">
|
||||||
|
<div class="member-filter-result nano">
|
||||||
|
<div class="content">
|
||||||
|
<ul class="checkbox-card clearfix">
|
||||||
|
<% role.member_profiles.each do |profile| %>
|
||||||
|
<% next if profile.email.nil? %>
|
||||||
|
<li class="check-item">
|
||||||
|
<label>
|
||||||
|
<%= image_tag (profile.avatar.file ? profile.avatar : "menber-pic.png"), class: "user-pic" %>
|
||||||
|
<span class="user-name"><%= profile.name %></span>
|
||||||
|
</label>
|
||||||
|
<%= check_box_tag 'email_user_ids[]', profile.id , false %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="form-actions condition">
|
||||||
|
<button type="button" class="btn" data-dismiss="modal"><%= t(:cancel) %></button>
|
||||||
|
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="updateUsers()"><%= t(:submit) %></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,9 +1,5 @@
|
||||||
|
|
||||||
<tr id="<%= dom_id mail_cron %>">
|
<tr id="<%= dom_id mail_cron %>">
|
||||||
<td>
|
<td>
|
||||||
<% if is_manager? %>
|
|
||||||
<%= check_box_tag 'to_delete[]', mail_cron.id, false, :class => "list-check" %>
|
|
||||||
<% end -%>
|
|
||||||
</td>
|
</td>
|
||||||
<td><%= format_value(mail_cron.mail_sentdate) %></td>
|
<td><%= format_value(mail_cron.mail_sentdate) %></td>
|
||||||
<td><%= mail_cron.mail_subject %></td>
|
<td><%= mail_cron.mail_subject %></td>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
|
||||||
<tr id="<%= dom_id mail_cron_log %>">
|
<tr id="<%= dom_id mail_cron_log %>">
|
||||||
<td>
|
<td>
|
||||||
<% if is_manager? %>
|
<% if is_manager? %>
|
||||||
<%= check_box_tag 'to_delete[]', mail_cron_log.id, false, :class => "list-check" %>
|
<%= check_box_tag 'to_delete[]', mail_cron_log.id, false, :class => "list-check" %>
|
||||||
<% end -%>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= format_value(mail_cron_log.created_at) %></td>
|
<td><%= format_value(mail_cron_log.created_at) %></td>
|
||||||
<td><%= mail_cron_log.mail_subject %></td>
|
<td><%= mail_cron_log.mail_subject rescue "" %></td>
|
||||||
<td><%= mail_cron_log.mail_user.user_name %> </td>
|
<td><%= mail_cron_log.mail_user.user_name rescue "" %> </td>
|
||||||
<td><%= mail_cron_log.module_app.key %> </td>
|
<td><%= mail_cron_log.module_app.key rescue "" %> </td>
|
||||||
</tr>
|
</tr>
|
|
@ -87,9 +87,9 @@
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane fade in active list-check" id="send-log">
|
<div class="tab-pane fade in active list-check" id="send-log">
|
||||||
<p class="">
|
<p class="">
|
||||||
<%#= link_to(content_tag(:i, nil, :class => "icons-trash"), '#', :class => "btn list-active-btn disabled", :rel => delete_admin_mail_cron_logs_path) if at_least_module_manager %>
|
<%= link_to(content_tag(:i, nil, :class => "icons-trash"), '#', :class => "btn list-active-btn disabled", :rel => admin_site_delete_mail_log_path) %>
|
||||||
</p>
|
</p>
|
||||||
<table id="mail_cron_logs" class="table main-list table-striped">
|
<table class="table main-list table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
@ -101,25 +101,21 @@
|
||||||
<th><%= t(:mail_from_app) %></th>
|
<th><%= t(:mail_from_app) %></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody id="mail_cron_logs">
|
||||||
<%= render :partial => "mail_cron_log", :collection=> @mail_cron_logs%>
|
<%= render :partial => "mail_cron_log", :collection=> @mail_cron_logs%>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="paginate text-center" style="display:none">
|
<div class="paginate text-center">
|
||||||
<%#= paginate @mail_cron_logs, :remote => true %>
|
<%= paginate @mail_cron_logs, :remote => true, :param_name => :mail_log_page %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade in list-check" id="waiting-sent">
|
<div class="tab-pane fade in list-check" id="waiting-sent">
|
||||||
<p class="">
|
|
||||||
<%#= link_to(content_tag(:i, nil, :class => "icons-trash"), '#', :class => "btn list-active-btn disabled", :rel => delete_admin_mail_crons_path) if at_least_module_manager %>
|
|
||||||
</p>
|
|
||||||
<table class="table main-list table-striped">
|
<table class="table main-list table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<input type="checkbox" name="to_delete[]" value="b" />
|
|
||||||
</th>
|
</th>
|
||||||
<th><%= t(:sent_date) %></th>
|
<th><%= t(:sent_date) %></th>
|
||||||
<th><%= t(:subject) %></th>
|
<th><%= t(:subject) %></th>
|
||||||
|
@ -151,34 +147,3 @@
|
||||||
<button class="delete-item btn btn-danger"><%= t(:delete_) %></button>
|
<button class="delete-item btn btn-danger"><%= t(:delete_) %></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
// function checkScroll() {
|
|
||||||
// if (nearBottomOfPage()) {
|
|
||||||
// if($(".next a").length != 0){
|
|
||||||
// $.rails.handleRemote($(".next a"));
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// setTimeout("checkScroll()", 250);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function nearBottomOfPage() {
|
|
||||||
// return scrollDistanceFromBottom() < 150;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function scrollDistanceFromBottom(argument) {
|
|
||||||
// return pageHeight() - (window.pageYOffset + self.innerHeight);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function pageHeight() {
|
|
||||||
// return Math.max(document.body.scrollHeight, document.body.offsetHeight);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $(document).ready(function(){
|
|
||||||
// checkScroll();
|
|
||||||
// });
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
$("#user_actions").html("<%= j(render :partial => 'user_action', :collection => @user_actions) %>");
|
$("#user_actions").html("<%= j(render :partial => 'user_action', :collection => @user_actions) %>");
|
||||||
$(".user-paginate").html("<%= j(paginate @user_actions, :remote => true) %>");
|
$(".user-paginate").html("<%= j(paginate @user_actions, :remote => true) %>");
|
||||||
|
|
||||||
// $("<%#= j(render :partial => 'mail_cron_log', :collection => @mail_cron_logs) %>").appendTo($("#mail_cron_logs"));
|
$("#mail_cron_logs").html("<%= j(render :partial => 'mail_cron_log', :collection => @mail_cron_logs) %>");
|
||||||
// $(".paginate").html("<%#= j(paginate @mail_cron_logs, :remote => true) %>");
|
$(".paginate").html("<%= j(paginate @mail_cron_logs, :remote => true, :param_name => :mail_log_page) %>");
|
||||||
|
|
||||||
checkScroll();
|
checkScroll();
|
||||||
$('.list-check').listCheck();
|
$('.list-check').listCheck();
|
|
@ -38,25 +38,40 @@ if Page.where(:module=>"sitemap").blank?
|
||||||
sitemap.save
|
sitemap.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Page.where(:page_id=>'termofuse').blank?
|
||||||
|
termofuse = Page.new
|
||||||
|
termofuse.module = "page_content"
|
||||||
|
termofuse.page_id = "termofuse"
|
||||||
|
termofuse.name_translations = {:en=>"Term of use",:zh_tw=>"使用規則"}
|
||||||
|
termofuse.enabled_for = ["en", "zh_tw"]
|
||||||
|
termofuse.menu_enabled_for = []
|
||||||
|
termofuse.url = "/termofuse"
|
||||||
|
termofuse.parent_page_id = Page.root.id
|
||||||
|
termofuse.save
|
||||||
|
|
||||||
|
page = PageContext.new
|
||||||
|
page.content_translations = {:en=>"", :zh_tw=>""}
|
||||||
|
page.version = 1
|
||||||
|
page.save
|
||||||
|
termofuse.page_contexts << page
|
||||||
|
|
||||||
|
site = Site.first
|
||||||
|
site.terms_of_use_link = "/termofuse"
|
||||||
|
site.save
|
||||||
|
end
|
||||||
|
|
||||||
if User.count==0
|
if User.count==0
|
||||||
group = Workgroup.new
|
group = Workgroup.new
|
||||||
group.title = "Administrator"
|
group.title = "Administrator"
|
||||||
group.key = 'admin'
|
group.key = 'admin'
|
||||||
group.save
|
group.save
|
||||||
|
|
||||||
role = Role.new
|
|
||||||
role.key = 'admin'
|
|
||||||
role.title_translations = {:en=>'Administrator', :zh_tw=>'Administrator'}
|
|
||||||
role.save
|
|
||||||
|
|
||||||
profile = MemberProfile.new
|
profile = MemberProfile.new
|
||||||
profile.first_name_translations = {:en=>'Digital', :zh_tw=>'Digital'}
|
profile.first_name_translations = {:en=>'Digital', :zh_tw=>'Digital'}
|
||||||
profile.last_name_translations = {:en=>'Ruling', :zh_tw=>'Ruling'}
|
profile.last_name_translations = {:en=>'Ruling', :zh_tw=>'Ruling'}
|
||||||
profile.email = "orbit@rulingcom.com"
|
profile.email = "orbit@rulingcom.com"
|
||||||
profile.save
|
profile.save
|
||||||
|
|
||||||
role.member_profiles << profile
|
|
||||||
|
|
||||||
user = User.new
|
user = User.new
|
||||||
user.workgroup = group
|
user.workgroup = group
|
||||||
user.member_profile = profile
|
user.member_profile = profile
|
||||||
|
|
|
@ -95,6 +95,8 @@ Orbit::Application.routes.draw do
|
||||||
post 'toggle'
|
post 'toggle'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get 'select_emails' => 'member_selects#select_emails', :as => "select_emails"
|
||||||
|
|
||||||
resources :module_apps do
|
resources :module_apps do
|
||||||
resources :categories do
|
resources :categories do
|
||||||
collection do
|
collection do
|
||||||
|
@ -163,6 +165,7 @@ Orbit::Application.routes.draw do
|
||||||
get 'check_updates'
|
get 'check_updates'
|
||||||
get 'update_orbit'
|
get 'update_orbit'
|
||||||
get 'restart_server'
|
get 'restart_server'
|
||||||
|
get 'delete_mail_log'
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :designs do
|
resources :designs do
|
||||||
|
|
Loading…
Reference in New Issue