// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
-//= require jquery.ui.all
+//= require jquery
+//= require jquery_ujs
+// require jquery.ui.all
//require jquery.validate
//require additional-methods
//require jquery.validate.localization/messages_ja
_this = this\r
item.fetch({}).done () ->\r
if item.is_remote()\r
- window.router.navigate(item.remote_name(), true)\r
+ window.router[item.event_name()]() # call action event in router for redirect\r
else\r
list_result = new Pettanr.Folder.Children({id: item.id})\r
new Pettanr.FilerRender('folder', list_result, 'default', window.operators)\r
remote_name: () ->\r
Pettanr.to_s(@get('controller_name')) + '/' + Pettanr.to_s(@get('action_name'))\r
\r
+ event_name: () ->\r
+ a = if Pettanr.is_blank(@get('action_name'))\r
+ 'index'\r
+ else\r
+ @get('action_name')\r
+ Pettanr.to_s(@get('controller_name')) + '_' + a\r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
\r
class Pettanr.FolderWatch extends Pettanr.Folder\r
- url: 'watch/'\r
+ url: ''\r
initialize: () ->\r
- if @id\r
- @url = @url + @id\r
+ super()\r
+ @url = @url + '?ref=1'\r
class Pettanr.Folder.Collection extends Backbone.Collection\r
model: Pettanr.Folder\r
url: 'folders'\r
set_model
@item = Folder.root
respond_to do |format|
- show_html_format format
- show_json_format format
+ children_html_format format
+ children_json_format format
end
end
filer_list
end
- def show_html_format format
+ def children_html_format format
format.html {
@filer = Locmare::Filer.new self.class.model.item_name, @item.children, nil, :none, @operators
render :action => :show
}
end
- def show_json_format format
+ def children_json_format format
format.json {
@items = @item.children
render json: @items.to_json(self.class.model.list_json_opt)
def show
set_show
- if @item.category_id == 10
- redirect_to @item.remote_name
- else
+ if params[:ref]
respond_to do |format|
- show_html_format format
- show_prof_format format
show_json_format format
end
+ else
+ if @item.category_id == 10
+ redirect_to @item.remote_name
+ else
+ respond_to do |format|
+ children_html_format format
+ show_prof_format format
+ children_json_format format
+ end
+ end
end
end
describe 'columnsに於いて' do
before do
@columns = @my_local_manifest.columns
- @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ @names = ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
end
it 'これらのカラムが定義されている' do
set_columns? @columns, @names
expect(@column_names.size).to eq 4 + 3
end
it '順序が守られている' do
- expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ expect(@column_names).to eq ['id',
+ 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
end
end
describe 'extend_settingsに於いて' do