Finished
This commit is contained in:
		
							parent
							
								
									c7225e7b89
								
							
						
					
					
						commit
						90deeb15d9
					
				| 
						 | 
				
			
			@ -0,0 +1,41 @@
 | 
			
		|||
class Admin::ExperienceTypesController < OrbitAdminController
 | 
			
		||||
  def new
 | 
			
		||||
    @experience_type = ExperienceType.new
 | 
			
		||||
    @url = admin_experience_types_path(@experience_type)
 | 
			
		||||
    render :layout=>false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def create
 | 
			
		||||
    @experience_type = ExperienceType.new(experience_type_params)
 | 
			
		||||
    @experience_type.save
 | 
			
		||||
    @experience_types = ExperienceType.all
 | 
			
		||||
    render :partial=>'list', :layout=>false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def edit
 | 
			
		||||
    @experience_type = ExperienceType.find(params[:id])
 | 
			
		||||
    @url = admin_experience_type_path(@experience_type)
 | 
			
		||||
    render :layout=>false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def update
 | 
			
		||||
    @experience_type = ExperienceType.find(params[:id])
 | 
			
		||||
    @experience_type.update_attributes(experience_type_params)
 | 
			
		||||
    @experience_type.save
 | 
			
		||||
    @experience_types = ExperienceType.all
 | 
			
		||||
    render :partial=>'list', :layout=>false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def destroy
 | 
			
		||||
    experience_type = ExperienceType.find(params[:id])
 | 
			
		||||
    experience_type.destroy
 | 
			
		||||
    @experience_types = ExperienceType.all
 | 
			
		||||
    render :partial=>'list', :layout=>false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  def experience_type_params
 | 
			
		||||
    params.require(:experience_type).permit! rescue nil
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,89 @@
 | 
			
		|||
class Admin::ExperiencesController < OrbitMemberController
 | 
			
		||||
  layout "member_plugin"
 | 
			
		||||
 | 
			
		||||
  before_action :set_plugin
 | 
			
		||||
  before_action :get_settings,:only => [:new, :edit, :setting]
 | 
			
		||||
 | 
			
		||||
  def index
 | 
			
		||||
    @experiences = Experience.all
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def new
 | 
			
		||||
    @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
 | 
			
		||||
    @experience = Experience.new
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def create
 | 
			
		||||
    @member = MemberProfile.find(experience_params['member_profile_id']) rescue nil
 | 
			
		||||
    @experience = Experience.new(experience_params)
 | 
			
		||||
    @experience.save
 | 
			
		||||
    redirect_to '/admin/members/'+@member.to_param+'/Experience'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def edit
 | 
			
		||||
    @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
 | 
			
		||||
    @experience = Experience.find(params[:id])
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def update
 | 
			
		||||
    @member = MemberProfile.find(experience_params['member_profile_id']) rescue nil
 | 
			
		||||
    @experience = Experience.find(params[:id])
 | 
			
		||||
    @experience.update_attributes(experience_params)
 | 
			
		||||
    @experience.save
 | 
			
		||||
    redirect_to '/admin/members/'+@member.to_param+'/Experience'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def destroy
 | 
			
		||||
    @experience = Experience.find(params[:id])
 | 
			
		||||
    @experience.destroy
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def toggle_hide
 | 
			
		||||
    if params[:ids]
 | 
			
		||||
      @experiences = Experience.any_in(_id: params[:ids])
 | 
			
		||||
 | 
			
		||||
      @experiences.each do |experience|
 | 
			
		||||
        experience.is_hidden = params[:disable]
 | 
			
		||||
        experience.save
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    render json: {"success"=>true}
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def setting
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def frontend_setting
 | 
			
		||||
    @member = MemberProfile.find_by(:uid=>params['uid']) rescue nil
 | 
			
		||||
    @intro = ExperienceIntro.find_by(:member_profile_id=>@member.id) rescue nil
 | 
			
		||||
    @intro = @intro.nil? ? ExperienceIntro.new({:member_profile_id=>@member.id}) : @intro
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def update_frontend_setting
 | 
			
		||||
    @member = MemberProfile.find(intro_params['member_profile_id']) rescue nil
 | 
			
		||||
    @intro = ExperienceIntro.find_by(:member_profile_id=>@member.id) rescue nil
 | 
			
		||||
    @intro = @intro.nil? ? ExperienceIntro.new({:member_profile_id=>@member.id}) : @intro
 | 
			
		||||
    @intro.update_attributes(intro_params)
 | 
			
		||||
    @intro.save
 | 
			
		||||
    redirect_to '/admin/members/'+@member.to_param+'/Experience'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def get_settings
 | 
			
		||||
    @experience_types = ExperienceType.all
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def set_plugin
 | 
			
		||||
    @plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'Experience'}.first
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  def experience_params
 | 
			
		||||
    params.require(:experience).permit! rescue nil
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def intro_params
 | 
			
		||||
    params.require(:experience_intro).permit! rescue nil
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,43 @@
 | 
			
		|||
