diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index d7a79457a..833711e3e 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -124,11 +124,12 @@ class ContestsController < ApplicationController def show_contest @user = @contest.author @jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') - @limit = 10 - @feedback_count = @jours.count - @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] - @offset ||= @feedback_pages.offset - @jour = @jours[@offset, @limit] + #@limit = 10 + #@feedback_count = @jours.count + #@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + #@offset ||= @feedback_pages.offset + #@jour = @jours[@offset, @limit] + @jour = paginateHelper @jours,10 @state = false respond_to do |format| diff --git a/app/views/contests/_contest_jours.html.erb b/app/views/contests/_contest_jours.html.erb new file mode 100644 index 000000000..94814c492 --- /dev/null +++ b/app/views/contests/_contest_jours.html.erb @@ -0,0 +1,12 @@ +
+

留言内容

+ <%= render :partial => 'new', :locals => {:contest => @contest, :sta => @state} %> + + + +
+
+ <%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %> +
+ + \ No newline at end of file diff --git a/app/views/contests/_history.html.erb b/app/views/contests/_history.html.erb index 73d71c0d0..75fffe734 100644 --- a/app/views/contests/_history.html.erb +++ b/app/views/contests/_history.html.erb @@ -1,79 +1,63 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %> -<% tip1 = l(:label_user_response) %> -

<%=tip1%>

-
- <%= render :partial => 'new', :locals => {:contest => @contest, :sta => @state} %> +
+
+ <% if journals.size > 0 %> + <% for journal in journals %> +
+ +
+
+ + <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= format_time(journal.created_on) %> +
+

<%= textilizable journal.notes%>

+
+
+ <% ids = 'project_respond_form_'+ journal.id.to_s%> + + <% if journal.user == User.current|| User.current.admin? %> + <%= link_to(l(:label_bid_respond_delete), + {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', + :class => "delete", :title => l(:button_delete)) %> + <% end %> + <% if reply_allow %> + <%= link_to l(:label_bid_respond_quote),'', + {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> + <%= link_to(l(:button_quote), contests_path(:id => contest, + :journal_id => journal), + :remote => true, + :method => 'post', + :title => l(:button_quote))%> + <% end %> + + + <%= l(:label_bids_published) %>  + <%= time_tag(journal.created_on).html_safe %>  + <%= l(:label_bids_published_ago) %> + +
+
+ <% ids = 'project_respond_form_'+ journal.id.to_s%> + <% if reply_allow %> +
+ <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %> +
+ <% end %> +
+
+ <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %> +
+
+
+
+ <% end %> + <% end %> +
-<% if journals.size >0 %> - -<% end %> diff --git a/app/views/contests/show_contest.html.erb b/app/views/contests/show_contest.html.erb index be98c10ac..7e107cb73 100644 --- a/app/views/contests/show_contest.html.erb +++ b/app/views/contests/show_contest.html.erb @@ -1,15 +1,8 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %> +<%= stylesheet_link_tag 'css', :media => 'all' %> - -
- <%= render :partial => 'history', + <%= render :partial => 'contest_jours', :locals => { :contest => @contest, :journals => @jour, :state => false} %> -
- <% html_title(l(:label_user_response)) -%> diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb new file mode 100644 index 000000000..70f956d4e --- /dev/null +++ b/app/views/courses/_courses_jours.html.erb @@ -0,0 +1,29 @@ +
+ <% reply_allow = JournalsForMessage.create_by_user? User.current %> + +

<%= l(:label_user_response) %>

+ + <% if !User.current.logged?%> +
+ <%= l(:label_user_login_tips) %> + <%= link_to l(:label_user_login_new), signin_path %> +
+
+ <% else %> +
+ <%= form_for('new_form', :method => :post, + :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> + <%= f.text_area 'course_message', :rows => 3, :cols => 65, + :placeholder => "#{l(:label_welcome_my_respond)}", + :style => "resize: none; width: 98%", + :class => 'noline'%> + <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> + <% end %> +
+ <% end %> + +
+
+ <%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %> +
+ diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb new file mode 100644 index 000000000..beb31f830 --- /dev/null +++ b/app/views/courses/_history.html.erb @@ -0,0 +1,59 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %> + +
+
+ <% if journals.size > 0 %> + <% for journal in journals %> +
+ +
+
+ + <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= format_time(journal.created_on) %> +
+

<%= textilizable journal.notes%>

+
+
+ <% ids = 'project_respond_form_'+ journal.id.to_s%> + + <% if journal.user == User.current|| User.current.admin? %> + <%= link_to(l(:label_bid_respond_delete), + {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', + :class => "delete", :title => l(:button_delete)) %> + <% end %> + <% if reply_allow %> + <%= link_to l(:label_bid_respond_quote),'', + {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %> + + <% end %> + + + <%= l(:label_bids_published) %>  + <%= time_tag(journal.created_on).html_safe %>  + <%= l(:label_bids_published_ago) %> + +
+
+ <% ids = 'project_respond_form_'+ journal.id.to_s%> + <% if reply_allow %> +
+ <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %> +
+ <% end %> +
+
+ <%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %> +
+
+
+
+ <% end %> + <% end %> +
+
+ + + + + diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index 574061034..90fb9e0c2 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -1,3 +1,11 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %> +<%= stylesheet_link_tag 'css', :media => 'all' %> + +<%= render :partial => 'courses_jours', + :locals => { :contest => @contest, :journals => @jour, :state => false} +%> + +<% html_title(l(:label_user_response)) -%> - -<% reply_allow = JournalsForMessage.create_by_user? User.current %> - -

<%= l(:label_user_response) %>

- -<% if !User.current.logged?%> -
- <%= l(:label_user_login_tips) %> - <%= link_to l(:label_user_login_new), signin_path %> -
-
-<% else %> -
- <%= form_for('new_form', :method => :post, - :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> - <%= f.text_area 'course_message', :rows => 3, :cols => 65, - :placeholder => "#{l(:label_welcome_my_respond)}", - :style => "resize: none; width: 98%", - :class => 'noline'%> - <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> - <% end %> -
-<% end %> -
-<% if @jour.size >0 %> - -<% end %>