Add Brief intro. for all personal plugins

Add Share Setting for Personal Plugins ( if have old data must be add default value "field: is_hidden => false " )
Apply New UI to Member Plugin Edit Page
Personal Plugin Summary fix
Academic Info. list fix
This commit is contained in:
Spen 2013-09-18 17:31:53 +08:00 committed by saurabhbhatia
parent b487740035
commit a067bcd304
159 changed files with 5145 additions and 3453 deletions

View File

@ -0,0 +1,105 @@
var ListCheck = function(element) {
this.element = $(element);
this.element.data('exists', true);
if(this.element.context.parentNode.tagName == "TD") {
this.elementWrap = $(this.element.context.parentNode);
this.elementWrap.addClass('listCheck');
} else if(this.element.context.parentNode.tagName == "TH") {
this.elementWrap = $(this.element.context.parentNode);
this.elementWrap.addClass('listCheckHead');
}
this.element.before('<i class="icon-check-empty" />');
};
$.fn.listCheck = function (callback) {
this.each(function (i) {
if(!$(this).data('exists')) {
new ListCheck(this);
};
});
this.on(clickEvent, function(e) {
if($(this).prop('checked')) {
$(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
} else {
$(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
};
if ($(this).closest('.listCheckHead').length) {
$('.listCheck .list-check').prop('checked', $(this).prop('checked'));
if($(this).prop('checked')) {
$('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
} else {
$('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
}
};
var _isCheck = $('tbody .list-check').filter(':checked').length,
_defaultLength = $('tbody .list-check').length;
if(_isCheck > 0 && _isCheck < _defaultLength) {
$('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
} else if(!_isCheck) {
$('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
} else {
$('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
}
_isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false);
});
};
function clearCheck() {
$('.list-check').each(function() {
$(this).prop('checked', false);
})
}
function actionSuccess(e) {
$("tbody .list-check").each(function() {
switch(e) {
case 'list-be-hide':
$(this).filter(':checked').closest('tr').addClass('checkHide');
break;
case 'list-be-show':
$(this).filter(':checked').closest('tr').removeClass('checkHide');
break;
case 'list-be-remove':
$(this).filter(':checked').closest('tr').fadeOut(300, function() {
$(this).remove();
});
break;
};
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
});
clearCheck();
}
$(function() {
var $t = null,
_data = null;
clearCheck();
$('.list-check').listCheck();
$('.list-active-btn').data('actionable', false).on(clickEvent, function(e) {
$t = $(this)
_data = $(this).data()
_data.actionable ? $('#dialog').modal('show') : "";
e.preventDefault();
});
$("#dialog").on('show', function (e) {
$(this).find('.delete-item').on(clickEvent, function() {
var _v = [];
$("tbody .list-check").each(function() {
this.checked && _v.push("ids[]="+this.value)
});
var _t = $t.attr("rel");
if(_t.indexOf("?") > -1) {
$.ajax(_t + "&" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
} else {
$.ajax(_t + "?" + _v.join("&")).done(function() {
actionSuccess(_data.checkAction)
});
}
$('#dialog').modal('hide');
$('.list-active-btn').addClass('disabled').data('actionable', false);
e.preventDefault();
})
});
});

View File

@ -0,0 +1,28 @@
.table .listCheckHead,
.table .listCheck {
width: 30px;
vertical-align: middle;
padding: 0 0 0 10px!important;
}
.listCheckHead .list-check,
.listCheck .list-check {
position: absolute;
margin: -12px 0 0 -1px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
.listCheckHead i,
.listCheck i {
display: block;
}
.checkHide td {
background-color: #E6E6E6 !important;
color: #B9B9B9;
}
.checkHide a {
color: #B9B9B9;
}
.checkHit td {
background-color: #FFFEDB !important;
}

View File

@ -3,9 +3,9 @@
color: #000; color: #000;
text-decoration: none; text-decoration: none;
display: block; display: block;
overflow: hidden;
width: 100%; width: 100%;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
@ -364,6 +364,9 @@
#profile #module-navbar { #profile #module-navbar {
margin-left: 10px; margin-left: 10px;
} }
#profile #module-navbar .navbar {
margin-bottom: 15px;
}
#profile #member-module { #profile #member-module {
margin-left: 360px; margin-left: 360px;
} }
@ -372,9 +375,13 @@
} }
#profile #member-module #module-content .content { #profile #member-module #module-content .content {
right: 10px; right: 10px;
padding-bottom: 10px;
outline: none; outline: none;
} }
#profile #member-module #module-content .list-active {
padding-bottom: 8px;
/*border-bottom: 1px solid #DDD;*/
}
/* Responsive */ /* Responsive */
@media (max-width: 979px) { @media (max-width: 979px) {

View File

@ -26,6 +26,9 @@
margin-top: 4px; margin-top: 4px;
margin-left: 10px; margin-left: 10px;
} }
.topnav .btn-group {
margin-left: 0;
}
/* Bottom Nav */ /* Bottom Nav */
.bottomnav { .bottomnav {

View File

@ -0,0 +1,83 @@
class Admin::PersonalPluginIntrosController < OrbitMemberController
include OrbitControllerLib::DivisionForDisable
before_filter :authenticate_user!
before_filter :is_admin?
def index
get_types
@plugin_intro = @types.where(:user_id => params[:user_id]).first
if @plugin_intro.blank?
@set_type = @types.new()
@url = eval("panel_#{@app_type_name}_back_end_#{@app_type}s_path(:user_id=>params[:user_id])")
@verb = :post
else
@set_type = @types.find(@plugin_intro.id)
@url = polymorphic_path(["panel_#{@app_type_name}_back_end", @plugin_intro])
@verb = :put
end
end
def show
end
def new
end
def edit
end
def create
get_types
@plugin_intro = @types.new(params[:plugin_intro])
respond_to do |format|
if @plugin_intro.save
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) }
end
end
end
def update
get_types
@plugin_intro = @types.find(params[:id])
respond_to do |format|
if @plugin_intro.update_attributes(params[:plugin_intro])
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:plugin_intro][:user_id],:show_plugin_profile=>@reback_name)) }
end
end
end
def destroy
end
protected
def get_types
@types = @app_type.classify.constantize
end
end

View File

@ -98,9 +98,11 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
if(!params[:show_plugin_profile].nil?) if(!params[:show_plugin_profile].nil?)
@right_partial = OrbitApp::Plugin::Registration.find_by_key(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary' @right_partial = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).profile_partial_path rescue 'plugin_summary'
@plugin_app_name = OrbitApp::Plugin::Registration.find_by_app_name(params[:show_plugin_profile]).name rescue nil
else else
@right_partial = "plugin_summary" @right_partial = "plugin_summary"
@plugin_app_name = ''
end end
# @user.attribute_values.each{|att_val| # @user.attribute_values.each{|att_val|

View File

@ -0,0 +1,28 @@
class PersonalPluginIntro
include Mongoid::Document
include Mongoid::Timestamps
# include OrbitCoreLib::ObjectAuthable
# include OrbitCoreLib::ObjectDisable
# has_and_belongs_to_many :users
belongs_to :user
field :text, localize: true
field :brief_intro, :type => Boolean, :default => false
field :complete_list, :type => Boolean, :default => true
def pp_object
brief_intro
end
def self.from_id(id)
PersonalPluginIntro.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end

View File

@ -39,11 +39,14 @@ class User
has_many :user_actions, :dependent => :destroy has_many :user_actions, :dependent => :destroy
has_many :personal_plugin_intro
# has_and_belongs_to_many :statuses # has_and_belongs_to_many :statuses
has_and_belongs_to_many :roles has_and_belongs_to_many :roles
has_and_belongs_to_many :sub_roles has_and_belongs_to_many :sub_roles
has_and_belongs_to_many :role_statuses has_and_belongs_to_many :role_statuses
has_and_belongs_to_many :role_categorys has_and_belongs_to_many :role_categorys
accepts_nested_attributes_for :attribute_values, :allow_destroy => true accepts_nested_attributes_for :attribute_values, :allow_destroy => true
before_create :initialize_desktop before_create :initialize_desktop

View File

@ -0,0 +1,117 @@
<% # encoding: utf-8 %>
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<% end %>
<%= form_for(:plugin_intro, :url => @url, :method => @verb, html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
<%= f.error_messages %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name"><strong><%= I18n.t("module_name.#{@app_type_name}") %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
</ul>
<!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<% if !params[:user_id].blank? %>
<div class="control-group">
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
</div>
<% end %>
<!-- frontend_page -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_plugins.frontend_page") %></label>
<div class="controls">
<%= f.check_box :brief_intro, :checked => @set_type.brief_intro %> <%= t("personal_plugins.brief_intro") %>
<%= f.check_box :complete_list, :checked => @set_type.complete_list %> <%= t("personal_plugins.complete_list") %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Content -->
<div class="control-group input-content">
<label class="control-label muted"><%= t(:content) %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :text_translations do |f| %>
<%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@set_type.text_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</fieldset>
<% end %>

View File

@ -1,11 +1,11 @@
<div class="item element"> <div class="item element">
<h3><i class="icons-book-2"></i>Module Name</h3> <h3><i class="icons-book-2"></i>Module Name</h3>
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>模組</th> <th><%= t(:module) %></th>
<th class="span2">數量</th> <th class="span2"><%= t(:quantity) %></th>
</tr> </tr>
</thead> </thead>
</table> </table>
@ -21,26 +21,26 @@
<div class="overview"> <div class="overview">
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
<%
@plugins.each do |plugin|
if is_admin?
@data = plugin.app_name.classify.constantize.where(:create_user_id=>@user.id).count
else
@data = plugin.app_name.classify.constantize.where(:is_hidden=>false , :create_user_id=>@user.id).count
end
%>
<tr> <tr>
<td>University</td> <td><%= plugin.name %></td>
<td class="span2">2,304</td> <td class="span2"><%= @data %></td>
</tr>
<tr>
<td>Master</td>
<td class="span2">783</td>
</tr>
<tr>
<td>Doctor</td>
<td class="span2">45</td>
</tr>
<tr>
<td>Staff</td>
<td class="span2">62</td>
</tr> </tr>
<% end -%>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,7 +5,8 @@
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<div id="filter" class="topnav clearfix"> <% content_for :right_nav do %>
<div class="searchClear pull-left" style="clear: left;"> <div class="searchClear pull-left" style="clear: left;">
<form action="" method="get"> <form action="" method="get">
<%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> <%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %>
@ -34,8 +35,8 @@
</div> </div>
</div> </div>
</div>
<% end %>
<div id="list-view"> <div id="list-view">

View File

@ -5,8 +5,9 @@
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<div id="filter" class="topnav clearfix"> <% content_for :right_nav do %>
<div class="searchClear pull-left">
<div class="searchClear pull-left" style="clear: left;">
<form action="" method="get"> <form action="" method="get">
<%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> <%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %>
<input type="hidden" name="at" id="at" value="<%= params[:at] %>" /> <input type="hidden" name="at" id="at" value="<%= params[:at] %>" />
@ -35,7 +36,8 @@
</div> </div>
</div> </div>
</div>
<% end %>
<div id="list-view"> <div id="list-view">
<ul id="member-abstract" class="clearfix"> <ul id="member-abstract" class="clearfix">

View File

@ -5,8 +5,9 @@
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
<div id="filter" class="topnav clearfix"> <% content_for :right_nav do %>
<div class="searchClear pull-left">
<div class="searchClear pull-left" style="clear: left;">
<form action="" method="get"> <form action="" method="get">
<%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %> <%= text_field_tag 'mq',( params[:mq] ? params[:mq] : '' ), {:id=>'filter-input', :class => "search-query input-medium", :placeholder => 'Search'} %>
<input type="hidden" name="at" id="at" value="<%= params[:at] %>" /> <input type="hidden" name="at" id="at" value="<%= params[:at] %>" />
@ -35,7 +36,8 @@
</div> </div>
</div> </div>
</div>
<% end %>
<div id="list-view"> <div id="list-view">
<ul id="member-card" class="clearfix"> <ul id="member-card" class="clearfix">

View File

@ -43,7 +43,7 @@
<div class="navbar"> <div class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<span class="brand"> <span class="brand">
<%= params[:show_plugin_profile].nil? ? t(:all_plugin_summary) : params[:show_plugin_profile] %> <%= @plugin_app_name.nil? ? t(:all_plugin_summary) : @plugin_app_name %>
</span> </span>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li class="divider-vertical"></li> <li class="divider-vertical"></li>
@ -52,8 +52,8 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<% @plugins.each do |plugin| %> <% @plugins.each do |plugin| %>
<%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.name ? "active" : nil) do %> <%= content_tag :li, :class=>(params[:show_plugin_profile] == plugin.app_name ? "active" : nil) do %>
<%= link_to plugin.name, :show_plugin_profile => plugin.name %> <%= link_to plugin.name, :show_plugin_profile => plugin.app_name %>
<% end -%> <% end -%>
<% end -%> <% end -%>

View File

@ -23,8 +23,8 @@
<section id="main-wrap"> <section id="main-wrap">
<div class="wrap-inner"> <div class="wrap-inner">
<div id="filter" class="topnav clearfix"> <div id="filter" class="topnav clearfix">
<ul class="breadcrumb"> <ul class="breadcrumb text-info pull-left">
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml">Dashboard</a> <span class="divider">/</span></li> <li><a href="<%= admin_users_new_interface_index_path %>">Member</a> <span class="divider">/</span></li>
<li class="active">All</li> <li class="active">All</li>
</ul> </ul>
<%= yield :right_nav %> <%= yield :right_nav %>

View File

@ -331,6 +331,12 @@ en:
password_confirmation: Password confirmation password_confirmation: Password confirmation
password_current: Current password password_current: Current password
pending: Pending pending: Pending
personal_plugins:
author : "Author"
edit_brief_intro : "Edit Brief Intro."
brief_intro : "Brief Intro."
complete_list : "Complete List"
frontend_page : "Frontend Page"
picture: Picture picture: Picture
placeholder: Field Hint placeholder: Field Hint
plugins: Plugins plugins: Plugins

View File

@ -332,6 +332,12 @@ zh_tw:
password_confirmation: 確認密碼 password_confirmation: 確認密碼
password_current: 目前的密碼 password_current: 目前的密碼
pending: 待審核 pending: 待審核
personal_plugins:
author : "著作人"
edit_brief_intro : "編輯摘要"
brief_intro : "摘要"
complete_list : "完整列表"
frontend_page : "前台呈現"
picture: 圖片 picture: 圖片
placeholder: 欄位提示文字 placeholder: 欄位提示文字
plugins: 學術資訊 plugins: 學術資訊

View File

@ -24,4 +24,4 @@ production:
# password: <%= ENV['MONGOID_PASSWORD'] %> # password: <%= ENV['MONGOID_PASSWORD'] %>
# database: <%= ENV['MONGOID_DATABASE'] %> # database: <%= ENV['MONGOID_DATABASE'] %>
<<: *defaults <<: *defaults
database: test_site database: test_site_new

View File

@ -14,6 +14,13 @@ module OrbitApp
@@registrations << DataSheet.new(name,args,:base_path=>base_path) @@registrations << DataSheet.new(name,args,:base_path=>base_path)
end end
def find_by_app_name(name)
@@registrations.each{|t|
return t if t.app_name == name
}
return nil
end
def find_by_key(key) def find_by_key(key)
@@registrations.each{|t| @@registrations.each{|t|
return t if t.name == key return t if t.name == key
@ -46,6 +53,8 @@ module OrbitApp
def initialize(name,partial=nil,*args ,&block) def initialize(name,partial=nil,*args ,&block)
@base_path = args[0][:base_path] @base_path = args[0][:base_path]
@name = partial[0][:i18n].nil? ? name : lambda{ I18n.t(partial[0][:i18n]) } @name = partial[0][:i18n].nil? ? name : lambda{ I18n.t(partial[0][:i18n]) }
@app_name = partial[0][:app_name]
@intro_app_name = partial[0][:intro_app_name]
@partial_path = '' @partial_path = ''
@front_partial_path = '' @front_partial_path = ''
@admin_partial_path = '' @admin_partial_path = ''
@ -59,6 +68,14 @@ module OrbitApp
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
end end
def app_name
return @app_name
end
def intro_app_name
return @intro_app_name
end
def profile_partial_path def profile_partial_path
return @partial_path return @partial_path
end end

View File

@ -33,7 +33,6 @@
else else
@rodata = nil @rodata = nil
end end
end
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank? if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
%> %>
@ -47,4 +46,7 @@
<% end -%> <% end -%>
<% end -%>
<%= render :partial => 'show_sub_role',:collection=> @member.get_sub_roles_by_role(show_roles)%> <%= render :partial => 'show_sub_role',:collection=> @member.get_sub_roles_by_role(show_roles)%>

View File

@ -46,38 +46,71 @@
<%= show_avatar(@member) %> <%= show_avatar(@member) %>
</div> </div>
<div class="member-module"> <div class="member-module">
<div class="module-nav"> <div class="module-nav">
<ul> <ul>
<% @plugins.each do |plugin| %> <%
@plugins.each do |plugin|
@data = plugin.app_name.classify.constantize.where(is_hidden: false, :create_user_id=>@member.id)
@intro_data = plugin.intro_app_name.classify.constantize.where(:user_id=>@member.id).first
%>
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<li><a href="#<%= plugin.name %>"><%= plugin.name %></a></li> <li><a href="#<%= plugin.name %>"><%= plugin.name %></a></li>
<% end %> <% end %>
<% else %>
<% if !@data.blank? %>
<li><a href="#<%= plugin.name %>"><%= plugin.name %></a></li>
<% end %>
<% end %>
<% end %>
</ul> </ul>
</div> </div>
<div class="module-content"> <div class="module-content">
<% <%
@plugins.each do |plugin| @plugins.each do |plugin|
@plugin_partial = !plugin.front_partial_path.blank? ? OrbitApp::Plugin::Registration.find_by_key(plugin.name).front_partial_path : nil @plugin_partial = !plugin.front_partial_path.blank? ? OrbitApp::Plugin::Registration.find_by_key(plugin.name).front_partial_path : nil
@data = plugin.app_name.classify.constantize.where(:create_user_id=>@member.id)
@intro_data = plugin.intro_app_name.classify.constantize.where(:user_id=>@member.id).first
%> %>
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<div class="module-pane" id="<%= plugin.name %>"> <div class="module-pane" id="<%= plugin.name %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %> <%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div> </div>
<% end %>
<% else %>
<% if !@data.blank? %>
<div class="module-pane" id="<%= plugin.name %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
<% end %>
<% end %> <% end %>
</div>
<% end %>
</div> </div>
</div>
</div> </div>
<%= stylesheet_link_tag "member/default_member" %> <%= stylesheet_link_tag "member/default_member" %>
<%= javascript_include_tag "member/moduletab" %> <%= javascript_include_tag "member/moduletab" %>

View File

@ -0,0 +1,10 @@
class Panel::PersonalBook::BackEnd::PersonalBookIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_book_intro'
@app_type_name = 'personal_book'
@reback_name = 'WritingBook'
end
end

View File

@ -9,43 +9,19 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end end
def index def index
get_plugins get_plugins
get_categorys("BookPaperType",params[:book_paper_type_id]) # @tags = get_tags
@filter = params[:filter] # @categories = get_categories_for_index
new_filter = params[:new_filter] # @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
if @filter && params[:clear] @paper_type_ids = BookPaperType.all.collect{|t| t.id.to_s} + [nil]
@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
@paper_types = BookPaperType.all
@paper_type_ids = @paper_types.collect{|t| t.id.to_s} + [nil]
# @writing_books = WritingBook.search(params[:category_id])
#@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_books : WritingBook.all.page(params[:page]).per(10)
@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:book_paper_type_id.in => @paper_type_ids) : get_viewable("writing_book",:book_paper_type_id.in => @paper_type_ids)
@books = @writing_books.page params[:page]
@tags = get_tags
@writing_books = get_sorted_and_filtered("writing_book", :book_paper_type_id.in => @paper_type_ids)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @writing_books } format.xml { render :xml => @writing_books }
format.js
end end
end end
@ -196,10 +172,11 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
end end
respond_to do |format| respond_to do |format|
if @writing_book.save if @writing_book.save
if params[:writing_book][:user_id] if params[:writing_book][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_book][:user_id],:show_plugin_profile=>'Book')) } format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_book][:user_id],:show_plugin_profile=>"WritingBook")) }
else else
format.html { redirect_to(panel_personal_book_back_end_writing_books_url) } format.html { redirect_to(panel_personal_book_back_end_writing_books_url) }
end end
@ -209,7 +186,9 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
format.html { render :action => "new" } format.html { render :action => "new" }
format.xml { render :xml => @writing_book.errors, :status => :unprocessable_entity } format.xml { render :xml => @writing_book.errors, :status => :unprocessable_entity }
end end
end end
end end
end end
@ -260,6 +239,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
format.xml { render :xml => @writing_book.errors, :status => :unprocessable_entity } format.xml { render :xml => @writing_book.errors, :status => :unprocessable_entity }
end end
end end
end end
end end
@ -284,6 +264,29 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
redirect_to panel_personal_book_back_end_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_book_back_end_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@writing_books = WritingBook.any_in(:_id => params[:ids])
@writing_books.each do |writing_book|
writing_book.is_hidden = params[:disable]
writing_book.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"WritingBook")) }
end
end
protected protected

View File

@ -0,0 +1,4 @@
class PersonalBookIntro < PersonalPluginIntro
end

View File

@ -1,17 +1,58 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<% if show_form_status_field(@writing_book) %>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<% end %>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
<div id="widget-tags" class="widget-box widget-size-300"> <!-- Module -->
<div class="widget-action clear tip" title="Setting"> <div class="tab-content module-area">
<a class="action"><i class="icon-cog icon-white"></i></a>
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<% if !params[:user_id].blank? %>
<div class="control-group">
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :author_type ,t("personal_book.author_type")%></h3> </div>
<div class="widget-content clear form-horizontal">
<% end %>
<!-- Category -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_book.author_type") %></label>
<div class="controls">
<% @author_types.each do |author_type| %> <% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_book[book_author_type_ids][]', author_type.id, @writing_book.book_author_type_ids.include?(author_type.id)%> <%= check_box_tag 'writing_book[book_author_type_ids][]', author_type.id, @writing_book.book_author_type_ids.include?(author_type.id)%>
@ -22,235 +63,278 @@
</div> </div>
</div> </div>
<!-- Category -->
<div id="widget-tags" class="widget-box widget-size-300"> <div class="control-group">
<div class="widget-action clear tip" title="Setting"> <label class="control-label muted"><%= t("personal_book.book_paper_type") %></label>
<a class="action"><i class="icon-cog icon-white"></i></a> <div class="controls">
</div>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3>
<div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id)%>
<%= tag.name %>
<%= hidden_field_tag 'writing_book[tag_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
</div>
<!--Wiget End-->
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div>
<% end %>
<div class="title">
<%= f.label :year ,t("personal_book.year")%>
<%= select_year((@writing_book.year ? @writing_book.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_book[year]'} ) %>
</div>
<div class="title">
<%= f.label :book_paper_type ,t("personal_book.book_paper_type")%>
<%= f.select :book_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]} %> <%= f.select :book_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]} %>
</div> </div>
</div>
<ul class="nav nav-tabs"> <!-- year -->
<% @site_valid_locales.each_with_index do |locale, i| %> <div class="control-group">
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li> <label class="control-label muted"><%= t("personal_book.year") %></label>
<% end %> <div class="controls">
</ul> <%= select_year((@writing_book.year ? @writing_book.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_book[year]',:class => 'span1'} ) %>
</div>
</div>
<div class="title"> <!-- publish_date -->
<%= f.label :publish_date ,t("personal_book.publish_date")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_book.publish_date") %></label>
<div class="controls">
<%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %> <%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div> </div>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :paper_title ,t("personal_book.paper_title")%>
<%= f.fields_for :paper_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_book.paper_title_translations[locale] rescue nil) %>
<% end %>
</div> </div>
<div class="title"> <!-- publication_date -->
<%= f.label :book_title ,t("personal_book.book_title")%> <div class="control-group">
<%= f.fields_for :book_title_translations do |f| %> <label class="control-label muted"><%= t("personal_book.publication_date") %></label>
<%= I18nVariable.from_locale(locale) %> <div class="controls">
<%= f.text_field locale, :class=>'post-title', :value => (@writing_book.book_title_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :extracted_chapters ,t("personal_book.extracted_chapters")%>
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_book.extracted_chapters_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :publisher ,t("personal_book.publisher")%>
<%= f.fields_for :publisher_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_book.publisher_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :editor ,t("personal_book.editor")%>
<%= f.fields_for :editor_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_book.editor_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :authors,t("web_resource.authors") %>
<%= f.fields_for :authors_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_area locale, :size => "60x3", :value => (@writing_book.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="title">
<%= f.label :publication_date ,t("personal_book.publication_date")%>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month, :day] }, {:class => 'span1'} %> <%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div> </div>
<div class="title">
<%= f.label :url, t("personal_book.url") %>
<%= f.text_field :url %>
</div> </div>
<div class="title"> <!-- url -->
<%= f.label :keywords, t("personal_book.keywords") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_book.url") %></label>
<div class="controls">
<%= f.text_field :url , :class => "span6" %>
</div>
</div>
<!-- keywords -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_book.keywords") %></label>
<div class="controls">
<%= f.text_field :keywords %> <%= f.text_field :keywords %>
</div> </div>
</div>
<div class="title"> <!-- pages -->
<%= f.label :pages, t("personal_book.pages") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_book.pages") %></label>
<div class="controls">
<%= f.text_field :pages %> <%= f.text_field :pages %>
</div> </div>
<div class="title">
<%= f.label :isbn, t("personal_book.isbn") %>
<%= f.text_field :isbn %>
</div> </div>
<div id="title"> <!-- isbn -->
<%= f.label :language, t("personal_book.language") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_book.isbn") %></label>
<div class="controls">
<%= f.text_field :isbn %>
</div>
</div>
<!-- language -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_book.language") %></label>
<div class="controls">
<%= f.radio_button :language, "Chinese" %> <%= t("personal_book.Chinese") %> <%= f.radio_button :language, "Chinese" %> <%= t("personal_book.Chinese") %>
<%= f.radio_button :language, "English" %> <%= t("personal_book.English") %> <%= f.radio_button :language, "English" %> <%= t("personal_book.English") %>
</div> </div>
</div>
<div class="title"> <!-- note -->
<%= f.label :note, t("personal_book.note") %> <div class="control-group">
<%= f.text_area :note, :size => "60x3" %> <label class="control-label muted"><%= t("personal_book.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div> </div>
</div> </div>
<!-- Status Module -->
<% if show_form_status_field(@writing_book) %>
<div class="tab-pane fade" id="status">
<!-- Status -->
<div class="control-group">
<label class="control-label muted"><%= t(:status) %></label>
<div> <div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn <%= 'active' if @writing_book.is_hidden? %>">
<div id='plugin_files' class="plugin_files_block"> <%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
<table class="table table-condensed"> </div>
<thead>
<tr>
<th>File</th>
<th>File Name</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td style="text-align:center" colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block">
<%= hidden_field_tag 'plugin_file_field_count', @writing_book.writing_book_files.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a>
</div> </div>
</td>
</tr>
</tfoot> </div>
<tbody> <% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @writing_book.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'writing_book[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- paper_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.paper_title") %></label>
<div class="controls">
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.paper_title"), value: (@writing_book.paper_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- book_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.book_title") %></label>
<div class="controls">
<%= f.fields_for :book_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.book_title"), value: (@writing_book.book_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- extracted_chapters-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.extracted_chapters") %></label>
<div class="controls">
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.extracted_chapters"), value: (@writing_book.extracted_chapters_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- publisher-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.publisher") %></label>
<div class="controls">
<%= f.fields_for :publisher_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.publisher"), value: (@writing_book.publisher_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- editor-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.editor") %></label>
<div class="controls">
<%= f.fields_for :editor_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_book.editor"), value: (@writing_book.editor_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- authors-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_book.authors") %></label>
<div class="controls">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_area locale, rows: 2, class: "input-block-level", value: (@writing_book.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if @writing_book && !@writing_book.writing_book_files.blank? %>
<div class="exist">
<% @writing_book.writing_book_files.each_with_index do |writing_book_file, i| %> <% @writing_book.writing_book_files.each_with_index do |writing_book_file, i| %>
<%= f.fields_for :writing_book_files, writing_book_file do |f| %> <%= f.fields_for :writing_book_files, writing_book_file do |f| %>
<%= render :partial => 'form_file', :object => writing_book_file, :locals => {:f => f, :i => i} %> <%= render :partial => 'form_file', :object => writing_book_file, :locals => {:f => f, :i => i} %>
<% end %> <% end %>
<% end %> <% end %>
</tbody> <hr>
</table> </div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'plugin_file_field_count', @writing_book.writing_book_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div> </div>
</div> </div>
</div> </div>
<!--Post End-->
<div class="form-actions"> </div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "archive_plugin_form" %>
<script> <script>
$('#add_plugin_file a.add').live('click', function(){ $(document).ready(function() {
$('.main-forms .add-on').tooltip();
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value'); var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g"); var old_id = new RegExp("new_writing_book_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1); $(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_book_files) %>").replace(old_id, new_id)); $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_book_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
}); });
formTip();
$('.add_plugin_files_block a.delete').live('click', function(){ });
$(this).parents('.list_item').remove(); $(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
}); });
$('.action a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
}); });
</script> </script>
<% end %> <% end %>

View File

@ -1,50 +1,45 @@
<% # encoding: utf-8 %> <% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'> <% else %>
<td> <div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<div class="control-group"> <% if form_file.file.blank? %>
<div class="controls"> <%= t(:no_file) %>
<%= f.file_field :file %>
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
</div>
</div>
</td>
<td>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>
<%= f.fields_for :file_title_translations do |f| %>
<div class="control-group">
<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
<div class="controls">
<%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
</td>
<td>
<span class="action">
<% if form_file.new_record? %>
<a class="delete"><i class="icon-remove"></i></a>
<% else %> <% else %>
<%= f.hidden_field :id %> <%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<a class="remove_existing_record"><i class="icon-remove"></i></a> <% end %>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> <% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %> <% end %>
</span> </span>
<% end %>
</td> </span>
</tr> </span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -1,9 +1,4 @@
<tr id="<%= dom_id writing_book %>" class="with_action"> <tr id="<%= dom_id writing_book %>" class="with_action">
<td class="span1">
<% if (writing_book.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', writing_book.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td class="span1"><%= writing_book.year %></td> <td class="span1"><%= writing_book.year %></td>
<td class="span1"> <td class="span1">
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %> <%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>

View File

@ -9,8 +9,8 @@
</div> </div>
<h1><%= t('personal_book.editing_personal_book') %></h1> <%= form_for @writing_book, url: panel_personal_book_back_end_writing_book_path(@writing_book), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= form_for @writing_book, :url => panel_personal_book_back_end_writing_book_path(@writing_book), :html => {:class => 'clear'} do |f| %> <%= render partial: 'form', locals: {f: f} %>
<%= render :partial => 'form', :locals => {:f => f} %> </fieldset>
<% end %> <% end %>

View File

@ -13,10 +13,9 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span1"><%= t("personal_book.year") %></th>
<th class="span1"></th> <th class="span7"><%= t("personal_book.book_title") %></th>
<th class="span1"></th> <th class="span1"><%= t("personal_plugins.author") %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_books" class="sort-holder"> <tbody id="tbody_writing_books" class="sort-holder">
@ -24,10 +23,13 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_book_back_end_writing_book_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_book_back_end_writing_book_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_book_pagination" class="paginationFixed"> </div>
<%= paginate @books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -9,14 +9,8 @@
</div> </div>
<%= flash_messages %> <%= form_for @writing_book, url: panel_personal_book_back_end_writing_books_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div id="poststuff"> <%= render partial: 'form', locals: {f: f} %>
<h1><%= t('writing_book.new_personal_book') %></h1> </fieldset>
<%= form_for @writing_book, :url => panel_personal_book_back_end_writing_books_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
</div>
<%#= link_back %>

View File

@ -15,7 +15,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_book_back_end_writing_book_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_book_back_end_writing_book_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>論文型態</span> <span><%= t("personal_book.book_paper_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
@ -41,7 +41,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_book_back_end_writing_book_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_book_back_end_writing_book_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>作者型態</span> <span><%= t("personal_book.author_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">

View File

@ -1,13 +1,22 @@
<% <%
if @member if @member
@writing_books = WritingBook.where(:create_user_id => @member.id).desc(:year)
else
@writing_books = WritingBook.all.desc(:year)
end
@writing_books = WritingBook.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
@writing_book_intro = !PersonalBookIntro.where(:user_id => @member.id).blank? ? PersonalBookIntro.where(:user_id => @member.id).first : PersonalBookIntro.new
%> %>
<% if !@writing_books.blank? %> <% if @writing_book_intro.brief_intro and !@writing_book_intro.blank? %>
<div class="info">
<%= @writing_book_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@writing_book_intro.blank? and @writing_book_intro.complete_list ) or @writing_book_intro.blank? %>
<% if !@writing_books.blank? %>
<table class="table"> <table class="table">
<thead> <thead>
@ -34,9 +43,8 @@
</tbody> </tbody>
</table> </table>
<% end %>
<% else %> <% end %>
<%= t('nothing')%>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -17,17 +24,29 @@
end end
if @user if @user && is_admin?
@writing_books = WritingBook.where(:create_user_id => @user.id).page(params[:page]).per(10) @writing_books = WritingBook.where(:create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
else else
@writing_books = WritingBook.all.page(params[:page]).per(10) @writing_books = WritingBook.where(is_hidden: false, :create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_book_back_end_writing_books_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_book_back_end_writing_books_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_book.year') %></th> <th class="span1"><%= t('personal_book.year') %></th>
<th><%= t('personal_book.book_title') %></th> <th><%= t('personal_book.book_title') %></th>
</tr> </tr>
@ -36,7 +55,12 @@
<% @writing_books.each do |writing_book| %> <% @writing_books.each do |writing_book| %>
<tr> <tr class="<%= writing_book.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', writing_book.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= writing_book.year %></td> <td><%= writing_book.year %></td>
<td> <td>
<%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %> <%= link_to writing_book.create_link, panel_personal_book_front_end_writing_book_path(writing_book) %>
@ -48,11 +72,25 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_book_back_end_personal_book_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_book_back_end_writing_book_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @writing_books, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

View File

@ -10,9 +10,12 @@ Rails.application.routes.draw do
match 'writing_book_setting' => "writing_books#writing_book_setting" ,:as => :writing_book_setting match 'writing_book_setting' => "writing_books#writing_book_setting" ,:as => :writing_book_setting
# match 'writing_book_intro' => "writing_books#writing_book_intro" ,:as => :writing_book_intro
resources :writing_books do resources :writing_books do
collection do collection do
get 'delete' get 'delete'
get 'data_share'
end end
match "author_type_quick_add" => "writing_books#author_type_quick_add" ,:as => :author_type_quick_add match "author_type_quick_add" => "writing_books#author_type_quick_add" ,:as => :author_type_quick_add
@ -21,6 +24,8 @@ Rails.application.routes.draw do
match "paper_type_quick_add" => "writing_books#paper_type_quick_add" ,:as => :paper_type_quick_add match "paper_type_quick_add" => "writing_books#paper_type_quick_add" ,:as => :paper_type_quick_add
match "paper_type_quick_edit" => "writing_books#paper_type_quick_edit" ,:as => :paper_type_quick_edit match "paper_type_quick_edit" => "writing_books#paper_type_quick_edit" ,:as => :paper_type_quick_edit
end end
resources :personal_book_intros
resources :book_paper_types resources :book_paper_types
resources :book_author_types resources :book_author_types
resources :tags resources :tags

View File

@ -2,7 +2,7 @@ module PersonalBook
OrbitApp.registration "PersonalBook",:type=> 'ModuleApp' do OrbitApp.registration "PersonalBook",:type=> 'ModuleApp' do
module_label 'module_name.personal_book' module_label 'module_name.personal_book'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_book/plugin/profile",:front_path=>"panel/personal_book/front_end/profile",:admin_path=>"/panel/personal_book/back_end/writing_books",:i18n=>'module_name.personal_book' personal_plugin :enable => true, :app_name=>"WritingBook", :intro_app_name=>"PersonalBookIntro",:path=>"panel/personal_book/plugin/profile",:front_path=>"panel/personal_book/front_end/profile",:admin_path=>"/panel/personal_book/back_end/writing_books",:i18n=>'module_name.personal_book'

View File

@ -0,0 +1,10 @@
class Panel::PersonalConference::BackEnd::PersonalConferenceIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_conference_intro'
@app_type_name = 'personal_conference'
@reback_name = 'WritingConference'
end
end

View File

@ -9,43 +9,19 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
end end
def index def index
get_plugins get_plugins
get_categorys("ConferencePaperType",params[:conference_paper_type_id]) # @tags = get_tags
@filter = params[:filter] # @categories = get_categories_for_index
new_filter = params[:new_filter] # @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
if @filter && params[:clear] @paper_type_ids = ConferencePaperType.all.collect{|t| t.id.to_s} + [nil]
@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
@paper_types = ConferencePaperType.all
@paper_type_ids = @paper_types.collect{|t| t.id.to_s} + [nil]
# @writing_conferences = WritingConference.search(params[:category_id])
#@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10)
@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:conference_paper_type_id.in => @paper_type_ids) : get_viewable("writing_conference",:conference_paper_type_id.in => @paper_type_ids)
@conferences = @writing_conferences.page params[:page]
@tags = get_tags
@writing_conferences = get_sorted_and_filtered("writing_conference", :conference_paper_type_id.in => @paper_type_ids)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @writing_conferences } format.xml { render :xml => @writing_conferences }
format.js
end end
end end
@ -197,7 +173,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
if @writing_conference.save if @writing_conference.save
if params[:writing_conference][:user_id] if params[:writing_conference][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_conference][:user_id],:show_plugin_profile=>'Conference')) } format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_conference][:user_id],:show_plugin_profile=>'WritingConference')) }
else else
format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) } format.html { redirect_to(panel_personal_conference_back_end_writing_conferences_url) }
end end
@ -258,6 +234,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity } format.xml { render :xml => @writing_conference.errors, :status => :unprocessable_entity }
end end
end end
end end
end end
@ -282,6 +259,30 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@writing_conferences = WritingConference.any_in(:_id => params[:ids])
@writing_conferences.each do |writing_conference|
writing_conference.is_hidden = params[:disable]
writing_conference.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"WritingConference")) }
end
end
protected protected

View File

@ -0,0 +1,4 @@
class PersonalConferenceIntro < PersonalPluginIntro
end

View File

@ -1,17 +1,58 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li></li>
<li class="active">
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<% if show_form_status_field(@writing_conference) %>
<li>
<a href="#status" data-toggle="tab"><%= t(:status) %></a>
</li>
<% end %>
<li>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
<div id="widget-tags" class="widget-box widget-size-300"> <!-- Module -->
<div class="widget-action clear tip" title="Setting"> <div class="tab-content module-area">
<a class="action"><i class="icon-cog icon-white"></i></a>
<!-- Basic Module -->
<div class="tab-pane fade in active" id="basic">
<% if !params[:user_id].blank? %>
<div class="control-group">
<label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :paper_type ,t("personal_conference.paper_type")%></h3> </div>
<div class="widget-content clear form-horizontal">
<% end %>
<!-- paper_type -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.paper_type") %></label>
<div class="controls">
<% @paper_types.each do |paper_type| %> <% @paper_types.each do |paper_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_conference[conference_paper_type_ids][]', paper_type.id, @writing_conference.conference_paper_type_ids.include?(paper_type.id)%> <%= check_box_tag 'writing_conference[conference_paper_type_ids][]', paper_type.id, @writing_conference.conference_paper_type_ids.include?(paper_type.id)%>
@ -22,12 +63,10 @@
</div> </div>
</div> </div>
<div id="widget-tags" class="widget-box widget-size-300"> <!-- author_type -->
<div class="widget-action clear tip" title="Setting"> <div class="control-group">
<a class="action"><i class="icon-cog icon-white"></i></a> <label class="control-label muted"><%= t("personal_conference.author_type") %></label>
</div> <div class="controls">
<h3 class="widget-title"><i class="icons-tag"></i><%= f.label :author_type ,t("personal_conference.author_type")%></h3>
<div class="widget-content clear form-horizontal">
<% @author_types.each do |author_type| %> <% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_conference[conference_author_type_ids][]', author_type.id, @writing_conference.conference_author_type_ids.include?(author_type.id)%> <%= check_box_tag 'writing_conference[conference_author_type_ids][]', author_type.id, @writing_conference.conference_author_type_ids.include?(author_type.id)%>
@ -38,221 +77,257 @@
</div> </div>
</div> </div>
<!-- year -->
<div id="widget-tags" class="widget-box widget-size-300"> <div class="control-group">
<div class="widget-action clear tip" title="Setting"> <label class="control-label muted"><%= t("personal_conference.year") %></label>
<a class="action"><i class="icon-cog icon-white"></i></a> <div class="controls">
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]',:class => 'span1'} ) %>
</div> </div>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3> </div>
<div class="widget-content clear form-horizontal">
<!-- period_start_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.period_start_date") %></label>
<div class="controls">
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
</div>
<!-- period_end_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.period_end_date") %></label>
<div class="controls">
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
</div>
<!-- publication_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.publication_date") %></label>
<div class="controls">
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
</div>
<!-- url -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.url") %></label>
<div class="controls">
<%= f.text_field :url , :class => "span6" %>
</div>
</div>
<!-- keywords -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.keywords") %></label>
<div class="controls">
<%= f.text_field :keywords %>
</div>
</div>
<!-- abstract -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.abstract") %></label>
<div class="controls">
<%= f.text_field :abstract %>
</div>
</div>
<!-- language -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.language") %></label>
<div class="controls">
<%= f.select :language, WritingConference::LANGUAGE_TYPES, :prompt => 'Select' %>
</div>
</div>
<!-- note -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_conference.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div>
</div>
<!-- Status Module -->
<% if show_form_status_field(@writing_conference) %>
<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 @writing_conference.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <label class="checkbox inline btn <%= 'active' if @writing_conference.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%> <%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= tag.name %>
<%= hidden_field_tag 'writing_conference[tag_ids][]', '' %> <%= hidden_field_tag 'writing_conference[tag_ids][]', '' %>
<% end %> </label>
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>
<!--Wiget End-->
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %>
<div class="span6">
<%= t("著作人")%>
<%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
<% end %> <!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<div class="title"> <ul class="nav nav-pills language-nav">
<%= f.label :year ,t("personal_conference.year")%>
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]'} ) %>
</div>
<ul class="nav nav-tabs">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @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> <li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %> <% end %>
</ul> </ul>
<div class="title"> <!-- Language -->
<%= f.label :period_start_date ,t("personal_conference.period_start_date")%> <div class="tab-content language-area">
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
<div class="title">
<%= f.label :period_end_date ,t("personal_conference.period_end_date")%>
<%= f.date_select :period_end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :paper_title ,t("personal_conference.paper_title")%> <!-- paper_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.paper_title") %></label>
<div class="controls">
<%= f.fields_for :paper_title_translations do |f| %> <%= f.fields_for :paper_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.paper_title"), value: (@writing_conference.paper_title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.paper_title_translations[locale] rescue nil) %>
<% end %> <% end %>
</div> </div>
</div>
<div class="title"> <!-- conference_title-->
<%= f.label :conference_title ,t("personal_conference.conference_title")%> <div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.conference_title") %></label>
<div class="controls">
<%= f.fields_for :conference_title_translations do |f| %> <%= f.fields_for :conference_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.conference_title"), value: (@writing_conference.conference_title_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.conference_title_translations[locale] rescue nil) %>
<% end %> <% end %>
</div> </div>
</div>
<div class="title"> <!-- location-->
<%= f.label :location ,t("personal_conference.location")%> <div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.location") %></label>
<div class="controls">
<%= f.fields_for :location_translations do |f| %> <%= f.fields_for :location_translations do |f| %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.location"), value: (@writing_conference.location_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.location_translations[locale] rescue nil) %>
<% end %> <% end %>
</div> </div>
</div>
<div class="title"> <!-- sponsor-->
<%= f.label :sponsor ,t("personal_conference.sponsor")%> <div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.sponsor") %></label>
<div class="controls">
<%= f.fields_for :sponsor_translations do |f| %> <%= f.fields_for :sponsor_translations do |f| %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.sponsor"), value: (@writing_conference.sponsor_translations[locale] rescue nil) %>
<%= f.text_field locale, :class=>'post-title', :value => (@writing_conference.sponsor_translations[locale] rescue nil) %>
<% end %> <% end %>
</div> </div>
</div>
<div class="title"> <!-- authors-->
<%= f.label :authors,t("web_resource.authors") %> <div class="control-group input-title">
<label class="control-label muted"><%= t("personal_conference.authors") %></label>
<div class="controls">
<%= f.fields_for :authors_translations do |f| %> <%= f.fields_for :authors_translations do |f| %>
<%= I18nVariable.from_locale(locale) %> <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_conference.authors"), value: (@writing_conference.authors_translations[locale] rescue nil) %>
<%= f.text_area locale, :size => "60x3", :value => (@writing_conference.authors_translations[locale] rescue nil) %>
<% end %> <% end %>
</div> </div>
</div>
</div> </div>
<% end %> <% end %>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<!-- Exist -->
<% if @writing_conference && !@writing_conference.writing_conference_files.blank? %>
<div class="exist">
<% @writing_conference.writing_conference_files.each_with_index do |archive_file_multiple, i| %>
<%= f.fields_for :writing_conference_files, archive_file_multiple do |f| %>
<%= render :partial => 'form_file', :object => archive_file_multiple, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
<hr>
</div> </div>
<% end %>
<div class="title"> <!-- Add -->
<%= f.label :publication_date ,t("personal_conference.publication_date")%> <div class="add-target">
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div> </div>
<p class="add-btn">
<div class="title">
<%= f.label :url, t("personal_conference.url") %>
<%= f.text_field :url %>
</div>
<div class="title">
<%= f.label :keywords, t("personal_conference.keywords") %>
<%= f.text_field :keywords %>
</div>
<div class="title">
<%= f.label :abstract, t("personal_conference.abstract") %>
<%= f.text_field :abstract %>
</div>
<div class="title">
<%= f.label :language, t("personal_journal.language") %>
<%= f.select :language, WritingConference::LANGUAGE_TYPES, :prompt => 'Select' %>
</div>
<div class="title">
<%= f.label :note, t("personal_conference.note") %>
<%= f.text_area :note, :size => "60x3" %>
</div>
</div>
<div>
<div id='plugin_files' class="plugin_files_block">
<table class="table table-condensed">
<thead>
<tr>
<th>File</th>
<th>File Name</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td style="text-align:center" colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %> <%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a> <a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</div> </p>
</td>
</tr>
</tfoot>
<tbody>
<% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %>
<%= f.fields_for :writing_conference_files, writing_conference_file do |f| %>
<%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
</tbody>
</table>
</div> </div>
</div>
</div> </div>
</div>
<!-- Form Actions -->
<div class="form-actions">
</div>
<!--Post End-->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "archive_plugin_form" %>
<script> <script>
$('#add_plugin_file a.add').live('click', function(){ $(document).ready(function() {
$('.main-forms .add-on').tooltip();
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value'); var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g"); var old_id = new RegExp("new_writing_conference_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1); $(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id)); $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
}); });
formTip();
$('.add_plugin_files_block a.delete').live('click', function(){ });
$(this).parents('.list_item').remove(); $(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
}); });
$('.action a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
}); });
</script> </script>
<% end %> <% end %>

View File

@ -1,50 +1,45 @@
<% # encoding: utf-8 %> <% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'> <% else %>
<td> <div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<div class="control-group"> <% if form_file.file.blank? %>
<div class="controls"> <%= t(:no_file) %>
<%= f.file_field :file %>
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
</div>
</div>
</td>
<td>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>
<%= f.fields_for :file_title_translations do |f| %>
<div class="control-group">
<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
<div class="controls">
<%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
</td>
<td>
<span class="action">
<% if form_file.new_record? %>
<a class="delete"><i class="icon-remove"></i></a>
<% else %> <% else %>
<%= f.hidden_field :id %> <%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<a class="remove_existing_record"><i class="icon-remove"></i></a> <% end %>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> <% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %> <% end %>
</span> </span>
<% end %>
</td> </span>
</tr> </span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -1,9 +1,4 @@
<tr id="<%= dom_id writing_conference %>" class="with_action"> <tr id="<%= dom_id writing_conference %>" class="with_action">
<td>
<% if (writing_conference.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', writing_conference.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td><%= writing_conference.year %></td> <td><%= writing_conference.year %></td>
<td> <td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %> <%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>

View File

@ -8,8 +8,8 @@
</div> </div>
<h1><%= t('personal_conference.editing_personal_conference') %></h1> <%= form_for @writing_conference, url: panel_personal_conference_back_end_writing_conference_path(@writing_conference), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= form_for @writing_conference, :url => panel_personal_conference_back_end_writing_conference_path(@writing_conference), :html => {:class => 'clear'} do |f| %> <%= render partial: 'form', locals: {f: f} %>
<%= render :partial => 'form', :locals => {:f => f} %> </fieldset>
<% end %> <% end %>

View File

@ -13,10 +13,9 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span1"><%= t("personal_book.year") %></th>
<th class="span1"></th> <th class="span7"><%= t("module_name.personal_conference") %></th>
<th class="span1"></th> <th class="span1"><%= t("personal_plugins.author") %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_conferences" class="sort-holder"> <tbody id="tbody_writing_conferences" class="sort-holder">
@ -24,10 +23,12 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_conference_back_end_writing_conference_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_conference_back_end_writing_conference_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_conference_pagination" class="paginationFixed"> </div>
<%= paginate @conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -8,14 +8,8 @@
</div> </div>
<%= flash_messages %> <%= form_for @writing_conference, url: panel_personal_conference_back_end_writing_conferences_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div id="poststuff"> <%= render partial: 'form', locals: {f: f} %>
<h1><%= t('writing_conference.new_personal_conference') %></h1> </fieldset>
<%= form_for @writing_conference, :url => panel_personal_conference_back_end_writing_conferences_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
</div>
<%#= link_back %>

View File

@ -15,7 +15,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_paper_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>論文型態</span> <span><%= t("personal_conference.paper_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
@ -41,7 +41,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_conference_back_end_writing_conference_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>作者型態</span> <span><%= t("personal_conference.author_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">

View File

@ -1,15 +1,24 @@
<% <%
if @member if @member
@writing_conferences = WritingConference.where(:create_user_id => @member.id).desc(:year)
else
@writing_conferences = WritingConference.all.desc(:year)
end
@writing_conferences = WritingConference.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
@writing_conference_intro = !PersonalConferenceIntro.where(:user_id => @member.id).blank? ? PersonalConferenceIntro.where(:user_id => @member.id).first : PersonalConferenceIntro.new
%> %>
<% if !@writing_conferences.blank? %> <% if @writing_conference_intro.brief_intro and !@writing_conference_intro.blank? %>
<table class="table"> <div class="info">
<%= @writing_conference_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@writing_conference_intro.blank? and @writing_conference_intro.complete_list ) or @writing_conference_intro.blank? %>
<% if !@writing_conferences.blank? %>
<table class="table">
<thead> <thead>
<tr> <tr>
<th class="grid1"><%= t('personal_conference.year') %></th> <th class="grid1"><%= t('personal_conference.year') %></th>
@ -32,11 +41,10 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% end %>
<% else %> <% end %>
<%= t('nothing')%>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -17,18 +24,29 @@
end end
if @user if @user && is_admin?
@writing_conferences = WritingConference.where(:create_user_id => @user.id).page(params[:page]).per(10) @writing_conferences = WritingConference.where(:create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
else else
@writing_conferences = WritingConference.all.page(params[:page]).per(10) @writing_conferences = WritingConference.where(is_hidden: false, :create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_conference_back_end_writing_conferences_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_conference_back_end_writing_conferences_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_conference.year') %></th> <th class="span1"><%= t('personal_conference.year') %></th>
<th><%= t('module_name.personal_conference') %></th> <th><%= t('module_name.personal_conference') %></th>
</tr> </tr>
@ -37,7 +55,12 @@
<% @writing_conferences.each do |writing_conference| %> <% @writing_conferences.each do |writing_conference| %>
<tr> <tr class="<%= writing_conference.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', writing_conference.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= writing_conference.year %></td> <td><%= writing_conference.year %></td>
<td> <td>
<%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %> <%= link_to writing_conference.create_link, panel_personal_conference_front_end_writing_conference_path(writing_conference) %>
@ -49,11 +72,25 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_conference_back_end_personal_conference_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_conference_back_end_writing_conference_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @writing_conferences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

View File

@ -1,7 +1,7 @@
en: en:
module_name: module_name:
personal_conference: Conference personal_conference: Conference Paper
personal_conference: personal_conference:
year : "Year" year : "Year"

View File

@ -14,12 +14,14 @@ Rails.application.routes.draw do
resources :writing_conferences do resources :writing_conferences do
collection do collection do
get 'delete' get 'delete'
get 'data_share'
end end
match "author_type_quick_add" => "writing_conferences#author_type_quick_add" ,:as => :author_type_quick_add match "author_type_quick_add" => "writing_conferences#author_type_quick_add" ,:as => :author_type_quick_add
match "author_type_quick_edit" => "writing_conferences#author_type_quick_edit" ,:as => :author_type_quick_edit match "author_type_quick_edit" => "writing_conferences#author_type_quick_edit" ,:as => :author_type_quick_edit
match "paper_type_quick_add" => "writing_conferences#paper_type_quick_add" ,:as => :paper_type_quick_add match "paper_type_quick_add" => "writing_conferences#paper_type_quick_add" ,:as => :paper_type_quick_add
match "paper_type_quick_edit" => "writing_conferences#paper_type_quick_edit" ,:as => :paper_type_quick_edit match "paper_type_quick_edit" => "writing_conferences#paper_type_quick_edit" ,:as => :paper_type_quick_edit
end end
resources :personal_conference_intros
resources :conference_paper_types resources :conference_paper_types
resources :conference_author_types resources :conference_author_types
# resources :conference_level_types # resources :conference_level_types

View File

@ -2,7 +2,7 @@ module PersonalConference
OrbitApp.registration "PersonalConference",:type=> 'ModuleApp' do OrbitApp.registration "PersonalConference",:type=> 'ModuleApp' do
module_label 'module_name.personal_conference' module_label 'module_name.personal_conference'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_conference/plugin/profile",:front_path=>"panel/personal_conference/front_end/profile",:admin_path=>"/panel/personal_conference/back_end/writing_conferences",:i18n=>'module_name.personal_conference' personal_plugin :enable => true, :app_name=>"WritingConference", :intro_app_name=>"PersonalConferenceIntro",:path=>"panel/personal_conference/plugin/profile",:front_path=>"panel/personal_conference/front_end/profile",:admin_path=>"/panel/personal_conference/back_end/writing_conferences",:i18n=>'module_name.personal_conference'

View File

@ -5,36 +5,18 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
before_filter :authenticate_user! before_filter :authenticate_user!
def index def index
get_plugins get_plugins
@filter = params[:filter] # @tags = get_tags
new_filter = params[:new_filter] # @categories = get_categories_for_index
# @statuses = get_statuses
if @filter && params[:clear] # category_ids = @categories.collect{|t| t.id}
@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
@diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma") : get_viewable("diploma")
@diplomas_page = @diplomas.page params[:page]
@tags = get_tags
@diplomas = get_sorted_and_filtered("diploma")
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @diplomas } format.xml { render :xml => @diplomas }
format.js
end end
end end
@ -113,6 +95,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
format.xml { render :xml => @diploma.errors, :status => :unprocessable_entity } format.xml { render :xml => @diploma.errors, :status => :unprocessable_entity }
end end
end end
end end
# PUT /diplomas/1 # PUT /diplomas/1
@ -135,6 +118,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
format.xml { render :xml => @diploma.errors, :status => :unprocessable_entity } format.xml { render :xml => @diploma.errors, :status => :unprocessable_entity }
end end
end end
end end
# DELETE /diplomas/1 # DELETE /diplomas/1
@ -157,6 +141,29 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
redirect_to panel_personal_diploma_back_end_diplomas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_diploma_back_end_diplomas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@diplomas = Diploma.any_in(:_id => params[:ids])
@diplomas.each do |diploma|
diploma.is_hidden = params[:disable]
diploma.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Diploma")) }
end
end
protected protected

View File

@ -0,0 +1,10 @@
class Panel::PersonalDiploma::BackEnd::PersonalDiplomaIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_diploma_intro'
@app_type_name = 'personal_diploma'
@reback_name = 'Diploma'
end
end

View File

@ -0,0 +1,4 @@
class PersonalDiplomaIntro < PersonalPluginIntro
end

View File

@ -1,9 +1,4 @@
<tr id="<%= dom_id diploma %>" class="with_action"> <tr id="<%= dom_id diploma %>" class="with_action">
<td class="span1">
<% if (diploma.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', diploma.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td class="span1"><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td> <td class="span1"><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
<td class="span1"> <td class="span1">
<%= diploma.school_name %> <%= diploma.school_name %>

View File

@ -1,136 +1,210 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<div id="widget-tags" class="widget-box widget-size-300"> <ul class="nav nav-pills module-nav">
<div class="widget-action clear tip" title="Setting"> <li></li>
<a class="action"><i class="icon-cog icon-white"></i></a> <li class="active">
</div> <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3> </li>
<div class="widget-content clear form-horizontal"> <% if show_form_status_field(@diploma) %>
<% @tags.each do |tag| %> <li>
<%= content_tag :label,:class => "checkbox inline" do -%> <a href="#status" data-toggle="tab"><%= t(:status) %></a>
<%= check_box_tag 'diploma[tag_ids][]', tag.id, @diploma.tag_ids.include?(tag.id)%> </li>
<%= tag.name %>
<%= hidden_field_tag 'diploma[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <li>
</div> <a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</div> </li>
</ul>
</div> <!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<!--Wiget End--> <div class="tab-pane fade in active" id="basic">
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %> <% if !params[:user_id].blank? %>
<div class="span6"> <div class="control-group">
<%= t("著作人")%> <label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%> <%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
</div>
<% end %> <% end %>
<div class="title"> <!-- start_date -->
<%= f.label :start_date ,t("personal_diploma.start_date")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_diploma.start_date") %></label>
<div class="controls">
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> <%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %>
</div> </div>
</div>
<div class="title"> <!-- end_date -->
<%= f.label :end_date ,t("personal_diploma.end_date")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_diploma.end_date") %></label>
<div class="controls">
<%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> <%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %>
</div> </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| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :school_name ,t("personal_diploma.school_name")%>
<%= f.fields_for :school_name_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@diploma.school_name_translations[locale] rescue nil) %>
<% end %>
</div> </div>
<div class="title"> <!-- url -->
<%= f.label :country ,t("personal_diploma.country")%> <div class="control-group">
<%= f.fields_for :country_translations do |f| %> <label class="control-label muted"><%= t("personal_diploma.url") %></label>
<%= I18nVariable.from_locale(locale) %> <div class="controls">
<%= f.text_field locale, :class=>'post-title', :value => (@diploma.country_translations[locale] rescue nil) %> <%= f.text_field :url , :class => "span6" %>
<% end %> </div>
</div> </div>
<div class="title"> <!-- keywords -->
<%= f.label :department ,t("personal_diploma.department")%> <div class="control-group">
<%= f.fields_for :department_translations do |f| %> <label class="control-label muted"><%= t("personal_diploma.keywords") %></label>
<%= I18nVariable.from_locale(locale) %> <div class="controls">
<%= f.text_field locale, :class=>'post-title', :value => (@diploma.department_translations[locale] rescue nil) %>
<% end %>
</div>
<div class="title">
<%= f.label :degree ,t("personal_diploma.degree")%>
<%= f.fields_for :degree_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@diploma.degree_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="title">
<%= f.label :url, t("personal_diploma.url") %>
<%= f.text_field :url %>
</div>
<div class="title">
<%= f.label :keywords, t("personal_diploma.keywords") %>
<%= f.text_field :keywords %> <%= f.text_field :keywords %>
</div> </div>
</div>
<div id="title"> <!-- language -->
<%= f.label :language, t("personal_diploma.language") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_diploma.language") %></label>
<div class="controls">
<%= f.radio_button :language, "Chinese" %> <%= t("personal_diploma.Chinese") %> <%= f.radio_button :language, "Chinese" %> <%= t("personal_diploma.Chinese") %>
<%= f.radio_button :language, "English" %> <%= t("personal_diploma.English") %> <%= f.radio_button :language, "English" %> <%= t("personal_diploma.English") %>
</div> </div>
</div>
<div class="title"> <!-- note -->
<%= f.label :note, t("personal_diploma.note") %> <div class="control-group">
<%= f.text_area :note, :size => "60x3" %> <label class="control-label muted"><%= t("personal_diploma.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div> </div>
</div> </div>
<!-- Status Module -->
<% if show_form_status_field(@diploma) %>
<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 @diploma.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @diploma.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'diploma[tag_ids][]', tag.id, @diploma.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'diploma[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div> </div>
<!--Post End--> </div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<div class="form-actions"> <!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- school_name-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_diploma.school_name") %></label>
<div class="controls">
<%= f.fields_for :school_name_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_diploma.school_name"), value: (@diploma.school_name_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- country-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_diploma.country") %></label>
<div class="controls">
<%= f.fields_for :country_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_diploma.country"), value: (@diploma.country_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- department-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_diploma.department") %></label>
<div class="controls">
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_diploma.department"), value: (@diploma.department_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- degree-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_diploma.degree") %></label>
<div class="controls">
<%= f.fields_for :degree_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_diploma.degree"), value: (@diploma.degree_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -1,12 +1,15 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %> <%= render :partial => 'admin/plugins/plugin_list' %>
<h1><%= t('personal_diploma.editing_personal_diploma') %></h1> </div>
<%= form_for @diploma, :url => panel_personal_diploma_back_end_diploma_path(@diploma), :html => {:class => 'clear'} do |f| %> <%= form_for @diploma, url: panel_personal_diploma_back_end_diploma_path(@diploma), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %> <% end %>

View File

@ -13,10 +13,9 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span2"><%= t('date_') %></th>
<th class="span1"></th> <th class="span5"><%= t('personal_diploma.school_name') %></th>
<th class="span1"></th> <th class="span1"><%= t("personal_plugins.author") %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_diplomas" class="sort-holder"> <tbody id="tbody_diplomas" class="sort-holder">
@ -24,10 +23,12 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_diploma_back_end_diploma_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_diploma_back_end_diploma_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path, :class => 'btn btn-primary pull-right' %>
<div id="diploma_pagination" class="paginationFixed"> </div>
<%= paginate @diplomas_page, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -1,18 +1,15 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:user), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<div class="subnav">
<%= render :partial => 'admin/plugins/plugin_list' %> <%= render :partial => 'admin/plugins/plugin_list' %>
<%= flash_messages %>
<div id="poststuff">
<h1><%= t('diploma.new_personal_diploma') %></h1>
<%= form_for @diploma, :url => panel_personal_diploma_back_end_diplomas_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
</div> </div>
<%#= link_back %> <%= form_for @diploma, url: panel_personal_diploma_back_end_diplomas_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= render partial: 'form', locals: {f: f} %>
</fieldset>
<% end %>

