Merge branch 'store' of github.com:Rulingcom/orbit into store

This commit is contained in:
OrbitServer 2012-12-06 16:08:01 +08:00
commit 339e20964a
46 changed files with 508 additions and 271 deletions

View File

@ -116,7 +116,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete" href="'+paper.url_delete+'">Delete</a></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div><div class="list_item_function"><a class="journal_paper_edit admbg2 admtxt" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete admbg2 admtxt" href="'+paper.url_delete+'">Delete</a></div></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@ -145,7 +145,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
var img = $('<div class="list_t_des"><a href="'+file.url+'" target="_blank" ><img src="'+file.icon+'" />'+thistitle+'</a></div>');
li.append(img);
})
li.append('<a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete" href="'+paper.url_delete+'">Delete</a>');
li.append('<div class="list_item_function"><a class="journal_paper_edit admbg2 admtxt" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete admbg2 admtxt" href="'+paper.url_delete+'">Delete</a></div>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@ -164,7 +164,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete" href="'+paper.url_delete+'">Delete</a></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div><div class="list_item_function"><a class="journal_paper_edit admbg2 admtxt" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete admbg2 admtxt" href="'+paper.url_delete+'">Delete</a></div></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@ -184,7 +184,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete" href="'+paper.url_delete+'">Delete</a></li>');
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_item_function"><a class="journal_paper_edit admbg2 admtxt" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete admbg2 admtxt" href="'+paper.url_delete+'">Delete</a></div></li>');
column.find("ul").append(li);
if(counter%5==0){
$("#journal_p div#paper_list div.overview").append(column);
@ -203,7 +203,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
li;
$.each(journalData,function(i,journal){
$.each(journal.papers,function(j,paper){
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div><a class="journal_paper_edit" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete" href="'+paper.url_delete+'">Delete</a></li>');
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="icon-check-empty"></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.abstract+'</div><div class="list_item_function"><a class="journal_paper_edit admbg2 admtxt" href="'+paper.url_edit+'">Edit</a> <a class="journal_paper_delete admbg2 admtxt" href="'+paper.url_delete+'">Delete</a></div></li>');
column.find("ul").append(li);
$("#journal_p div#paper_list div.overview").append(column);
column = $('<div class="g_col list_t"><ul></ul></div>');
@ -238,10 +238,9 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.journal = function(){ // to open add pages in journal papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
fill: '.g_col'
})
}
bindHandlers();
@ -261,9 +260,9 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
fill: '.g_col'
})
$("a.bt-edit").click(function(){
$("div[container=true]").unbind(".editcoauthor").on("click.editcoauthor", "a.bt-edit", function(){
$.ajax({
url : $(this).attr("href"),
type : "get",
@ -281,7 +280,25 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
})
return false;
})
$("div[container=true]").unbind(".editype").on("click.edittype", "a.bt-edit-type", function(){
var parent = $(this).parent().parent();
parent.find('.list_item_function').hide();
$.ajax({
url : $(this).attr("href"),
type : "get",
success : function(data){
var prev_data = parent.find(".form_space").html();
parent.find(".form_space").html(data);
$(".bt-cancel-type").click(function(){
parent.find(".form_space").html(prev_data);
parent.find('.list_item_function').show();
});
}
})
return false;
})
$("div[container=true]").unbind(".delete").on("click.delete","a.bt-delete",function(){
var delurl = $(this).attr("href");
var parent = $(this).parent().parent();
o.confirm({
@ -346,7 +363,15 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
this.initializeJournalPapers.coauthorRelationForm = function(data){
if(data.success){
o.notify(data.msg,"success");
$("#co_author_relation_table tbody").prepend(data.newvalue);
$("#co_author_relation_table").html(data.newvalue);
}else{
o.notify(data.msg,"alert");
}
}
this.initializeJournalPapers.coauthorRelationEditForm = function(data){
if(data.success){
o.notify(data.msg,"success");
$("#co_author_relation_table").html(data.newvalue);
}else{
o.notify(data.msg,"alert");
}

View File

@ -26,7 +26,7 @@ var orbitDesktopAPI = function(){
break;
}
$notify.find("img#note_img").attr("src",o.notifyImgPath+img);
$notify.find(".note_message").text(msg);
$notify.find(".note_message").html(msg);
n_height = $notify.outerHeight();
if(!time)time=5000; else time=time*1000;
$notify

View File

@ -26,7 +26,7 @@ time, mark, audio, video {
#container input, #container textarea, #container select, #container input:focus, #container textarea:focus {
border-radius: 0;
box-shadow: none;
font: inherit;
font-family: inherit;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
@ -126,10 +126,13 @@ a:focus { outline: none; }
.ini_input {
margin: 0;
padding: 0;
border: none;
border: 0;
}
.ini_input:focus { outline: none; }
#search_app { position: relative; background-color: #fff; }
#search_app {
position: relative;
background-color: #fff;
}
#search_app .form {
position: absolute;
left: 0;
@ -139,6 +142,7 @@ a:focus { outline: none; }
height: 28px;
line-height: 28px;
background: none;
border: 0;
}
#search_app .submit {
position: absolute;
@ -289,7 +293,7 @@ a:focus { outline: none; }
position: relative;
z-index: 9;
}
.toolbar .sdm, .toolbar .fn_g { display: inline-block; }
.toolbar .sdm, .toolbar .fn_g { display: inline-block; vertical-align: top; }
.toolbar .sdm_o { top: 36px; background-color: #f0f0f0; }
.toolbar button {
border: none;
@ -300,7 +304,10 @@ a:focus { outline: none; }
font-size: 15px;
vertical-align: top;
}
.toolbar .fn_btn {
display: inline-block;
vertical-align: top;
}
/* Setting Page */
.theme_list {}
@ -344,6 +351,7 @@ a:focus { outline: none; }
font-size: 15px;
line-height: 36px;
text-align: center;
border: 0;
}
/* theme color opacity */
@ -452,7 +460,7 @@ a:focus { outline: none; }
height: 100%;
left: 0;
top: 0;
z-index: 9;
z-index: 10;
}
#orbitdiag .tile { background-color: #000; }
.diag_holder { background-color: #000; }
@ -535,7 +543,7 @@ a:focus { outline: none; }
.s_form input[type=text], .s_form input[type=password], .s_form textarea{
outline: solid 3px #f6f6f6;
border: solid 1px #eee;
font-size: 18px;
font-size: 15px;
font-family: Arial !important;
margin: 0;
padding: 6px;
@ -578,14 +586,14 @@ a:focus { outline: none; }
height: 30px;
line-height: 30px;
right: 5px;
top: 4px;
top: 5px;
display: block;
background-color: #fff;
}
.s_form.s_grid_con { width: 416px; }
.s_form .s_grid_row { width: 410px; }
.s_form .s_grid_row .s_grid:first-child { margin-left: 0; }
.s_form input[type=text].s_grid, .s_form input[type=passowrd].s_grid, .s_form textarea.s_grid, .s_form label.s_grid { float: none; display: inline-block; margin-left: 10px; }
.s_form input[type=text].s_grid, .s_form input[type=passowrd].s_grid, .s_form textarea.s_grid, .s_form label.s_grid, .s_form select.s_grid { /*float: none; display: inline-block;*/ margin-left: 10px; }
.s_form input[type=text].s_grid_1, .s_form input[type=passowrd].s_grid_1, .s_form textarea.s_grid_1 { width: 46px; }
.s_form input[type=text].s_grid_2, .s_form input[type=passowrd].s_grid_2, .s_form textarea.s_grid_2 { width: 116px; }
.s_form input[type=text].s_grid_3, .s_form input[type=passowrd].s_grid_3, .s_form textarea.s_grid_3 { width: 186px; }
@ -598,7 +606,30 @@ a:focus { outline: none; }
.s_form select.s_grid_4 { width: 270px; }
.s_form select.s_grid_5 { width: 340px; }
.s_form select.s_grid_6 { width: 410px; }
.s_form label.s_grid { line-height: 34px; }
.s_form select.s_grid {
height: 26px;
margin-top: 4px;
margin-bottom: 4px;
}
.s_form textarea.full_height {
height: 436px;
}
.s_form .s_table {
width: 100%;
}
.s_form .s_table th, .s_form .s_table td {
padding: 6px 0;
}
.s_form .s_table th {
text-align: left;
}
.s_form .s_table td {
vertical-align: middle;
}
.s_form .s_table thead th {
border-bottom: solid 1px #eee;
}
#group_wrapper {}
@ -616,7 +647,7 @@ a:focus { outline: none; }
.list_t_title {
font-size: 15px;
font-family: Arial;
margin-bottom: 10px;
margin-bottom: 6px;
color: #333;
}
.list_t_des {
@ -624,7 +655,7 @@ a:focus { outline: none; }
line-height: 1.5em;
color: #999;
font-family: Arial, sans-serif;
margin-bottom: 10px;
margin-bottom: 4px;
}
/* Connection Page */
@ -684,6 +715,12 @@ a:focus { outline: none; }
float: left;
margin-left: -30px;
}
#paper_list .list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
}
.list_item_action a {
display: block;
width: 20px;
@ -708,6 +745,110 @@ a:focus { outline: none; }
#paper_add .f_w { width: 336px; }
#paper_add label { margin-right: 0; }
/* Journal Journal list */
#journal_list .g_col {
width: 416px;
}
#journal_list .g_col {
float: left;
height: 456px;
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #EEE;
}
#journal_list .g_col:first-child {
margin-left: 0;
padding-left: 0;
border: none;
}
#journal_list .g_col .list_t_item {
padding-left: 30px;
height: 86px;
}
#journal_list .list_item_action {
font-size: 12px;
float: left;
margin-left: -30px;
}
#journal_list .list_item_action i {
color: #999;
font-size: 20px;
display: block;
width: 20px;
height: 20px;
line-height: 20px;
margin: 1px 1px 6px 1px;
}
/* Journal Co-Author */
#co_author {}
#co_author .list_t_item {
height: 110px;
}
#co_author .list_item_function {}
#co_author .list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
}
#co_author .g_col:first-child {
margin-left: 0;
padding-left: 10px;
border: none;
}
#co_author .g_col {
width: 300px;
height: 456px;
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #EEE;
}
#co_author .info {
font-family: Arial, sans-serif;
}
#co_author .info li {
margin-bottom: 8px;
color: #999;
}
#co_author .info .name {
font-size: 18px;
line-height: 24px;
color: #333;
}
/* Journal Co-Author Relationship*/
#co_author_relation_table .s_grid_con {
float: left;
width: 346px;
height: 456px;
margin-left: 12px;
padding-left: 12px;
border-left: solid 1px #EEE;
}
#co_author_relation_table .s_grid_con:first-child {
margin-left: 0;
padding-left: 0;
border: 0;
}
#co_author_relation_table .s_grid_row {
width: auto;
height: 64px;
}
#co_author_relation_table .edit_co_author_relation {
margin-left: -10px;
}
#co_author_relation_table .list_item_function a {
display: inline-block;
padding: 4px;
font-family: Arial, sans-serif;
font-size: 11px;
}
#co_author_relation_table .form_space {
margin-bottom: 10px;
font-size: 15px;
font-family: Arial, sans-serif;
}
/* App */
.app_frame {
margin: 48px 96px 48px 156px;

View File

@ -143,6 +143,7 @@
display: inline-block;
line-height: 22px;
padding: 0 10px;
vertical-align: top;
}
#orbit-bar .nav img.member-img {
display: inline-block;

