Compare commits

..
82 changed files with 350 additions and 1341 deletions

No files matched your search

@@ -226,7 +226,7 @@ var orbitDesktop = function(dom){
this.bindDesktopEvents = function(){ //this function will bind the global handlers to thd desktop, for example doc
$(".docklist a").click(function(){
if( !$( this ).hasClass( 'disable' ) )
if( !$( this ).parent().hasClass( 'disable' ) )
o.menu_item($(this));
return false;
});
+29 -158
View File
@@ -83,7 +83,6 @@ legend {
min-width: 61px;
z-index: 1030;
position: fixed;
padding-top: 40px;
background-color: #171717;
-webkit-box-shadow: inset -1px 0px 10px #000000;
-moz-box-shadow: inset -1px 0px 10px #000000;
@@ -92,14 +91,12 @@ legend {
}
#sidebar #sidebar-menu {
position: absolute;
top: 85px;
top: 88px;
bottom: 0;
z-index: 0;
z-index: 1;
display: block;
width: 61px;
}
#sidebar #sidebar-menu.nano {
top: 0;
/*overflow: auto;*/
}
#sidebar .scroller {
position: absolute;
@@ -123,12 +120,16 @@ legend {
list-style: none;
}
#sidebar > h2.position {
top: 40px;
margin: 0;
width: 61px;
color: #FFFFFF;
font-weight: normal;
font-size: 2.4em;
line-height: 47px;
line-height: 46px\9;
text-align: center;
position: relative;
position: absolute;
background-color: #08c;
background-image: -moz-linear-gradient(top, #08c, #006091);
background-image: -ms-linear-gradient(top, #08c, #006091);
@@ -157,20 +158,24 @@ legend {
}
#sidebar > h2.position a {
color: #FFFFFF;
padding: 6px 6px 5px;
text-decoration: none;
display: inline-block;
-webkit-text-shadow: 0px -1px 0px #333333;
-moz-text-shadow: 0px -1px 0px #333333;
-o-text-shadow: 0px -1px 0px #333333;
text-shadow: 0px -1px 0px #333333;
}
#sidebar > h2.position a i {
line-height: 45px;
}
#sidebar .sidebar-nav > li {
min-width: 61px;
height: 45px;
}
#sidebar .sidebar-nav > li.active span {
#sidebar .sidebar-nav > li.active {
font-size: 1.2em;
}
#sidebar .sidebar-nav > li.active .sub-nav-block {
display: block;
}
#sidebar .sidebar-nav > li.active > a > span {
color: #FFFFFF;
cursor: pointer;
-webkit-text-shadow: 0px -1px 0px #636363;
@@ -178,7 +183,8 @@ legend {
-o-text-shadow: 0px -1px 0px #636363;
text-shadow: 0px -1px 0px #636363;
}
#sidebar .sidebar-nav > li span {
#sidebar .sidebar-nav > li > a > span {
padding: 10px;
color: #B0B0B0;
display: block;
-webkit-text-shadow: 0px 1px 0px #000000;
@@ -186,15 +192,8 @@ legend {
-o-text-shadow: 0px 1px 0px #000000;
text-shadow: 0px 1px 0px #000000;
}
#sidebar .sidebar-nav > li a {
display: block;
}
#sidebar .sidebar-nav > li i {
font-size: 1.6em;
line-height: 60px;
}
#sidebar .sidebar-nav > li.active i {
font-size: 2.2em;
#sidebar .sidebar-nav > li > a > span > i {
font-size: 1.7em;
}
#sidebar .sub-nav-block-list {
top: 40px;
@@ -275,7 +274,7 @@ legend {
}
#sidebar .sub-nav-arrow {
left: 53px;
top: -16px;
top: -10px;
width: 0px;
height: 0px;
z-index: -1;
@@ -283,6 +282,7 @@ legend {
border-style: solid;
border-width: 8px 8px 8px 0;
border-color: transparent #0088CC transparent transparent;
display: none\9; /* 用IE的去死 */
}
@@ -300,15 +300,14 @@ legend {
position: absolute;
z-index: 100;
width: 100%;
border-radius: 50%/1px;
background-color: rgba(0, 136, 204, .6);
border-radius: 1px;
background-color: rgba(0, 136, 204, .3);
}
/* Main Wrap */
#main-wrap {
padding-top: 40px;
position: relative;
}
#main-wrap .wrap-inner {
padding: 60px 20px 20px;
@@ -420,7 +419,6 @@ legend {
/* Search Clear */
.searchClear {
position: relative;
display: inline-block;
}
.searchClear .icon-search {
position: absolute;
@@ -522,9 +520,10 @@ legend {
padding: 0px 5px;
position: absolute;
z-index: 9999;
max-width: 300px;
max-width: 500px;
border-radius: 3px;
background-color: #0088CC;
white-space: nowrap;
}
#sideset .ui-tooltip.sidebar-tooltip:after {
display: none;
@@ -534,9 +533,10 @@ legend {
padding: 0px 5px;
position: absolute;
z-index: 9999;
max-width: 300px;
max-width: 500px;
border-radius: 3px;
background-color: #000000;
white-space: nowrap;
}
.ui-tooltip:after {
content: '';
@@ -551,135 +551,6 @@ legend {
border-color: #000000 transparent transparent transparent;
}
/* Sign In */
#sign-in {
background-color: #F3F3F3;
background-repeat: no-repeat;
background : -webkit-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
background : -moz-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
background : -o-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
background : -ms-radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
background : -radial-gradient(center center,circle cover, #F3F3F3 10%, #DBDBDB 100%);
}
.sign-in {
text-align: center;
position: relative;
width: 300px;
margin: 150px auto 0;
}
.sign-in .other-sign-in {
display: none;
}
.sign-in .login-logo {
margin: 0;
padding-bottom: 15px;
border-bottom: 1px solid #ededed;
}
.sign-in .alert {
box-shadow: 0 3px 10px #CBCBCB;
text-align: left;
}
.sign-in .form {
background-color: #FFF;
box-shadow: 0 10px 20px #CBCBCB;
padding: 15px;
margin-bottom: 20px;
}
.sign-in .form-block {
overflow: hidden;
}
.sign-in .form-list {
width: 555px;
}
.sign-in .content {
float: left;
margin-bottom: 0;
position: relative;
}
.sign-in .content + .content {
margin-left: 15px;
}
.sign-in .control-group {
position: relative;
width: 270px;
margin: 0;
}
.sign-in .control-group label {
position: absolute;
top: 0;
left: 0;
width: 39px;
height: 40px;
line-height: 40px;
margin: 0;
color: #5C5C5C;
}
.sign-in .control-group input {
width: 222px;
height: 30px;
padding: 4px 6px 4px 40px;
margin-bottom: 25px;
}
.sign-in .btn {
display: block;
padding: 4px 0;
width: 100%;
margin-bottom: 10px;
}
.sign-in .other-sign-in {
position: relative;
margin-top: 20px;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid #ededed;
}
.sign-in .other-sign-in p {
position: absolute;
width: 30px;
height: 30px;
background-color: #FFF;
padding: 0 10px;
margin-bottom: 0;
margin-left: -25px;
line-height: 30px;
left: 50%;
bottom: -15px;
font-size: 1.3em;
color: #b1b1b1;
}
.sign-in .checkbox {
position: absolute;
text-align: left;
bottom: 47px;
}
.sign-in .switchboard {
color: #08C;
cursor: pointer;
}
.sign-in .switchboard span,
.sign-in .switchboard.active i {
display: inline;
}
.sign-in .switchboard.active span,
.sign-in .switchboard i {
display: none;
}
.register {
box-shadow: inset 0 5px 5px #E0E0E0;
background-color: #eee;
padding: 15px;
margin: 15px -15px -15px;
}
.register .btn {
margin: 0;
}
.have-other-sign-in {
margin: 80px auto 0;
}
.have-other-sign-in .other-sign-in {
display: block;
}
/* IE go die */
:root #sidebar .sub-nav-block:before {
display: block\9;
+12 -65
View File
@@ -2,17 +2,16 @@
top: 0px;
left: -10px;
right: -10px;
height: 40px;
z-index: 1041;
position: fixed;
margin-bottom: 0;
height: 40px;
}
#orbit-bar .orbitlogo {
width: 50px;
height: 40px;
padding: 0!important;
width: 20px;
height: 20px;
background-size: 70%;
display: block;
display: inline-block;
background-position: center;
background-repeat: no-repeat;
background-image: url(<%= asset_path 'orbit-logo.svg' %>);
@@ -20,23 +19,8 @@
/* For Suck IE */
background-image: url(<%= asset_path 'orbit-logo.png' %>)\9;
}
#orbit-bar .dropdown-menu li > a {
padding: 0 20px;
display: block;
height: 30px;
line-height: 30px;
}
#orbit-bar .dropdown-menu li i {
float: left;
display: inline-block;
margin-right: 5px;
line-height: 30px;
height: 100%;
}
#orbit-bar.navbar .nav > li > a {
color: #EEE;
padding: 0 15px;
display: block;
text-shadow: 0 -1px 0 #000;
border-right: 1px solid #363636;
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
@@ -50,11 +34,6 @@
background-color: #0095CF;
text-shadow: 0 -1px 0 #014380;
}
#orbit-bar.navbar .nav > li > a > [class^="icon"],
#orbit-bar.navbar .nav > li > a > [class*=" icon"] {
line-height: 40px;
display: block;
}
#orbit-bar.navbar .nav li.dropdown.open > .dropdown-toggle,
#orbit-bar.navbar .nav li.dropdown.active > .dropdown-toggle,
#orbit-bar.navbar .nav li.dropdown.open.active > .dropdown-toggle {
@@ -62,7 +41,9 @@
text-shadow: 0 -1px 0 #014380;
}
#orbit-bar .navbar-inner {
height: 40px;
border-width: 0;
min-height: 40px;
background-color: #333333;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
@@ -85,10 +66,6 @@
right: auto;
bottom: auto;
}
#orbit-bar .nav > li {
display: block;
line-height: 40px;
}
#orbit-bar .nav [class^="icon"],
#orbit-bar .nav [class*=" icon"] {
font-size: 1.5em;
@@ -115,45 +92,17 @@
#orbit-bar .modal .input-prepend {
margin-bottom: 15px;
}
#orbit-bar .modal .other-sign-in {
position: relative;
text-align: center;
margin-top: 20px;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid #EDEDED;
}
#orbit-bar .modal .other-sign-in .btn {
padding: 4px 0;
display: block;
margin-bottom: 5px;
width: 100%;
}
#orbit-bar .modal .other-sign-in p {
position: absolute;
width: 30px;
height: 30px;
background-color: #FFF;
padding: 0 10px;
margin-bottom: 0;
margin-left: -25px;
line-height: 30px;
left: 50%;
bottom: -15px;
font-size: 1.3em;
color: #B1B1B1;
}
/*Search*/
#orbit-bar #search {
margin-bottom: 0;
position: relative;
padding: 0 10px;
padding: 8px 10px 0;
border-right: 1px solid #363636;
box-shadow: 1px 0px 0px rgba(0, 0, 0, 0.3);
}
#orbit-bar #search form {
margin: 8px 0;
margin-bottom: 8px;
}
#orbit-bar #search input[type="text"] {
height: 14px;
@@ -161,7 +110,6 @@
font-size: 13px;
padding-left: 25px;
padding-right: 25px;
display: block;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
-o-border-radius: 12px;
@@ -174,16 +122,15 @@
#orbit-bar #search .search-clear {
position: absolute;
color: #A3A3A3;
top: 16px;
top: 14px;
}
#orbit-bar #search .icon-search {
left: 15px;
left: 13px;
top: 15px;
font-size: 1.2em;
width: 1.25em;
margin-top: 0;
}
#orbit-bar #search .search-clear {
right: 13px;
right: 14px;
font-size: 1.3em;
}
#orbit-bar #search .search-clear:hover {
@@ -21,10 +21,14 @@
}
.form_fix {
textarea {
margin-bottom: 12px;
margin-bottom: 12px;
}
input {
input[type="text"] {
margin-left: 0;
margin-top: 0;
}
input[type="text"] + input {
margin-top: 12px;
}
}
// fixed width column with 12px gutter
@@ -1,579 +0,0 @@
# encoding: utf-8
require 'net/http'
require 'open-uri'
class Admin::ImportDataController < OrbitBackendController
helper Admin::PagePartsHelper
include Admin::FrontendWidgetInterface
def get_teacher_data
uri = URI("https://localhost:8000/teachers.xml")
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
#uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
@teacher_data = Hash.from_xml(res.body)
@teachers = @teacher_data["objects"]
@i = 5000
@teachers.each do |hash|
# @roles = Role.skip(1).first
@roles = Role.all
@teacher = User.new
I18n.locale = :zh_tw
if !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw'].blank? && !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.first_name = "Please Fill the Name"
end
I18n.locale = :en
if !hash['teacher_en'].blank?
@teacher.first_name = hash['teacher_en']
elsif hash['teacher_en'].blank? && !hash['teacher_zh_tw'].blank?
@teacher.first_name = hash['teacher_zh_tw']
elsif hash['teacher_en'].blank? && hash['teacher_zh_tw'].blank?
@teacher.first_name = "Please Fill the Name"
end
#@teacher.first_name = hash['teacher_en']
@teacher.ntu_seq = hash['ntu_seq']
@teacher.sid = hash['ntu_seq']
@teacher.role_ids = ["#{@roles.skip(1).first.id}"]
@teacher.password = "testpass"
@i += 10
if !hash['email'].blank?
@user = User.where(email: "#{hash['email']}")
if @user.length == 0
@teacher.email = hash['email']
elsif @user.length > 0
@teacher.email = "#{@i}duplicate@ntu.edu.tw"
end
else
@teacher.email = "#{@i}@ntu.edu.tw"
end
if hash['teacher_zh_tw'].blank? && hash['teacher_en'].blank?
@teacher.user_id = "defaultuser"
elsif hash['teacher_en'].blank?
@teacher.user_id = hash['teacher_zh_tw']
elsif hash['teacher_zh_tw']
@teacher.user_id = hash['teacher_en']
end
@teacher.save!
end
end
def get_book_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.ntu_seq.present?
ntu_seq = hash.ntu_seq
books_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
@books = books_xml.xpath("//Book").map do |book_node|
{
author: (book_node>"Authors").text,
year: (book_node>"PublishYear").text,
title: (book_node>"DocTitle").text,
remarks: (book_node>"Remarks").text,
publisher: (book_node>"Publisher").text,
book_title: (book_node>"BookTitle").text
}
end
if @books.present?
@books.each do |b|
@book = WritingBook.new
I18n.locale = :zh_tw
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
I18n.locale = :en
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
@book.year = b[:year]
@book.create_user_id = hash.id
@book.save
end
else
puts "No books by Teacher"
end
end
end
end
def get_conference_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.ntu_seq.present?
ntu_seq = hash.ntu_seq
conference_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
{
author: (cp_node>"Authors").text,
year: (cp_node>"PublishYear").text,
title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
conference_title: (cp_node>"PublishOn").text,
remarks: (cp_node>"Remarks").text
}
end
if @conference_papers.present?
@conference_papers.each do |b|
@conference_paper = WritingConference.new
I18n.locale = :zh_tw
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
I18n.locale = :en
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year]
@conference_paper.create_user_id = hash.id
@conference_paper.save!
end
else
puts "No conference by Teacher"
end
end
end
end
def get_journal_paper_data
uri = URI("http://ann.cc.ntu.edu.tw/Achv/xmlTeacherData.asp")
params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
teachers = User.all
teachers.each do |hash|
if hash.ntu_seq.present?
ntu_seq = hash.ntu_seq
paper_xml = Nokogiri::XML( \
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
{
author: (paper_node>"Authors").text,
year: (paper_node>"PublishYear").text,
title: (paper_node>"PaperTitle").text,
journal: (paper_node>"PublishOn").text,
volume:(paper_node>"Volume").text,
volumeno:(paper_node>"VolumeNo").text,
beginpage:(paper_node>"BeginPage").text,
endpage:(paper_node>"EndPage").text,
subgroup:(paper_node>"subgroup").text,
remarks: (paper_node>"Remarks").text,
cate: ((paper_node>"subgroup")>"Group").text
}
end
if @journal_papers.present?
@journal_papers.each do |b|
@journal_paper = WritingJournal.new
I18n.locale = :zh_tw
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
I18n.locale = :en
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
@journal_paper.year = b[:year]
@journal_paper.vol_no = b[:volumeno]
@journal_paper.form_to_start = b[:beginpage]
@journal_paper.form_to_end = b[:endpage]
if !b[:cate].blank?
@level_type = JournalLevelType.where(:key => b[:cate])
if @level_type.present?
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
end
end
@journal_paper.create_user_id = hash.id
@journal_paper.save!
end
else
puts "No journal paper by Teacher"
end
end
end
end
def sync_conference_data
@conference_data = WritingConference.where(create_user_id: "#{params[:user_id]}")
@conference_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
conference_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=C"))
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@conference_papers = conference_xml.xpath("//Paper").map do |cp_node|
{
author: (cp_node>"Authors").text,
year: (cp_node>"PublishYear").text,
title: (cp_node>"PaperTitle").text,
conference: (cp_node>"PublishOn").text,
date: Date::MONTHNAMES[(cp_node>"PublishMonth").text.to_i],
location: "#{(cp_node>"Country").text} #{(cp_node>"location").text}",
conference_title: (cp_node>"PublishOn").text,
remarks: (cp_node>"Remarks").text
}
end
if @conference_papers.present?
@conference_papers.each do |b|
@conference_paper = WritingConference.new
I18n.locale = :zh_tw
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
I18n.locale = :en
@conference_paper.authors = b[:author]
if b[:title].blank?
@conference_paper.paper_title = "No Title Present"
else
@conference_paper.paper_title = b[:title]
end
if b[:conference_title].blank?
@conference_paper.conference_title = "No Title Present"
else
@conference_paper.conference_title = b[:conference_title]
end
@conference_paper.note = b[:remarks]
@conference_paper.location = b[:location]
@conference_paper.year = b[:year]
@conference_paper.create_user_id = @user.id
@conference_paper.save!
end
else
puts "No conference by Teacher"
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def sync_journal_paper_data
@journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}")
@journal_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
paper_xml = Nokogiri::XML( \
#open("http://versatile.management.ntu.edu.tw/publication1/journal/#{ntuseq}.xml"))
open("http://ann.cc.ntu.edu.tw/Achv/xmlPaper.asp?Seq=#{ntu_seq}&type=J"))
@journal_papers = paper_xml.xpath("//Paper").map do |paper_node|
{
author: (paper_node>"Authors").text,
year: (paper_node>"PublishYear").text,
title: (paper_node>"PaperTitle").text,
journal: (paper_node>"PublishOn").text,
volume:(paper_node>"Volume").text,
volumeno:(paper_node>"VolumeNo").text,
beginpage:(paper_node>"BeginPage").text,
endpage:(paper_node>"EndPage").text,
subgroup:(paper_node>"subgroup").text,
remarks: (paper_node>"Remarks").text,
cate: ((paper_node>"subgroup")>"Group").text
}
end
if @journal_papers.present?
@journal_papers.each do |b|
@journal_paper = WritingJournal.new
I18n.locale = :zh_tw
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
I18n.locale = :en
@journal_paper.authors = b[:author]
if b[:title].blank?
@journal_paper.paper_title = "No Title Present"
else
@journal_paper.paper_title = b[:title]
end
@journal_paper.journal_title = b[:journal]
@journal_paper.note = b[:remarks]
@journal_paper.year = b[:year]
@journal_paper.vol_no = b[:volumeno]
@journal_paper.form_to_start = b[:beginpage]
@journal_paper.form_to_end = b[:endpage]
if !b[:cate].blank?
@level_type = JournalLevelType.where(:key => b[:cate])
if @level_type.present?
@journal_paper.journal_level_type_ids = ["#{@level_type.first.id}"]
end
end
@journal_paper.create_user_id = @user.id
@journal_paper.save!
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def sync_book_data
@books_data = WritingBook.where(create_user_id: "#{params[:user_id]}")
@books_data.delete_all
@user = User.find("#{params[:user_id]}")
# teachers.each do |hash|
if @user.sid.present?
ntu_seq = @user.sid
books_xml = Nokogiri::XML( \
open("http://ann.cc.ntu.edu.tw/Achv/xmlBook.asp?Seq=#{ntu_seq}"))
@books = books_xml.xpath("//Book").map do |book_node|
{
author: (book_node>"Authors").text,
year: (book_node>"PublishYear").text,
title: (book_node>"DocTitle").text,
remarks: (book_node>"Remarks").text,
publisher: (book_node>"Publisher").text,
book_title: (book_node>"BookTitle").text
}
end
if @books.present?
@books.each do |b|
@book = WritingBook.new
I18n.locale = :zh_tw
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
I18n.locale = :en
@book.authors = b[:author]
@book.paper_title = b[:title]
@book.book_title = b[:book_title]
@book.note = b[:remarks]
@book.publisher = b[:publisher]
@book.year = b[:year]
@book.create_user_id = @user.id
@book.save
end
end
end
respond_to do |format|
format.html
format.json { render json: {"success"=>true}.to_json}
end
end
def get_announcement_data
uri = URI("https://localhost:8000/announcements.xml")
#params = {"UnitName" => "管理學院".encode('big5-uao'), "account" => "manage"}
#uri.query = URI.encode_www_form(params)
res = Net::HTTP.get_response(uri)
@announcement_data = Hash.from_xml(res.body)
@announcements = @announcement_data["objects"]
@announcements.each do |hash|
@bulletin = Bulletin.new
I18n.locale = :zh_tw
if hash['announcement_title_zh_tw'].blank?
@bulletin.title = hash['announcement_title_en']
@bulletin.text = hash['announcement_content_zh_tw']
elsif hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
@bulletin.title = "Please Fill the Name"
@bulletin.text = hash['announcement_content_zh_tw']
else
@bulletin.title = hash['announcement_title_zh_tw']
@bulletin.text = hash['announcement_content_zh_tw']
end
I18n.locale = :en
if hash['announcement_title_zh_tw'].blank? && hash['announcement_title_en'].blank?
@bulletin.title = "Please Fill the Name"
@bulletin.text = hash['announcement_content_en']
elsif hash['announcement_title_en'].blank?
@bulletin.title = hash['announcement_zh_tw']
@bulletin.text = hash['announcement_content_en']
elsif hash['announcement_title_zh_tw'].blank?
@bulletin.title = hash['announcement_title_en']
@bulletin.text = hash['announcement_content_en']
end
@bulletin.category_id = "51d2a16438178423c2000001"
@bulletin.is_pending = true
@bulletin.save!
end
end
def get_page_data
f = File.open("/home/rwub/orbit-db/ntu_mb/pages/management_pages.xml")
page_xml = Nokogiri::XML(f)
#open("http://versatile.management.ntu.edu.tw/publication1/conference/#{ntuseq}.xml"))
@pages = page_xml.xpath("//management-page").map do |cp_node|
{
menu_title: (cp_node>"menu-title").text,
content: (cp_node>"content").text
}
end
if @pages.present?
@i=0
@pages.each do |b|
get_variables_for_new
@page = Page.new
@page.parent = "4f45f3b9e9d02c5db900005d"
@page.design = "50ac424983e75219d2000021"
@page.theme_id = "50ac424a83e75219d2000025"
@page.menu_enabled_for= ["en", "zh_tw", ""]
@page.enabled_for= ["en", "zh_tw", ""]
@page.is_published = false
if b[:menu_title].blank?
@page.title = 'No Title Present'
@i += 1
@page.name = "#{@i}Page"
else
@i += 1
@page.title = b[:menu_title]
@page.name = "#{@i}Page"
end
if b[:content].blank?
@page.content = "No Content Present"
else
@page.content = b[:content]
end
@page.save!
end
else
puts "No Page Data"
end
end
def get_variables_for_new
@designs = Design.all.entries
@themes = Design.first.themes
@module_apps = ModuleApp.for_frontend_select
@app_frontend_urls = nil
@categories = nil
@tags = nil
@page_frontend_data_counts = nil
@frontend_styles = nil
@selected={
:design => @designs.first,
:theme=> @themes.first,
:module_app=>nil,#@module_apps.first
:app_frontend_url=> nil, #@module_apps.first
:category=>nil,
:tag=>nil,
:page_frontend_data_count=>nil,
:frontend_style => nil
}
end
end
+1 -1
View File
@@ -95,7 +95,7 @@ class Admin::PagesController < Admin::ItemsController
if @item.module_app && @item.module_app.key == 'page_content'
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
end
if @item.save
flash.now[:notice] = t('create.success.page')
respond_to do |format|
@@ -261,7 +261,7 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
if to_go > 0
user_at_position = User.where(position: to_go - 1).first
user = User.find(pair[1])
if user_at_position && !user_at_position == user
if user_at_position && !(user_at_position == user)
if user.position > user_at_position.position
user.move_above(user_at_position)
else
-40
View File
@@ -1,40 +0,0 @@
# encoding: utf-8
class SessionsController < Devise::SessionsController
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
def create
@site = Site.first
private_key = OpenSSL::PKey::RSA.new(@site.private_key)
wresult = private_key.private_decrypt(request.params['wresult'])
@ids = wresult.split("@")
login_uid = @ids[0]
resource = User.first(conditions:{user_id: login_uid})
if !resource.blank?
resource_name = resource.class.to_s.downcase
sign_in(resource_name, resource)
session[:user_id_type] = "myntumb"
redirect_to after_sign_in_path_for(resource)
else
flash[:error] = "很抱歉,您無此權限或帳號登入本站,請洽本站管理員<br />Sorry, you don't have the account or authority to login. Please contact the website administrator."
redirect_to :root
end
end
def destroy
@user_id_type = session[:user_id_type]
sign_out
if @user_id_type == "myntumb"
redirect_to "https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignout1.0&wreply=https://management.ntu.edu.tw"
else
redirect_to root_path
end
end
end
-3
View File
@@ -16,13 +16,10 @@ class User
field :first_name, localize: true
field :last_name, localize: true
field :email
field :email_hidden, :type => Boolean, :default => false
field :sex, :default => 'unknown'
field :office_tel
field :cache_dept,type: Hash
field :status_record,type: Hash
field :ntu_seq
#validates :ntu_seq, :uniqueness => true
has_and_belongs_to_many :approving_apps, class_name: 'AuthApproval', inverse_of: 'authorized_users'
has_and_belongs_to_many :managing_apps, class_name: 'AuthManager', inverse_of: 'authorized_users'
@@ -1 +0,0 @@
<p>Successfully Imported Announcement Data!</p>
@@ -1 +0,0 @@
<p>Successfully Journal Paper Data!</p>
@@ -1 +0,0 @@
<p>Successfully Imported Page Data!</p>
@@ -1 +0,0 @@
<p>Successfully Imported Teacher Data!</p>
@@ -1 +0,0 @@
<p>Book Data Synced Successfully!</p>
@@ -1 +0,0 @@
<p>Conference Paper Data Synced Successfully!</p>
@@ -1 +0,0 @@
<p>Journal Paper Data Synced Successfully!</p>
@@ -6,7 +6,6 @@
<%= stylesheet_link_tag "lib/main-list" %>
<%= stylesheet_link_tag "lib/filter" %>
<%= stylesheet_link_tag "lib/member" %>
<%= stylesheet_link_tag "lib/togglebox" %>
<% end -%>
<% content_for :page_specific_javascript do -%>
@@ -94,13 +94,7 @@
<%= f.email_field :email %>
</div>
</div>
<div class="control-group">
<%= f.label "Disable email", :class=>"control-label muted" %>
<div class="controls">
<%= f.check_box :email_hidden %>
</div>
</div>
<!-- ID Number -->
<div class="control-group">
<%= f.label t("users.sid"),:class=>"control-label muted" %>
@@ -21,7 +21,6 @@
</form>
</div>
<ul class="nav nav-pills filter-nav pull-right">
<li class="accordion-group">
<div class="accordion-heading">
@@ -22,7 +22,6 @@
<%= link_to("<i class='icon-edit'></i> #{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
<%= link_to("<i class='icons-cycle'></i> #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
</div>
</div>
<div id="member-roles" class="nano">
+30 -62
View File
@@ -1,62 +1,30 @@
<div class="sign-in have-other-sign-in">
<% flash.each do |key, msg| %>
<%= content_tag :p, msg, :class => [key, "alert alert-error"] %>
<% end %>
<div class="form">
<h3 class="login-logo"><%= t(:login) %></h3>
<div class="other-sign-in">
<% @request_hosts = request.host_with_port.split(".") %>
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://management.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
<p>or</p>
</div>
<div class="form-block">
<div class="form-list clearfix">
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'content'} do |f| %>
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<%= f.text_field :user_id, :placeholder => t("users.user_id") %>
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icon-lock"></i>
</label>
<%= f.password_field :password, :placeholder => t(:dots) %>
</div>
<!-- <label class="checkbox">
<input type="checkbox" value="">
<small>Remember me</small>
</label> -->
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
<% end %>
<!-- <form class="content" accept-charset="UTF-8" action="/users/sign_in" method="post">
<div class="control-group clear">
<label for="user_email">
<i class="icon-user"></i>
</label>
<input type="text" id="user_id" name="user[id]" placeholder="帳號" />
</div>
<div class="control-group clear">
<label for="user_password">
<i class="icons-mail"></i>
</label>
<input type="text" id="user_email" name="user[email]" placeholder="電子郵件" />
</div>
<button class="btn btn-primary" type="submit">Submit</button>
</form> -->
</div>
<!-- <div class="switchboard"><span>Forgot Password ?</span> <i class="icons-arrow-left-2"></i></div> -->
</div>
<!-- <div class="register">
<button class="btn btn-inverse" type="submit">Register</button>
</div> -->
</div>
</div>
<h1 class="login-logo"><%= t(:ruling_site) %></h1>
<div id="signin-header">
<h3><%= t(:login) %></h3>
</div>
<div id="container" class="sign-in">
<%= form_for resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'user_new form-horizontal'} do |f| %>
<div class="content">
<% flash.each do |key, msg| %>
<%= content_tag :span, msg, :class => [key, "notice label label-warning"] %>
<% end %>
<p class="alert hide">You need to sign in or sign up before continuing.</p>
<div class="main">
<div class="control-group clear">
<%= f.label :user_id ,t("users.user_id")%>
<%= f.text_field :user_id, :placeholder => t("users.user_id"), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
<div class="control-group clear">
<%= f.label :password,t("password") %>
<%= f.password_field :password, :placeholder => t(:dots), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
<%= link_to t(:forgot_password), new_user_password_path, :class => 'pull-right forgot hide' %>
</div>
</div>
</div>
<div class="form-actions clear">
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary pull-right' %>
</div>
<% end %>
</div>
-5
View File
@@ -53,11 +53,6 @@
</div>
<div class="modal-body">
<%= form_for :user, url: user_session_path, html: {class: 'container'} do |f| %>
<div class="other-sign-in">
<% @request_hosts = request.host_with_port.split(".") %>
<a class="btn btn-primary" type="submit" href="https://adfs.ntu.edu.tw/adfs/ls/?wa=wsignin1.0&wtrealm=https://management.ntu.edu.tw/saml_login&wctx=<%= @request_hosts[0] %>">使用計中帳號登入</a>
<p>or</p>
</div>
<div class="input-prepend">
<span class="add-on">
<i class="icon-user"></i>
+2 -3
View File
@@ -13,9 +13,8 @@
<body>
<%= render 'layouts/orbit_bar' %>
<%= yield %>
<!--<div id="sign-footer">
<div id="sign-footer">
<p>Rulingcom</p>
</div>
-->
</div>
</body>
</html>
+1 -1
View File
@@ -8,7 +8,7 @@ defaults: &defaults
development:
<<: *defaults
database: ntu_mb_orbit_test
database: test_site
-19
View File
@@ -9,14 +9,6 @@ Orbit::Application.routes.draw do
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
end
devise_scope :user do
get 'user_login' => 'sessions#create'
match 'user_logout' => 'sessions#destroy'
end
match "saml_login" => 'saml_logins#index'
mount Resque::Server, :at => "/admin/resque"
mount Rack::GridFS::Endpoint.new(:db => Mongoid.database,:lookup=>:path), :at => "gridfs"
@@ -208,17 +200,6 @@ Orbit::Application.routes.draw do
get 'change_design'
get 'preference'
end
get "import_data/get_teacher_data"
get "import_data/get_book_data"
get "import_data/get_conference_data"
get "import_data/get_journal_paper_data"
get "import_data/get_announcement_data"
get "import_data/get_page_data"
get "import_data/sync_book_data"
get "import_data/sync_journal_paper_data"
get "import_data/sync_conference_data"
resources :tags do
collection do
@@ -84,11 +84,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin.create_user_id = current_user.id
@bulletin.update_user_id = current_user.id
if(is_manager? || is_admin?)
#if(is_manager? || is_admin?)
@bulletin.is_checked = true
@bulletin.is_rejected = false
@bulletin.de_pending
end
#end
respond_to do |format|
if @bulletin.save
@@ -132,11 +132,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
respond_to do |format|
if @bulletin.update_attributes(params[:bulletin])
if(is_manager? || is_admin?)
#if(is_manager? || is_admin?)
@bulletin.is_checked = true
@bulletin.is_rejected = false
@bulletin.de_pending!
end
#end
# if (params[:bulletin][:is_checked] == "false")
# @bulletin.is_rejected = true
# @bulletin.save!
@@ -1,30 +0,0 @@
<% show_research_field.attribute_fields.where(:disabled=>false).asc(:_id).each do |rf| %>
<%
if !@member.get_attribute_value(rf).blank?
if !@member.get_attribute_value(rf)['val'].blank?
@rodata = @member.get_attribute_value(rf)['val']
elsif !@member.get_attribute_value(rf)[I18n.locale].blank?
@rodata = @member.get_attribute_value(rf)[I18n.locale]
else
@rodata = nil
end
if !@rodata.blank? and !@member.get_attribute_value(rf).get_value_by_locale(I18n.locale).blank?
%>
<tr>
<% if rf.title == "Research Field"%>
<td><%= rf.title %></td>
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
</tr>
<%end%>
</tr>
<% end -%>
<% end -%>
<% end -%>
@@ -1,4 +1,4 @@
<!-- <%
<%
@status = @member.role_statuses.where(:role_id=>show_roles.id)
if !@status.blank?
@@ -8,7 +8,7 @@
<td><%= show_attribute_value(@member.role_statuses.where(:role_id=>show_roles.id).map{|t|t.title.to_s}.join(',')) rescue '' %></td>
</tr>
<% end -%> -->
<% end -%>
<%
@category = @member.role_categorys.where(:role_id=>show_roles.id)
@@ -38,12 +38,8 @@
%>
<tr>
<% if rf.title != "Research Field"%>
<td><%= rf.title %></td>
<td><%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %></td>
</tr>
<%end%>
</tr>
<% end -%>
@@ -1,5 +1,5 @@
<% # encoding: utf-8 %>
<!-- useless comment -->
<section>
<div class="side"></div>
@@ -38,10 +38,7 @@
<%= @job_title %>
</li>
<% end %>
<% if !member.email_hidden? %>
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
<% end %>
<li><b class="o-members-label"><%= t("users.email")%></b><%= member.email %></li>
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
</ul>
</li>
@@ -82,9 +79,7 @@
%>
<li><b class="o-members-label"><%= @member_lists.get_member_list_attribute_field_name("teacher","job_title") %></b><%= @job_title %></li>
<% end %>
<% if !member.email_hidden? %>
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
<% end %>
<li><b class="o-members-label"><%= t("users.email")%></b> <%= member.email %></li>
<li><b class="o-members-label"><%= t("users.office_tel")%></b><%= member.office_tel %></li>
</ul>
</li>
@@ -2,18 +2,19 @@
<div class="member-data">
<table>
<tbody>
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
<tr>
<td><%= t('users.name')%></td>
<td><%= @member.name%></td>
</tr>
<% if !@member.email_hidden? %>
<tr>
<td><%= t('users.email')%></td>
<td><a href="mailto:<%= @member.email %>"><%= @member.email %></a></td>
</tr>
<% if !@member.sid.blank? %>
<tr>
<td><%= t('users.sid')%></td>
<td><%= @member.sid%></td>
</tr>
<% end %>
<% if !@member.office_tel.blank? %>
<tr>
@@ -34,8 +35,8 @@
</tr>
<% end -%>
<% end -%>
<%= render :partial=> "show_research_field",:collection=>@member.roles.asc(:created_at) %>
<%= render :partial=> "show_roles",:collection=>@member.roles.asc(:created_at) %>
</tbody>
</table>
@@ -58,14 +59,13 @@
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<li><a href="#<%= plugin.name.gsub(' ', '') %>"><%= plugin.name %></a></li>
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
<% end %>
<% else %>
<% if !@data.blank? %>
<li><a href="#<%= plugin.name.gsub(' ', '') %>"><%= plugin.name %></a></li>
<li><a href="#<%= plugin["name"].gsub(' ', '') %>"><%= plugin["name"] %></a></li>
<% end %>
<% end %>
@@ -86,9 +86,7 @@
<% if !@intro_data.blank? %>
<% if !@intro_data.brief_intro.blank? or !@intro_data.complete_list.blank? %>
<div class="module-pane" id="<%= plugin.name.gsub(' ', '') %>">
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
<% end %>
@@ -96,8 +94,7 @@
<% else %>
<% if !@data.blank? %>
<div class="module-pane" id="<%= plugin.name.gsub(' ', '') %>">
<div class="module-pane" id="<%= plugin["name"].gsub(' ', '') %>">
<%= render :partial => @plugin_partial if !@plugin_partial.blank? %>
</div>
<% end %>
@@ -93,11 +93,6 @@ orbitDesktop.prototype.initializePersonalBook = function(target,url,cache){ // t
});
}
this.initializePersonalBook.syncComplete = function(){
o.notify("Sync Complete","success");
o.sub_menu_item($("div[content-type=menu] a").eq(0));
}
this.initializePersonalBook.coAuthorformCallback = function(data){
if(data.success){
o.notify(data.msg,"success");
@@ -7,7 +7,7 @@ class Panel::PersonalBook::Desktop::PersonalBooksController < ApplicationControl
page ||= 1
@per_column = 5
@userid = current_user.id
case @view_by
when "abstract"
@per_column = 1
@@ -4,10 +4,13 @@ module Panel::PersonalBook::Desktop::PersonalBooksHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -83,12 +83,11 @@ class WritingBook
end
def create_link
title = []
# title = ["#{self.extracted_chapters}"] if self.extracted_chapters.present?
title << self.paper_title if self.paper_title.present?
title << self.book_title if self.book_title.present?
title << self.publisher if self.publisher.present?
title << self.pages if self.pages.present?
title = ["\"#{self.extracted_chapters}\""]
title << self.book_title
title << self.publisher
title << self.pages
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
title.join(', ')
end
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_book_back_end_writing_book_author_type_quick_edit_path(list_author_type) %>#myModal2" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_author_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_book, :back_end, list_author_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -21,14 +21,14 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row" >
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %> >
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_12 s_grid s_grid_h_3",
@@ -36,8 +36,7 @@
placeholder: t("personal_book.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@personal_book.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :book_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -45,8 +44,7 @@
class: "s_grid_12 s_grid",
value: (@personal_book.book_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -54,8 +52,7 @@
class: "s_grid_12 s_grid",
value: (@personal_book.extracted_chapters_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %> >
<%= f.fields_for :publishers_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -63,8 +60,9 @@
class: "s_grid_12 s_grid",
value: (@personal_book.publishers_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_book.book_paper_type"), class: "s_grid_4 s_grid") %>
<%= f.select :book_paper_type_id, BookPaperType.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
@@ -107,12 +105,7 @@
<%= label_tag("", t("personal_book.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_book.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
</li>
@@ -127,14 +120,9 @@
<%= label_tag("", t("personal_book.isbn"), class: "s_grid_4 s_grid") %><%= f.text_field :isbn, size: "20", class: "s_grid_8 s_grid"%>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_book.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_book.note"), class: "s_grid_12 s_grid s_grid_h_5 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -165,8 +153,7 @@
</table>
</li>
</ul>
</div>
</div>
</div>
<script>
var get_html = function(old_id,new_id){
@@ -57,15 +57,14 @@
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_book_data_path(:user_id=>@userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="books_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @writing_books.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="books_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @writing_books.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -75,8 +75,6 @@
<% if is_admin? %>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_book_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= 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' %>
</div>
@@ -42,10 +42,7 @@ orbitDesktop.prototype.initializeConferencePapers = function(target,url,cache){
this.initializeConferencePapers.cancelpaper = function(){
o.highlight_sub_menu_item(0);
}
this.initializeConferencePapers.syncComplete = function(){
o.notify("Sync Complete","success");
o.sub_menu_item($("div[content-type=menu] a").eq(0));
}
var uploadFiles = function(){
$('#add_plugin_file a.add').click(function(){
var new_id = $(this).prev().attr('value');
@@ -4,7 +4,7 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
@writing_conferences = WritingConference.where(create_user_id: current_user.id)
page = params[:page]
page ||= 1
@userid = current_user.id
if @view_by.nil?
@writing_conferences = @writing_conferences.asc(:paper_title)
else
@@ -84,11 +84,12 @@ class WritingConference
end
def create_link
title = ["#{self.paper_title}"]
title << self.conference_title if self.conference_title.present?
title << self.sponsor if self.sponsor.present?
title << self.location if self.location.present?
title << "#{period_start_date}-#{period_end_date}" if (self.period_start_date.present? && self.period_end_date.present?)
title = ["\"#{self.paper_title}\""]
title << self.conference_title
title << self.sponsor
title << self.location
title << "#{period_start_date}-#{period_end_date}"
# title << "(#{self.conference_paper_types.collect{|x| x.title}.join(', ')})"
title.join(', ')
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_conference_back_end_writing_conference_author_type_quick_edit_path(list_author_type) %>#myModal2" data-toggle="modal" data-remote="true" class="action">編輯</a>
<%= link_to show_toggle_archive_btn(list_author_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_conference, :back_end, list_author_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_conference_back_end_writing_conference_paper_type_quick_edit_path(list_paper_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action">編輯</a>
<%= link_to show_toggle_archive_btn(list_paper_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_conference, :back_end, list_paper_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -29,14 +29,13 @@
</div>
</div>
<div class="viewport"> -->
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row" >
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :paper_title_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_12 s_grid_h_2 s_grid",
@@ -44,8 +43,6 @@
placeholder: t("personal_conference.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -53,8 +50,9 @@
class: "s_grid_12 s_grid",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type"), class: 's_grid s_grid_4') %>
@@ -99,11 +97,7 @@
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_8 s_grid"%>
</li>
</ul>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :author_tokens,
class: "s_grid_12 s_grid",
@@ -155,12 +149,7 @@
</li>
<li class="s_grid_row"><input class="s_grid s_grid_12" type="text" placeholder=<%= t("personal_conference.tags") %>></li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -190,22 +179,16 @@
</tbody>
</table>
</li>
</ul>
</div>
<div column="true">
<ul class="s_form">
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_12 s_grid_h_10 s_grid"%>
</li>
</ul>
</div>
<div column="true">
<ul class="s_form">
<li class="s_grid_row">
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_12 s_grid_h_10 s_grid"%>
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_12 s_grid_h_10 s_grid s_grid_h_full"%>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_12 s_grid_h_10 s_grid s_grid_h_full"%>
</li>
</ul>
</div>
</div>
<!-- </div>
</div> -->
@@ -58,9 +58,6 @@
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_conference_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Conference Papers</a></div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
@@ -75,8 +75,6 @@
<% if is_admin? %>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_conference_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= 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' %>
</div>
@@ -4,10 +4,13 @@ module Panel::PersonalDiploma::Desktop::PersonalDiplomasHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -21,10 +21,8 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<%= label_tag("", t("personal_diploma.start_date"), class: "s_grid_4 s_grid") %>
<%= f.date_select :start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
@@ -35,10 +33,11 @@
<%= f.date_select :end_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
<%= f.date_select :end_date, {:use_month_numbers => true, :order => [:month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li>
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :school_name_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -46,8 +45,7 @@
class: "s_grid_12 s_grid",
value: (@diploma.school_name_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :country_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -55,8 +53,7 @@
class: "s_grid_12 s_grid",
value: (@diploma.country_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -64,8 +61,7 @@
class: "s_grid_12 s_grid",
value: (@diploma.department_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :degree_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -73,8 +69,9 @@
class: "s_grid_12 s_grid",
value: (@diploma.degree_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_diploma.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
</li>
@@ -85,16 +82,10 @@
<%= f.label :language, t("personal_diploma.language"), :class => "s_grid s_grid_4" %>
<%= f.select :language, Diploma::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_diploma.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_diploma.note"), class: "s_grid_12 s_grid s_grid_h_10 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
</div>
@@ -60,8 +60,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="diploma_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @diplomas.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="diploma_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @diplomas.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -4,10 +4,13 @@ module Panel::PersonalExperience::Desktop::PersonalExperiencesHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_experience_back_end_experience_experience_category_quick_edit_path(list_experience_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_experience_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_experience, :back_end, list_experience_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -21,14 +21,13 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :organizationt_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -36,8 +35,7 @@
class: "s_grid_12 s_grid",
value: (@experience.organizationt_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :department_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -45,8 +43,7 @@
class: "s_grid_12 s_grid",
value: (@experience.department_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :job_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -54,8 +51,9 @@
class: "s_grid_12 s_grid",
value: (@experience.job_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_experience.experience_category"), class: "s_grid_4 s_grid") %>
<%= f.select :experience_category_id, ExperienceCategory.all.collect {|t| [ t.title, t.id ]}, {:class => "s_grid s_grid_8"} %>
@@ -80,16 +78,9 @@
<%= f.label :language, t("personal_experience.language"), :class => "s_grid s_grid_4" %>
<%= f.select :language, Experience::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_experience.note"), value: @experience.note , class: "s_grid_12 s_grid s_grid_h_3"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_experience.note"), value: @experience.note , class: "s_grid_12 s_grid s_grid_h_3 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
</div>
@@ -61,8 +61,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="experience_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @experiences.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="experience_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @experiences.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -4,10 +4,13 @@ module Panel::PersonalHonor::Desktop::PersonalHonorsHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_honor_back_end_honor_honor_category_quick_edit_path(list_honor_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_honor_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_honor, :back_end, list_honor_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -21,11 +21,9 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row" >
<%= label_tag("", t("personal_honor.award_name"), class: "s_grid_4 s_grid") %><%= f.text_field :award_name, size: "20", class: "s_grid_8 s_grid"%>
</li>
<li class="s_grid_row">
@@ -49,16 +47,10 @@
<%= f.label :language, t("personal_honor.language"), :class => "s_grid s_grid_4" %>
<%= f.select :language, Honor::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_honor.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_honor.note"), class: "s_grid_12 s_grid s_grid_h_5 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
</div>
@@ -59,8 +59,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="honor_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @honors.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="honor_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @honors.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -42,10 +42,6 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.cancelpaper = function(){
o.highlight_sub_menu_item(0);
}
this.initializeJournalPapers.syncComplete = function(){
o.notify("Sync Complete","success");
o.sub_menu_item($("div[content-type=menu] a").eq(0));
}
var uploadFiles = function(){
$('#add_plugin_file a.add').click(function(){
@@ -7,7 +7,7 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
page ||= 1
@per_column = 5
@userid = current_user.id
case @view_by
when "abstract"
@per_column = 1
@@ -90,12 +90,10 @@ class WritingJournal
end
def create_link
title = ["#{self.paper_title}"]
title << self.journal_title if self.journal_title.present?
title = ["\"#{self.paper_title}\""]
title << self.journal_title
title.join(', ')
title << ( !self.journal_level_types.blank? ? "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})" : nil)
title << "Volume No: "+self.vol_no if (self.vol_no.present? && self.vol_no != "0")
title << "From Page: "+self.form_to_start if (self.form_to_start.present? && self.form_to_start != "0")
title << "To Page: "+self.form_to_end if (self.form_to_end.present? && self.form_to_end != "0")
title.join(', ')
end
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_journal_back_end_writing_journal_author_type_quick_edit_path(list_author_type) %>#myModal2" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_author_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_journal, :back_end, list_author_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_journal_back_end_writing_journal_level_type_quick_edit_path(list_level_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to "Delete",
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_journal, :back_end, list_level_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -5,7 +5,7 @@
<td>
<a href="<%= panel_personal_journal_back_end_writing_journal_level_type_quick_edit_path(list_level_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action">編輯</a>
<%= link_to show_toggle_archive_btn(list_level_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_journal, :back_end, list_level_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle" %>
</td>
</tr>
@@ -44,7 +44,7 @@
placeholder: t("personal_journal.paper_title")+ "("+I18nVariable.from_locale(locale)+")",
value: (@writing_journal.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
<p></p>
<%= f.fields_for :journal_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -58,9 +58,6 @@
</ul>
</div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
</div>
<div class="hh1 hp sdm">
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
@@ -80,8 +80,6 @@
<% if is_admin? %>
<div class="bottomnav clearfix">
<div class="action pull-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus') + t('personal_plugins.sync_data'), admin_import_data_sync_journal_paper_data_path(:user_id => @user.id), :class => 'btn btn-primary' %>
<%= 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' %>
</div>
@@ -4,10 +4,13 @@ module Panel::PersonalLab::Desktop::PersonalLabsHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -21,14 +21,13 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :lab_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -36,8 +35,7 @@
class: "s_grid_12 s_grid",
value: (@lab.lab_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :location_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -45,8 +43,7 @@
class: "s_grid_12 s_grid",
value: (@lab.location_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participating_professor_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -54,8 +51,7 @@
class: "s_grid_12 s_grid",
value: (@lab.participating_professor_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participating_student_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -63,8 +59,9 @@
class: "s_grid_12 s_grid",
value: (@lab.participating_student_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_lab.extension_no"), class: "s_grid_4 s_grid") %><%= f.text_field :extension_no, size: "20", class: "s_grid_8 s_grid"%>
</li>
@@ -81,12 +78,7 @@
<li class="s_grid_row">
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_lab.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= label_tag("", t("personal_lab.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
</li>
@@ -95,14 +87,8 @@
<%= f.select :language, Lab::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_lab.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_lab.note"), class: "s_grid_12 s_grid s_grid_h_5 s_grid_h_full"%>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -133,8 +119,7 @@
</table>
</li>
</ul>
</div>
</div>
</div>
<script>
var get_html = function(old_id,new_id){
@@ -61,8 +61,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="lab_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @labs.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="lab_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @labs.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -4,10 +4,13 @@ module Panel::PersonalPatent::Desktop::PersonalPatentsHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_patent_back_end_writing_patent_writing_patent_category_quick_edit_path(list_patent_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_patent_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_patent, :back_end, list_patent_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -21,14 +21,13 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :patent_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -36,8 +35,9 @@
class: "s_grid_12 s_grid",
value: (@patent.patent_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_patent.patent_no"), class: "s_grid_4 s_grid") %><%= f.text_field :patent_no, size: "20", class: "s_grid_8 s_grid"%>
</li>
@@ -67,21 +67,10 @@
<%= f.label :language, t("personal_patent.language"), :class => "s_grid s_grid_4" %>
<%= f.select :language, WritingPatent::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_patent.note"), class: "s_grid_12 s_grid s_grid_h_5"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_patent.note"), class: "s_grid_12 s_grid s_grid_h_5 s_grid_h_full"%>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -112,8 +101,7 @@
</table>
</li>
</ul>
</div>
</div>
</div>
<script>
var get_html = function(old_id,new_id){
@@ -60,8 +60,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="patent_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @patents.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="patent_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @patents.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -5,10 +5,13 @@ module Panel::PersonalProject::Desktop::PersonalProjectsHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -5,7 +5,7 @@
<td class="span2">
<a href="<%= panel_personal_project_back_end_project_project_category_quick_edit_path(list_project_type) %>#myModal1" data-toggle="modal" data-remote="true" class="action"><%= t('edit')%></a>
<%= link_to show_toggle_archive_btn(list_project_type),
<%= link_to 'Delete',
polymorphic_path([:panel, :personal_project, :back_end, list_project_type]), :confirm => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
</td>
</tr>
@@ -21,14 +21,13 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :project_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -36,8 +35,7 @@
class: "s_grid_12 s_grid",
value: (@project.project_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :job_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -45,8 +43,7 @@
class: "s_grid_12 s_grid",
value: (@project.job_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :participator_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -54,8 +51,7 @@
class: "s_grid_12 s_grid",
value: (@project.participator_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :unit_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -63,8 +59,9 @@
class: "s_grid_12 s_grid",
value: (@project.unit_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_project.start_date"), class: "s_grid_4 s_grid") %>
<%= f.date_select :period_start_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
@@ -86,12 +83,7 @@
<li class="s_grid_row">
<%= label_tag("", t("personal_project.url"), class: "s_grid_4 s_grid") %><%= f.text_field :url, size: "20", class: "s_grid_8 s_grid"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :keywords, size: "20x3", placeholder: t("personal_project.keywords"), class: "s_grid_12 s_grid_h_2 s_grid"%>
</li>
@@ -100,23 +92,13 @@
<%= f.select :language, Project::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_project.note"), class: "s_grid_12 s_grid s_grid_h_7"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_project.note"), class: "s_grid_12 s_grid s_grid_h_7 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_project.abstract"), class: "s_grid_12 s_grid s_grid_h_10"%>
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_project.abstract"), class: "s_grid_12 s_grid s_grid_h_10 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -147,8 +129,6 @@
</table>
</li>
</ul>
</div>
</div>
</div>
<script>
var get_html = function(old_id,new_id){
@@ -61,8 +61,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="project_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @projects.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="project_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @projects.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -5,10 +5,13 @@ module Panel::PersonalResearch::Desktop::PersonalResearchsHelper
"item" => "true",
"data-id" => publication.id.to_s,
:class => "list_t_item #{view.blank? ? '' : "#{view}_view" } #{publication.is_hidden? ? "private" : "public" }" do
content_tag :div,
:class => "inner" do
marker(publication.id) + \
content(publication, view) + \
edit_or_delete(publication)
end
end
end
def marker id
@@ -21,14 +21,13 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" content-layout="column" base-width="420">
<div column="true">
<div class="s_form">
<ul>
<div class="overview" content-layout="simple" base-width="420">
<ul class="s_form" isotope="true">
<li class="s_grid_row">
<% @site_valid_locales.each_with_index do |locale, i| %>
<% style = locale != I18n.locale.to_s ? 'style=display:none;' : "" %>
<% data = "data-language=" + locale %>
<li class="s_grid_row" <%= style %> <%= data %>>
<div class="form_fix" <%= style %> <%= data %>>
<%= f.fields_for :research_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -36,8 +35,7 @@
class: "s_grid_12 s_grid",
value: (@research.research_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row" <%= style %> <%= data %>>
<%= f.fields_for :extracted_chapters_translations do |f| %>
<%= f.text_field locale,
size: "20",
@@ -45,8 +43,9 @@
class: "s_grid_12 s_grid",
value: (@research.extracted_chapters_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
</div>
<% end %>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_research.publication_date"), class: "s_grid_4 s_grid") %>
<%= f.date_select :publish_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year] }, {:class => 's_grid_4 s_grid'} %>
@@ -63,14 +62,9 @@
<%= f.select :language, Research::LANGUAGE_TYPES,{} ,{:class => "s_grid s_grid_8"} %>
</li>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x3", placeholder: t("personal_research.note"), class: "s_grid_12 s_grid s_grid_h_3"%>
<%= f.text_area :note, size: "20x3", placeholder: t("personal_research.note"), class: "s_grid_12 s_grid s_grid_h_3 s_grid_h_full"%>
</li>
</ul>
</div>
</div>
<div column="true">
<div class="s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
@@ -101,8 +95,6 @@
</table>
</li>
</ul>
</div>
</div>
</div>
<script>
var get_html = function(old_id,new_id){
@@ -61,8 +61,10 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div class="overview" page-name="research_list" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<% @researches.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
<div class="overview" page-name="research_list" content-layout="simple" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="view=<%= @view_by %>&page" >
<ul isotope="true">
<% @researches.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>
</ul>
</div>
@@ -21,6 +21,7 @@ function setData(l, length, optionsI, className) {
radiogroupsName = l+"][survey_question_radiogroups_attributes]["+optionsI+"][name_translations]";
data = {
_l: l,
_ques: "new",
_length: length,
_className: className,
_destroy: [id+l+"_destroy", name+l+"][_destroy]"],
@@ -48,6 +49,7 @@ function setEditData(l, length, d, optionsI, className) {
radiogroupsName = l+"][survey_question_radiogroups_attributes]["+optionsI+"][name_translations]";
data = {
_l: l,
_ques: "old",
_length: length,
_className: className,
_destroy: [id+l+"__destroy", name+l+"][_destroy]"],
@@ -75,11 +77,14 @@ function setEditQuestionAttributes(l, length, d, optionsI, className) {
radiogroupsID = l+"_survey_question_radiogroups_attributes_"+optionsI+"_name_translations_",
radiogroupsName = l+"][survey_question_radiogroups_attributes]["+optionsI+"][name_translations]",
option_id = l+"][survey_question_options_attributes]["+optionsI+"][id]",
destroy = l+"][survey_question_options_attributes]["+optionsI+"][_destroy]",
radiogroups_id = l+"][survey_question_radiogroups_attributes]["+optionsI+"][id]";
data = {
_l: l,
_length: length,
_ques: "old",
_className: className,
_destroy: [name+destroy],
_option: [id+optionID, name+optionName, "attributes_"+l+"_options_"+optionsI+"_", d.name_translations],
_radiogroups: [id+radiogroupsID, name+radiogroupsName, "attributes_"+l+"_radiogroups_"+optionsI+"_",d.name_translations],
_options_id: [name+option_id,d._id],
@@ -93,7 +98,12 @@ function inputAppendLength(element, length) {
if(length == 2) {
element.closest('.add-target').find('.remove-input').addClass('hide').prev().addClass('last');
}
element.closest('.input-append').remove();
var option = element.closest('.input-append');
if( option.data( 'question-option' ) == "old" ){
option.hide().removeAttr( 'question-option' ).find( "input.should_destroy_option" ).val("1");
} else if( option.data( "question-option" ) == "new"){
option.remove();
}
}
function editQuestion (dataArray){
@@ -165,7 +175,7 @@ $(function() {
};
});
$('.add-question').on(clickEvent, function(event) {
$('#template-survery').tmpl(setData(l, $('.questions > .attributes').length + 1)).appendTo($('.questions'));
$('#template-survery').tmpl(setData(l, $('.questions > .attributes[data-question]').length + 1)).appendTo($('.questions'));
checkQuestionsLength();
textareaResizable(); // from textarea-lang-btn.js
l += 1;
@@ -207,14 +217,26 @@ $(function() {
inputAppendLength($(this), $(this).closest('.add-target').children('.input-append').length);
} else if($(this).hasClass('delete')) {
$(this).closest('.attributes').fadeOut(300, function() {
$(this).hide();
$( this ).find( '.should_destroy' ).val(1);
checkQuestionsLength();
$('.questions .attributes').each(function(index, el) {
$( this ).find( "input.sequence" ).val( index );
$( this ).find( "h4 span:eq(0)" ).text( index + 1 );
$( this ).attr( "data-index", index );
});
if( $( this ).data( 'question' ) == "old" ){
$(this).hide().removeAttr('data-question');
$( this ).find( '.should_destroy' ).val(1);
l--;
checkQuestionsLength();
$('.questions .attributes[data-question]').each(function(index, el) {
$( this ).find( "input.sequence" ).val( index );
$( this ).find( "h4 span:eq(0)" ).text( index + 1 );
$( this ).attr( "data-index", index );
});
} else if( $( this ).data( 'question' ) == "new" ){
$( this ).remove();
l--;
checkQuestionsLength();
$('.questions .attributes[data-question]').each(function(index, el) {
$( this ).find( "input.sequence" ).val( index );
$( this ).find( "h4 span:eq(0)" ).text( index + 1 );
$( this ).attr( "data-index", index );
});
}
});
} else if($(this).hasClass('icon-caret-up') || $(this).hasClass('icon-caret-down')) {
if($(this).hasClass('icon-caret-up')) {
@@ -236,7 +258,7 @@ $(function() {
$('#template-survery-option').tmpl(setData(_index, "", _i, _className)).insertBefore($(this).closest('.add-btn'));
$(this).closest('.add-target').find('.input-append').find('.remove-input').removeClass('hide').prev().removeClass('last');
_i += 1
$(this).closest('.control-group').data('index', _i)
$(this).closest('.control-group').data('index', _i);
}
event.preventDefault();
});
@@ -1,11 +1,11 @@
<script id="template-survery" type="text/x-tmpl">
<div class="attributes" data-index="${_l}">
<div class="attributes" data-index="${_l}" data-question="${_ques}">
<div class="attributes-header clearfix">
<a class="btn btn-mini pull-right btn-danger delete" href="#"><i class="icon-trash"></i> Delete</a>
<input class="should_destroy" id="${_destroy[0]}" name="${_destroy[1]}" type="hidden">
<input id="${_sequence[0]}" class="sequence" name="${_sequence[1]}" type="hidden" value="${_sequence[2]}">
{{if _id}}
<input id="${_id[0]}" class="sequence" name="${_id[1]}" type="hidden" value="${_id[2]}">
<input id="${_id[0]}" name="${_id[1]}" type="hidden" value="${_id[2]}">
{{/if}}
<h4><b></b> Q<span>${_length}</span> <i class="icon-caret-up"></i> <span class="questions-title">${_title_translations[3].en}</span></h4>
</div>
@@ -123,9 +123,10 @@
<script id="template-survery-option" type="text/x-tmpl">
{{if _className == 'rgl'}}
<div class="input-append">
<div class="input-append" data-question-option="${_ques}">
{{if _radiogroups_id}}
<input type="hidden" value="${_radiogroups_id[1]}" name="${_radiogroups_id[0]}" />
<input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
{{/if}}
<div class="tab-content">
<div class="tab-pane fade active in" id="${_radiogroups[2]+'en'}">
@@ -144,9 +145,10 @@
</div>
</div>
{{else}}
<div class="input-append">
<div class="input-append" data-question-option="${_ques}">
{{if _options_id}}
<input type="hidden" value="${_options_id[1]}" name="${_options_id[0]}" />
<input type="hidden" class="should_destroy_option" name="${_destroy[0]}" />
{{/if}}
<div class="tab-content">
<div class="tab-pane fade active in" id="${_option[2]+'en'}">