clean add/edit page and add conference list page

This commit is contained in:
Rueshyna 2013-02-21 01:48:10 +08:00 committed by chris
parent 16fda25ace
commit 13c757e8a9
9 changed files with 367 additions and 175 deletions

View File

@ -8,62 +8,61 @@ GIT
GIT
remote: git://github.com/charlotte-ruby/impressionist.git
revision: 7a93fff25568cd3edcc63c1a3c4b60dc6b81d2b7
revision: 0894f6a550a33f83f4937d655e9f0774521781e4
specs:
impressionist (1.1.1)
impressionist (1.2.0)
httpclient (~> 2.2)
nokogiri (~> 1.5)
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.9)
actionpack (= 3.2.9)
actionmailer (3.2.12)
actionpack (= 3.2.12)
mail (~> 2.4.4)
actionpack (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
actionpack (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.0)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.9)
activesupport (= 3.2.9)
activemodel (3.2.12)
activesupport (= 3.2.12)
builder (~> 3.0.0)
activerecord (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
activerecord (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
activesupport (3.2.9)
activeresource (3.2.12)
activemodel (= 3.2.12)
activesupport (= 3.2.12)
activesupport (3.2.12)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.3.2)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.0.0)
binding_of_caller (0.7.1)
debug_inspector (>= 0.0.1)
bourne (1.1.2)
mocha (= 0.10.5)
brakeman (1.9.0)
activesupport
brakeman (1.9.2)
erubis (~> 2.6)
fastercsv (~> 1.5)
haml (~> 3.0)
highline (~> 1.6)
i18n
multi_json (~> 1.3)
multi_json (~> 1.2)
ruby2ruby (~> 2.0)
ruby_parser (~> 3.0.4)
ruby_parser (~> 3.1.1)
sass (~> 3.0)
terminal-table (~> 1.4)
bson (1.8.1)
bson_ext (1.8.1)
bson (~> 1.8.1)
bson (1.8.2)
bson_ext (1.8.2)
bson (~> 1.8.2)
builder (3.0.4)
capybara (2.0.2)
mime-types (>= 1.16)
@ -75,13 +74,14 @@ GEM
carrierwave (0.6.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
carrierwave-mongoid (0.2.1)
carrierwave-mongoid (0.2.2)
carrierwave (~> 0.6.1)
mongoid (~> 2.1)
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
childprocess (0.3.8)
ffi (~> 1.0, >= 1.0.11)
chinese_pinyin (0.4.1)
chronic (0.9.0)
coderay (1.0.8)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
@ -91,13 +91,14 @@ GEM
coffee-script-source (1.4.0)
columnize (0.3.6)
database_cleaner (0.9.1)
debugger (1.2.3)
debug_inspector (0.0.2)
debugger (1.2.4)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.5)
debugger-ruby_core_source (~> 1.1.7)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.6)
debugger-ruby_core_source (1.1.8)
delorean (2.1.0)
chronic
devise (1.5.3)
@ -107,60 +108,51 @@ GEM
diff-lcs (1.1.3)
encrypted_strings (0.3.3)
erubis (2.7.0)
eventmachine (1.0.0)
exception_notification (3.0.0)
exception_notification (3.0.1)
actionmailer (>= 3.0.4)
tinder (~> 1.8)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.1.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.1.0)
factory_girl (~> 4.1.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
faker (1.1.2)
i18n (~> 0.5)
faraday (0.8.4)
multipart-post (~> 1.1)
faraday_middleware (0.9.0)
faraday (>= 0.7.4, < 0.9)
fastercsv (1.5.5)
fattr (2.2.1)
ffi (1.2.0)
haml (3.1.7)
hashie (1.2.0)
ffi (1.4.0)
haml (3.1.8)
highline (1.6.15)
hike (1.2.1)
http_parser.rb (0.5.3)
httpclient (2.3.2)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.4)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (3.0.0)
jquery-ui-rails (4.0.1)
jquery-rails
railties (>= 3.1.0)
json (1.7.6)
libwebsocket (0.1.7.1)
addressable
websocket
json (1.7.7)
libv8 (3.11.8.13)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
mime-types (1.19)
mini_magick (3.4)
method_source (0.8.1)
mime-types (1.21)
mini_magick (3.5.0)
subexec (~> 0.2.1)
mocha (0.10.5)
metaclass (~> 0.0.1)
mongo (1.8.1)
bson (~> 1.8.1)
mongo (1.8.2)
bson (~> 1.8.2)
mongo_session_store-rails3 (3.0.6)
actionpack (>= 3.0)
mongo
mongoid (2.5.1)
mongoid (2.6.0)
activemodel (~> 3.1)
mongo (~> 1.7)
tzinfo (~> 0.3.22)
@ -170,8 +162,7 @@ GEM
mongoid (~> 2)
mongoid-tree (0.7.0)
mongoid (~> 2.0)
multi_json (1.5.0)
multipart-post (1.1.5)
multi_json (1.6.1)
net-ldap (0.3.1)
nokogiri (1.5.6)
options (2.3.0)
@ -182,7 +173,20 @@ GEM
progress_bar (0.4.0)
highline (~> 1.6.1)
options (~> 2.3.0)
rack (1.4.4)
pry (0.9.12)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
pry-debugger (0.2.1)
debugger (~> 1.2.0)
pry (~> 0.9.10)
pry-remote (0.1.6)
pry (~> 0.9)
slop (~> 3.0)
pry-stack_explorer (0.4.9)
binding_of_caller (>= 0.7)
pry (~> 0.9.11)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-protection (1.3.2)
@ -192,23 +196,24 @@ GEM
rack-test (0.6.2)
rack (>= 1.0)
radius (0.7.3)
rails (3.2.9)
actionmailer (= 3.2.9)
actionpack (= 3.2.9)
activerecord (= 3.2.9)
activeresource (= 3.2.9)
activesupport (= 3.2.9)
rails (3.2.12)
actionmailer (= 3.2.12)
actionpack (= 3.2.12)
activerecord (= 3.2.12)
activeresource (= 3.2.12)
activesupport (= 3.2.12)
bundler (~> 1.0)
railties (= 3.2.9)
railties (3.2.9)
actionpack (= 3.2.9)
activesupport (= 3.2.9)
railties (= 3.2.12)
railties (3.2.12)
actionpack (= 3.2.12)
activesupport (= 3.2.12)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rdoc (3.12)
rb-readline (0.4.2)
rdoc (3.12.1)
json (~> 1.4)
redis (3.0.2)
redis-namespace (1.2.1)
@ -217,6 +222,7 @@ GEM
chinese_pinyin (>= 0.3.0)
redis (>= 2.1.1)
redis-namespace (>= 1.0.2)
ref (1.0.2)
resque (1.23.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0)
@ -238,45 +244,45 @@ GEM
rspec-core (2.12.2)
rspec-expectations (2.12.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.12.1)
rspec-rails (2.12.0)
rspec-mocks (2.12.2)
rspec-rails (2.12.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
ruby2ruby (2.0.1)
ruby_parser (~> 3.0.0)
ruby2ruby (2.0.3)
ruby_parser (~> 3.1)
sexp_processor (~> 4.0)
ruby_parser (3.0.4)
ruby_parser (3.1.1)
sexp_processor (~> 4.1)
rubyzip (0.9.9)
rufus-scheduler (2.0.17)
tzinfo (>= 0.3.23)
sass (3.2.5)
sass-rails (3.2.5)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
selenium-webdriver (2.27.2)
selenium-webdriver (2.30.0)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
sexp_processor (4.1.3)
websocket (~> 1.0.4)
sexp_processor (4.1.5)
shoulda-matchers (1.4.2)
activesupport (>= 3.0.0)
bourne (~> 1.1.2)
simple_oauth (0.1.9)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
sinatra (1.3.4)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
slop (3.4.3)
social-share-button (0.1.1)
spork (0.9.2)
sprockets (2.2.2)
@ -297,26 +303,16 @@ GEM
sunspot (= 1.3.3)
sunspot_solr (1.3.3)
terminal-table (1.4.5)
therubyracer (0.11.3)
libv8 (~> 3.11.8.12)
ref
thor (0.17.0)
tilt (1.3.3)
tinder (1.9.2)
eventmachine (~> 1.0)
faraday (~> 0.8)
faraday_middleware (~> 0.9)
hashie (~> 1.0)
json (~> 1.7.5)
mime-types (~> 1.19)
multi_json (~> 1.5)
twitter-stream (~> 0.1)
tinymce-rails (3.5.8)
railties (>= 3.1.1)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
twitter-stream (0.1.16)
eventmachine (>= 0.12.8)
http_parser.rb (~> 0.5.1)
simple_oauth (~> 0.1.4)
tzinfo (0.3.35)
uglifier (1.3.0)
execjs (>= 0.3.0)
@ -326,7 +322,7 @@ GEM
warden (1.2.1)
rack (>= 1.0)
watchr (0.7)
websocket (1.0.6)
websocket (1.0.7)
xpath (1.0.0)
nokogiri (~> 1.3)
@ -350,9 +346,10 @@ DEPENDENCIES
factory_girl_rails
faker
impressionist!
jquery-rails (= 2.1.4)
jquery-rails
jquery-ui-rails
kaminari!
libv8 (~> 3.11.8)
mime-types
mini_magick
mongo_session_store-rails3 (= 3.0.6)
@ -362,9 +359,14 @@ DEPENDENCIES
net-ldap (~> 0.3.1)
nokogiri
progress_bar
pry
pry-debugger
pry-remote
pry-stack_explorer
radius
rails (~> 3.2.9)
rake
rb-readline
redis (>= 2.1.1)
redis-namespace
redis-search
@ -385,6 +387,7 @@ DEPENDENCIES
sunspot-rails-tester
sunspot_mongo
sunspot_solr
therubyracer
tinymce-rails
uglifier
watchr

View File

@ -209,11 +209,6 @@ Orbit::Application.routes.draw do
match 'desktop_publications/books_list'=>'desktop_publications#books_list'
match 'desktop_publications/books_add'=>'desktop_publications#books_add'
match 'desktop_publications/conference_p' => 'desktop_publications#conference_p'
match 'desktop_publications/conference_p_list/'=>'desktop_publications#conference_p_list'
match 'desktop_publications/conference_p_add/'=>'desktop_publications#conference_p_add'
# end
# namespace :desktop_research do
match 'desktop_research/research_d' => 'desktop_research#research_d'
match 'desktop_research/research_d_list/' => 'desktop_research#research_d_list'

View File

@ -26,13 +26,60 @@ class Panel::PersonalConference::Desktop::ConferencePagesController < Applicatio
end
def edit
@writing_conference = WritingConference.new
@writing_conference = WritingConference.find(params[:id])
@paper_types = ConferencePaperType.all
@author_types = ConferenceAuthorType.all
respond_to do |format|
format.html { render :layout => false}
end
end
def create
params[:writing_conference][:create_user_id] = current_user.id
@writing_conference = WritingConference.new(params[:writing_conference])
if @writing_conference.save
render json: {success: true, msg: t('create.success.paper')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def update
params[:writing_conference][:update_user_id] = current_user.id
@writing_conference= WritingConference.find(params[:id])
if @writing_conference.update_attributes(params[:writing_conference])
render json: {success: true, msg: t('update.success.paper')}.to_json
else
error_msg = @writing_conference.errors.full_messages.join("<br />")
render json: {success: false, msg: error_msg}.to_json
end
end
def destroy
@writing_conference = WritingConference.find(params[:id])
@writing_conference.destroy
render :json => {success: true, msg: t('delete.success.paper')}
end
def conference_type
conference_types = ConferencePaperType.all
all_conference_lists = WritingConference.where(create_user_id: current_user.id)
all_conference_lists = all_conference_lists.map do |j|
[ j.conference_title,
j.conference_paper_type_ids.map do |type|
conference_types.find(type).title
end
]
end
@conference_lists = all_conference_lists.uniq
respond_to do |format|
format.html { render :layout => false}
end
end
end

View File

@ -34,41 +34,44 @@
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.paper_title"),
value: (@writing_conference.paper_title_translations[locale] rescue nil) %>
value: (@writing_conference.paper_title_translations[locale.to_s] rescue nil) %>
<% end %>
</li>
<li class="s_grid_row">
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title"),
class: "s_grid_6 s_grid",
# "autocomplete-list" => "conference_title_autocomplete_list",
value: (@writing_conference.conferece_title_translations[locale] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
<%= f.fields_for :conference_title_translations do |f| %>
<%= f.text_field locale,
size: "20",
placeholder: t("personal_conference.conference_title"),
class: "s_grid_6 s_grid",
# "autocomplete-list" => "conference_title_autocomplete_list",
value: (@writing_conference.conference_title_translations[locale.to_s] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.paper_type")) %>
<ul>
<% @paper_types.each_with_index do |paper_type, i| %>
<li class="s_grid_row">
<%= radio_button_tag "writing_conference[conference_paper_type_ids][]",
paper_type.id,
@writing_conference.conference_paper_type_ids.include?(paper_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", paper_type.title) %>
</li>
<li class="s_grid_row">
<%= radio_button_tag "writing_conference[conference_paper_type_ids][]",
paper_type.id,
@writing_conference.conference_paper_type_ids.include?(paper_type.id),
id: "field-#{i}"
%><%= label_tag("field-#{i}", paper_type.title) %>
</li>
<% end %>
</ul>
</div>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<%= f.text_field :keywords, size: "20", placeholder: t("personal_conference.keywords"), class: "s_grid_6 s_grid"%>
</li>
<li class="s_grid_row">
<div>
<%= label_tag("", t("personal_conference.conference_time")) %>
<ul>
@ -83,67 +86,135 @@
</li>
</ul>
</div>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
<%= label_tag("", t("personal_conference.sponsor"), class: "s_grid_2 s_grid") %><%= f.text_field :sponsor, size: "20", placeholder: "Sponsor", class: "s_grid_4 s_grid"%>
</li>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.location"), class: "s_grid_2 s_grid") %><%= f.text_field :location, size: "20", placeholder: "Location", class: "s_grid_4 s_grid"%>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.url"), class: "s_grid_2 s_grid") %><%= f.text_field :url, size: "20", placeholder: "www.sample.com", class: "s_grid_4 s_grid"%>
</li>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<%= f.fields_for :authors_translations do |f| %>
<%= f.text_area locale,
class: "s_grid_6 s_grid",
size: "20x2",
placeholder: t("personal_conference.authors"),
# "autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_conference.authors_translations[locale] rescue nil) %>
# "autocomplete-list" => "coauthor_autocomplete_list",
value: (@writing_conference.authors_translations[locale.to_s] rescue nil) %>
<% end %>
<span class="icon-plus input_append"></span>
<select name="writing_conference[conference_author_type_ids][]" id="" class="s_grid s_grid_4">
<%= options_for_select(
[t("personal_conference.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
<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>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.publication_date"), 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"><input class="s_grid s_grid_6" type="text" value="Tags"><span class="icon-plus input_append"></li>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</div>
<div class="s_grid_con s_form">
<li class="s_grid_row">
<ul>
<%= f.text_area :note, size: "20x22", placeholder: t("personal_journal.note"), class: "s_grid_6 s_grid full_height"%>
</ul>
<select name="writing_conference[conference_author_type_ids][]" id="" class="s_grid s_grid_6">
<%= options_for_select(
[t("personal_conference.author_type")] +
@author_types.map do |author_type|
[author_type.title, author_type.id]
end
)
%>
</select>
</li>
<li class="s_grid_row">
<select name="" id="" class="s_grid s_grid_6">
<option value="">Status</option>
<option value="">Published</option>
<option value="">Pending</option>
<option value="">Writing</option>
</select>
</li>
<li class="s_grid_row">
<%= label_tag("", t("personal_conference.publication_date"), 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.label :year, t("personal_conference.year"), :class => "s_grid_2 s_grid" %>
<%= select_year((@writing_conference.year ? @writing_conference.year.to_i : DateTime.now.year), {:start_year => DateTime.now.year, :end_year => 1930}, {:name => 'writing_conference[year]', :class => "s_grid_4 s_grid"} ) %>
</li>
<li class="s_grid_row"><input class="s_grid s_grid_6" type="text" placeholder=<%= t("tags") %>><span class="icon-plus input_append"></li>
<li class="s_grid_row">
<%= f.text_area :abstract, size: "20x22", placeholder: t("personal_conference.abstract"), class: "s_grid_6 s_grid full_height"%>
</li>
</ul>
</div>
<div class="s_grid_con s_form">
<ul>
<li class="s_grid_row">
<table class="s_table">
<thead>
<tr>
<th class="s_grid_2"><%= t("personal_conference.file")%></th>
<th class="s_grid_3"><%= t("personal_conference.file_name")%></th>
<th class="s_grid_1"><%= t("personal_conference.description") %></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<div id='add_plugin_file' class="info_input plugin_files_block s_action">
<%= hidden_field_tag 'plugin_file_field_count', @writing_conference.writing_conference_files.count %>
<a class="add setting_btn thmc1 thmtxt w1 hh2 hp" href=""><i class="icon-plus icon-white"></i> add</a>
</div>
</td>
</tr>
</tfoot>
<tbody>
<% @writing_conference.writing_conference_files.each_with_index do |writing_conference_file, i| %>
<%= f.fields_for :writing_conference_files, writing_conference_file do |f| %>
<%= render :partial => 'form_file', :object => writing_conference_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
</tbody>
</table>
</li>
</div>
</div>
</div>
</div>
<div class="s_grid_con s_form">
<li class="s_grid_row">
<ul>
<%= f.text_area :note, size: "20x22", placeholder: t("personal_conference.note"), class: "s_grid_6 s_grid full_height"%>
</ul>
</li>
</div>
</div>
</div>
<script type="text/javascript">
orbitDesktop.prototype.initializeJournalPapers.conference_title_autocomplete_list = <%= @conference_candidate.to_json.html_safe %>;
orbitDesktop.prototype.initializeJournalPapers.coauthor_autocomplete_list = <%= @co_author_candidate.to_json.html_safe %>;
</script>
<script>
$('#add_plugin_file a.add').click(function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_writing_conference_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
var newfield = $(("<%= escape_javascript(add_attribute 'form_file', f, :writing_conference_files) %>").replace(old_id, new_id));
$(this).parents('table').append(newfield);
newfield.find('.action a.delete').click(function(){
newfield.remove();
});
return false;
});
$('.action a.remove_existing_record').click(function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
});
</script>

View File

@ -0,0 +1,31 @@
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class="list_item">
<td>
<div>
<% if form_file.new_record? %>
<%= f.file_field :file, class: "s_grid_2 s_grid" %>
<% end %>
</div>
</td>
<td>
<%= f.text_field :title %>
<%= f.fields_for :file_title_translations do |f| %>
<%= f.text_field locale,
class: 's_grid_3 s_grid',
value: (form_file.file_title_translations[locale] rescue nil) %>
<% end %>
</td>
<td>
<span class="action">
<% if form_file.new_record? %>
<a class="delete"><i class="icon-remove"></i></a>
<% else %>
<%= f.hidden_field :id %>
<a class="remove_existing_record"><i class="icon-remove"></i></a>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
<%= form_file.file.file ? ( link_to '', form_file.file.url, {:class => 'icon-eye-open', :target => '_blank', :title => t(:view)} ) : '' %>
</span>
</td>
</tr>

View File

@ -0,0 +1,40 @@
<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="conference_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">
<% @conference_lists.each_with_index do |conference_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 = conference_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 %>
</div>
</div>
</div>

View File

@ -0,0 +1,4 @@
<%= form_for @writing_conference, html: { multipart: true, "form-type"=>"ajax_form", "callback-method"=>"formCallback"}, url: panel_personal_conference_desktop_conference_page_path(@writing_conference) do |f| %>
<%= render partial: 'form', locals: {:f => f} %>
<%end%>

View File

@ -15,7 +15,7 @@
<ul id='setting_left_nav'>
<li><a href="<%= panel_personal_conference_desktop_conference_pages_path %>" load="true" callback-method="list" class="hh2 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= new_panel_personal_conference_desktop_conference_page_path %>" callback-method="addconference" custom-load="add" class="admtxt hh2 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" callback-method="conference" class="admtxt hh2 w2 hp" onclick='return false;'>Conference</a></li>
<li><a href="<%= panel_personal_conference_desktop_conference_type_path %>" callback-method="conference" class="admtxt hh2 w2 hp" onclick='return false;'>Conference</a></li>
<li><a href="" callback-method="coauthor" class="admtxt hh2 w2 hp" onclick='return false;'>Co-Authors</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Tags &amp; Keywords</a></li>
<li><a href="" class="admtxt hh2 w2 hp" onclick='return false;'>Analysis</a></li>

View File

@ -4,6 +4,7 @@ Rails.application.routes.draw do
namespace :personal_conference do
namespace :desktop do
match 'conference_window' => 'conference_windows#conference_window'
match 'conference_type' => 'conference_pages#conference_type'
resources :conference_pages
end
namespace :back_end do