Merge branch 'design_team' into ldap
Conflicts: app/views/devise/sessions/new.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb
This commit is contained in:
commit
1f4fe65430
18 files changed
+142
-238
No files matched your search
-75
@@ -1,75 +0,0 @@
|
||||
class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
include AdminHelper
|
||||
# layout 'admin'
|
||||
|
||||
def setting
|
||||
@bulletin_categorys = BulletinCategory.all
|
||||
if params.has_key?(:category_id)
|
||||
first_category = BulletinCategory.find params[:category_id]
|
||||
if params[:commit] == 'Update'
|
||||
privilege_users = params[:users].collect{|key,value| User.find key } rescue []
|
||||
preload_object_auth_ary = first_category.object_auths.where(title: 'fact_check') || (first_category.object_auths.create :title=> 'fact_check')
|
||||
preload_object_auth = preload_object_auth_ary.first
|
||||
preload_object_auth.privilege_users = privilege_users
|
||||
preload_object_auth.save!
|
||||
end
|
||||
else
|
||||
first_category = @bulletin_categorys.first
|
||||
end
|
||||
preload_object_auth = first_category.object_auths.where(title: 'fact_check').empty?? (first_category.object_auths.create! :title=> 'fact_check') : first_category.object_auths.where(title: 'fact_check')
|
||||
@users_array = preload_object_auth.first.privilege_users rescue []
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def update_setting
|
||||
|
||||
end
|
||||
# def index
|
||||
# get_categorys(params[:bulletin_category_id])
|
||||
#
|
||||
# @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
|
||||
# @bulletin_categories = BulletinCategory.all
|
||||
#
|
||||
# module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
|
||||
# @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc)
|
||||
#
|
||||
# respond_to do |format|
|
||||
# format.html # index.html.erb
|
||||
# format.js
|
||||
# format.xml { render :xml => @bulletins }
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def new
|
||||
#
|
||||
# end
|
||||
#
|
||||
# def create
|
||||
#
|
||||
# end
|
||||
#
|
||||
# def update
|
||||
#
|
||||
# end
|
||||
#
|
||||
# def edit
|
||||
#
|
||||
# end
|
||||
#
|
||||
# def destroy
|
||||
#
|
||||
# end
|
||||
protected
|
||||
def get_categorys(id = nil)
|
||||
@bulletin_categorys = []
|
||||
if(is_manager? || is_admin?)
|
||||
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||
elsif is_sub_manager?
|
||||
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
end
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -10,6 +10,6 @@
|
||||
</tr>
|
||||
|
||||
<% bulletin_category.bulletins.each do |post| %>
|
||||
<%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %>
|
||||
<%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:approval_allow=>true} %>
|
||||
<% end %>
|
||||
</table>
|
||||
+2
-3
@@ -25,12 +25,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<%= hidden_field_tag 'bulletin_link[bulletin_id]', @bulletin_link.bulletin_id %>
|
||||
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a
|
||||
</div>
|
||||
<a class="btn" data-dismiss="modal"><%= t('cancel')%></a>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
+18
-17
@@ -1,24 +1,25 @@
|
||||
<div id="qe-picture" class="qe-edit-div">
|
||||
<div id="widget-picture">
|
||||
<div id="widget-picture clear">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Picture</label>
|
||||
<!--<label class="control-label">Picture</label>-->
|
||||
<div class="control-group">
|
||||
<img class="pull-left upload-picture" src="" />
|
||||
<div class="controls file-upload">
|
||||
<label class="control-label btn" for="input-upload">
|
||||
Browse/選擇檔案
|
||||
<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
|
||||
</label>
|
||||
<span id='fu' class="file-name"></span>
|
||||
<br>
|
||||
<input name='fu' class="input-large" type="text">
|
||||
<br>
|
||||
<% if bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
<%= t('announcement.刪除已上傳檔案') %>
|
||||
<% end %>
|
||||
<div class="controls upload-picture">
|
||||
<img class="pull-left upload-picture" src="" />
|
||||
</div>
|
||||
<div class="controls file-upload input-prepend">
|
||||
<label class="control-label add-on btn" for="input-upload">
|
||||
<%= t(:browse) %>
|
||||
<%= f.file_field :image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
|
||||
</label>
|
||||
<span id='fu' class="file-name"></span>
|
||||
<input name='fu' class="input-medium qe-picture-rename" type="text">
|
||||
<br>
|
||||
<% if bulletin.image.file %>
|
||||
<%= f.check_box :remove_image %>
|
||||
<%= t('announcement.刪除已上傳檔案') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+10
-6
@@ -34,11 +34,15 @@
|
||||
|
||||
<div id="qe-tags" class="qe-edit-div">
|
||||
<div id="widget-tags">
|
||||
<div class="form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<div class="form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<label class="checkbox inline">
|
||||
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id)%>
|
||||
<%= tag[I18n.locale] %>
|
||||
</label>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
<h1><%= bulletin_category.key %></h1>
|
||||
<table>
|
||||
<tr>
|
||||
<th><%= t('bulletin.status') %></th>
|
||||
<th><%= t('bulletin.category') %></th>
|
||||
<th><%= t('bulletin.title') %></th>
|
||||
<th><%= t('bulletin.postdate') %></th>
|
||||
<th><%= t('bulletin.deadline') %></th>
|
||||
<th><%= t('bulletin.action') %></th>
|
||||
</tr>
|
||||
|
||||
<% bulletin_category.bulletins.each do |post| %>
|
||||
<%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %>
|
||||
<% end %>
|
||||
</table>
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
<%= render 'panel/announcement/back_end/bulletins/filter' %>
|
||||
<table id="bulettin_sort_list" class="table main-list">
|
||||
<%= render 'panel/announcement/back_end/bulletins/bulletins' %>
|
||||
</table>
|
||||
<div class="form-actions">
|
||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<% content_for :secondary do %>
|
||||
<%#= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<fieldset><legend><%= t('bulletin.search') %></legend>
|
||||
|
||||
<%= form_for :bulletin, :action => 'search', :method => 'get', :url => panel_announcement_back_end_bulletins_path do |f| %>
|
||||
|
||||
<%#= f.select :bulletin_category_id, @bulletin_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ] },{ :include_blank => t('bulletin.select') }%>
|
||||
|
||||
Category <%#= select_tag "category_id", options_for_select(@bulletin_categorys.collect{|t| [t.i18n_variable[I18n.locale], t.id]}), :prompt => t('bulletin.select') %>
|
||||
|
||||
KeyWord <%#= text_field_tag :search, params[:search], :id => 'search_field' %>
|
||||
|
||||
<%= submit_tag "Search", :name => nil %>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h1><%= t('bulletin.list_announcement') %></h1>
|
||||
|
||||
<div id="check_block">
|
||||
<h1>Check Please</h1>
|
||||
<%#= render :partial => "list_table", :collection => @bulletin_categorys_check,:as => :bulletin_category%>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
-->
|
||||
-1
@@ -1 +0,0 @@
|
||||
$("#users_checkbox_ary").replaceWith('<%= (render :partial => 'privilege_user', :locals => {:users => @users_array}).html_safe%>');
|
||||
Reference in new issue
Block a user