done personal conference list page, but it need to js.

This commit is contained in:
Rueshyna 2013-02-20 13:43:30 +08:00 committed by chris
parent 2afbae7c08
commit 6d65af0312
5 changed files with 139 additions and 72 deletions

View File

@ -0,0 +1,65 @@
module Panel::PersonalConference::Desktop::ConferencePagesHelper
def publication_record publication
content_tag :li,
:class => "list_t_item" do
marker + \
content(publication) + \
edit_or_delete(publication)
end
end
def marker
content_tag :div,
:class => "list_item_action"
content_tag(:a, "", :class => "icon-check-empty") + \
content_tag(:a, "", :class => "icon-star-empty")
end
def content publication
content_tag(:div, "conference : " + publication.conference_title,
:class => "list_t_title") + \
content_tag(:div, "title : " + publication.paper_title,
:class => "list_t_des") + \
content_tag(:div, "keyword :" + publication.keywords,
:class => "list_t_des") + \
content_tag(:div, "abstract : " + publication.abstract,
:class => "list_t_des") + \
content_tag(:div, link_publication_file(publication),
:class => "list_t_des")
end
def edit_or_delete publication
content_tag :div,
:class => "list_item_function" do
content_tag(:a, t("edit"),
:class => "journal_paper_edit admbg2 admtxt",
:href => edit_panel_personal_conference_desktop_conference_page_path(publication),
"ajax-remote" => "get") + \
content_tag(:a, t("delete"),
"ajax-remote" => "delete",
"confirm-message" => t("sure?"),
"callback-method" => "paperDelete",
:class => "journal_paper_delete admbg2 admtxt",
:href => panel_personal_conference_desktop_conference_page_path(publication))
end
end
def link_publication_file publication
publication.writing_conference_files.map{|file|
link_to(image_tag(check_file_type(file.file.url)) + \
content_tag(:span, file.title, :class => "filetitle"),
file.file.url,
:class => "file",
"target" => "_blank")
}.inject(:+)
end
def check_file_type file
if not file.nil?
file_type = MIME::Types.type_for(file).first.to_s.split("/")[1]
file_type = "/assets/ft-icons/#{file_type}/#{file_type}-48_32.png"
else
file_type = ""
end
end
end

View File

@ -41,7 +41,7 @@
<div class="sdm_t hh2">View</div>
<div class="admbg sdm_o">
<ul id="journal_view_selection">
<li><a class="hp hh2 admtxt" href="journal">Journal</a></li>
<li><a class="hp hh2 admtxt" href="conference">Conference</a></li>
<li><a class="hp hh2 admtxt" href="title">Title</a></li>
<li><a class="hp hh2 admtxt" href="file">File</a></li>
<li><a class="hp hh2 admtxt" href="keywords">Keywords</a></li>
@ -69,7 +69,9 @@
<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">
<% @writing_conferences.each do |w| %>
<%= publication_record w%>
<% end %>
</div>
</div>
</div>