View File

@ -8,6 +8,9 @@ class Admin::InfosController < ApplicationController
def index
@attributes = Info.all.entries
@roles = Role.excludes('disabled' => true)
render :template => 'admin/attributes/index'
end
@ -22,7 +25,7 @@ class Admin::InfosController < ApplicationController
def edit
@attribute = Info.find(params[:id])
@attribute_fields_upper_object = [@attribute]
# @attribute_fields_upper_object = [@attribute]
render :template => 'admin/attributes/edit'
end
@ -49,10 +52,20 @@ class Admin::InfosController < ApplicationController
end
def add_attribute_field
attribute = Info.find(params[:info_id]) rescue nil
@attribute_field_counter = attribute.attribute_fields.count
@attribute_field = attribute.attribute_fields.build
@attribute_field.save
@attribute_field[:af_count] = @attribute_field_counter
@attribute = Info.find(params[:info_id])
respond_to do |format|
format.js { render 'admin/attributes/add_attribute_field' }
end
end
protected

View File

@ -8,18 +8,38 @@ class Desktop::CoAuthorRelationsController < ApplicationController
end
end
def edit
@co_author_relation = CoAuthorRelation.find(params[:id])
respond_to do |format|
format.html { render :layout => false}
end
end
def new
@new_relation = CoAuthorRelation.new
@co_author_relation = CoAuthorRelation.new
end
def create
@new_relation = CoAuthorRelation.new(params[:co_author_relation])
@co_author_relation = CoAuthorRelation.new(params[:co_author_relation])
@co_author_relations = CoAuthorRelation.all
if @new_relation.save
newv = render_to_string :partial=>"show_form", :object=>@new_relation
render json: {success:true, msg: "New Relation successfully saved!","newvalue"=>newv}.to_json
if @co_author_relation.save
newv = render_to_string partial: "show_form", object: @co_author_relations
render json: {success: true, msg: "New Relation successfully saved!", newvalue: newvm}.to_json
else
error_msg = @new_relation.errors.full_messages.join("<br />")
error_msg = @co_author_relation.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
@co_author_relation = CoAuthorRelation.find(params[:id])
if @co_author_relation.update_attributes(params[:co_author_relation])
@co_author_relations = CoAuthorRelation.all
newv = render_to_string partial: "show_form", object: @co_author_relations
render json: {success: true, msg: "New Relation successfully updated!", newvalue: newv}.to_json
else
error_msg = @co_author.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
@ -27,7 +47,17 @@ class Desktop::CoAuthorRelationsController < ApplicationController
def destroy
@co_author_relation = CoAuthorRelation.find(params[:id])
@co_author_relation.destroy
reset_co_author_relation
render :json => {success: true, msg: "deleted successfully!"}
end
private
def reset_co_author_relation
co_author = CoAuthor.where(co_author_relations_id: @co_author_relation.id)
co_author.map do |c|
c.update_attributes(co_author_relations_id: nil)
end
end
end

View File

@ -1,6 +1,8 @@
class Desktop::CoAuthorsController < ApplicationController
def index
@co_authors = CoAuthor.where(name_id: current_user.id)
nils, not_nils = CoAuthor.where(name_id: current_user.id)\
.asc(:co_author).partition{|p| p.email.nil?}
@co_authors = not_nils + nils
@co_author_relations = CoAuthorRelation.all
respond_to do |format|
@ -8,15 +10,6 @@ class Desktop::CoAuthorsController < ApplicationController
end
end
def show
@co_author = CoAuthor.find(params[:id])
respond_to do |format|
format.html { redirect_to desktop_co_authors_url, :layout => false }
format.json { render json: @co_author }
end
end
def new
@co_author = CoAuthor.new
@co_author_relations = CoAuthorRelation.all

View File

@ -1,5 +1,4 @@
class Desktop::JournalListsController < ApplicationController
def index
level_types = JournalLevelType.all
all_journal_lists = WritingJournal.where(create_user_id: current_user.id)
@ -7,8 +6,7 @@ class Desktop::JournalListsController < ApplicationController
[ j.journal_title,
j.journal_level_type_ids.map do |type|
level_types.find(type).title
end.join(",")
].join(" -- ")
end]
end
@journal_lists = all_journal_lists.uniq

View File

@ -1,6 +1,4 @@
class Desktop::JournalPagesController < ApplicationController
#before_filter :check_for_cancel, :only => [:create, :update]
def index
@writing_journal = WritingJournal.where(create_user_id: current_user.id)
@level_types = JournalLevelType.all
@ -10,9 +8,6 @@ class Desktop::JournalPagesController < ApplicationController
end
end
def show
end
def new
@writing_journal = WritingJournal.new
@level_types = JournalLevelType.all
@ -109,10 +104,4 @@ class Desktop::JournalPagesController < ApplicationController
render json: JSON.pretty_generate(data)
end
private
def check_for_cancel
if params[:commit] == "Cancel"
end
end
end

View File

@ -11,7 +11,6 @@ class Section
def initialize_group
self.groups.build
self.groups.build
end
end
end

View File

@ -4,6 +4,7 @@ class AttributeField
include ::AttributeFieldsHelper
field :key
field :af_count
field :markup ,:default=>"text_field"
field :option_list ,:type => Hash,:default => {}
field :markup_options,:type => Hash

View File

@ -0,0 +1 @@
$('<%= j render :partial => 'shared/attribute_field/attribute_field', :collection => [@attribute_field] %>').appendTo('#attribute_field_list').hide().fadeIn();

View File

@ -18,13 +18,14 @@
</div>
</div>
</div>
<% @attribute_fields_upper_object.each do |attribute|%>
<div class="map-block back attributes">
<h4><span><%= attribute.title+ t(:attributes)%></span></h4>
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>attribute.attribute_fields%>
</div>
<% end %>
<div class="map-block back attributes">
<h4><span><%= @attribute.title+ t(:attributes)%></span></h4>
<div id="attribute_field_list">
<%= render :partial=>"shared/attribute_field/attribute_field",:collection=>@attribute.attribute_fields%>
</div>
</div>
</div>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i,t(:add_attribute_field),:class=>"icon-plus icon-white"),admin_info_add_attribute_field_path(@attribute),:class=>"btn btn-primary",:remote => true%>

0
app/views/desktop/app_manager.html.erb Executable file → Normal file
View File

View File

@ -1,4 +1,5 @@
<%= form_for(@new_relation , url: desktop_co_author_relations_path, html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationForm"} ) do |f| %>
<%= f.text_field :relation %>
<%= f.submit "Save" %>
<%= f.text_field :relation, class: "ini_input" %>
<%= f.submit "Save", class: "ini_input hp hh2 thmtxt thmc2", style: "margin-left: 10px;" %>
<% if not @co_author_relation.new_record? %>
<%= submit_tag "Cancel", :type => "button", class: "bt-cancel-type ini_input hp hh2 thmtxt" %>
<% end %>

View File

@ -0,0 +1,3 @@
<%= form_for(@co_author_relation, url: desktop_co_author_relations_path, html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationForm"} ) do |f| %>
<%= render partial: 'desktop/co_author_relations/form' , locals: {:f => f}%>
<% end %>

View File

@ -1,6 +1,17 @@
<%# @co_author_relations.each do |co_author_relation| %>
<tr>
<td><%= show_form.relation %></td>
<td><%= link_to 'Destroy', desktop_co_author_relation_path(show_form), confirm: 'Are you sure?', method: :delete, :class=>"bt-delete" %></td>
</tr>
<%# end %>
<% @co_author_relations.each_with_index do |co_author_relation,i| %>
<% if ( i % 6 ) == 0 %>
<div class="s_grid_con s_form">
<ul>
<% end %>
<li class="s_grid_row">
<div class="form_space"><%= co_author_relation.relation %></div>
<div class="list_item_function">
<%= link_to 'Edit', edit_desktop_co_author_relation_path(co_author_relation), :class => "bt-edit-type admbg2 admtxt" %>
<%= link_to 'Destroy', desktop_co_author_relation_path(co_author_relation), confirm: 'Are you sure?', method: :delete, :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% if ( i % 6 ) == 5 %>
</ul>
</div>
<% end %>
<% end %>

View File

@ -0,0 +1,3 @@
<%= form_for(@co_author_relation, url: desktop_co_author_relation_path(@co_author_relation), html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationEditForm"} ) do |f| %>
<%= render partial: 'desktop/co_author_relations/form' , locals: {:f => f}%>
<% end %>

View File

@ -1,17 +1,22 @@
<h1>Listing co_author_relations</h1>
<div class="toolbar hh2">
<div class="fn_g hp">
<div class="hh2 sdm">
<div class="sdm_t hp hh2 thmc2 thmtxt">Create</div>
<div class="admbg sdm_o">
<ul>
<li class="vp hp s_form" style="width:282px;"><%= render 'new' %></li>
</ul>
</div>
</div>
<%= submit_tag "Back", :type => "button", class: "bt-cancel fn_btn ini_input hp hh2 thmtxt" %>
</div>
</div>
<%= submit_tag "Back", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
<%= render 'form' %>
<table id="co_author_relation_table">
<thead>
<tr>
<th>Relation</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<%= render :partial => 'show_form', :collection => @co_author_relations %>
</tbody>
</table>
<div id="co_author_relation_table" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<%= render :partial => 'show_form'%>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="fn_g hp">
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= submit_tag "Cancel", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
<%= submit_tag "Cancel", :type => "button", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
</div>
<div></div>

View File

@ -1,3 +1,3 @@
<%= form_for @co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: desktop_co_author_path(@co_author) do |f| %>
<%= form_for @co_author_relation, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: desktop_co_author_path(@co_author_relation) do |f| %>
<%= render partial: 'desktop/co_authors/form', locals: {:f => f} %>
<% end %>

View File

@ -1,28 +1,34 @@
<h1>list all coauthor</h1>
<%= link_to "New Co-Author", new_desktop_co_author_path, :class=>"bt-co-author" %>
<%= link_to "New Type", desktop_co_author_relations_path, :class=>"bt-new-type" %>
<table>
<thead>
<tr>
<th>Name</th>
<th>EMail</th>
<th>Type</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @co_authors.each do |co_author| %>
<tr>
<td><%= co_author.co_author %></td>
<td><%= co_author.email %></td>
<td><%= @co_author_relations.find(co_author.co_author_relations_id).relation \
unless co_author.co_author_relations_id.nil?%></td>
<td><%= link_to 'Edit', edit_desktop_co_author_path(co_author), :class => "bt-edit" %></td>
<td><%= link_to 'Destroy', desktop_co_author_path(co_author), method: :delete, confirm: 'Are you sure?', :class=>"bt-delete" %></td>
</tr>
<% end %>
</tbody>
</table>
<br />
<div class="toolbar hh2">
<div class="fn_g hp">
<%= link_to "New Co-Author", new_desktop_co_author_path, :class=>"bt-co-author fn_btn hp hh2 thmc2 thmtxt" %>
<%= link_to "New Type", desktop_co_author_relations_path, :class=>"bt-new-type fn_btn hp hh2 thmc2 thmtxt" %>
</div>
</div>
<div id="co_author" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<% @co_authors.each_with_index do |co_author,i| %>
<% if ( i % 4 ) == 0 %>
<div class="g_col">
<ul>
<% end %>
<li class="list_t_item">
<ul class="info">
<li><div class="name"><%= co_author.co_author %></div></li>
<li><div class="email"><i class="icon-envelope"></i> <%= co_author.email %></div></li>
<li><div class="relations"><i class="icon-user"></i> <%= @co_author_relations.find(co_author.co_author_relations_id).relation unless co_author.co_author_relations_id.nil?%></div></li>
</ul>
<div class="list_item_function">
<%= link_to 'Edit', edit_desktop_co_author_path(co_author), :class => "bt-edit admbg2 admtxt" %>
<%= link_to 'Destroy', desktop_co_author_path(co_author), method: :delete, confirm: 'Are you sure?', :class=>"bt-delete admbg2 admtxt" %>
</div>
</li>
<% if ( i % 4 ) == 3 %>
</ul>
</div>
<% end %>
<% end %>
</div>
</div>
</div>

View File

@ -1,3 +1,3 @@
<%= form_for @co_author, html: { multipart: true ,"form-type"=>"ajax_form", "callback-method"=>"coAuthorformCallback"} , url: desktop_co_authors_path do |f| %>
<%= render partial: 'desktop/co_authors/form', locals: {:f => f} %>
<%= render partial: 'desktop/co_author_relations/form', locals: {:f => f} %>
<% end %>

0
app/views/desktop/desktop.html.erb Executable file → Normal file
View File

0
app/views/desktop/index.html.erb Executable file → Normal file
View File

View File

@ -1,17 +0,0 @@
<%= form_for(@desktop_journal_list) do |f| %>
<% if @desktop_journal_list.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@desktop_journal_list.errors.count, "error") %> prohibited this desktop_journal_list from being saved:</h2>
<ul>
<% @desktop_journal_list.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@ -1,6 +0,0 @@
<h1>Editing desktop_journal_list</h1>
<%= render 'form' %>
<%= link_to 'Show', @desktop_journal_list %> |
<%= link_to 'Back', desktop_journal_lists_path %>

View File

@ -1,24 +1,40 @@
<h1>journal_title -- journal_level</h1>
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="s_grid_con s_form">
<% @journal_lists.each_with_index do |journal_list,i| %>
<% if ( i % 5 ) == 0 %>
<div class="s_grid_con s_form">
<ul>
<div class="toolbar hh2">
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Share</div>
<div class="admbg sdm_o">
<ul>
<li><a class="hp hh2 admtxt" href="">Friends</a></li>
<li><a class="hp hh2 admtxt" href="">Private</a></li>
<li><a class="hp hh2 admtxt" href="">Group</a></li>
</ul>
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2"><span class="icon-question-sign"></span></div>
</div>
</div>
<div id="journal_list" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<% @journal_lists.each_with_index do |journal_list,i| %>
<% if ( i % 5 ) == 0 %>
<div class="g_col">
<ul>
<% end %>
<li class="list_t_item">
<div class="list_item_action">
<i class="icon-file"></i>
</div>
<% title, level = journal_list %>
<div class="list_t_title"><%= title %></div>
<div class="list_t_desc"><%= level.join(",") %></div>
</li>
<% if ( i % 5 ) == 4 %>
</ul>
</div>
<% end %>
<% end %>
<li class="s_grid_row">
<%= journal_list %>
</li>
<% if ( i % 5 ) == 4 %>
</ul>
</div>
<% end %>
<% end %>
</div>
</div>
</div>

View File

@ -1,5 +0,0 @@
<h1>New desktop_journal_list</h1>
<%= render 'form' %>
<%= link_to 'Back', desktop_journal_lists_path %>

View File

@ -1,5 +0,0 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_desktop_journal_list_path(@desktop_journal_list) %> |
<%= link_to 'Back', desktop_journal_lists_path %>

View File

@ -1,33 +1,28 @@
<div class="toolbar hh2">
<div class="fn_g hp">
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= f.submit "Save", name: "commit", value: "Save", class: "fn_btn ini_input hp hh2 thmc2 thmtxt" %>
<!-- class: bt-cancle can't be remove -->
<% if not @writing_journal.new_record? %>
<%= submit_tag "Cancel", :type => "button", class: "bt-cancel fn_btn hh2 thmc2 thmtxt" %>
<%= submit_tag "Cancel", :type => "button", class: "bt-cancel ini_input hp hh2 thmadm thmtxt" %>
<% end %>
</div>
<div class="hh2 hp sdm">
<!--<div class="hh2 hp sdm">
<div class="sdm_t hh2">Entry Year</div>
<div class="admbg sdm_o">
<!--<ul>
<ul>
<li><a class="hp hh2 admtxt" href="">2012</a></li>
<li><a class="hp hh2 admtxt" href="">2011</a></li>
<li><a class="hp hh2 admtxt" href="">2010</a></li>
<li><a class="hp hh2 admtxt" href="">2009</a></li>
<li><a class="hp hh2 admtxt" href="">2008</a></li>
</ul>
-->
</div>
</div>
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Language</div>
<div class="admbg sdm_o">
<ul>
<!--<li><a class="hp hh2 admtxt" href="">English</a></li>
<li><a class="hp hh2 admtxt" href="">Chinese</a></li>-->
<li><a class="hp hh2 admtxt" href="">English</a></li>
<li><a class="hp hh2 admtxt" href="">Chinese</a></li>
</ul>
</div>
</div>
</div>-->
<div class="hh2 hp sdm">
<div class="sdm_t hh2">Share</div>
<div class="admbg sdm_o">
@ -74,15 +69,6 @@
<!--<label for="">Journal Level</label>
<ul>
<li><input type="checkbox"><label for="">SCI</label></li>
<li><input type="checkbox"><label for="">SCIE</label></li>
<li><input type="checkbox"><label for="">SSCI</label></li>
<li><input type="checkbox"><label for="">AH & HCI</label></li>
<li><input type="checkbox"><label for="">EI</label></li>
<li><input type="checkbox"><label for="">CSCI</label></li>
<li><input type="checkbox"><label for="">CSSCI</label></li>
<li><input type="checkbox"><label for="">TSCI</label></li>
<li><input type="checkbox"><label for="">TSSCI</label></li>
<li><input type="checkbox"><label for="">THCI</label></li>
</ul>-->
</div>
</li>
@ -138,28 +124,21 @@
%>
</select>
</li>
<ul>
<li class="s_grid_row">
<%= label_tag("", "Date of Publication", class: "s_grid_4 s_grid") %>
</li>
<li class="s_grid_row">
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_2 s_grid'} %>
</li>
</ul>
<li class="s_grid_row">
<%= label_tag("", "Date of Publication", class: "s_grid_3 s_grid") %>
<%= f.date_select :publication_date, {:use_month_numbers => true, :start_year => Time.now.year, :end_year => 1930, :order => [:year, :month, :day] }, {:class => 's_grid_1 s_grid'} %>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", value: @writing_journal.keywords ||= "Keywords", class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<div><%= f.label :year ,:class => "s_grid_2 s_grid" %></div>
<div><%= 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 => "s_grid_4 s_grid"} ) %></div>
<%= f.label :year ,:class => "s_grid_2 s_grid" %>
<%= 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 => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row">
<div><%= f.label :language ,:class => "s_grid_2 s_grid" %></div>
<%= f.label :language ,:class => "s_grid_2 s_grid" %>
<select name="writing_journal[language][]" id="" class="s_grid s_grid_4">
<%= options_for_select(
[["Chinese", "Chinese"],
@ -174,33 +153,32 @@
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_2">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
<select name="" id="" class="s_grid s_grid_3">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
</ul>
</div>
<div class="s_grid_con s_form">
<span class="icon-plus input_append"></span>
<ul>
<li class="s_grid_row">
<table>
<table class="s_table">
<thead>
<tr>
<th class="s_grid_2 s_grid">File</th>
<th class="s_grid_2 s_grid">File Name</th>
<th><span id='add_plugin_file' class="icon-plus input_append"></span></th>
<th class="s_grid_2">File</th>
<th class="s_grid_3">File Name</th>
<th class="s_grid_1">Action</th>
</tr>
</thead>
<tfoot>
<tr>
<td>
<div id='add_plugin_file' class="info_input plugin_files_block">
<td colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_journal.writing_journal_files.count %>
<a class="add"><span><i class="icon-plus icon-white"></i> add </span></a>
<a class="add setting_btn thmc1 thmtxt w1 hh2 hp" href=""><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>
@ -216,15 +194,16 @@
</li>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :note, size: "20x2", placeholder: "Note", class: "s_grid_6 s_grid"%>
<%= f.text_area :note, size: "20x22", placeholder: "Note", class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x26", placeholder: "Abstract", class: "s_grid_6 s_grid"%>
<%= f.text_area :abstract, size: "20x22", placeholder: "Abstract", class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</div>
@ -248,6 +227,7 @@
newfield.find('.action a.delete').click(function(){
newfield.remove();
});
return false;
});
$('.action a.remove_existing_record').click(function(){

View File

@ -1,12 +1,12 @@
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
<td>
<div>
<%= f.file_field :file, class: "s_grid_1 s_grid" %>
<%= f.file_field :file, class: "s_grid_2 s_grid" %>
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn s_grid_1 s_grid', :target => '_blank', :title => t(:view)} ) : '' %>
</div>
</td>
<td>
<%= f.text_field :title, :class=>'s_grid_1 s_grid' %>
<%= f.text_field :title, :class=>'s_grid_3 s_grid' %>
</td>
<td>

View File

@ -9,8 +9,8 @@
<div id="panel_l" class="ph">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Overview</a></li>
<li><a href="<%= edit_user_registration_path %>" callback-method="account" custom-load="account" class="admtxt hh2 w2 hp" load="true" onclick='return false;'>Account</a></li>
<li><a href="" class="admtxt hh2 w2 hp" load="true" onclick='return false;'>Overview</a></li>
<li><a href="<%= edit_user_registration_path %>" callback-method="account" custom-load="account" class="admtxt hh2 w2 hp" onclick='return false;'>Account</a></li>
<li><a href="<%= desktop_sections_path %>" callback-method="sections" custom-load="sections" class="admtxt hh2 w2 hp" onclick='return false;'>Sections</a></li>
<li><a href="<%= desktop_themes_path %>" callback-method="themes" class="admtxt hh2 w2 hp" onclick='return false;'>Theme</a></li>
<li><a href="<%= desktop_connections_path %>" callback-method="connection" class="admtxt hh2 w2 hp" onclick='return false;'>Connection</a></li>

View File

@ -1,14 +1,18 @@
<div class="vp">
<div class="s_title hh3">Password Managment</div>
<%= form_for(resource, :as => resource_name, :url => users_passwd_path(resource_name), :html => { :method => :put, "form-type"=>"ajax_form" ,"callback-method"=>"passwordUpdate" }) do |f| %>
<ul class="s_form">
<li><%= f.label :current_password %>
<%= f.password_field :current_password %></li>
<%= form_for(resource, :as => resource_name, :url => users_passwd_path(resource_name), :html => { :method => :put, "form-type"=>"ajax_form" ,"callback-method"=>"passwordUpdate" }) do |f| %>
<div><%= f.submit "Update" %></div>
<li><%= f.label :password %>
<%= f.password_field :password %></li>
<div><%= f.label :current_password %>
<%= f.password_field :current_password %></div>
<li><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></li>
</ul>
<div class="s_action"><%= f.submit "Update", :class => "setting_btn thmc1 thmtxt w1 hh2 hp" %></div>
<div><%= f.label :password %>
<%= f.password_field :password %></div>
<% end %>
</div>
<div><%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %></div>
<% end %>

View File

@ -1,24 +1,29 @@
<div class="form-horizontal">
<%
attribute_field.af_count ? @af_counter = attribute_field_counter + attribute_field.af_count : @af_counter = attribute_field_counter
%>
<%= @af_counter %>
<%#= attribute_field_counter %>
<legend>
<button class="onoff pull-right <%= attribute_field.disabled ? 'disabled' : ''%>">ON</button>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","disabled",:value=>attribute_field.disabled,:class=>"attribute_field_disabled"%>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","to_delete",:value=>false,:class=>"attribute_field_to_delete"%>
<a class="btn btn-small pull-right btn-danger remove_attribute" href="#"><i class="icon-trash icon-large"></i> <%= t(:delete_)%></a>
<div class="clear">
<div class="control-group pull-left">
<label class="control-label" for="key"><%= t(:key) %></label>
<div class="multipleInput">
<div class="controls">
<%= text_field "info[attribute_fields][#{attribute_field_counter}]","key",:value=>attribute_field.key%>
<%= text_field "info[attribute_fields][#{@af_counter}]","key",:value=>attribute_field.key%>
</div>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{attribute_field_counter}][title_translations]"}%>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field.title_translations,:class_ext=>"pull-left",:label_ext=>t(:name),:field_name=>"info[attribute_fields][#{@af_counter}][title_translations]"}%>
<div class="control-group pull-left">
<label class="control-label" for=""><%= t(:type)%></label>
<div class="controls">
<%#= select_tag "info[attribute_fields][#{attribute_field_counter}][markup]" do %>
<select class="dataType" name=<%= "info[attribute_fields][#{attribute_field_counter}][markup]"%>>
<%#= select_tag "info[attribute_fields][#{@af_counter}][markup]" do %>
<select class="dataType" name=<%= "info[attribute_fields][#{@af_counter}][markup]"%>>
<%LIST[:markups].each do |key,val|%>
<option value="<%= key %>" <%= attribute_field.markup == key ? 'selected="selected"' : '' %> ref="<%=val["panel"]%>"><%=t("lists.markups."+key)%></option >
<% end %>
@ -33,25 +38,25 @@
<label class="control-label"><%= t(:options)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][cross_lang]","true",attribute_field["typeA"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeA][add_more]","true",attribute_field["typeA"]["add_more"]) %>
<%= t(:add_more)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeA][placeholder]"}%>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:values=>attribute_field["typeA"]["placeholder"],:field_name=>"info[attribute_fields][#{@af_counter}][typeA][placeholder]"}%>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeB") do %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeB][initial]"}%>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:label_ext=>t(:initial),:values=>attribute_field["typeB"]["initial"],:field_name=>"info[attribute_fields][#{@af_counter}][typeB][initial]"}%>
<% if attribute_field.self_defined_markup_options?%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_counter}][attribute][role][statuses]"} %>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][attribute][role][statuses]"} %>
<%else #normal list%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{attribute_field_counter}][typeB][option_list]"} %>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:values=>attribute_field["option_list"],:field_name=> "info[attribute_fields][#{@af_counter}][typeB][option_list]"} %>
<% end #of self_defined_markup_options?%>
<% end %>
@ -59,17 +64,17 @@
<div class="control-group">
<label class="control-label"><%= t("date.format")%></label>
<div class="controls">
<%= select "info[attribute_fields][#{attribute_field_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
<%= select "info[attribute_fields][#{@af_counter}][typeC]","format",Admin::AttributeValuesViewHelper::OPT,:class=>"dataType",:selected=>attribute_field["typeC"]["format"] %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t("date.range")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "false",:checked => (!attribute_field.date_is_range? ? true : false)) %><%= t(:yes_)%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "is_range", "true",:checked => (attribute_field.date_is_range? ? true : false)) %><%= t(:no_)%>
</label>
</div>
</div>
@ -77,10 +82,10 @@
<label class="control-label"><%= t("date.calendar")%></label>
<div class="controls">
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "west_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "west_calendar" ? true : false)) %><%= t("date.west_calendar")%>
</label>
<label class="radio inline">
<%= radio_button("info[attribute_fields][#{attribute_field_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
<%= radio_button("info[attribute_fields][#{@af_counter}][typeC]", "calendar", "tw_calendar",:checked =>(attribute_field["typeC"]["calendar"]== "tw_calendar" ? true : false)) %><%= t("date.tw_calendar")%>
</label>
</div>
</div>
@ -90,16 +95,16 @@
<label class="control-label"><%= t(:options)%></label>
<div class="controls">
<label class="checkbox inline">
<%= check_box_tag("info[attribute_fields][#{attribute_field_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= check_box_tag("info[attribute_fields][#{@af_counter}][typeD][cross_lang]","true",attribute_field["typeD"]["cross_lang"]) %>
<%= t(:cross_lang)%>
</label>
</div>
</div>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<%= render :partial=>"shared/attribute_field/placeholder_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeD][placeholder]",:values=>attribute_field["typeD"]["placeholder"]} %>
<% end %>
<%= content_tag :div,:class=>show_type_panel(attribute_field,"typeE") do%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"info[attribute_fields][#{attribute_field_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<%= render :partial=>"shared/attribute_field/list_block",:locals=>{:field_name=>"info[attribute_fields][#{@af_counter}][typeE][option_list]",:values=>attribute_field["option_list"]}%>
<% end %>
</div>
<%= hidden_field "info[attribute_fields][#{attribute_field_counter}]","id",:value=>attribute_field.id%>
<%= hidden_field "info[attribute_fields][#{@af_counter}]","id",:value=>attribute_field.id%>
</div>

View File

@ -180,10 +180,10 @@ Orbit::Application.routes.draw do
match '/widget_layout' => 'desktop#widget_layout'
match '/temp_func/'=>'desktop#temp_func'
resources :journal_pages
resources :journal_lists
resources :co_authors
resources :co_author_relations
resources :journal_pages, except: :show
resources :journal_lists, only: :index
resources :co_authors, except: :show
resources :co_author_relations, except: :show
end
# namespace :desktop_publications do

BIN
db/files/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 KiB

BIN
db/files/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 KiB

BIN
db/files/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

BIN
db/files/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 KiB

BIN
db/files/5.pdf Normal file

Binary file not shown.

BIN
db/files/6.pdf Normal file

Binary file not shown.

BIN
db/files/7.pdf Normal file

Binary file not shown.

View File

@ -5,6 +5,8 @@ require 'json'
CoAuthor.destroy_all
CoAuthorRelation.destroy_all
WritingJournal.destroy_all
WritingJournalFile.destroy_all
JournalLevelType.destroy_all
data = File.read("db/data")
data_json = JSON.parse(data)
@ -17,9 +19,32 @@ name_en = name_en.map do |p| Faker::Name::name end
email = Array.new 51,""
email= email.map do |p| Faker::Internet.email end
type = ["friend0", "teacher0", "student0", "mate0", "relation0", "friend1", "teacher1", "student1", "mate1", "relation1"]
type = ["friend", "teacher", "student", "schoolmate", "parent", "best friend", "instructor", "labmate", "TA", "mate"]
file_desc = Array.new 7, ""
file_desc = file_desc.map do |p| Faker::Lorem.word end
file = ["1.png", "5.pdf", "2.png", "6.pdf", "3.png", "7.pdf", "4.png"]
level = ["SCI", "SCIE", "SSCI", "AH & HCI", "EI", "CSCI", "CSSCI", "TSCI", "TSSCI", "THCI"]
FactoryGirl.define do
factory(:journal_level, class: "JournalLevelType") do |f|
f.sequence(:title_translations) do |n|
{ zh_tw: "#{level[n]}",
en: "#{level[n]}" }
end
end
factory(:upload_file, class: "WritingJournalFile") do |f|
f.sequence(:file) do |n|
File.new(File.join(Rails.root, "db" ,"files", file[Random.rand(0..6)]))
end
f.sequence(:title) do |n|
"#{file_desc[Random.rand(0..6)]}"
end
end
factory(:type, class: "CoAuthorRelation") do |f|
f.sequence(:relation_translations) do |n|
{ zh_tw: "#{type[n%type.size]}",
@ -33,7 +58,7 @@ FactoryGirl.define do
{ zh_tw: "#{name_tw[n]}",
en: "#{name_en[n]}" }
end
f.sequence(:type) do |n| "#{type[n%5]}" end
f.sequence(:co_author_relations_id) do |n| "#{CoAuthorRelation.all[n%type.size].id}" end
f.sequence(:email) do |n| "#{email[n]}" end
f.name_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
end
@ -85,20 +110,38 @@ FactoryGirl.define do
"#{data_json[n]["abstract"].split[-3..-1].join(",")}"
end
f.sequence(:journal_level_types) do |n|
level = []
total_levels = Random.rand(1..JournalLevelType.count)
total_levels.times do
level << JournalLevelType.all[Random.rand(0..JournalLevelType.count-1)]
end
level.uniq
end
f.sequence(:writing_journal_files) do |n|
files = []
total_files = Random.rand(1..7)
total_files.times do files << FactoryGirl.create(:upload_file) end
files
end
f.create_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
f.update_user_id BSON::ObjectId('4f45f3b9e9d02c5db9000067') #user_id, this is Chris' account
end
end
10.times.each do
(level.size - 1).times do
FactoryGirl.create(:journal_level)
end
10.times do
FactoryGirl.create(:type)
end
50.times.each do
50.times do
FactoryGirl.create(:paper_record)
end
50.times.each do
50.times do
FactoryGirl.create(:co_author_candidate)
end

View File

@ -12,6 +12,7 @@ xml.rss :version => "2.0" do
xml.item do
xml.title bulletin.title_translations[I18n.locale.to_s]
xml.pubDate bulletin.postdate.to_s(:rfc822)
xml.description bulletin.text_translations[I18n.locale.to_s]
xml.link url_for(:action=>"show", :controller=>"panel/announcement/front_end/bulletins", :id=>bulletin ,:only_path=>false)
xml.guid url_for(:action=>"show", :controller=>"panel/announcement/front_end/bulletins", :id=>bulletin ,:only_path=>false)
xml.fb_share generate_fb_url(bulletin, "announcement")

View File

@ -8,12 +8,12 @@ xml.rss :version => "2.0" do
end
xml.link url_for(:action=>"index", :controller=>"panel/announcement/front_end/bulletins",:format=> :rss,:only_path=>false,:inner=>true)
xml.item do
xml.title @bulletin.title
xml.description @bulletin.text
xml.title @bulletin.title_translations[I18n.locale.to_s]
xml.description @bulletin.text_translations[I18n.locale.to_s]
xml.pubDate @bulletin.postdate.to_s(:rfc822)
xml.link url_for(:action=>"show", :controller=>"panel/announcement/front_end/bulletins", :id=>@bulletin ,:format=> :rss,:only_path=>false,:inner=>true)
xml.guid url_for(:action=>"show", :controller=>"panel/announcement/front_end/bulletins", :id=>@bulletin ,:only_path=>false)
end
# end
end
end
end