class Experience
 | 
			
		||||
  include Mongoid::Document
 | 
			
		||||
  include Mongoid::Timestamps
 | 
			
		||||
  include OrbitModel::Status
 | 
			
		||||
  include Slug
 | 
			
		||||
 | 
			
		||||
  field :organizationt_title, localize: true
 | 
			
		||||
  field :department, localize: true
 | 
			
		||||
  field :job_title, localize: true
 | 
			
		||||
  
 | 
			
		||||
  belongs_to :experience_type
 | 
			
		||||
  belongs_to :member_profile
 | 
			
		||||
  
 | 
			
		||||
  field :language
 | 
			
		||||
  field :start_date , :type => Date
 | 
			
		||||
  field :end_date , :type => Date
 | 
			
		||||
  field :keywords
 | 
			
		||||
  field :url
 | 
			
		||||
  field :note
 | 
			
		||||
  field :create_user_id, :type => BSON::ObjectId
 | 
			
		||||
  field :update_user_id, :type => BSON::ObjectId
 | 
			
		||||
 | 
			
		||||
  paginates_per 10
 | 
			
		||||
 | 
			
		||||
  before_validation :add_http
 | 
			
		||||
 | 
			
		||||
  def duration
 | 
			
		||||
    self.start_date.strftime('%Y.%m')+' ~ '+self.end_date.strftime('%Y.%m')
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def slug_title
 | 
			
		||||
    self.organizationt_title+' '+self.department+' '+self.job_title
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  protected
 | 
			
		||||
 | 
			
		||||
  def add_http
 | 
			
		||||
    unless self.url.blank? || self.url[/^http:\/\//] || self.url[/^https:\/\//]
 | 
			
		||||
      self.url = 'http://' + self.url
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
  
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
class ExperienceIntro < PersonalPluginIntro
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
class ExperienceType
 | 
			
		||||
  include Mongoid::Document
 | 
			
		||||
  include Mongoid::Timestamps
 | 
			
		||||
 | 
			
		||||
  field :title, localize: true
 | 
			
		||||
  
 | 
			
		||||
  has_many :experiences
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
<%= form_for(@experience_type, :html =>{:class=>"form-horizontal", :style=>"margin: 0;"}, :remote => true, :url => @url ) do |f| %>
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
    <h3 id="myModalLabel"><%= t("personal_experience.experience_category") %></h3>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <%= f.fields_for :title_translations do |f| %>
 | 
			
		||||
      <% @site_in_use_locales.each do |locale| %>
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <%= label_tag t(locale), t(locale), :class => 'control-label' %>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.text_field locale, :value => (@experience_type.title_translations[locale] rescue nil) %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <% end %>
 | 
			
		||||
    <% end %>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <%= f.submit t('submit'), :class=>'btn btn-primary' %>
 | 
			
		||||
    <a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
$('#experience_types tbody').html("<%= j render :partial => '/admin/experiences/list_experience_type', :collection => @experience_types %>");
 | 
			
		||||
$('#experience_type_modal').modal('hide');
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
$('#experience_type_modal').html("<%= j render 'form' %>");
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
$('#experience_type_modal').html("<%= j render 'form' %>");
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
<% @experiences.each do |experience| %> 
 | 
			
		||||
  <tr id="<%= dom_id experience %>" class="<%= experience.is_hidden ? "checkHide" : "" %>">
 | 
			
		||||
    <td><%= experience.duration %></td>
 | 
			
		||||
    <td>
 | 
			
		||||
      <%= link_to experience.organizationt_title, '', target: "blank"%>
 | 
			
		||||
      <div class="quick-edit">
 | 
			
		||||
        <ul class="nav nav-pills hide">
 | 
			
		||||
          <li><%= link_to t('edit'), '/admin/members/'+experience.member_profile.to_param+'/experiences/'+experience.id+'/edit' %></li>
 | 
			
		||||
          <li><%= link_to t(:delete_), admin_experience_path(id: experience.id, member_profile_id: experience.member_profile.id), method: :delete, remote: true, data: { confirm: t('sure?') } %></li>
 | 
			
		||||
        </ul>
 | 
			
		||||
      </div>
 | 
			
		||||
    </td>
 | 
			
		||||
    <td><%= experience.department %></td>
 | 
			
		||||
    <td><%= experience.job_title %></td>
 | 
			
		||||
  </tr>   
 | 
			
		||||
<% end %>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,178 @@
 | 
			
		|||
<% # encoding: utf-8 %>
 | 
			
		||||
<% content_for :page_specific_css do %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/main-forms" %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/fileupload" %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/main-list" %>
 | 
			
		||||
<% end %>
 | 
			
		||||
<% content_for :page_specific_javascript do %>
 | 
			
		||||
  <%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
 | 
			
		||||
  <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
 | 
			
		||||
  <%= javascript_include_tag "lib/module-area" %>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<!-- Input Area -->
 | 
			
		||||
<div class="input-area">
 | 
			
		||||
 | 
			
		||||
  <!-- Module Tabs --> 
 | 
			
		||||
  <div class="nav-name"><strong><%= t(:module) %></strong></div>
 | 
			
		||||
  <ul class="nav nav-pills module-nav">
 | 
			
		||||
    <li></li>
 | 
			
		||||
    <li class="active">
 | 
			
		||||
      <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
 | 
			
		||||
    </li>
 | 
			
		||||
    <li>
 | 
			
		||||
      <a href="#status" data-toggle="tab"><%= t(:status) %></a>
 | 
			
		||||
    </li>
 | 
			
		||||
  </ul>
 | 
			
		||||
 | 
			
		||||
  <!-- Module -->
 | 
			
		||||
  <div class="tab-content module-area">
 | 
			
		||||
 | 
			
		||||
    <!-- Basic Module -->
 | 
			
		||||
    <div class="tab-pane fade in active" id="basic">
 | 
			
		||||
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_plugins.author") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= @member.name rescue ''%>
 | 
			
		||||
          <%= f.hidden_field :member_profile_id, :value => @member.id %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- experience_category -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.experience_category") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.select :experience_type_id, @experience_types.collect {|t| [ t.title, t.id ]} %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- start_date -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.start_date") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.datetime_picker :start_date, :no_label => true, :format=>"yyyy/MM", :placeholder=>"YYYY/MM" %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- end_date -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.end_date") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.datetime_picker :end_date, :no_label => true, :format=>"yyyy/MM", :placeholder=>"YYYY/MM" %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- keywords -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.keywords") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.text_field :keywords %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- language -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.language") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <select id="experience_language" name="experience[language]">
 | 
			
		||||
            <% @site_in_use_locales.each do |locale| %>
 | 
			
		||||
              <option value="<%= locale %>" <%= @experience.language.eql?(locale.to_s) ? "selected" : ""%>><%= t(locale) %></option>
 | 
			
		||||
            <% end %>
 | 
			
		||||
          </select>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- url -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.url") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.text_field :url , :class => "span5" %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
      <!-- note -->
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t("personal_experience.note") %></label>
 | 
			
		||||
        <div class="controls">
 | 
			
		||||
          <%= f.text_area :note, rows: 2, class: "input-block-level" %>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div> 
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- Status Module -->
 | 
			
		||||
    <div class="tab-pane fade" id="status">
 | 
			
		||||
      <div class="control-group">
 | 
			
		||||
        <label class="control-label muted"><%= t(:status) %></label>
 | 
			
		||||
        <div class="controls" data-toggle="buttons-checkbox">
 | 
			
		||||
          <label class="checkbox inline btn <%= 'active' if @experience.is_hidden? %>">
 | 
			
		||||
            <%= f.check_box :is_hidden %> <%= t(:hide) %>
 | 
			
		||||
          </label>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <!-- Language Tabs -->
 | 
			
		||||
  <div class="nav-name"><strong><%= t(:language) %></strong></div>
 | 
			
		||||
  <ul class="nav nav-pills language-nav">
 | 
			
		||||
    <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
      <li class="<%= 'active' if i == 0 %>">
 | 
			
		||||
        <a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
 | 
			
		||||
      </li>
 | 
			
		||||
    <% end %>
 | 
			
		||||
  </ul>
 | 
			
		||||
 | 
			
		||||
  <!-- Language -->
 | 
			
		||||
  <div class="tab-content language-area">
 | 
			
		||||
 | 
			
		||||
    <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
    
 | 
			
		||||
      <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
 | 
			
		||||
 | 
			
		||||
        <!-- organizationt_title-->
 | 
			
		||||
        <div class="control-group input-title">
 | 
			
		||||
          <label class="control-label muted"><%= t("personal_experience.organizationt_title") %></label>
 | 
			
		||||
          <div class="controls">
 | 
			
		||||
            <%= f.fields_for :organizationt_title_translations do |f| %>
 | 
			
		||||
              <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.organizationt_title"), value: (@experience.organizationt_title_translations[locale] rescue nil) %>
 | 
			
		||||
            <% end %>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <!-- department-->
 | 
			
		||||
        <div class="control-group input-title">
 | 
			
		||||
          <label class="control-label muted"><%= t("personal_experience.department") %></label>
 | 
			
		||||
          <div class="controls">
 | 
			
		||||
            <%= f.fields_for :department_translations do |f| %>
 | 
			
		||||
              <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.department"), value: (@experience.department_translations[locale] rescue nil) %>
 | 
			
		||||
            <% end %>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <!-- job_title-->
 | 
			
		||||
        <div class="control-group input-title">
 | 
			
		||||
          <label class="control-label muted"><%= t("personal_experience.job_title") %></label>
 | 
			
		||||
          <div class="controls">
 | 
			
		||||
            <%= f.fields_for :job_title_translations do |f| %>
 | 
			
		||||
              <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_experience.job_title"), value: (@experience.job_title_translations[locale] rescue nil) %>
 | 
			
		||||
            <% end %>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
    <% end %>
 | 
			
		||||
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
</div> 
 | 
			
		||||
 | 
			
		||||
<!-- Form Actions -->
 | 
			
		||||
<div class="form-actions">
 | 
			
		||||
  <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
 | 
			
		||||
  <%= f.submit t('submit'), class: 'btn btn-primary' %>
 | 
			
		||||
  <%= link_to t('cancel'), get_go_back, :class=>"btn" %>  
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,55 @@
 | 
			
		|||
<% if form_file.new_record? %>
 | 
			
		||||
  <div class="fileupload fileupload-new start-line" data-provides="fileupload">
 | 
			
		||||
<% else %>
 | 
			
		||||
  <div class="fileupload fileupload-exist start-line" data-provides="fileupload">
 | 
			
		||||
    <% if form_file.file.blank? %>
 | 
			
		||||
      <%= t(:no_file) %>
 | 
			
		||||
    <% else %>
 | 
			
		||||
      <%= link_to content_tag(:i) + form_file.file_identifier, form_file.file.url, {:class => 'file-link file-type', :target => '_blank', :title => form_file.file_identifier} %>
 | 
			
		||||
    <% end %>
 | 
			
		||||
<% end %>
 | 
			
		||||
  <div class="input-prepend input-append">
 | 
			
		||||
    <label>
 | 
			
		||||
      <span class="add-on btn btn-file" title='<%= t(:file_) %>'>
 | 
			
		||||
        <i class="icons-paperclip"></i>
 | 
			
		||||
        <%= f.file_field :file %>
 | 
			
		||||
      </span>
 | 
			
		||||
      <div class="uneditable-input input-medium">
 | 
			
		||||
        <i class="icon-file fileupload-exists"></i>
 | 
			
		||||
        <span class="fileupload-preview"><%= (form_file.new_record? || form_file.file.blank?) ? t(:select_file) : t(:change_file) %></span>
 | 
			
		||||
      </div>
 | 
			
		||||
    </label>
 | 
			
		||||
    <span class="add-on icons-pencil" title='<%= t(:alternative) %>'></span>
 | 
			
		||||
    <span class="tab-content">
 | 
			
		||||
      <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
        <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
 | 
			
		||||
          <%= f.fields_for :title_translations do |f| %>
 | 
			
		||||
            <%= f.text_field locale, :class => "input-medium", placeholder: t(:alternative), :value => (form_file.title_translations[locale] rescue nil) %>
 | 
			
		||||
          <% end %>
 | 
			
		||||
        </span>
 | 
			
		||||
      <% end %>
 | 
			
		||||
    </span>
 | 
			
		||||
    <span class="add-on icons-pencil" title='<%= t(:description) %>'></span>
 | 
			
		||||
    <span class="tab-content">
 | 
			
		||||
      <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
        <span class="tab-pane fade <%= ( i == 0 ) ? "in active" : '' %> <%= locale %>">
 | 
			
		||||
          <%= f.fields_for :description_translations do |f| %>
 | 
			
		||||
            <%= f.text_field locale, :class => "input-medium", placeholder: t(:description), :value => (form_file.description_translations[locale] rescue nil) %>
 | 
			
		||||
          <% end %>
 | 
			
		||||
        </span>
 | 
			
		||||
      <% end %>
 | 
			
		||||
    </span>
 | 
			
		||||
    </span>
 | 
			
		||||
    <% if form_file.new_record? %>
 | 
			
		||||
      <span class="delete_file add-on btn" title="<%= t(:delete_) %>">
 | 
			
		||||
        <a class="icon-trash"></a>
 | 
			
		||||
      </span>
 | 
			
		||||
    <% else %> 
 | 
			
		||||
      <span class="remove_existing_record add-on btn" title="<%= t(:remove) %>">
 | 
			
		||||
        <%= f.hidden_field :id %>
 | 
			
		||||
        <a class="icon-remove"></a>
 | 
			
		||||
        <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %>
 | 
			
		||||
      </span>
 | 
			
		||||
    <% end %>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