View File

@ -1,14 +1,24 @@
<% <%
if @member if @member
@diplomas = Diploma.where(:create_user_id => @member.id).desc(:start_date)
else @diplomas = Diploma.where(is_hidden: false, :create_user_id => @member.id).desc(:start_date)
@diplomas = Diploma.all.desc(:start_date)
end @diploma_intro = !PersonalDiplomaIntro.where(:user_id => @member.id).blank? ? PersonalDiplomaIntro.where(:user_id => @member.id).first : PersonalDiplomaIntro.new
%> %>
<% if !@diplomas.blank? %> <% if @diploma_intro.brief_intro and !@diploma_intro.blank? %>
<table class="table"> <div class="info">
<%= @diploma_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@diploma_intro.blank? and @diploma_intro.complete_list ) or @diploma_intro.blank? %>
<% if !@diplomas.blank? %>
<table class="table">
<thead> <thead>
<tr> <tr>
<th class="grid3"><%= t('date_') %></th> <th class="grid3"><%= t('date_') %></th>
@ -29,10 +39,10 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% end %>
<%= t('nothing')%> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -17,17 +24,29 @@
end end
if @user if @user && is_admin?
@diplomas = Diploma.where(:create_user_id => @user.id).page(params[:page]).per(10) @diplomas = Diploma.where(:create_user_id => @user.id).desc(:start_date).page(params[:page]).per(10)
else else
@diplomas = Diploma.all.page(params[:page]).per(10) @diplomas = Diploma.where(is_hidden: false, :create_user_id => @user.id).desc(:start_date).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_diploma_back_end_diplomas_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_diploma_back_end_diplomas_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('date_') %></th> <th class="span2"><%= t('date_') %></th>
<th><%= t('personal_diploma.school_name') %></th> <th><%= t('personal_diploma.school_name') %></th>
</tr> </tr>
@ -36,7 +55,12 @@
<% @diplomas.each do |diploma| %> <% @diplomas.each do |diploma| %>
<tr> <tr class="<%= diploma.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', diploma.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td> <td><%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %> <%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %>
@ -48,11 +72,25 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_diploma_back_end_personal_diploma_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_diploma_back_end_diploma_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @diplomas, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

View File

@ -13,9 +13,11 @@ Rails.application.routes.draw do
resources :diplomas do resources :diplomas do
collection do collection do
get 'delete' get 'delete'
get 'data_share'
end end
end end
resources :personal_diploma_intros
resources :tags resources :tags
end end
namespace :front_end do namespace :front_end do

View File

@ -2,7 +2,7 @@ module PersonalDiploma
OrbitApp.registration "PersonalDiploma",:type=> 'ModuleApp' do OrbitApp.registration "PersonalDiploma",:type=> 'ModuleApp' do
module_label 'module_name.personal_diploma' module_label 'module_name.personal_diploma'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_diploma/plugin/profile",:front_path=>"panel/personal_diploma/front_end/profile",:admin_path=>"/panel/personal_diploma/back_end/diplomas",:i18n=>'module_name.personal_diploma' personal_plugin :enable => true, :app_name=>"Diploma", :intro_app_name=>"PersonalDiplomaIntro",:path=>"panel/personal_diploma/plugin/profile",:front_path=>"panel/personal_diploma/front_end/profile",:admin_path=>"/panel/personal_diploma/back_end/diplomas",:i18n=>'module_name.personal_diploma'

View File

@ -10,40 +10,19 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
end end
def index def index
get_plugins get_plugins
get_categorys("ExperienceCategory",params[:experience_category_ids]) # @tags = get_tags
@filter = params[:filter] # @categories = get_categories_for_index
new_filter = params[:new_filter] # @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
if @filter && params[:clear] @experience_category_ids = ExperienceCategory.all.collect{|t| t.id.to_s} + [nil]
@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
@experience_categorys = get_categories_for_index("ExperienceCategory")
@experience_category_ids = @experience_categorys.collect{|t| t.id.to_s} + [nil]
@experiences = (params[:sort] || @filter) ? get_sorted_and_filtered("experience",:experience_category_id.in => @experience_category_ids) : get_viewable("experience",:experience_category_id.in => @experience_category_ids)
@experience_pages = @experiences.page params[:page]
@tags = get_tags
@experiences = get_sorted_and_filtered("experience", :experience_category_id.in => @experience_category_ids)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @experiences } format.xml { render :xml => @experiences }
format.js
end end
end end
@ -154,7 +133,7 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
if @experience.save if @experience.save
if params[:experience][:user_id] if params[:experience][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:experience][:user_id],:show_plugin_profile=>'Experience')) } format.html { redirect_to(admin_users_new_interface_url(:id=>params[:experience][:user_id],:show_plugin_profile=>"Experience")) }
else else
format.html { redirect_to(panel_personal_experience_back_end_experiences_url) } format.html { redirect_to(panel_personal_experience_back_end_experiences_url) }
end end
@ -203,6 +182,7 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
format.xml { render :xml => @experience.errors, :status => :unprocessable_entity } format.xml { render :xml => @experience.errors, :status => :unprocessable_entity }
end end
end end
end end
end end
@ -227,6 +207,29 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
redirect_to panel_personal_experience_back_end_experiences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_experience_back_end_experiences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@experiences = Experience.any_in(:_id => params[:ids])
@experiences.each do |experience|
experience.is_hidden = params[:disable]
experience.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Experience")) }
end
end
protected protected

View File

@ -0,0 +1,10 @@
class Panel::PersonalExperience::BackEnd::PersonalExperienceIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_experience_intro'
@app_type_name = 'personal_experience'
@reback_name = 'Experience'
end
end

View File

@ -0,0 +1,4 @@
class PersonalExperienceIntro < PersonalPluginIntro
end

View File

@ -1,9 +1,4 @@
<tr id="<%= dom_id experience %>" class="with_action"> <tr id="<%= dom_id experience %>" class="with_action">
<td class="span1">
<% if (experience.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', experience.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td class="span1"><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td> <td class="span1"><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td>
<td class="span1"> <td class="span1">
<%= experience.organizationt_title %> <%= experience.organizationt_title %>

View File

@ -1,133 +1,208 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<div id="widget-tags" class="widget-box widget-size-300"> <ul class="nav nav-pills module-nav">
<div class="widget-action clear tip" title="Setting"> <li></li>
<a class="action"><i class="icon-cog icon-white"></i></a> <li class="active">
</div> <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3> </li>
<div class="widget-content clear form-horizontal"> <% if show_form_status_field(@experience) %>
<% @tags.each do |tag| %> <li>
<%= content_tag :label,:class => "checkbox inline" do -%> <a href="#status" data-toggle="tab"><%= t(:status) %></a>
<%= check_box_tag 'experience[tag_ids][]', tag.id, @experience.tag_ids.include?(tag.id)%> </li>
<%= tag.name %>
<%= hidden_field_tag 'experience[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <li>
</div> <a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</div> </li>
</ul>
</div> <!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<!--Wiget End--> <div class="tab-pane fade in active" id="basic">
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %> <% if !params[:user_id].blank? %>
<div class="span6"> <div class="control-group">
<%= t("著作人")%> <label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%> <%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
</div>
<% end %> <% end %>
<div class="title"> <!-- experience_category -->
<%= f.label :experience_category ,t("personal_experience.experience_category")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_experience.experience_category") %></label>
<div class="controls">
<%= f.select :experience_category_id, @experience_categorys.collect {|t| [ t.title, t.id ]} %> <%= f.select :experience_category_id, @experience_categorys.collect {|t| [ t.title, t.id ]} %>
</div> </div>
</div>
<div class="title"> <!-- start_date -->
<%= f.label :start_date ,t("personal_experience.start_date")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_experience.start_date") %></label>
<div class="controls">
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> <%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %>
</div> </div>
</div>
<div class="title"> <!-- end_date -->
<%= f.label :end_date ,t("personal_experience.end_date")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_experience.end_date") %></label>
<div class="controls">
<%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %> <%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1890, :order => [:year, :month], :discard_day => true }, {:class => 'span1'} %>
</div> </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| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<div class="title">
<%= f.label :organizationt_title ,t("personal_experience.organizationt_title")%>
<%= f.fields_for :organizationt_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'post-title', :value => (@experience.organizationt_title_translations[locale] rescue nil) %>
<% end %>
</div> </div>
<div class="title"> <!-- url -->
<%= f.label :department ,t("personal_experience.department")%> <div class="control-group">
<%= f.fields_for :department_translations do |f| %> <label class="control-label muted"><%= t("personal_experience.url") %></label>
<%= I18nVariable.from_locale(locale) %> <div class="controls">
<%= f.text_field locale, :class=>'post-title', :value => (@experience.department_translations[locale] rescue nil) %> <%= f.text_field :url , :class => "span6" %>
<% end %> </div>
</div> </div>
<div class="title"> <!-- keywords -->
<%= f.label :job_title ,t("personal_experience.job_title")%> <div class="control-group">
<%= f.fields_for :job_title_translations do |f| %> <label class="control-label muted"><%= t("personal_experience.keywords") %></label>
<%= I18nVariable.from_locale(locale) %> <div class="controls">
<%= f.text_field locale, :class=>'post-title', :value => (@experience.job_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="title">
<%= f.label :url, t("personal_experience.url") %>
<%= f.text_field :url %>
</div>
<div class="title">
<%= f.label :keywords, t("personal_experience.keywords") %>
<%= f.text_field :keywords %> <%= f.text_field :keywords %>
</div> </div>
</div>
<div id="title"> <!-- language -->
<%= f.label :language, t("personal_experience.language") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_experience.language") %></label>
<div class="controls">
<%= f.radio_button :language, "Chinese" %> <%= t("personal_experience.Chinese") %> <%= f.radio_button :language, "Chinese" %> <%= t("personal_experience.Chinese") %>
<%= f.radio_button :language, "English" %> <%= t("personal_experience.English") %> <%= f.radio_button :language, "English" %> <%= t("personal_experience.English") %>
</div> </div>
</div>
<div class="title"> <!-- note -->
<%= f.label :note, t("personal_experience.note") %> <div class="control-group">
<%= f.text_area :note, :size => "60x3" %> <label class="control-label muted"><%= t("personal_experience.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div> </div>
</div> </div>
<!-- Status Module -->
<% if show_form_status_field(@experience) %>
<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 @experience.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @experience.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'experience[tag_ids][]', tag.id, @experience.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'experience[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div> </div>
<!--Post End--> </div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
</li>
<% end %>
</ul>
<div class="form-actions"> <!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- organizationt_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_experience.organizationt_title") %></label>
<div class="controls">
<%= f.fields_for :organizationt_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.organizationt_title"), value: (@experience.school_name_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- department-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_experience.department") %></label>
<div class="controls">
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.department"), value: (@experience.department_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- job_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_experience.job_title") %></label>
<div class="controls">
<%= f.fields_for :job_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.job_title"), value: (@experience.job_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -8,8 +8,8 @@
</div> </div>
<h1><%= t('personal_experience.editing_personal_experience') %></h1> <%= form_for @experience, url: panel_personal_experience_back_end_experience_path(@experience), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= form_for @experience, :url => panel_personal_experience_back_end_experience_path(@experience), :html => {:class => 'clear'} do |f| %> <%= render partial: 'form', locals: {f: f} %>
<%= render :partial => 'form', :locals => {:f => f} %> </fieldset>
<% end %> <% end %>

View File

@ -15,7 +15,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_experience_back_end_experience_experience_category_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_experience_back_end_experience_experience_category_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>機關類別</span> <span><%= t("personal_experience.experience_category") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">

View File

@ -13,12 +13,11 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span2"><%= t('date_') %></th>
<th class="span1"></th> <th class="span2"><%= t('personal_experience.organizationt_title') %></th>
<th class="span1"></th> <th class="span2"><%= t('personal_experience.department') %></th>
<th class="span1"></th> <th class="span2"><%= t('personal_experience.job_title') %></th>
<th class="span1"></th> <th class="span1"><%= t("personal_plugins.author") %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_experiences" class="sort-holder"> <tbody id="tbody_experiences" class="sort-holder">
@ -26,10 +25,12 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_experience_back_end_experience_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_experience_back_end_experience_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path, :class => 'btn btn-primary pull-right' %>
<div id="experience_pagination" class="paginationFixed"> </div>
<%= paginate @experience_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -8,14 +8,8 @@
</div> </div>
<%= flash_messages %> <%= form_for @experience, url: panel_personal_experience_back_end_experiences_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div id="poststuff"> <%= render partial: 'form', locals: {f: f} %>
<h1><%= t('experience.new_personal_experience') %></h1> </fieldset>
<%= form_for @experience, :url => panel_personal_experience_back_end_experiences_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
</div>
<%#= link_back %>

View File

@ -1,14 +1,24 @@
<% <%
if @member if @member
@experiences = Experience.where(:create_user_id => @member.id).desc(:start_date)
else @experiences = Experience.where(is_hidden: false, :create_user_id => @member.id).desc(:start_date)
@experiences = Experience.all.desc(:start_date)
end @experience_intro = !PersonalExperienceIntro.where(:user_id => @member.id).blank? ? PersonalExperienceIntro.where(:user_id => @member.id).first : PersonalExperienceIntro.new
%> %>
<% if !@experiences.blank? %> <% if @experience_intro.brief_intro and !@experience_intro.blank? %>
<table class="table"> <div class="info">
<%= @experience_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@experience_intro.blank? and @experience_intro.complete_list ) or @experience_intro.blank? %>
<% if !@experiences.blank? %>
<table class="table">
<thead> <thead>
<tr> <tr>
<th class="grid3"><%= t('date_') %></th> <th class="grid3"><%= t('date_') %></th>
@ -29,10 +39,10 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% end %>
<%= t('nothing')%> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -17,18 +24,29 @@
end end
if @user if @user && is_admin?
@experiences = Experience.where(:create_user_id => @user.id).page(params[:page]).per(10) @experiences = Experience.where(:create_user_id => @user.id).desc(:start_date).page(params[:page]).per(10)
else else
@experiences = Experience.all.page(params[:page]).per(10) @experiences = Experience.where(is_hidden: false, :create_user_id => @user.id).desc(:start_date).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_experience_back_end_experiences_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_experience_back_end_experiences_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span2"><%= t('date_') %></th> <th class="span2"><%= t('date_') %></th>
<th><%= t('personal_experience.organizationt_title') %></th> <th><%= t('personal_experience.organizationt_title') %></th>
</tr> </tr>
@ -37,7 +55,12 @@
<% @experiences.each do |experience| %> <% @experiences.each do |experience| %>
<tr> <tr class="<%= experience.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', experience.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td> <td><%= experience.start_date.strftime("%Y.%m") %> ~ <%= experience.end_date.strftime("%Y.%m") %></td>
<td> <td>
<%= link_to experience.organizationt_title, panel_personal_experience_front_end_experience_path(experience) %> <%= link_to experience.organizationt_title, panel_personal_experience_front_end_experience_path(experience) %>
@ -49,10 +72,24 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_experience_back_end_personal_experience_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_experience_back_end_experience_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> </div> <%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

View File

@ -13,11 +13,13 @@ Rails.application.routes.draw do
resources :experiences do resources :experiences do
collection do collection do
get 'delete' get 'delete'
get 'data_share'
end end
match "experience_category_quick_add" => "experiences#experience_category_quick_add" ,:as => :experience_category_quick_add match "experience_category_quick_add" => "experiences#experience_category_quick_add" ,:as => :experience_category_quick_add
match "experience_category_quick_edit" => "experiences#experience_category_quick_edit" ,:as => :experience_category_quick_edit match "experience_category_quick_edit" => "experiences#experience_category_quick_edit" ,:as => :experience_category_quick_edit
end end
resources :personal_experience_intros
resources :experience_categorys resources :experience_categorys
resources :tags resources :tags
end end

View File

@ -2,7 +2,7 @@ module PersonalExperience
OrbitApp.registration "PersonalExperience",:type=> 'ModuleApp' do OrbitApp.registration "PersonalExperience",:type=> 'ModuleApp' do
module_label 'module_name.personal_experience' module_label 'module_name.personal_experience'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_experience/plugin/profile",:front_path=>"panel/personal_experience/front_end/profile",:admin_path=>"/panel/personal_experience/back_end/experiences",:i18n=>'module_name.personal_experience' personal_plugin :enable => true, :app_name=>"Experience", :intro_app_name=>"PersonalExperienceIntro",:path=>"panel/personal_experience/plugin/profile",:front_path=>"panel/personal_experience/front_end/profile",:admin_path=>"/panel/personal_experience/back_end/experiences",:i18n=>'module_name.personal_experience'

View File

@ -9,40 +9,19 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
end end
def index def index
get_plugins get_plugins
get_categorys("HonorCategory",params[:honor_category_ids]) # @tags = get_tags
@filter = params[:filter] # @categories = get_categories_for_index
new_filter = params[:new_filter] # @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
if @filter && params[:clear] @honor_category_ids = HonorCategory.all.collect{|t| t.id.to_s} + [nil]
@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
@honor_categorys = get_categories_for_index("HonorCategory")
@honor_category_ids = @honor_categorys.collect{|t| t.id.to_s} + [nil]
@honors = (params[:sort] || @filter) ? get_sorted_and_filtered("honor",:honor_category_id.in => @honor_category_ids) : get_viewable("honor",:honor_category_id.in => @honor_category_ids)
@honor_pages = @honors.page params[:page]
@tags = get_tags
@honors = get_sorted_and_filtered("honor", :honor_category_id.in => @honor_category_ids)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @honors } format.xml { render :xml => @honors }
format.js
end end
end end
@ -156,7 +135,7 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
if @honor.save if @honor.save
if params[:honor][:user_id] if params[:honor][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:honor][:user_id],:show_plugin_profile=>'Honor')) } format.html { redirect_to(admin_users_new_interface_url(:id=>params[:honor][:user_id],:show_plugin_profile=>"Honor")) }
else else
format.html { redirect_to(panel_personal_honor_back_end_honors_url) } format.html { redirect_to(panel_personal_honor_back_end_honors_url) }
end end
@ -229,6 +208,29 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
redirect_to panel_personal_honor_back_end_honors_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_honor_back_end_honors_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@honors = Honor.any_in(:_id => params[:ids])
@honors.each do |honor|
honor.is_hidden = params[:disable]
honor.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"Honor")) }
end
end
protected protected

View File

@ -0,0 +1,10 @@
class Panel::PersonalHonor::BackEnd::PersonalHonorIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_honor_intro'
@app_type_name = 'personal_honor'
@reback_name = 'Honor'
end
end

View File

@ -0,0 +1,4 @@
class PersonalHonorIntro < PersonalPluginIntro
end

View File

@ -1,97 +1,163 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<div id="widget-tags" class="widget-box widget-size-300"> <ul class="nav nav-pills module-nav">
<div class="widget-action clear tip" title="Setting"> <li></li>
<a class="action"><i class="icon-cog icon-white"></i></a> <li class="active">
</div> <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3> </li>
<div class="widget-content clear form-horizontal"> <% if show_form_status_field(@honor) %>
<% @tags.each do |tag| %> <li>
<%= content_tag :label,:class => "checkbox inline" do -%> <a href="#status" data-toggle="tab"><%= t(:status) %></a>
<%= check_box_tag 'honor[tag_ids][]', tag.id, @honor.tag_ids.include?(tag.id)%> </li>
<%= tag.name %>
<%= hidden_field_tag 'honor[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <li>
</div> <a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</div> </li>
</ul>
</div> <!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<!--Wiget End--> <div class="tab-pane fade in active" id="basic">
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %> <% if !params[:user_id].blank? %>
<div class="span6"> <div class="control-group">
<%= t("著作人")%> <label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%> <%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
</div>
<% end %> <% end %>
<div class="title"> <!-- personal_honor -->
<%= f.label :year ,t("personal_honor.year")%> <div class="control-group">
<%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]'} ) %> <label class="control-label muted"><%= t("personal_honor.year") %></label>
<div class="controls">
<%= select_year((@honor.year ? @honor.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'honor[year]', :class => "span1"} ) %>
</div>
</div> </div>
<div class="title"> <!-- honor_category -->
<%= f.label :honor_category ,t("personal_honor.honor_category")%> <div class="control-group">
<label class="control-label muted"><%= t("personal_honor.honor_category") %></label>
<div class="controls">
<%= f.select :honor_category_id, @honor_categorys.collect {|t| [ t.title, t.id ]} %> <%= f.select :honor_category_id, @honor_categorys.collect {|t| [ t.title, t.id ]} %>
</div> </div>
</div>
<div class="title"> <!-- award_name -->
<%= f.label :award_name, t("personal_honor.award_name") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_honor.award_name") %></label>
<div class="controls">
<%= f.text_field :award_name %> <%= f.text_field :award_name %>
</div> </div>
</div>
<div class="title"> <!-- awarding_unit -->
<%= f.label :awarding_unit, t("personal_honor.awarding_unit") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_honor.awarding_unit") %></label>
<div class="controls">
<%= f.text_field :awarding_unit %> <%= f.text_field :awarding_unit %>
</div> </div>
<div class="title">
<%= f.label :url, t("personal_honor.url") %>
<%= f.text_field :url %>
</div> </div>
<div class="title"> <!-- url -->
<%= f.label :keywords, t("personal_honor.keywords") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_honor.url") %></label>
<div class="controls">
<%= f.text_field :url , :class => "span6" %>
</div>
</div>
<!-- keywords -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_honor.keywords") %></label>
<div class="controls">
<%= f.text_field :keywords %> <%= f.text_field :keywords %>
</div> </div>
</div>
<div id="title"> <!-- language -->
<%= f.label :language, t("personal_honor.language") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_honor.language") %></label>
<div class="controls">
<%= f.radio_button :language, "Chinese" %> <%= t("personal_honor.Chinese") %> <%= f.radio_button :language, "Chinese" %> <%= t("personal_honor.Chinese") %>
<%= f.radio_button :language, "English" %> <%= t("personal_honor.English") %> <%= f.radio_button :language, "English" %> <%= t("personal_honor.English") %>
</div> </div>
</div>
<div class="title"> <!-- note -->
<%= f.label :note, t("personal_honor.note") %> <div class="control-group">
<%= f.text_area :note, :size => "60x3" %> <label class="control-label muted"><%= t("personal_honor.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div> </div>
</div> </div>
<!-- Status Module -->
<% if show_form_status_field(@honor) %>
<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 @honor.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @honor.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'honor[tag_ids][]', tag.id, @honor.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'honor[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div> </div>
<!--Post End--> </div>
</div>
<div class="form-actions"> <!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>

View File

@ -1,9 +1,4 @@
<tr id="<%= dom_id honor %>" class="with_action"> <tr id="<%= dom_id honor %>" class="with_action">
<td class="span1">
<% if (honor.create_user_id == current_user.id) || is_manager? %>
<%= check_box_tag 'to_delete[]', honor.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td class="span1"><%= honor.year %></td> <td class="span1"><%= honor.year %></td>
<td class="span1"> <td class="span1">
<%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %> <%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %>

View File

@ -8,8 +8,8 @@
</div> </div>
<h1><%= t('personal_honor.editing_personal_honor') %></h1> <%= form_for @honor, url: panel_personal_honor_back_end_honor_path(@honor), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= form_for @honor, :url => panel_personal_honor_back_end_honor_path(@honor), :html => {:class => 'clear'} do |f| %> <%= render partial: 'form', locals: {f: f} %>
<%= render :partial => 'form', :locals => {:f => f} %> </fieldset>
<% end %> <% end %>

View File

@ -15,7 +15,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_honor_back_end_honor_honor_category_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_honor_back_end_honor_honor_category_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>類別</span> <span><%= t("personal_honor.honor_category") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">

View File

@ -13,11 +13,10 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span1"><%= t('personal_honor.year') %></th>
<th class="span1"></th> <th class="span3"><%= t('personal_honor.award_name') %></th>
<th class="span1"></th> <th class="span2"><%= t('personal_honor.awarding_unit') %></th>
<th class="span1"></th> <th class="span1"><%= t("personal_plugins.author") %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_honors" class="sort-holder"> <tbody id="tbody_honors" class="sort-holder">
@ -25,9 +24,12 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_honor_back_end_honor_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path, :class => 'btn btn-primary pull-right' %>
<div id="honor_pagination" class="paginationFixed"> </div>
<%= paginate @honor_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -8,14 +8,8 @@
</div> </div>
<%= flash_messages %> <%= form_for @honor, url: panel_personal_honor_back_end_honors_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div id="poststuff"> <%= render partial: 'form', locals: {f: f} %>
<h1><%= t('honor.new_personal_honor') %></h1> </fieldset>
<%= form_for @honor, :url => panel_personal_honor_back_end_honors_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
</div>
<%#= link_back %>

View File

@ -1,14 +1,24 @@
<% <%
if @member if @member
@honors = Honor.where(:create_user_id => @member.id).desc(:year)
else @honors = Honor.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
@honors = Honor.all.desc(:year)
end @honor_intro = !PersonalHonorIntro.where(:user_id => @member.id).blank? ? PersonalHonorIntro.where(:user_id => @member.id).first : PersonalHonorIntro.new
%> %>
<% if !@honors.blank? %> <% if @honor_intro.brief_intro and !@honor_intro.blank? %>
<table class="table"> <div class="info">
<%= @honor_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@honor_intro.blank? and @honor_intro.complete_list ) or @honor_intro.blank? %>
<% if !@honors.blank? %>
<table class="table">
<thead> <thead>
<tr> <tr>
<th class="grid1"><%= t('personal_honor.year') %></th> <th class="grid1"><%= t('personal_honor.year') %></th>
@ -29,10 +39,11 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %> <% end %>
<%= t('nothing')%> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -17,18 +24,29 @@
end end
if @user if @user && is_admin?
@honors = Honor.where(:create_user_id => @user.id).page(params[:page]).per(10) @honors = Honor.where(:create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
else else
@honors = Honor.all.page(params[:page]).per(10) @honors = Honor.where(is_hidden: false, :create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_honor_back_end_honors_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_honor_back_end_honors_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_honor.year') %></th> <th class="span1"><%= t('personal_honor.year') %></th>
<th><%= t('personal_honor.award_name') %></th> <th><%= t('personal_honor.award_name') %></th>
</tr> </tr>
@ -37,7 +55,12 @@
<% @honors.each do |honor| %> <% @honors.each do |honor| %>
<tr> <tr class="<%= honor.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', honor.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= honor.year %></td> <td><%= honor.year %></td>
<td> <td>
<%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %> <%= link_to honor.award_name, panel_personal_honor_front_end_honor_path(honor) %>
@ -49,11 +72,25 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_honor_back_end_personal_honor_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_honor_back_end_honor_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @honors, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

View File

@ -14,11 +14,13 @@ Rails.application.routes.draw do
resources :honors do resources :honors do
collection do collection do
get 'delete' get 'delete'
get 'data_share'
end end
match "honor_category_quick_add" => "honors#honor_category_quick_add" ,:as => :honor_category_quick_add match "honor_category_quick_add" => "honors#honor_category_quick_add" ,:as => :honor_category_quick_add
match "honor_category_quick_edit" => "honors#honor_category_quick_edit" ,:as => :honor_category_quick_edit match "honor_category_quick_edit" => "honors#honor_category_quick_edit" ,:as => :honor_category_quick_edit
end end
resources :personal_honor_intros
resources :honor_categorys resources :honor_categorys
resources :tags resources :tags
end end

View File

@ -2,7 +2,7 @@ module PersonalHonor
OrbitApp.registration "PersonalHonor",:type=> 'ModuleApp' do OrbitApp.registration "PersonalHonor",:type=> 'ModuleApp' do
module_label 'module_name.personal_honor' module_label 'module_name.personal_honor'
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
personal_plugin :enable => true,:path=>"panel/personal_honor/plugin/profile",:front_path=>"panel/personal_honor/front_end/profile",:admin_path=>"/panel/personal_honor/back_end/honors",:i18n=>'module_name.personal_honor' personal_plugin :enable => true, :app_name=>"Honor", :intro_app_name=>"PersonalHonorIntro",:path=>"panel/personal_honor/plugin/profile",:front_path=>"panel/personal_honor/front_end/profile",:admin_path=>"/panel/personal_honor/back_end/honors",:i18n=>'module_name.personal_honor'

View File

@ -0,0 +1,10 @@
class Panel::PersonalJournal::BackEnd::PersonalJournalIntrosController < Admin::PersonalPluginIntrosController
def initialize
super
@app_type = 'personal_journal_intro'
@app_type_name = 'personal_journal'
@reback_name = 'WritingJournal'
end
end

View File

@ -9,43 +9,19 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
end end
def index def index
get_plugins get_plugins
get_categorys("JournalPaperType",params[:journal_paper_type_id]) # @tags = get_tags
@filter = params[:filter] # @categories = get_categories_for_index
new_filter = params[:new_filter] # @statuses = get_statuses
# category_ids = @categories.collect{|t| t.id}
if @filter && params[:clear] @paper_type_ids = JournalPaperType.all.collect{|t| t.id.to_s} + [nil]
@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
@paper_types = JournalPaperType.all
@paper_type_ids = @paper_types.collect{|t| t.id.to_s} + [nil]
@level_types = JournalLevelType.all
# @writing_journals = WritingJournal.search(params[:category_id])
#@writing_journals = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_journals : WritingJournal.all.page(params[:page]).per(10)
@writing_journals = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_journal",:journal_paper_type_id.in => @paper_type_ids) : get_viewable("writing_journal",:journal_paper_type_id.in => @paper_type_ids)
@writing_journal_pages = @writing_journals.page params[:page]
@tags = get_tags
@writing_journals = get_sorted_and_filtered("writing_journal", :journal_paper_type_id.in => @paper_type_ids)
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.js { }
format.xml { render :xml => @writing_journals } format.xml { render :xml => @writing_journals }
format.js
end end
end end
@ -235,7 +211,7 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
if @writing_journal.save if @writing_journal.save
if params[:writing_journal][:user_id] if params[:writing_journal][:user_id]
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_journal][:user_id],:show_plugin_profile=>'Journal')) } format.html { redirect_to(admin_users_new_interface_url(:id=>params[:writing_journal][:user_id],:show_plugin_profile=>"WritingJournal")) }
else else
format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) } format.html { redirect_to(panel_personal_journal_back_end_writing_journals_url) }
end end
@ -293,7 +269,6 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
else else
@writing_journal = WritingJournal.find(params[:id]) @writing_journal = WritingJournal.find(params[:id])
@writing_journal.update_user_id = current_user.id @writing_journal.update_user_id = current_user.id
@ -334,6 +309,29 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
redirect_to panel_personal_journal_back_end_writing_journals_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_personal_journal_back_end_writing_journals_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
def data_share
if params[:ids]
@writing_journals = WritingJournal.any_in(:_id => params[:ids])
@writing_journals.each do |writing_journal|
writing_journal.is_hidden = params[:disable]
writing_journal.save
end
end
respond_to do |format|
format.html { redirect_to(admin_users_new_interface_url(:id=>params[:user_id],:show_plugin_profile=>"WritingJournal")) }
end
end
protected protected

View File

@ -0,0 +1,4 @@
class PersonalJournalIntro < PersonalPluginIntro
end

View File

@ -1,295 +1,345 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<%= f.error_messages %> <%= f.error_messages %>
<!--Widget start--> <!-- Input Area -->
<div class="input-area">
<div id="sub-wiget"> <!-- Module Tabs -->
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<div class="widget-box widget-size-300" id="widget-intro"> <ul class="nav nav-pills module-nav">
<div class="widget-action clear tip" title="Setting"> <li></li>
<a class="action"><i class="icon-cog icon-white"></i></a> <li class="active">
</div> <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
<h3 class="widget-title"><i class="icon-book"></i><%= f.label :abstract, t("personal_journal.abstract") %></h3> </li>
<div class="widget-content clear form-horizontal"> <% if show_form_status_field(@writing_journal) %>
<%= f.text_area :abstract, :size => "60x3" %> <li>
</div> <a href="#status" data-toggle="tab"><%= t(:status) %></a>
</div> </li>
<div class="widget-box widget-size-300" id="widget-intro">
<div class="widget-action clear tip" title="Setting">
<a class="action"><i class="icon-cog icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icon-book"></i><%= f.label :abstract, t("personal_journal.note") %></h3>
<div class="widget-content clear form-horizontal">
<%= f.text_area :note, :size => "60x3" %>
</div>
</div>
<div id="widget-tags" class="widget-box widget-size-300">
<div class="widget-action clear tip" title="Setting">
<a class="action"><i class="icon-cog icon-white"></i></a>
</div>
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3>
<div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_journal[tag_ids][]', tag.id, @writing_journal.tag_ids.include?(tag.id)%>
<%= tag.name %>
<%= hidden_field_tag 'writing_journal[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <li>
</div> <a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</div> </li>
</ul>
</div> <!-- Module -->
<div class="tab-content module-area">
<!-- Basic Module -->
<!--Wiget End--> <div class="tab-pane fade in active" id="basic">
<!--Post Start-->
<div id="post-body">
<div id="post-body-content" class="clear">
<% if !params[:user_id].blank? %> <% if !params[:user_id].blank? %>
<div class="span6"> <div class="control-group">
<%= t("著作人")%> <label class="control-label muted"><%= t("personal_plugins.author") %></label>
<div class="controls">
<%= User.from_id(params[:user_id]).name rescue ''%> <%= User.from_id(params[:user_id]).name rescue ''%>
</div> </div>
<% end %>
<div class="span6">
<%= f.label :year ,t("personal_journal.year")%>
<%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "span6"} ) %>
</div>
<div class="span6">
<%= f.label :language, t("personal_journal.language") %>
<%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select', :class => "span6" %>
</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| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%= f.label :paper_title ,t("personal_journal.paper_title")%>
<%= f.fields_for :paper_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'span12', :value => (@writing_journal.paper_title_translations[locale] rescue nil) %>
<% end %>
<br>
<%= f.label :journal_title ,t("personal_journal.journal_title")%>
<%= f.fields_for :journal_title_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'span12', :value => (@writing_journal.journal_title_translations[locale] rescue nil) %>
<% end %>
<br>
</div> </div>
<% end %> <% end %>
<%= f.label :level_type ,t("personal_journal.level_type")%> <!-- year -->
<div class="form-inline"> <div class="control-group">
<ul class="nav nav-pills"> <label class="control-label muted"><%= t("personal_journal.year") %></label>
<% @level_types.each_with_index do |level_type, i| %> <div class="controls">
<li class="pull-left"> <%= select_year((@writing_journal.year ? @writing_journal.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_journal[year]', :class => "span1"} ) %>
<%= check_box_tag 'writing_journal[journal_level_type_ids][]', level_type.id, @writing_journal.journal_level_type_ids.include?(level_type.id), :id => "field-#{i}" %> </div>
<label for="field-<%= i %>"><%= level_type.title %></label> </div>
<!-- language -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.language") %></label>
<div class="controls">
<%= f.select :language, WritingJournal::LANGUAGE_TYPES, :prompt => 'Select', :class => "span3" %>
</div>
</div>
<!-- level_type -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.level_type") %></label>
<div class="controls">
<% @level_types.each do |level_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_journal[journal_level_type_ids][]', level_type.id, @writing_journal.journal_level_type_ids.include?(level_type.id)%>
<%= level_type.title %>
<%= hidden_field_tag 'writing_journal[journal_level_type_ids][]', '' %> <%= hidden_field_tag 'writing_journal[journal_level_type_ids][]', '' %>
</li>
<% end %> <% end %>
</ul> <% end %>
</div>
</div> </div>
<div class="row"> <!-- paper_type -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.paper_type") %></label>
<div class="controls">
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span3" %>
</div>
</div>
<div class="span3"> <!-- author_type -->
<%= f.label :vol_no, t("personal_journal.vol_no") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_journal.author_type") %></label>
<div class="controls">
<% @author_types.each do |author_type| %>
<%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_journal[journal_author_type_ids][]', author_type.id, @writing_journal.journal_author_type_ids.include?(author_type.id)%>
<%= author_type.title %>
<%= hidden_field_tag 'writing_journal[journal_author_type_ids][]', '' %>
<% end %>
<% end %>
</div>
</div>
<!-- vol_no -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.vol_no") %></label>
<div class="controls">
<%= f.text_field :vol_no %> <%= f.text_field :vol_no %>
</div> </div>
</div>
<div class="span3"> <!-- issue_no -->
<%= f.label :issue_no, t("personal_journal.issue_no") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_journal.issue_no") %></label>
<div class="controls">
<%= f.text_field :issue_no %> <%= f.text_field :issue_no %>
</div> </div>
</div>
<div class="span3"> <!-- form_to -->
<%= f.label :form_to, t("personal_journal.form_to") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_journal.form_to") %></label>
<div class="controls">
<%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %> <%= f.text_field :form_to_start, :class=>'span1' %> ~ <%= f.text_field :form_to_end, :class=>'span1' %>
</div> </div>
</div>
<div class="span3"> <!-- total_pages -->
<%= f.label :total_pages, t("personal_journal.total_pages") %> <div class="control-group">
<label class="control-label muted"><%= t("personal_journal.total_pages") %></label>
<div class="controls">
<%= f.text_field :total_pages %> <%= f.text_field :total_pages %>
</div> </div>
</div>
<!-- isbn -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.isbn") %></label>
<div class="controls">
<%= f.text_field :isbn %>
</div>
</div>
<!-- keywords -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.keywords") %></label>
<div class="controls">
<%= f.text_field :keywords %>
</div>
</div>
<!-- publication_date -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.publication_date") %></label>
<div class="controls">
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
</div>
<!-- url -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.url") %></label>
<div class="controls">
<%= f.text_field :url , :class => "span6" %>
</div>
</div>
<!-- abstract -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.abstract") %></label>
<div class="controls">
<%= f.text_area :abstract, rows: 2, class: "input-block-level" %>
</div>
</div>
<!-- note -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.note") %></label>
<div class="controls">
<%= f.text_area :note, rows: 2, class: "input-block-level" %>
</div>
</div>
</div> </div>
<div class="row"> <!-- Status Module -->
<% if show_form_status_field(@writing_journal) %>
<div class="tab-pane fade" id="status">
<div class="span5"> <!-- 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 @writing_journal.is_hidden? %>">
<%= f.check_box :is_hidden %> <%= t(:hide) %>
</label>
</div>
</div>
</div>
<% end %>
<!-- Tag Module -->
<div class="tab-pane fade" id="tag">
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @writing_journal.tag_ids.include?(tag.id) %>">
<%= check_box_tag 'writing_journal[tag_ids][]', tag.id, @writing_journal.tag_ids.include?(tag.id) %> <%= tag.name %>
<%= hidden_field_tag 'writing_journal[tag_ids][]', '' %>
</label>
<% end %>
</div>
</div>
</div>
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_valid_locales.each_with_index do |locale, i| %> <% @site_valid_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>"> <a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a>
<div class="title">
<%= f.label :authors,t("web_resource.authors") %>
<%= f.fields_for :authors_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>
<%= f.text_field locale, :class=>'span5', :value => (@writing_journal.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="span7">
<label>&nbsp;</label>
<input type="text" name="" id="" class="span7">
</div>
</div>
</div>
<div class="row">
<div class="span5">
<%= f.label :author_type ,t("personal_journal.author_type")%>
<div class="form-inline">
<ul class="nav nav-pills">
<% @author_types.each_with_index do |author_type, i | %>
<li class="pull-left">
<%= check_box_tag 'writing_journal[journal_author_type_ids][]', author_type.id, @writing_journal.journal_author_type_ids.include?(author_type.id), :id => "field-#{i}" %>
<label for="field-<%= i %>"><%= author_type.title %></label>
<%= hidden_field_tag 'writing_journal[journal_author_type_ids][]', '' %>
</li> </li>
<% end %> <% end %>
</ul> </ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- paper_title-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_journal.paper_title") %></label>
<div class="controls">
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_journal.paper_title"), value: (@writing_journal.paper_title_translations[locale] rescue nil) %>
<% end %>
</div> </div>
</div> </div>
<div class="span7"> <!-- journal_title-->
<%= f.label :paper_type ,t("personal_journal.paper_type")%> <div class="control-group input-title">
<%= f.select :journal_paper_type_id, @paper_types.collect {|t| [ t.title, t.id ]}, :class => "span7" %> <label class="control-label muted"><%= t("personal_journal.journal_title") %></label>
<div class="controls">
<%= f.fields_for :journal_title_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_journal.journal_title"), value: (@writing_journal.journal_title_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<!-- authors-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_journal.authors") %></label>
<div class="controls">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_field locale, class: "input-block-level", placeholder: t("personal_journal.authors"), value: (@writing_journal.authors_translations[locale] rescue nil) %>
<% end %>
</div>
</div> </div>
</div> </div>
<% end %>
<!-- File -->
<div class="control-group">
<label class="control-label muted"><%= t(:file_) %></label>
<div class="controls">
<%= f.label :isbn, t("personal_journal.isbn") %> <!-- Exist -->
<%= f.text_field :isbn , :class => "span12" %> <% if @writing_journal && !@writing_journal.writing_journal_files.blank? %>
<br> <div class="exist">
<%= f.label :keywords, t("personal_journal.keywords") %>
<%= f.text_field :keywords , :class => "span12" %>
<br>
<div class="title">
<%= f.label :publication_date ,t("personal_journal.publication_date")%>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 'span1'} %>
</div>
<%= f.label :url, t("personal_journal.url") %>
<%= f.text_field :url , :class => "span12" %>
<br>
</div>
<div>
<div id='plugin_files' class="plugin_files_block">
<table class="table table-condensed">
<thead>
<tr>
<th>File</th>
<th>File Name</th>
<th class="span1"></th>
</tr>
</thead>
<tfoot>
<tr>
<td style="text-align:center" colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block">
<%= hidden_field_tag 'plugin_file_field_count', @writing_journal.writing_journal_files.count %>
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a>
</div>
</td>
</tr>
</tfoot>
<tbody>
<% @writing_journal.writing_journal_files.each_with_index do |writing_journal_file, i| %> <% @writing_journal.writing_journal_files.each_with_index do |writing_journal_file, i| %>
<%= f.fields_for :writing_journal_files, writing_journal_file do |f| %> <%= f.fields_for :writing_journal_files, writing_journal_file do |f| %>
<%= render :partial => 'form_file', :object => writing_journal_file, :locals => {:f => f, :i => i} %> <%= render :partial => 'form_file', :object => writing_journal_file, :locals => {:f => f, :i => i} %>
<% end %> <% end %>
<% end %> <% end %>
</tbody> <hr>
</table> </div>
<% end %>
<!-- Add -->
<div class="add-target">
</div>
<p class="add-btn">
<%= hidden_field_tag 'plugin_file_field_count', @writing_journal.writing_journal_files.count %>
<a id="add_file" class="trigger btn btn-small btn-primary"><i class="icons-plus"></i> <%= t(:add) %></a>
</p>
</div> </div>
</div> </div>
</div> </div>
<!--Post End-->
<div class="form-actions"> </div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %> <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
<%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div> </div>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "archive_plugin_form" %>
<script> <script>
$('#add_plugin_file a.add').live('click', function(){ $(document).ready(function() {
$('.main-forms .add-on').tooltip();
$(document).on('click', '#add_file', function(){
var new_id = $(this).prev().attr('value'); var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_add_plugin_files", "g"); var old_id = new RegExp("new_writing_journal_files", "g");
var on = $('.language-nav li.active').index();
var le = $(this).parent('.add-btn').prev('.add-target').children('.start-line').length;
$(this).prev().attr('value', parseInt(new_id) + 1); $(this).prev().attr('value', parseInt(new_id) + 1);
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id)); $(this).parent().siblings('.add-target').append(("<%= escape_javascript(add_attribute 'form_file', f, :writing_journal_files) %>").replace(old_id, new_id));
$(this).parent('.add-btn').prev('.add-target').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() {
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
}); });
formTip();
$('.add_plugin_files_block a.delete').live('click', function(){ });
$(this).parents('.list_item').remove(); $(document).on('click', '.delete_file', function(){
$(this).parents('.input-prepend').remove();
});
$(document).on('click', '.remove_existing_record', function(){
if(confirm("<%= I18n.t(:sure?)%>")){
$(this).children('.should_destroy').attr('value', 1);
$(this).parents('.start-line').hide();
}
}); });
$('.action a.remove_existing_record').live('click', function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
}); });
</script> </script>
<% end %> <% end %>

View File

@ -1,50 +1,45 @@
<% # encoding: utf-8 %> <% if form_file.new_record? %>
<div class="fileupload fileupload-new start-line" data-provides="fileupload">
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'> <% else %>
<td> <div class="fileupload fileupload-exist start-line" data-provides="fileupload">
<div class="control-group"> <% if form_file.file.blank? %>
<div class="controls"> <%= t(:no_file) %>
<%= f.file_field :file %>
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
</div>
</div>
</td>
<td>
<div class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>
<%= f.fields_for :file_title_translations do |f| %>
<div class="control-group">
<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
<div class="controls">
<%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
</td>
<td>
<span class="action">
<% if form_file.new_record? %>
<a class="delete"><i class="icon-remove"></i></a>
<% else %> <% else %>
<%= f.hidden_field :id %> <%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
<a class="remove_existing_record"><i class="icon-remove"></i></a> <% end %>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> <% end %>
<div class="input-prepend input-append">
<label>
<span class="add-on btn btn-file" title='<%= t(:file_) %>'>
<i class="icons-paperclip"></i>
<%= f.file_field :file %>
</span>
<div class="uneditable-input input-medium">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
</div>
</label>
<span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
<span class="tab-content">
<% @site_valid_locales.each_with_index do |locale, i| %>
<span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
<% end %> <% end %>
</span> </span>
<% end %>
</td> </span>
</tr> </span>
<% if form_file.new_record? %>
<span class="delete_file add-on btn" title="<%= t(:delete_) %>">
<a class="icon-trash"></a>
</span>
<% else %>
<span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
<%= f.hidden_field :id %>
<a class="icon-remove"></a>
<%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
</span>
<% end %>
</div>
</div>

View File

@ -1,10 +1,6 @@
<tr id="<%= dom_id writing_journal %>" class="with_action"> <tr id="<%= dom_id writing_journal %>" class="with_action">
<td class="span1">
<% if (writing_journal.create_user_id == current_user.id) || is_manager? %> <td class="span1"><%= writing_journal.year %></td>
<%= check_box_tag 'to_delete[]', writing_journal.id, false, :class => "checkbox_in_list" %>
<% end -%>
</td>
<td class="span1"><%= writing_journal.publication_date %></td>
<td class="span1"> <td class="span1">
<%= link_to writing_journal.create_link , panel_personal_journal_front_end_writing_journal_path(writing_journal) %> <%= link_to writing_journal.create_link , panel_personal_journal_front_end_writing_journal_path(writing_journal) %>
<div class="quick-edit"> <div class="quick-edit">

View File

@ -8,8 +8,8 @@
</div> </div>
<h1><%= t('personal_journal.editing_personal_journal') %></h1> <%= form_for @writing_journal, url: panel_personal_journal_back_end_writing_journal_path(@writing_journal), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<%= form_for @writing_journal, :url => panel_personal_journal_back_end_writing_journal_path(@writing_journal), :html => {:class => 'clear'} do |f| %> <%= render partial: 'form', locals: {f: f} %>
<%= render :partial => 'form', :locals => {:f => f} %> </fieldset>
<% end %> <% end %>

View File

@ -13,10 +13,9 @@
<table class="table main-list"> <table class="table main-list">
<thead> <thead>
<tr> <tr>
<th class="span1"></th> <th class="span1"><%= t('personal_journal.year') %></th>
<th class="span1"></th> <th class="span7"><%= t('module_name.personal_journal') %></th>
<th class="span1"></th> <th class="span1"><%= t('personal_journal.authors') %></th>
<th class="span1"></th>
</tr> </tr>
</thead> </thead>
<tbody id="tbody_writing_journals" class="sort-holder"> <tbody id="tbody_writing_journals" class="sort-holder">
@ -24,10 +23,12 @@
</tbody> </tbody>
</table> </table>
<div class="form-actions form-fixed pagination-right"> <div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_journal_back_end_writing_journal_setting_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), panel_personal_journal_back_end_writing_journal_setting_path, :class => 'btn btn-primary pull-right' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path, :class => 'btn btn-primary pull-right' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path, :class => 'btn btn-primary pull-right' %>
<div id="writing_journal_pagination" class="paginationFixed"> </div>
<%= paginate @writing_journal_pages, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <div class="pagination pagination-centered">
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>

View File

@ -8,14 +8,8 @@
</div> </div>
<%= flash_messages %> <%= form_for @writing_journal, url: panel_personal_journal_back_end_writing_journals_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div id="poststuff"> <%= render partial: 'form', locals: {f: f} %>
<h1><%= t('writing_journal.new_personal_journal') %></h1> </fieldset>
<%= form_for @writing_journal, :url => panel_personal_journal_back_end_writing_journals_path, :html => {:class => 'clear'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>
</div>
<%#= link_back %>

View File

@ -15,7 +15,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_level_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_level_type_quick_add_path('add') %>#myModal1" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>等級</span> <span><%= t("personal_journal.level_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
@ -41,7 +41,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_author_type_quick_add_path('add') %>#myModal2" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>作者型態</span> <span><%= t("personal_journal.author_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">
@ -67,7 +67,7 @@
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"> <p class="totle">
<a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_author_type_quick_add_path('add') %>#myModal3" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a> <a class="btn btn-small btn-primary pull-right" href="<%= panel_personal_journal_back_end_writing_journal_author_type_quick_add_path('add') %>#myModal3" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
<span>論文型態</span> <span><%= t("personal_journal.paper_type") %></span>
</p> </p>
<div class="detal-list my_scroll"> <div class="detal-list my_scroll">
<div class="scrollbar"> <div class="scrollbar">

View File

@ -1,13 +1,22 @@
<% <%
if @member if @member
@writing_journals = WritingJournal.where(:create_user_id => @member.id).desc(:year)
else
@writing_journals = WritingJournal.all.desc(:year)
end
@writing_journals = WritingJournal.where(is_hidden: false, :create_user_id => @member.id).desc(:year)
@writing_journal_intro = !PersonalJournalIntro.where(:user_id => @member.id).blank? ? PersonalJournalIntro.where(:user_id => @member.id).first : PersonalJournalIntro.new
%> %>
<% if !@writing_journals.blank? %> <% if @writing_journal_intro.brief_intro and !@writing_journal_intro.blank? %>
<div class="info">
<%= @writing_journal_intro.text.html_safe rescue '' %>
</div>
<% end %>
<% if ( !@writing_journal_intro.blank? and @writing_journal_intro.complete_list ) or @writing_journal_intro.blank? %>
<% if !@writing_journals.blank? %>
<table class="table"> <table class="table">
<thead> <thead>
@ -34,8 +43,8 @@
</tbody> </tbody>
</table> </table>
<% else %> <% end %>
<%= t('nothing')%> <% end %>
<% end %> <% end %>

View File

@ -1,3 +1,10 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/list-check" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/list-check" %>
<% end %>
<% <%
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@ -16,17 +23,29 @@
@filter = {new_filter[:type] => [new_filter[:id].to_s]} @filter = {new_filter[:type] => [new_filter[:id].to_s]}
end end
if @user if @user && is_admin?
@writing_journals = WritingJournal.where(:create_user_id => @user.id).page(params[:page]).per(10) @writing_journals = WritingJournal.where(:create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
else else
@writing_journals = WritingJournal.all.page(params[:page]).per(10) @writing_journals = WritingJournal.where(is_hidden: false, :create_user_id => @user.id).desc(:year).page(params[:page]).per(10)
end end
%> %>
<% if is_admin? %>
<div class="list-active">
<div class="btn-group">
<%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => data_share_panel_personal_journal_back_end_writing_journals_path(:user_id => params[:id], :disable => 'true') ) %>
<%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => data_share_panel_personal_journal_back_end_writing_journals_path(:user_id => params[:id], :disable => 'false') ) %>
</div>
</div>
<% end -%>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<% if is_admin? %>
<th><input type="checkbox" class="list-check" /></th>
<% end -%>
<th class="span1"><%= t('personal_journal.year') %></th> <th class="span1"><%= t('personal_journal.year') %></th>
<th><%= t('module_name.personal_journal') %></th> <th><%= t('module_name.personal_journal') %></th>
<% if not @user%> <% if not @user%>
@ -38,7 +57,12 @@
<% @writing_journals.each do |writing_journal| %> <% @writing_journals.each do |writing_journal| %>
<tr> <tr class="<%= writing_journal.is_hidden ? "checkHide" : "" %>">
<% if is_admin? %>
<td>
<%= check_box_tag 'to_change[]', writing_journal.id.to_s, false, :class => "list-check" %>
</td>
<% end -%>
<td><%= writing_journal.year %></td> <td><%= writing_journal.year %></td>
<td> <td>
<%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %> <%= link_to writing_journal.create_link, panel_personal_journal_front_end_writing_journal_path(writing_journal) %>
@ -53,11 +77,25 @@
</tbody> </tbody>
</table> </table>
<% if is_admin? %>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-right"> <div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.edit_brief_intro'), panel_personal_journal_back_end_personal_journal_intros_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary' %> <%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('announcement.add_new'), new_panel_personal_journal_back_end_writing_journal_path(:user_id => @user.id), :class => 'btn btn-primary' %>
</div> </div>
<div class="pagination pagination-centered"> <div class="pagination pagination-centered">
<%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %> <%= paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
</div> </div>
</div> </div>
<% end %>
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><%= t(:sure?) %></h3>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
<button class="delete-item btn btn-danger"><%= t(:submit) %></button>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More