add some changes
This commit is contained in:
parent
46e17ebef4
commit
9aa88aa080
|
@ -2,7 +2,22 @@ $:.push File.expand_path("../lib", __FILE__)
|
||||||
|
|
||||||
# Maintain your gem's version:
|
# Maintain your gem's version:
|
||||||
require "active/version"
|
require "active/version"
|
||||||
|
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
||||||
|
if bundle_update_flag
|
||||||
|
app_path = File.expand_path(__dir__)
|
||||||
|
template_path = ENV['PWD'] + '/app/templates'
|
||||||
|
all_template = Dir.glob(template_path+'/*/')
|
||||||
|
puts 'copying module'
|
||||||
|
all_template.each do |folder|
|
||||||
|
if folder.split('/')[-1] != 'mobile'
|
||||||
|
begin
|
||||||
|
system ('cp -r '+ app_path + '/modules/ ' + folder)
|
||||||
|
rescue
|
||||||
|
puts 'error copy'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
# Describe your gem and declare its dependencies:
|
# Describe your gem and declare its dependencies:
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "active"
|
s.name = "active"
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
// Place all the styles related to the act controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
|
.active-index2 li.col-md-4{
|
||||||
|
float: left;
|
||||||
|
.active-meta{
|
||||||
|
padding-left: 1em;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
}
|
||||||
|
.active-img-wrap {
|
||||||
|
overflow: hidden;
|
||||||
|
height: 12.5em;
|
||||||
|
img {
|
||||||
|
max-height: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a:hover .active-title{
|
||||||
|
color: #0032b2;
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
@media (min-width: 992px){
|
||||||
|
width: 33.3333%;
|
||||||
|
}
|
||||||
|
@media (min-width: 577px) and (max-width: 991px){
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
@media (max-width: 576px){
|
||||||
|
width: 100%;
|
||||||
|
.active-img-wrap {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,41 +3,58 @@ class ActivesController < ApplicationController
|
||||||
helper MemberHelper
|
helper MemberHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
begin
|
||||||
time_now = Time.now
|
time_now = Time.now
|
||||||
|
OrbitHelper.render_css_in_head(["active_front"])
|
||||||
actives = Act.filter_by_categories.desc(:sign_start_date).page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
actives = Act.filter_by_categories.desc(:sign_start_date).page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count)
|
||||||
|
|
||||||
acts = actives.collect do |a|
|
acts = actives.collect do |a|
|
||||||
|
link_to_show = OrbitHelper.url_to_show(a.to_param) + '?method=show_data'
|
||||||
title = ('<a href="'+ OrbitHelper.url_to_show(a.to_param) + '?method=show_data" target="_blank">' + a.title + '</a>').html_safe
|
title_text = a.title
|
||||||
|
title = "<a href=\"#{link_to_show}\" target=\"_blank\">#{title_text}</a>"
|
||||||
if (!a.sign_up.blank? and a.sign_start_date <= time_now and ( a.sign_end_date >= time_now or a.sign_end_date.nil? ) rescue false)
|
sign_up = a.signup_show
|
||||||
sign_up = ('<a href="'+ OrbitHelper.url_to_show(a.to_param) + '" target="_blank">' + t('act.sign_up') + '</a>').html_safe
|
statuses = a.statuses_with_classname.collect do |status|
|
||||||
elsif a.sign_up.blank?
|
{
|
||||||
sign_up = t('act.sign_up_not_open')
|
"status" => status["name"],
|
||||||
elsif (a.sign_start_date > time_now rescue false)
|
"status-class" => "status-#{status['classname']}"
|
||||||
sign_up = t('act.sign_up_not_yet')
|
}
|
||||||
else
|
|
||||||
sign_up = t('act.sign_up_overdue')
|
|
||||||
end
|
end
|
||||||
|
act_start_date = (a.act_start_date.blank? ? "" : a.act_start_date.strftime('%Y-%m-%d %H:%M') rescue "")
|
||||||
|
act_end_date = (a.act_end_date.blank? ? t(:no_deadline) : a.act_end_date.strftime('%Y-%m-%d %H:%M') rescue "")
|
||||||
|
act_duration_date = act_start_date.blank? ? act_end_date : "#{act_start_date} ~ #{act_end_date}"
|
||||||
|
|
||||||
|
sign_start_date = (a.sign_start_date.blank? ? "" : a.sign_start_date.strftime('%Y-%m-%d %H:%M') rescue "")
|
||||||
|
sign_end_date = ((a.sign_end_date ? a.sign_end_date.strftime('%Y-%m-%d %H:%M') : t(:no_deadline)) rescue "")
|
||||||
|
sign_duration_date = sign_start_date.blank? ? sign_end_date : "#{sign_start_date} ~ #{sign_end_date}"
|
||||||
|
|
||||||
|
desc = a.image_description
|
||||||
|
desc = (desc.blank? ? "active image" : desc)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"link_to_show" => link_to_show,
|
||||||
|
"title_text" => title_text,
|
||||||
|
"statuses" => statuses,
|
||||||
"title" => title,
|
"title" => title,
|
||||||
|
"subtitle" => a.subtitle,
|
||||||
|
"img_src" => a.image.thumb.url || "/assets/announcement-default.jpg",
|
||||||
|
"img_description" => desc,
|
||||||
"category" => a.category.title,
|
"category" => a.category.title,
|
||||||
"sign_start_date" => (a.sign_start_date.strftime('%Y-%m-%d %H:%M') rescue ""),
|
"sign_duration_date" => sign_duration_date,
|
||||||
"sign_end_date" => ((a.sign_end_date ? a.sign_end_date.strftime('%Y-%m-%d %H:%M') : t(:no_deadline)) rescue ""),
|
"sign_start_date" => sign_start_date,
|
||||||
"act_start_date" => (a.act_start_date.strftime('%Y-%m-%d %H:%M') rescue ""),
|
"sign_end_date" => sign_end_date,
|
||||||
"act_end_date" => (a.act_end_date ? a.act_end_date.strftime('%Y-%m-%d %H:%M') : t(:no_deadline) rescue ""),
|
"act_duration_date" => act_duration_date,
|
||||||
'sign_up_time_range' => (Act.time_range(a.sign_start_date, a.sign_end_date) rescue ""),
|
"act_start_date" => act_start_date,
|
||||||
|
"act_end_date" => act_end_date,
|
||||||
'sign_up_time_range' => (Act.time_range(a.sign_start_date, a.sign_end_date) rescue ""),
|
'sign_up_time_range' => (Act.time_range(a.sign_start_date, a.sign_end_date) rescue ""),
|
||||||
'act_time_range' => (Act.time_range(a.act_start_date, a.act_end_date) rescue ""),
|
'act_time_range' => (Act.time_range(a.act_start_date, a.act_end_date) rescue ""),
|
||||||
'sign_up' => sign_up
|
'sign_up' => sign_up
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
_display = acts.count == 0 ? "hide" : ''
|
||||||
{
|
{
|
||||||
"acts" => acts,
|
"acts" => acts,
|
||||||
"extras" => {
|
"extras" => {
|
||||||
|
"display" => _display,
|
||||||
"widget-title"=>t('act.active'),
|
"widget-title"=>t('act.active'),
|
||||||
"th_title" => t('act.title'),
|
"th_title" => t('act.title'),
|
||||||
"th_act_time_range" => t('act.act_time_range'),
|
"th_act_time_range" => t('act.act_time_range'),
|
||||||
|
@ -47,7 +64,9 @@ class ActivesController < ApplicationController
|
||||||
},
|
},
|
||||||
"total_pages" => actives.total_pages
|
"total_pages" => actives.total_pages
|
||||||
}
|
}
|
||||||
|
rescue => e
|
||||||
|
puts [e,e.backtrace]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_privacy
|
def show_privacy
|
||||||
|
@ -73,19 +92,9 @@ class ActivesController < ApplicationController
|
||||||
|
|
||||||
act = Act.find_by(uid: params[:uid])
|
act = Act.find_by(uid: params[:uid])
|
||||||
|
|
||||||
if (!act.sign_up.blank? and act.sign_start_date <= time_now and ( act.sign_end_date >= time_now or act.sign_end_date.nil? ) rescue false)
|
|
||||||
sign_up = ('<a href="'+ OrbitHelper.url_to_show(act.to_param) + '" target="_blank">' + t('act.sign_up') + '</a>').html_safe
|
|
||||||
elsif act.sign_up.blank?
|
|
||||||
sign_up = t('act.sign_up_not_open')
|
|
||||||
elsif (act.sign_start_date > time_now rescue false)
|
|
||||||
sign_up = t('act.sign_up_not_yet')
|
|
||||||
else
|
|
||||||
sign_up = t('act.sign_up_overdue')
|
|
||||||
end
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'act' => act,
|
'act' => act,
|
||||||
'sign_up' => sign_up,
|
'sign_up' => act.signup_show,
|
||||||
'time_now' => time_now,
|
'time_now' => time_now,
|
||||||
'sign_up_time_range' => (Act.time_range(act.sign_start_date, act.sign_end_date) rescue ""),
|
'sign_up_time_range' => (Act.time_range(act.sign_start_date, act.sign_end_date) rescue ""),
|
||||||
'act_time_range' => (Act.time_range(act.act_start_date, act.act_end_date) rescue "")
|
'act_time_range' => (Act.time_range(act.act_start_date, act.act_end_date) rescue "")
|
||||||
|
@ -102,7 +111,7 @@ class ActivesController < ApplicationController
|
||||||
|
|
||||||
act = Act.find_by(uid: params[:uid])
|
act = Act.find_by(uid: params[:uid])
|
||||||
|
|
||||||
act_signup = ActSignup.new
|
act_signup = ActSignup.new(id: nil)
|
||||||
|
|
||||||
time_now = Time.now
|
time_now = Time.now
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Admin::ActivesController < OrbitAdminController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@tags = @module_app.tags
|
@tags = @module_app.tags
|
||||||
@act = Act.new
|
@act = Act.new(id: nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -8,11 +8,22 @@ class Act
|
||||||
include OrbitCategory::Categorizable
|
include OrbitCategory::Categorizable
|
||||||
include Slug
|
include Slug
|
||||||
|
|
||||||
|
include OrbitModel::Status
|
||||||
|
field :image_description, type: String, localize: true
|
||||||
|
field :top_end_date, :type => DateTime
|
||||||
|
mount_uploader :image, ImageUploader
|
||||||
|
field :is_external_link, type: Boolean, default: false
|
||||||
|
field :external_link, type: String, default: ""
|
||||||
|
|
||||||
field :title, as: :slug_title, type: String, localize: true
|
field :title, as: :slug_title, type: String, localize: true
|
||||||
|
field :subtitle, type: String, localize: true
|
||||||
|
|
||||||
field :content, localize: true
|
field :content, localize: true
|
||||||
field :place, localize: true
|
field :place, localize: true
|
||||||
field :create_user_id
|
field :create_user_id
|
||||||
field :update_user_id
|
field :update_user_id
|
||||||
|
field :postdate , :type => DateTime, :default => Time.now
|
||||||
|
field :end_date , :type => DateTime, :default => Time.now
|
||||||
field :act_start_date , :type => DateTime, :default => Time.now
|
field :act_start_date , :type => DateTime, :default => Time.now
|
||||||
field :act_end_date , :type => DateTime, :default => Time.now
|
field :act_end_date , :type => DateTime, :default => Time.now
|
||||||
field :sign_start_date , :type => DateTime, :default => Time.now
|
field :sign_start_date , :type => DateTime, :default => Time.now
|
||||||
|
@ -94,4 +105,49 @@ class Act
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.remove_expired_status
|
||||||
|
self.where(:is_top => true, :top_end_date.ne => nil, :top_end_date.lt => Time.now).each do |act|
|
||||||
|
act.is_top = false
|
||||||
|
act.top_end_date = nil
|
||||||
|
act.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def top_text
|
||||||
|
I18n.t("top")
|
||||||
|
end
|
||||||
|
def hot_text
|
||||||
|
I18n.t("hot")
|
||||||
|
end
|
||||||
|
def hidden_text
|
||||||
|
I18n.t("hidden")
|
||||||
|
end
|
||||||
|
|
||||||
|
def statuses_with_classname
|
||||||
|
statuses = []
|
||||||
|
statuses << {"name" => top_text, "classname" => "top"} if is_top?
|
||||||
|
statuses << {"name" => hot_text, "classname" => "hot"} if is_hot?
|
||||||
|
statuses << {"name" => hidden_text, "classname" => "hidden"} if is_hidden?
|
||||||
|
statuses
|
||||||
|
end
|
||||||
|
|
||||||
|
def can_sign_up?
|
||||||
|
(self.sign_up && (self.sign_start_date.blank? || self.sign_start_date <= time_now) && ( self.sign_end_date.blank? || self.sign_end_date >= time_now )) rescue false
|
||||||
|
end
|
||||||
|
|
||||||
|
def is_external_link?
|
||||||
|
self.is_external_link && !self.external_link.blank?
|
||||||
|
end
|
||||||
|
def signup_show
|
||||||
|
if self.can_sign_up?
|
||||||
|
sign_up = ('<a href="'+ (self.is_external_link? ? self.external_link : OrbitHelper.url_to_show(self.to_param)) + '" target="_blank">' + I18n.t('act.sign_up') + '</a>').html_safe
|
||||||
|
elsif self.sign_up
|
||||||
|
sign_up = I18n.t('act.sign_up_not_open')
|
||||||
|
elsif (self.sign_start_date > time_now rescue false)
|
||||||
|
sign_up = I18n.t('act.sign_up_not_yet')
|
||||||
|
else
|
||||||
|
sign_up = I18n.t('act.sign_up_overdue')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,70 +8,68 @@
|
||||||
@act_time_range = data["act_time_range"]
|
@act_time_range = data["act_time_range"]
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
<h1 class="active-show-title title"><%= @act.title %></h1>
|
||||||
<table class="table table-striped active-show-table">
|
<table class="table table-striped active-show-table">
|
||||||
<tbody >
|
<tbody >
|
||||||
<tr>
|
<tr class="active-show-category">
|
||||||
<th class="active-title-field"><%= t(:category) %></th>
|
<th class="active-title-field"><%= t(:category) %></th>
|
||||||
<td class="active-title-value"><%= @act.category.title %></td>
|
<td class="active-title-value"><%= @act.category.title %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="active-show-act-time">
|
||||||
<th class="active-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('act.act_time_range') %></th>
|
<th class="active-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('act.act_time_range') %></th>
|
||||||
<td class="active-title-value"><%= @act_time_range %></td>
|
<td class="active-title-value"><%= @act_time_range %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr class="active-show-place">
|
||||||
<th class="active-title-field"><%= t('act.title') %></th>
|
<th class="active-title-field"><%= t('act.place') %></th>
|
||||||
<td class="active-title-value"><%= @act.title %></td>
|
<td class="active-title-value"><%= @act.place %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% if !@act.content.blank? %>
|
<% if !@act.sign_start_date.blank? || !@act.sign_end_date.blank? %>
|
||||||
<tr>
|
<tr class="active-show-sign_up_time_range">
|
||||||
<th class="active-title-field"><%= t('act.content') %></th>
|
|
||||||
<td class="active-title-value"><%= nl2br(@act.content) %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<tr>
|
|
||||||
<th class="active-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('act.sign_up_time_range') %></th>
|
<th class="active-title-field"><i class="fa fa-calendar fa-fw"></i><%= t('act.sign_up_time_range') %></th>
|
||||||
<td class="active-title-value"><%= @sign_up_time_range %></td>
|
<td class="active-title-value"><%= @sign_up_time_range %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% if !@act.place.blank? %>
|
|
||||||
<tr>
|
|
||||||
<th class="active-title-field"><i class="icon-flag"></i><%= t('act.place') %></th>
|
|
||||||
<td class="active-title-value"><%= @act.place %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if !@act.act_files.blank? %>
|
<% if @act.sign_up %>
|
||||||
<tr>
|
<tr class="active-show-sign_up">
|
||||||
<th class="active-title-field"><i class="fa fa-fw fa-paperclip"></i><%= t(:file_) %></th>
|
|
||||||
<td class="active-title-value">
|
|
||||||
<% @act.act_files.map do |file| %>
|
|
||||||
<%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% if !@act.act_links.blank? %>
|
|
||||||
<tr>
|
|
||||||
<th class="active-title-field"><i class="fa fa-fw fa-link"></i><%= t(:link) %></th>
|
|
||||||
<td class="active-title-value">
|
|
||||||
<% @act.act_links.map do |link| %>
|
|
||||||
<%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<% if !@act.note.blank? %>
|
|
||||||
<tr>
|
|
||||||
<th class="active-title-field"><%= t('act.note') %></th>
|
|
||||||
<td class="active-title-value"><%= @act.note %></td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
<tr>
|
|
||||||
<th class="active-title-field"><%= t('act.sign_up') %></th>
|
<th class="active-title-field"><%= t('act.sign_up') %></th>
|
||||||
<td class="active-title-value"><%= @sign_up %></td>
|
<td class="active-title-value">
|
||||||
|
<%= @sign_up %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="active-show-content">
|
||||||
<br />
|
<%= nl2br(@act.content.to_s).html_safe %>
|
||||||
|
</div>
|
||||||
<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>
|
<ul class="s-annc__related-wrap list-unstyled no-print">
|
||||||
|
<% if !@act.act_files.blank? %>
|
||||||
|
<li class="s-annc__related-file">
|
||||||
|
<i class="fa fa-fw fa-paperclip"></i>
|
||||||
|
<span class="s-annc__related-file-list">
|
||||||
|
<% @act.act_files.map do |file| %>
|
||||||
|
<a class="s-annc__flie-title btn btn-default btn-sm" href="<%= file.file.url %>">
|
||||||
|
<%= file.title.blank? ? File.basename(file.file.path) : file.title %>
|
||||||
|
</a>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% if !@act.act_links.blank? %>
|
||||||
|
<li class="s-annc__related-link">
|
||||||
|
<i class="fa fa-fw fa-link"></i>
|
||||||
|
<span class="s-annc__related-link-list">
|
||||||
|
<% @act.act_links.map do |link| %>
|
||||||
|
<a class="s-annc__link-title btn btn-default btn-sm"
|
||||||
|
href="<%= link.url.blank? ? "#" : link.url %>" target="_blank">
|
||||||
|
<%= link.title.blank? ? link.url : link.title %>
|
||||||
|
</a>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% if !@act.note.blank? %>
|
||||||
|
<p class="active-show-note"><%= @act.note %></p>
|
||||||
|
<% end %>
|
||||||
|
<%# link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %>
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
<ul class="nav nav-pills module-nav">
|
<ul class="nav nav-pills module-nav">
|
||||||
<li class="active"><a href="#basic" data-toggle="tab"><%= t(:basic) %></a></li>
|
<li class="active"><a href="#basic" data-toggle="tab"><%= t(:basic) %></a></li>
|
||||||
<li><a href="#settings" data-toggle="tab"><%= t("act.settings") %></a></li>
|
<li><a href="#settings" data-toggle="tab"><%= t("act.settings") %></a></li>
|
||||||
|
<li><a href="#status" data-toggle="tab"><%= t(:status) %></a></li>
|
||||||
|
<li><a href="#tag" data-toggle="tab"><%= t(:tags) %></a></li>
|
||||||
|
<li><a href="#imageupload" data-toggle="tab"><%= t('act.image') %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Module -->
|
<!-- Module -->
|
||||||
|
@ -36,6 +39,22 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- postdate Time Picker -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted"><%= t('act.postdate') %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.datetime_picker :postdate, :no_label => true, :new_record => @act.new_record? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end_date Time Picker -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted"><%= t('act.end_date') %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.datetime_picker :end_date, :no_label => true, :new_record => @act.new_record? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Act Date Time Picker -->
|
<!-- Act Date Time Picker -->
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t('act.act_start_date') %></label>
|
<label class="control-label muted"><%= t('act.act_start_date') %></label>
|
||||||
|
@ -74,6 +93,22 @@
|
||||||
<label class="radio inline"><%= f.radio_button :sign_up, "no", checked: @act.sign_up == false ? true : false %><%= t(:no_) %></label>
|
<label class="radio inline"><%= f.radio_button :sign_up, "no", checked: @act.sign_up == false ? true : false %><%= t(:no_) %></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" style="display: none;" id="external_link_check_box">
|
||||||
|
<%= f.label :is_external_link, t("act.is_external_link"), :class => "control-label muted" %>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.check_box :is_external_link %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group" style="display: none;" id="external_link_box">
|
||||||
|
<%= f.label :external_link, t("act.external_link"), :class => "control-label muted" %>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.text_field :external_link %>
|
||||||
|
<div class="hint"><%= t("act.external_link_hint") %></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="settings">
|
<div class="tab-pane fade" id="settings">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
|
@ -82,7 +117,7 @@
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label for="act_enabled_name" class="checkbox inline">
|
<label for="act_enabled_name" class="checkbox inline">
|
||||||
<%= f.check_box :enabled_name, :class => "enabler" %>
|
<%= f.check_box :enabled_name, :class => "enabler" %>
|
||||||
Enable
|
<%= t(:enable)%>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls required">
|
<div class="controls required">
|
||||||
|
@ -318,6 +353,84 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Status Module -->
|
||||||
|
|
||||||
|
<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 @act.is_top? || (!@act.top_end_date.nil? && @act.top_end_date > Time.now) %>">
|
||||||
|
<%= f.check_box :is_top %> <%= t(:top) %>
|
||||||
|
</label>
|
||||||
|
<label class="checkbox inline btn <%= 'active' if @act.is_hot? %>">
|
||||||
|
<%= f.check_box :is_hot %> <%= t(:hot) %>
|
||||||
|
</label>
|
||||||
|
<label class="checkbox inline btn <%= 'active' if @act.is_hidden? %>">
|
||||||
|
<%= f.check_box :is_hidden %> <%= t(:hide) %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="control-group <%= @act.is_top? || (!@act.top_end_date.nil? && @act.top_end_date > Time.now) ? "" : "hide" %>" data-for="is_top">
|
||||||
|
<label for="" class="control-label muted"><%= t('act.top_end_date') %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.datetime_picker :top_end_date, :no_label => true, :new_record => @act.new_record? %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tag Module -->
|
||||||
|
<div class="tab-pane fade" id="tag">
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted"><%= t(:tags) %></label>
|
||||||
|
<%= select_tags(f, @module_app) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Images Module -->
|
||||||
|
<div class="tab-pane fade" id="imageupload">
|
||||||
|
|
||||||
|
<!-- Images Upload -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted"><%= t(:image) %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if @act.image.file %>" data-provides="fileupload">
|
||||||
|
<div class="fileupload-new thumbnail pull-left">
|
||||||
|
<% if @act.image.file %>
|
||||||
|
<%= image_tag @act.image %>
|
||||||
|
<% else %>
|
||||||
|
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
|
||||||
|
<span class="btn btn-file">
|
||||||
|
<span class="fileupload-new"><%= t(:select_image) %></span>
|
||||||
|
<span class="fileupload-exists"><%= t(:change) %></span>
|
||||||
|
<%= f.file_field :image %>
|
||||||
|
</span>
|
||||||
|
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
|
||||||
|
<div class="controls" data-toggle="buttons-checkbox">
|
||||||
|
<label class="checkbox inline btn btn-danger fileupload-remove">
|
||||||
|
<%= f.check_box :remove_image %><%= t(:remove) %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% @site_in_use_locales.each do |locale| %>
|
||||||
|
<%= f.fields_for :image_description_translations do |f| %>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted" for="image_description_<%= locale.to_s %>"><%= t(:description) + " (#{t(locale.to_s)})" %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.text_field locale, value: (@act.image_description_translations[locale.to_s] rescue nil) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Language Tabs -->
|
<!-- Language Tabs -->
|
||||||
|
@ -342,7 +455,17 @@
|
||||||
<label class="control-label muted"><%= t(:title) %></label>
|
<label class="control-label muted"><%= t(:title) %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :title_translations do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@act.title_translations[locale] rescue nil) %>
|
<%= f.text_area locale, class: "ckeditor_reduce input-block-level", placeholder: t(:title), value: (@act.title_translations[locale] rescue nil) %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Subtitle-->
|
||||||
|
<div class="control-group input-title">
|
||||||
|
<label class="control-label muted"><%= t(:subtitle) %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.fields_for :subtitle_translations do |f| %>
|
||||||
|
<%= f.text_area locale, class: "ckeditor input-block-level", placeholder: t(:subtitle), value: (@act.subtitle_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -457,6 +580,16 @@
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
$("#act_is_top").parent().on("click",function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
if($("#act_is_top").parent().hasClass("active")){
|
||||||
|
$("div[data-for=is_top]").removeClass("hide");
|
||||||
|
}else{
|
||||||
|
$("div[data-for=is_top]").addClass("hide");
|
||||||
|
$("div[data-for=is_top]").find("input[type=text]").val("");
|
||||||
|
}
|
||||||
|
},100)
|
||||||
|
})
|
||||||
$(".enabler").on("click",function(){
|
$(".enabler").on("click",function(){
|
||||||
var parent = $(this).parent().parent().parent();
|
var parent = $(this).parent().parent().parent();
|
||||||
if($(this).is(":checked")){
|
if($(this).is(":checked")){
|
||||||
|
@ -505,8 +638,43 @@
|
||||||
$('#remind-check').prop('checked') ? '':$('.content-box').addClass('hide')
|
$('#remind-check').prop('checked') ? '':$('.content-box').addClass('hide')
|
||||||
$('#remind-check').on('change', function() {
|
$('#remind-check').on('change', function() {
|
||||||
$(this).prop('checked') ? $('.content-box').removeClass('hide'):$('.content-box').addClass('hide')
|
$(this).prop('checked') ? $('.content-box').removeClass('hide'):$('.content-box').addClass('hide')
|
||||||
})
|
});
|
||||||
|
|
||||||
|
$("#act_is_external_link").on("change",function(){
|
||||||
|
if($(this).is(":checked") && $("input[name=\"act[sign_up]\"]:checked").val()=='yes'){
|
||||||
|
$("#external_link_box").show();
|
||||||
|
}else{
|
||||||
|
$("#external_link_box").hide();
|
||||||
|
}
|
||||||
|
}).trigger('change');
|
||||||
|
|
||||||
|
$("input[name=\"act[sign_up]\"]").change(function(){
|
||||||
|
if($("input[name=\"act[sign_up]\"]:checked").val()=='yes'){
|
||||||
|
$("#external_link_check_box").show();
|
||||||
|
}else{
|
||||||
|
$("#external_link_check_box").hide();
|
||||||
|
}
|
||||||
|
$("#act_is_external_link").trigger('change')
|
||||||
|
}).trigger('change');
|
||||||
|
var config = {}
|
||||||
|
config.autoGrow_minHeight = 50;
|
||||||
|
config.allowedContent = false;
|
||||||
|
config.disallowedContent = 'img';
|
||||||
|
config.toolbar = [
|
||||||
|
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
|
||||||
|
{ name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
|
||||||
|
|
||||||
|
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat' ] },
|
||||||
|
'/',
|
||||||
|
{ name: 'insert', items: [ 'SpecialChar'] },
|
||||||
|
{ name: 'styles', items: [ 'Font' ] },
|
||||||
|
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }
|
||||||
|
];
|
||||||
|
|
||||||
|
var ckeditor_reduce = $('.ckeditor_reduce')
|
||||||
|
ckeditor_reduce.each(function(i,v){
|
||||||
|
CKEDITOR.replace(v,config);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
|
@ -11,6 +11,13 @@ en:
|
||||||
verification_failed: Verification Failed
|
verification_failed: Verification Failed
|
||||||
|
|
||||||
act:
|
act:
|
||||||
|
is_external_link: Enable External Link
|
||||||
|
external_link: External Link
|
||||||
|
external_link_hint: "Make sure URL starts with http://"
|
||||||
|
top_end_date: Top end date
|
||||||
|
postdate: Post date
|
||||||
|
end_date: End date
|
||||||
|
image: Cover Image
|
||||||
active: Active
|
active: Active
|
||||||
title: Event Title
|
title: Event Title
|
||||||
content: Content
|
content: Content
|
||||||
|
|
|
@ -11,6 +11,13 @@ zh_tw:
|
||||||
verification_failed: 驗證碼錯誤
|
verification_failed: 驗證碼錯誤
|
||||||
|
|
||||||
act:
|
act:
|
||||||
|
is_external_link: 連結外部網址
|
||||||
|
external_link: 外部連結
|
||||||
|
external_link_hint: "確定連結開頭為http://"
|
||||||
|
top_end_date: 至頂結束時間
|
||||||
|
postdate: 張貼日期
|
||||||
|
end_date: 下架日期
|
||||||
|
image: 封面圖片
|
||||||
active: 活動報名
|
active: 活動報名
|
||||||
title: 活動標題
|
title: 活動標題
|
||||||
content: 活動說明
|
content: 活動說明
|
||||||
|
@ -34,7 +41,7 @@ zh_tw:
|
||||||
sign_up_not_yet: 報名時間未開始
|
sign_up_not_yet: 報名時間未開始
|
||||||
sign_up_not_open: 未開放報名
|
sign_up_not_open: 未開放報名
|
||||||
sign_up_overdue: 報名時間已過
|
sign_up_overdue: 報名時間已過
|
||||||
settings: Activity Settings
|
settings: 活動報名設定
|
||||||
has_idno: 報名是否需填寫身分證字號
|
has_idno: 報名是否需填寫身分證字號
|
||||||
has_birthday: 出生年月日
|
has_birthday: 出生年月日
|
||||||
has_sex: 性別
|
has_sex: 性別
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<table class="table table-hover table-striped active-index">
|
||||||
|
<caption>
|
||||||
|
<h3>{{page-title}}</h3>
|
||||||
|
</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-md-2">{{th_category}}</th>
|
||||||
|
<th class="col-md-2">{{th_act_time_range}}</th>
|
||||||
|
<th class="col-md-5">{{th_title}}</th>
|
||||||
|
<th class="col-md-2">{{th_sign_up_time_range}}</th>
|
||||||
|
<th class="col-md-2">{{th_sign_up}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody data-level="0" data-list="acts">
|
||||||
|
<tr>
|
||||||
|
<td>{{category}}</td>
|
||||||
|
<td>{{act_duration_date}}</td>
|
||||||
|
<td>
|
||||||
|
<span class="active-status-wrap" data-list="statuses" data-level="1">
|
||||||
|
<span class="label status {{status-class}}">{{status}}</span>
|
||||||
|
</span>
|
||||||
|
{{title}}
|
||||||
|
</td>
|
||||||
|
<td>{{sign_duration_date}}</td>
|
||||||
|
<td>{{sign_up}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{{pagination_goes_here}}
|
|
@ -0,0 +1,25 @@
|
||||||
|
<div class="active-index1 {{display}}">
|
||||||
|
<h3>{{page-title}}</h3>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="active-th-time">{{th_act_time_range}}</th>
|
||||||
|
<th class="active-th-title">{{th_title}}</th>
|
||||||
|
<th class="col-md-2">{{th_sign_up}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody data-level="0" data-list="acts">
|
||||||
|
<tr>
|
||||||
|
<td class="active-time" date-format="%Y-%m-%d">{{act_duration_date}}</td>
|
||||||
|
<td class="active-content">
|
||||||
|
<span class="active-status-wrap" data-list="statuses" data-level="1">
|
||||||
|
<span class="label status {{status-class}}">{{status}}</span>
|
||||||
|
</span>
|
||||||
|
{{title}}
|
||||||
|
</td>
|
||||||
|
<td>{{sign_up}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{{pagination_goes_here}}
|
|
@ -0,0 +1,32 @@
|
||||||
|
<div class="active-index2">
|
||||||
|
<h3>{{page-title}}</h3>
|
||||||
|
<ul class="row" data-level="0" data-list="acts">
|
||||||
|
<li class="col-md-4">
|
||||||
|
<a href="{{link_to_show}}">
|
||||||
|
<div class="active-img-wrap">
|
||||||
|
<img src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}">
|
||||||
|
</div>
|
||||||
|
<div class="active-content-wrap">
|
||||||
|
<div class="active-meta">
|
||||||
|
<span class="active-status-wrap" data-list="statuses" data-level="1">
|
||||||
|
<span class="label {{status-class}}">{{status}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="active-time-wrap" date-format="%Y-%m-%d">
|
||||||
|
<i class="fa fa-calendar-o"></i>
|
||||||
|
<span class="active-time" date-format="%Y-%m-%d">{{act_duration_date}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="active-category-wrap">
|
||||||
|
<i class="fa fa-tasks"></i>
|
||||||
|
<span class="active-category">{{category}}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<h4 class="active-title">
|
||||||
|
{{title_text}}
|
||||||
|
</h4>
|
||||||
|
<p class="active-subtitle">{{subtitle}}</p>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{pagination_goes_here}}
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"frontend": [
|
||||||
|
{
|
||||||
|
"filename" : "active_index",
|
||||||
|
"name" : {
|
||||||
|
"zh_tw" : "1. 列表 (類別, 活動期間, 狀態, 活動標題, 報名期間, 線上報名)",
|
||||||
|
"en" : "1. List (Category, Event Period, status, Event Title, Registration Period, Register)"
|
||||||
|
},
|
||||||
|
"thumbnail" : "thumb.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "active_index1",
|
||||||
|
"name" : {
|
||||||
|
"zh_tw" : "2. 精簡表格列表-2 ( 模組標題, 活動期間, 狀態, 標題, 線上報名)",
|
||||||
|
"en" : "2. Simple Table List (widget-title, Event Period, status, title, Register)"
|
||||||
|
},
|
||||||
|
"thumbnail" : "active_index1_thumbs.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "active_index2",
|
||||||
|
"name" : {
|
||||||
|
"zh_tw" : "3. 三欄圖文 ( 模組標題, 圖片, 狀態, 活動期間, 類別, 標題, 副標題, 線上報名)",
|
||||||
|
"en" : "3. 3-Column Standard Image + Text (widget-title, image, status, postdate, category, title, subtitle, Register)"
|
||||||
|
},
|
||||||
|
"thumbnail" : "active_index2_thumbs.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue