Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/welcome/_search_project.html.erb config/locales/en.yml config/locales/zh.ymlmemcached_alan
commit
22aae1910b
@ -0,0 +1,30 @@
|
||||
module Mobile
|
||||
module Entities
|
||||
class Comment < Grape::Entity
|
||||
include Redmine::I18n
|
||||
def self.comment_expose(field)
|
||||
expose field do |f,opt|
|
||||
if f.is_a?(Hash) && f.key?(field)
|
||||
f[field]
|
||||
elsif f.is_a?(::Comment)
|
||||
if f.respond_to?(field)
|
||||
if field == :created_on
|
||||
format_time(f.send(field))
|
||||
else
|
||||
f.send(field)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
comment_expose :id
|
||||
expose :author, using: Mobile::Entities::User do |c, opt|
|
||||
if c.is_a? ::Comment
|
||||
c.author
|
||||
end
|
||||
end
|
||||
comment_expose :comments
|
||||
comment_expose :created_on
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
module Mobile
|
||||
module Entities
|
||||
class CourseDynamic < Grape::Entity
|
||||
def self.course_dynamic_expose(field)
|
||||
expose field do |c,opt|
|
||||
c[field] if (c.is_a?(Hash) && c.key?(field))
|
||||
end
|
||||
end
|
||||
|
||||
course_dynamic_expose :course_name
|
||||
course_dynamic_expose :need_anonymous_comments_count
|
||||
course_dynamic_expose :student_commit_number
|
||||
course_dynamic_expose :news_count
|
||||
course_dynamic_expose :message_count
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
class OrganizationsController < ApplicationController
|
||||
layout 'project_base'
|
||||
def index
|
||||
@projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)")
|
||||
end
|
||||
end
|
@ -1,6 +0,0 @@
|
||||
class OriginizationsController < ApplicationController
|
||||
layout 'project_base'
|
||||
def index
|
||||
@enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects")
|
||||
end
|
||||
end
|
@ -0,0 +1,39 @@
|
||||
<h3><%=l(:label_first_page_made)%></h3>
|
||||
|
||||
<%= form_tag(:controller => 'admin', :action => 'enterprise_page_made') do %>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<%= render 'tab_partial' %>
|
||||
<h4><%=l(:label_enterprise_page_made)%></h4>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||
</p>
|
||||
<div style="margin-left: 82px;" id="avatar">
|
||||
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@enterprise_page} %>
|
||||
</div>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_width' style="vertical-align: top"> <%= l(:label_image_width)%>:</label>
|
||||
<%= text_field_tag 'image_width', params[:label_image_width],:value => @enterprise_page.image_width,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='image_height' style="vertical-align: top"> <%= l(:label_imgae_height)%>:</label>
|
||||
<%= text_field_tag 'image_height', params[:label_imgae_height], :value => @enterprise_page.image_height,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='course_title'> <%= l(:label_site_title) %>:</label>
|
||||
<%= text_field_tag 'course_title', params[:label_site_title], :value => @enterprise_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
<p style="margin-left:60px;padding-right: 20px;">
|
||||
<label for='course_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||
<%= text_area_tag 'course_description',@enterprise_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||
</p>
|
||||
|
||||
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||
<% end %>
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<title><%= l(:label_all_enterprises) %></title>
|
||||
<div class="content_syqy">
|
||||
<div class="list"><%= l(:label_all_enterprises) %></div>
|
||||
<div class="syqy_box">
|
||||
<% if @projects.count == 0 %>
|
||||
<h3><%= l(:label_enterprise_nil) %></h3>
|
||||
<% else %>
|
||||
<% @projects.each do |organization| %>
|
||||
<% unless organization.enterprise_name.blank? %>
|
||||
<ul>
|
||||
<li ><img src="/images/organization_logo.jpg" width="30" height="30" alt="#{project.enterprise_name}" />
|
||||
<%= link_to organization.enterprise_name, home_path(:organization => organization) %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<div class="school-index">
|
||||
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||
</div>
|
||||
<% html_title(l(:label_enterprise_all)) -%>
|
@ -1,25 +0,0 @@
|
||||
<div class="enterprise_all">
|
||||
<p>
|
||||
<%= link_to l(:label_all_enterprises) %>
|
||||
<p>
|
||||
<p>
|
||||
<% if @enterprises.count == 0 %>
|
||||
<h3><%= l(:label_enterprise_nil) %></h3>
|
||||
<% else %>
|
||||
<% @enterprises.each do |enterprise| %>
|
||||
<% unless enterprise.enterprise_name.blank? %>
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to enterprise.enterprise_name, home_path(:originization => enterprise.enterprise_name) %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<div class="school-index">
|
||||
<ul id="schoollist" style="line-height: 25px"></ul>
|
||||
</div>
|
||||
<% html_title(l(:label_enterprise_all)) -%>
|
@ -0,0 +1,27 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<script type="text/javascript">
|
||||
function close_alert_form(){hideModal("#alert_form");}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="alert_form">
|
||||
<div class="upload_con">
|
||||
<div class="polls_alert_upload_box">
|
||||
<p class="polls_alert_box_p">
|
||||
<%= message%>
|
||||
</p>
|
||||
<div class="polls_alert_btn_box">
|
||||
<a class="upload_btn" onclick="close_alert_form();">
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,2 +1,10 @@
|
||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
alert("发布成功");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
|
||||
showModal('ajax-modal', '180px');
|
||||
$('#ajax-modal').css('height','111px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='#' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
@ -1,2 +1,10 @@
|
||||
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
|
||||
alert("取消成功");
|
||||
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
|
||||
showModal('ajax-modal', '180px');
|
||||
$('#ajax-modal').css('height','80px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='#' onclick='close_alert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().removeClass("alert_praise");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("poll_alert_form");
|
@ -1 +1 @@
|
||||
Subproject commit 3cabcc643f36939939685e6f55273dfbf89da545
|
||||
Subproject commit 222a9bdd72014f197baf2131ab71cc41660111ed
|
After Width: | Height: | Size: 8.5 KiB |
Loading…
Reference in new issue