diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 9163f5473..5153a01d4 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -100,7 +100,7 @@ class SoftapplicationsController < ApplicationController @softapplication.destroy respond_to do |format| - format.html { redirect_to :back } + format.html { redirect_to home_path } format.json { head :no_content } end end diff --git a/app/views/contests/_list_softapplications.html.erb b/app/views/contests/_list_softapplications.html.erb index 5646f5d12..29c985b7e 100644 --- a/app/views/contests/_list_softapplications.html.erb +++ b/app/views/contests/_list_softapplications.html.erb @@ -8,7 +8,6 @@ <%= link_to(c_softapplication.softapplication.name, softapplication_path(c_softapplication.softapplication)) %> - <%= link_to '删除', c_softapplication.softapplication, method: :delete, data: { confirm: '您确定要删除吗?' } %>
diff --git a/app/views/softapplications/_form.html.erb b/app/views/softapplications/_form.html.erb index 5a046801f..f45125ea2 100644 --- a/app/views/softapplications/_form.html.erb +++ b/app/views/softapplications/_form.html.erb @@ -1,64 +1,69 @@ -<%= form_for(@softapplication) do |f| %> +<%= form_for(softapplication) do |f| %> - <% if @softapplication.errors.any? %> + <% if softapplication.errors.any? %>
-

<%= pluralize(@softapplication.errors.count, "error") %> prohibited this softapplication from being saved:

+

<%= pluralize(softapplication.errors.count, "error") %> prohibited this softapplication from being saved:

<% end %> - - - <%= l(:label_softapplication_name) %> - * : - <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> - <%= l(:label_softapplication_name_condition)%> -

+
+ + + <%= l(:label_softapplication_name) %> + * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> + <%= l(:label_softapplication_name_condition)%> + +
+
+ + + <%= l(:label_softapplication_version_available) %> + * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> - - <%= l(:label_softapplication_version_available) %> - * : - <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> + +
+
+ + + <%= l(:label_softapplication_type) %> -

+ * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> - - <%= l(:label_softapplication_type) %> - * : - <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> + +
+
+ + + <%= l(:label_softapplication_description) %> + * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> -

+ +
+
+ + <%= l(:label_softapplication_developers) %> + * : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> - - <%= l(:label_softapplication_description) %> - * : - <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> - -

- - -
-
- <%=l(:label_upload_softapplication_packets)%> :
-

- <%= render :partial => 'attachments/form' %> -

-
-
- -
-
- <%=l(:label_upload_softapplication_photo)%> :(<%=l(:label_upload_softapplication_photo_condition)%>)
-

- <%= render :partial => 'attachments/form' %> -

-
-
+ +
+
+
+ 上传应用软件包和应用截图 + <%= render_flash_messages %> +

+ <%= render :partial => 'attachments/form' %> +

+

(<%=l(:label_upload_softapplication_photo_condition)%>)

+ +
+

+
<%= submit_tag l(:button_create), :onclick => "return true" %>
<% end %> diff --git a/app/views/softapplications/edit.html.erb b/app/views/softapplications/edit.html.erb index f93e091d2..c9e0c6f66 100644 --- a/app/views/softapplications/edit.html.erb +++ b/app/views/softapplications/edit.html.erb @@ -1,6 +1,8 @@ -

Editing softapplication

+

<%= l(:label_edit_softapplication)%>

+ +<%= render partial: 'form', locals:{softapplication: @softapplication} %> + + -<%= render 'form' %> -<%= link_to 'Show', @softapplication %> | -<%= link_to 'Back', softapplications_path %> diff --git a/app/views/softapplications/new.html.erb b/app/views/softapplications/new.html.erb index d5ff2c9c2..1112fcfa4 100644 --- a/app/views/softapplications/new.html.erb +++ b/app/views/softapplications/new.html.erb @@ -1,76 +1,5 @@

<%= l(:label_release_softapplication)%>

- +<%= render partial: 'form', locals:{softapplication: @softapplication} %> -
- <%= 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| %> -
- - - <%= l(:label_softapplication_name) %> - * : <%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %> - <%= l(:label_softapplication_name_condition)%> - -
-
- - <%= l(:label_softapplication_version_available) %> - * : <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %> - - -
-
- - - <%= l(:label_softapplication_type) %> - - * : <%= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %> - - -
-
- - - <%= l(:label_softapplication_description) %> - * : <%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %> - - -
-
- - - <%= l(:label_softapplication_developers) %> - * : <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %> - - -
-
-
- 上传应用软件包和应用截图 - <%= render_flash_messages %> -

- <%= render :partial => 'attachments/form' %> -

-

(<%=l(:label_upload_softapplication_photo_condition)%>)

- -
-

-
<%= submit_tag l(:button_create), :onclick => "return true" %>
- -
- - <% end %> -
\ No newline at end of file diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index a5c3fb596..d5681c4ea 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -18,6 +18,10 @@ + diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb index f283bd759..6ef2b4796 100644 --- a/app/views/welcome/contest.html.erb +++ b/app/views/welcome/contest.html.erb @@ -142,18 +142,18 @@
  • - <%= image_tag('/images/039.gif')%> + <%= image_tag('/images/contest1.png')%>
    -
    +
    <%= link_to(contest.name, contest.event_url, :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
    -
    +
    ><%=contest.description.truncate(50, omission: '...')%>

    -
    +
    发布时间:<%=format_time contest.created_on %>
    @@ -204,18 +204,18 @@
  • - <%= image_tag('/images/009.gif')%> + <%= image_tag('/images/app1.png')%>
    -
    +
    <%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
    -
    +
    ><%=softapplication.description.truncate(50, omission: '...')%>

    -
    +
    发布时间:<%=format_time softapplication.created_at %>
    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 079ad450d..c32c62c05 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1855,6 +1855,7 @@ zh: label_release_add_contest_succeed: 该应用发布并添加成功. label_add_contest_succeed_fail: 添加失败,该应用已参赛. label_no_ftapplication: 暂无应用 + label_edit_softapplication: 修改应用 \ No newline at end of file diff --git a/public/images/app1.png b/public/images/app1.png new file mode 100644 index 000000000..3342781ac Binary files /dev/null and b/public/images/app1.png differ diff --git a/public/images/contest1.png b/public/images/contest1.png new file mode 100644 index 000000000..486ea3c3a Binary files /dev/null and b/public/images/contest1.png differ
  • <%= @softapplication.name %> + <%= link_to '删除', softapplication_path(@softapplication), method: :delete, data: { confirm: '您确定要删除吗?' } if @softapplication.destroyable_by? User.current %>  + <%= link_to '编辑', edit_softapplication_path(@softapplication), method: :get if @softapplication.destroyable_by? User.current %> +
    所属类别:<%= @softapplication.app_type_name %>