<tr id="<%= dom_id list_experience_type %>">
 | 
			
		||||
  <td><%= list_experience_type.title %></td>
 | 
			
		||||
  <td class="span2">
 | 
			
		||||
  
 | 
			
		||||
  <a href="<%= edit_admin_experience_type_path(list_experience_type) %>#author_type_modal" data-toggle="modal" data-remote="true" class="action"><%= t(:edit) %></a>
 | 
			
		||||
  <%= link_to t(:delete_), admin_experience_type_path(list_experience_type), "data-confirm" => t('sure?'), :method => :delete, :remote => true,:class=>"archive_toggle action" %>
 | 
			
		||||
  </td>
 | 
			
		||||
</tr>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
$('#writing_conference_<%= @writing_conference.id.to_s%>').remove();
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
<%= form_for @experience, url:'/admin/experiences/'+@experience.id.to_s, html: {class: "form-horizontal main-forms previewable"} do |f| %>
 | 
			
		||||
  <fieldset>
 | 
			
		||||
    <%= render partial: 'form', locals: {f: f} %>
 | 
			
		||||
  </fieldset>
 | 
			
		||||
<% end %>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,93 @@
 | 
			
		|||
<% content_for :page_specific_css do %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/main-forms" %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/main-list" %>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<%= form_for(:experience_intro, :url => update_frontend_setting_admin_experiences_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
 | 
			
		||||
  <fieldset>
 | 
			
		||||
    <!-- Input Area -->
 | 
			
		||||
    <div class="input-area">
 | 
			
		||||
 | 
			
		||||
      <!-- Module Tabs --> 
 | 
			
		||||
      <div class="nav-name"><strong><%= t("module_name.personal_experience") %></strong></div>
 | 
			
		||||
      <ul class="nav nav-pills module-nav">
 | 
			
		||||
        <li></li>
 | 
			
		||||
        <li class="active">
 | 
			
		||||
          <a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
 | 
			
		||||
        </li>
 | 
			
		||||
      </ul>
 | 
			
		||||
 | 
			
		||||
      <!-- Module -->
 | 
			
		||||
      <div class="tab-content module-area">
 | 
			
		||||
        <!-- Basic Module -->
 | 
			
		||||
        <div class="tab-pane fade in active" id="basic">
 | 
			
		||||
          <% if !@member.blank? %>
 | 
			
		||||
            <div class="control-group">
 | 
			
		||||
              <label class="control-label muted"><%= t("personal_plugins.author") %></label>
 | 
			
		||||
              <div class="controls">
 | 
			
		||||
                <%= @member.name rescue ''%>
 | 
			
		||||
                <%= f.hidden_field :member_profile_id, :value => @member.id %>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div> 
 | 
			
		||||
          <% end %>
 | 
			
		||||
          <!-- frontend_page -->
 | 
			
		||||
          <div class="control-group">
 | 
			
		||||
            <label class="control-label muted"><%= t("personal_plugins.frontend_page") %></label>
 | 
			
		||||
            <div class="controls">
 | 
			
		||||
                <%= f.check_box :brief_intro, :checked => @intro.brief_intro %> <%= t("personal_plugins.brief_intro") %>
 | 
			
		||||
                <%= f.check_box :complete_list, :checked => @intro.complete_list %> <%= t("personal_plugins.complete_list") %>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div> 
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <!-- Language Tabs -->
 | 
			
		||||
      <div class="nav-name"><strong><%= t(:language) %></strong></div>
 | 
			
		||||
      <ul class="nav nav-pills language-nav">
 | 
			
		||||
        <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
          <li class="<%= 'active' if i == 0 %>">
 | 
			
		||||
            <a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
 | 
			
		||||
          </li>
 | 
			
		||||
        <% end %>
 | 
			
		||||
      </ul>
 | 
			
		||||
 | 
			
		||||
      <!-- Language -->
 | 
			
		||||
      <div class="tab-content language-area">
 | 
			
		||||
 | 
			
		||||
        <% @site_in_use_locales.each_with_index do |locale, i| %>
 | 
			
		||||
        
 | 
			
		||||
          <div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
 | 
			
		||||
 | 
			
		||||
            <!-- Content -->
 | 
			
		||||
            <div class="control-group input-content">
 | 
			
		||||
              <label class="control-label muted"><%= t(:content) %></label>
 | 
			
		||||
              <div class="controls">
 | 
			
		||||
                <div class="textarea">
 | 
			
		||||
                  <%= f.fields_for :text_translations do |f| %>
 | 
			
		||||
                    <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => (@intro.text_translations[locale] rescue nil) %>
 | 
			
		||||
                  <% end %>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
        <% end %>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
       </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- Form Actions -->
 | 
			
		||||
    <div class="form-actions">
 | 
			
		||||
      <%= f.hidden_field :user_id, :value => params[:user_id] if !params[:user_id].blank? %>
 | 
			
		||||
      <%= f.submit t('submit'), class: 'btn btn-primary' %>
 | 
			
		||||
      <%= link_to t('cancel'), get_go_back, :class=>"btn" %>  
 | 
			
		||||
    </div>
 | 
			
		||||
  </fieldset>
 | 
			
		||||
<% end %>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
<table class="table main-list">
 | 
			
		||||
  <thead>
 | 
			
		||||
    <tr>
 | 
			
		||||
      <th class="span3"><%= t('date_') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.organizationt_title') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.department') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.job_title') %></th>
 | 
			
		||||
    </tr>
 | 
			
		||||
  </thead>
 | 
			
		||||
  <tbody id="tbody_experiences" class="sort-holder">
 | 
			
		||||
    <%= render :partial => 'experience', :collection => @experiences %>
 | 
			
		||||
  </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
<div class="bottomnav clearfix">
 | 
			
		||||
  <div class="action pull-right">
 | 
			
		||||
  <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_experience_setting_path, :class => 'btn btn-primary pull-right' %>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="pagination pagination-centered">
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,5 @@
 | 
			
		|||
<%= form_for @experience, url: admin_experiences_path, html: {class: "form-horizontal main-forms previewable"} do |f| %>
 | 
			
		||||
  <fieldset>
 | 
			
		||||
    <%= render partial: 'form', locals: {f: f} %>
 | 
			
		||||
  </fieldset>
 | 
			
		||||
<% end %>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,52 @@
 | 
			
		|||
<style type="text/css">
 | 
			
		||||
  .element{
 | 
			
		||||
    background: #FFF;
 | 
			
		||||
    margin-bottom: 10px;
 | 
			
		||||
    border-radius: 5px;
 | 
			
		||||
    border: 1px solid #DDD;
 | 
			
		||||
  }
 | 
			
		||||
  .detail{
 | 
			
		||||
    padding: 10px;
 | 
			
		||||
    min-height: 250px;
 | 
			
		||||
  }
 | 
			
		||||
  .totle{
 | 
			
		||||
    margin-bottom: 25px;
 | 
			
		||||
  }
 | 
			
		||||
  .totle span{
 | 
			
		||||
    font-size: 18px;
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<div class="row">
 | 
			
		||||
  <div class="element span4">
 | 
			
		||||
    <div class="detail w-a h-a">
 | 
			
		||||
      <p class="totle">
 | 
			
		||||
        <a class="btn btn-small btn-primary pull-right" href="<%= new_admin_experience_type_path %>#experience_type_modal" data-toggle="modal" data-remote="true"><i class="icon-plus"></i> <%= t('add')%></a>
 | 
			
		||||
        <span><%= t("personal_experience.experience_category") %></span>                        
 | 
			
		||||
      </p>
 | 
			
		||||
      <div class="detal-list my_scroll">
 | 
			
		||||
        <div class="scrollbar">
 | 
			
		||||
          <div class="track">
 | 
			
		||||
            <div class="thumb">
 | 
			
		||||
              <div class="end"></div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="viewport">
 | 
			
		||||
          <div class="overview">
 | 
			
		||||
            <table id="experience_types" class="table table-striped">
 | 
			
		||||
              <tbody>
 | 
			
		||||
                <%= render :partial => 'list_experience_type', :collection => @experience_types %>
 | 
			
		||||
              </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div id="experience_type_qe">
 | 
			
		||||
  <div style="display:none;" class="modal" id="experience_type_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,86 @@
 | 
			
		|||
<% content_for :page_specific_css do %>
 | 
			
		||||
  <%= stylesheet_link_tag "lib/list-check" %>
 | 
			
		||||
<% end %>
 | 
			
		||||
<% content_for :page_specific_javascript do %>
 | 
			
		||||
  <%= javascript_include_tag "lib/list-check" %>
 | 
			
		||||
<% end %>
 | 
			
		||||
 | 
			
		||||
<%
 | 
			
		||||
  is_autorized_user = (current_user==@member.user || current_user.is_admin?)
 | 
			
		||||
  if is_autorized_user
 | 
			
		||||
    @experiences = Experience.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
 | 
			
		||||
  else
 | 
			
		||||
    @experiences = Experience.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
 | 
			
		||||
  end
 | 
			
		||||
%>
 | 
			
		||||
 | 
			
		||||
<% if is_autorized_user %>
 | 
			
		||||
  <div class="list-active">
 | 
			
		||||
    <div class="btn-group">
 | 
			
		||||
      <%= link_to('Hide', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-hide", :rel => toggle_hide_admin_experiences_path(member_profile_id: params[:id], disable: 'true') ) %>
 | 
			
		||||
      <%= link_to('Show', '#', :class => "btn btn-mini list-active-btn disabled", "data-check-action" => "list-be-show", :rel => toggle_hide_admin_experiences_path(member_profile_id: params[:id], disable: 'false') ) %>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end -%>
 | 
			
		||||
 | 
			
		||||
<table class="table table-condensed table-striped main-list">
 | 
			
		||||
  <thead>
 | 
			
		||||
    <tr>
 | 
			
		||||
      <% if is_autorized_user %>
 | 
			
		||||
        <th><input type="checkbox" /></th>
 | 
			
		||||
      <% end -%>
 | 
			
		||||
      <th class="span3"><%= t('date_') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.organizationt_title') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.department') %></th>
 | 
			
		||||
      <th class="span3"><%= t('personal_experience.job_title') %></th>
 | 
			
		||||
    </tr>
 | 
			
		||||
  </thead>
 | 
			
		||||
  <tbody>
 | 
			
		||||
    <% @experiences.each do |experience| %> 
 | 
			
		||||
      <tr id="<%= dom_id experience %>" class="<%= experience.is_hidden ? "checkHide" : "" %>">
 | 
			
		||||
        <% if is_autorized_user %>
 | 
			
		||||
          <td>
 | 
			
		||||
            <%= check_box_tag 'to_change[]', experience.id.to_s, false, :class => "list-check" %>
 | 
			
		||||
          </td>
 | 
			
		||||
        <% end %>
 | 
			
		||||
        <td><%= experience.duration %></td>
 | 
			
		||||
        <td>
 | 
			
		||||
          <%= link_to experience.organizationt_title, '', target: "blank"%>
 | 
			
		||||
          <div class="quick-edit">
 | 
			
		||||
            <ul class="nav nav-pills hide">
 | 
			
		||||
              <li><%= link_to t('edit'), '/admin/members/'+@member.to_param+'/experiences/'+experience.id+'/edit' %></li>
 | 
			
		||||
              <li><%= link_to t(:delete_), admin_experience_path(id: experience.id, member_profile_id: @member.id), method: :delete, remote: true, data: { confirm: t('sure?') } %></li>
 | 
			
		||||
            </ul>
 | 
			
		||||
          </div>
 | 
			
		||||
        </td>
 | 
			
		||||
        <td><%= experience.department %></td>
 | 
			
		||||
        <td><%= experience.job_title %></td>
 | 
			
		||||
      </tr>   
 | 
			
		||||
    <% end %> 
 | 
			
		||||
  </tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="bottomnav clearfix">
 | 
			
		||||
  <% if is_autorized_user %>
 | 
			
		||||
    <div class="action pull-right">
 | 
			
		||||
      <%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('setting'),'/admin/members/'+@member.to_param+'/experiences/frontend_setting', :class => 'btn btn-primary' %>
 | 
			
		||||
      <%= link_to content_tag(:i, nil, :class => 'icon-plus') +' '+ t('new_'), 
 | 
			
		||||
          '/admin/members/'+@member.to_param+'/experiences/new', :class => 'btn btn-primary' %>
 | 
			
		||||
    </div>
 | 
			
		||||
  <% end %>
 | 
			
		||||
  <div class="pagination pagination-centered">
 | 
			
		||||
    <%= paginate @experiences, :params => {:direction => params[:direction], :sort => params[:sort] } %>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | 
			
		||||
    <h3><%= t(:sure?) %></h3>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
 | 
			
		||||
    <button class="delete-item btn btn-danger"><%= t(:submit) %></button>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ zh_tw:
 | 
			
		|||
  module_name:
 | 
			
		||||
    personal_experience: 經歷
 | 
			
		||||
  personal_experience:
 | 
			
		||||
    department : "系所"
 | 
			
		||||
    department : "單位"
 | 
			
		||||
    experience_category : 經歷類別
 | 
			
		||||
    end_date : "結束日期"
 | 
			
		||||
    start_date : "開始日期"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,28 @@ Rails.application.routes.draw do
 | 
			
		|||
	locales = Site.find_by(site_active: true).in_use_locales rescue I18n.available_locales
 | 
			
		||||
	scope "(:locale)", locale: Regexp.new(locales.join("|")) do
 | 
			
		||||
		namespace :admin do
 | 
			
		||||
      get 'experience_setting' => "experiences#setting"
 | 
			
		||||
 | 
			
		||||
      resources :experiences do
 | 
			
		||||
        collection do
 | 
			
		||||
          get 'toggle_hide' => 'experiences#toggle_hide'
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      resources :members do
 | 
			
		||||
        collection do
 | 
			
		||||
          scope '(:name-:uid)' do
 | 
			
		||||
            resources :experiences do
 | 
			
		||||
              collection do
 | 
			
		||||
                get 'frontend_setting' => 'experiences#frontend_setting'
 | 
			
		||||
                post 'update_frontend_setting' => 'experiences#update_frontend_setting'
 | 
			
		||||
              end
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
      
 | 
			
		||||
      resources :experience_types
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@ module PersonalExperience
 | 
			
		|||
		OrbitApp.registration "PersonalExperience",:type=> 'ModuleApp' do
 | 
			
		||||
			module_label 'module_name.personal_experience'
 | 
			
		||||
			base_url File.expand_path File.dirname(__FILE__)
 | 
			
		||||
			personal_plugin :enable => true, :sort_number => '45', :app_name=>"Experience", :intro_app_name=>"PersonalExperienceIntro",:path=>"/plugin/profile",:front_path=>"/profile",:admin_path=>"/admin/experiences",:i18n=>'module_name.personal_experience'
 | 
			
		||||
			personal_plugin :enable => true, :sort_number => '45', :app_name=>"Experience", :intro_app_name=>"PersonalExperienceIntro",:path=>"/plugin/personal_experience/profile",:front_path=>"/profile",:admin_path=>"/admin/experiences",:i18n=>'module_name.personal_experience'
 | 
			
		||||
			version "0.1"
 | 
			
		||||
			organization "Rulingcom"
 | 
			
		||||
			author "RD dep"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue