parent
f9e5dd47f6
commit
98b6493b91
@ -0,0 +1,15 @@
|
||||
|
||||
class ContestingSoftapplication < ActiveRecord::Base
|
||||
attr_accessible :contest_id, :description, :softapplication_id, :user_id
|
||||
|
||||
belongs_to :contest
|
||||
belongs_to :softapplication
|
||||
belongs_to :user
|
||||
|
||||
|
||||
def self.create_softapplication_contesting(contest_id, softapplication_id, description = nil)
|
||||
self.create(:user_id => User.current.id, :contest_id => contest_id,
|
||||
:softapplication_id => softapplication_id, :description => description)
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,40 @@
|
||||
|
||||
<% contesting_softapplication.each do |c_softapplication|%>
|
||||
<% if c_softapplication.softapplication %>
|
||||
<table width="90%" border="0" align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
<table width="660px" border="0" align='center'>
|
||||
<tr>
|
||||
|
||||
<td width="65%" valign="top">
|
||||
<table width="100%" valign="top" align="left">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50%">
|
||||
<strong>
|
||||
<%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %>
|
||||
</strong>
|
||||
<span class="font_lighter"><%= l(:label_joined_contest)%></span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="50%" style=" word-wrap: break-word; word-break: break-all"><%= c_softapplication.softapplication.description %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top"><span class="font_lighter">
|
||||
<%=format_time c_softapplication.created_at %>
|
||||
</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -0,0 +1,4 @@
|
||||
$('#contesting_softapplication_list').html('<%= escape_javascript(render(:partial => 'softapplication_list', :locals => {:contesting_softapplication => @contesting_softapplication})) %>');
|
||||
$("#softapplication_id").val("请选择参赛应用");
|
||||
$("#contest_message").val( "<%= l(:label_bid_reason) %>" );
|
||||
$("#put-bid-form").hide();
|
@ -0,0 +1,32 @@
|
||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||
|
||||
|
||||
<div id='leave-message'>
|
||||
<%= render :partial => 'new_message', :locals => {:softapplication => @softapplication, :sta => @state} %>
|
||||
</div>
|
||||
|
||||
|
||||
<% if journals.size >0 %>
|
||||
<ul class="message-for-user">
|
||||
<% for journal in journals%>
|
||||
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
|
||||
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
|
||||
<span class="body">
|
||||
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
|
||||
<span class="font_lighter"><% label = l(:label_contest_requirement) %></span>
|
||||
<div> <%= textilizable journal.notes%> </div>
|
||||
<span class="font_lighter"><%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %></span>
|
||||
|
||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||
|
||||
<span>
|
||||
<% if @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 %>
|
||||
</span>
|
||||
</span>
|
||||
<div style="clear: both;"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
@ -0,0 +1,53 @@
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
function clearInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<%= form_for('softapplication_message',
|
||||
:remote => true, :method => :post,
|
||||
:url => {:controller => 'softapplications',
|
||||
:action => 'create_message',
|
||||
:id => softapplication,
|
||||
:sta => sta}
|
||||
) do |f|%>
|
||||
|
||||
<div id = 'pre_show'>
|
||||
<%= render :partial => 'pre_show', :locals => {:content => @content} %>
|
||||
</div>
|
||||
|
||||
<% if User.current.logged? %>
|
||||
<table border="0" width="525px" align="center" >
|
||||
<tr>
|
||||
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_respond), :style => "resize: none;", :class => 'noline'%></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<%= f.text_field :reference_user_id, :style=>"display:none"%> <!--what function?-->
|
||||
|
||||
<!-- modified by bai -->
|
||||
<table border="0" width="525px" align="center">
|
||||
<tr>
|
||||
<td align="right"> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "softapplication_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
|
||||
<%= submit_tag l(:button_clear), :name => nil, :onclick => "clearMessage('softapplication_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- end -->
|
||||
<% else %>
|
||||
<div style="font-size: 14px;margin:10px;">
|
||||
<%= l(:label_user_login_tips) %>
|
||||
<%= link_to l(:label_user_login_new), signin_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,13 @@
|
||||
<!-- fq -->
|
||||
<% unless content.nil?%>
|
||||
<table width="60%" style="margin-left: 60px;">
|
||||
<tr>
|
||||
<td> <%= textilizable content %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><%= hidden_field_tag 'reference_content', params[:reference_content], :value => content%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
$('#message_history').html('<%= escape_javascript(render(:partial => 'history_message', :locals => {:softapplication => @softapplication, :journals => @jour, :state => @state})) %>');
|
||||
$('#softapplication_message_reference_user_id').val("");
|
@ -0,0 +1,4 @@
|
||||
$('#history').html('<%= escape_javascript(render(:partial => 'softapplications/message_history', :locals => {:contest => @softapplication, :journals => @jour, :state => true})) %>');
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
||||
$('#softapplication_message_message').val("");
|
||||
$('#softapplication_message_reference_user_id').val("");
|
@ -0,0 +1,2 @@
|
||||
$('#message_history').html('<%= escape_javascript(render(:partial => 'message_history', :locals => {:softapplication => @softapplication, :journals => @jour, :state => @state})) %>');
|
||||
$('#softapplication_message_reference_user_id').val("");
|
@ -0,0 +1,12 @@
|
||||
<h3><%=l(:label_release_softapplication)%></h3>
|
||||
<!-- <%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', softapplications_path %> -->
|
||||
|
||||
<%= labelled_form_for @softapplication, :url => {:controller => 'softapplications', :action => 'create'}, method: :post do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
<h3><%=l(:label_release_softapplication)%></h3>
|
||||
<!-- <%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', softapplications_path %> -->
|
||||
|
||||
<%= labelled_form_for @softapplication, :url => {:controller => 'softapplications', :action => 'create'}, method: :post do |f| %>
|
||||
<div class="box tabular">
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<!-- <%= javascript_tag "$('#bid_name').focus();" %> -->
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,64 @@
|
||||
<h3><%= l(:label_release_softapplication)%></h3> <!-- <%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', softapplications_path %> -->
|
||||
|
||||
|
||||
<div id="put-bid-form" style="">
|
||||
<%= form_for Softapplication.new, :url => {:controller => 'softapplications', :action => 'create'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<%= l(:label_attachment_plural) %>
|
||||
</legend>
|
||||
<tr style="width:700px; margin-left: -10px">
|
||||
<td><%= l(:label_softapplication_name) %></td>
|
||||
<td style="require, color: #bb0000"> * </td>: <td ><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<td><%= l(:label_softapplication_name_condition)%></td>
|
||||
</tr></ br>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<td><%= l(:label_softapplication_version_available) %></td>
|
||||
<td style="require, color: #bb0000"> * </td>: <td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<td><%= l(:label_softapplication_type) %></td>
|
||||
|
||||
<td style="require, color: #bb0000"> * </td>: <td style="width: 100px"><%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<tr style="width:800px;">
|
||||
<td><%= l(:label_softapplication_description) %></td>
|
||||
<td style="require, color: #bb0000"> * </td>: <td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr></ br>
|
||||
<br />
|
||||
<br />
|
||||
<%= render_flash_messages %>
|
||||
<p id="put-bid-form-partial">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<%= submit_tag l(:button_create), :onclick => "return true" %>
|
||||
<script type="text/javascript">
|
||||
function j_submit () {
|
||||
alert('start')
|
||||
var submit_homework = function(){
|
||||
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "softapplications", :action => "create"})+".js" %>').ajaxSubmit()
|
||||
};
|
||||
alert('stop')
|
||||
$.globalEval(submit_homework());
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => @content})) %>');
|
||||
$('#softapplication_message_reference_user_id').val("<%= @id%>");
|
||||
showAndScrollTo("pre_show", "softapplication_message_reference_user_id");
|
||||
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddContestIdToSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :softapplications, :contest_id, :integer
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddSoftapplicationIdToSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :softapplications, :softapplication_id, :integer
|
||||
end
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
class CreateContestingSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :contesting_softapplications do |t|
|
||||
t.integer :softapplication_id
|
||||
t.integer :contest_id
|
||||
t.integer :user_id
|
||||
t.string :description
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddRewardToContestingSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :contesting_softapplications, :reward, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddIsPublicToSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :softapplications, :is_public, :integer
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddApplicationdevelopersToSoftapplications < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :softapplications, :application_developers, :string
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
softapplication_id: 1
|
||||
contest_id: 1
|
||||
user_id: 1
|
||||
description: MyString
|
||||
|
||||
two:
|
||||
softapplication_id: 1
|
||||
contest_id: 1
|
||||
user_id: 1
|
||||
description: MyString
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue