Remove files which should be deleted in previous commit
This commit is contained in:
1 parent
2f9dcf7791
commit
8a4cffae8f
100 files changed
-5991
No files matched your search
@@ -1,54 +0,0 @@
|
||||
class Admin::ComponentsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :find_parent_item
|
||||
|
||||
def show
|
||||
#TODO
|
||||
end
|
||||
|
||||
def new
|
||||
@component = Component.new
|
||||
@component.is_published = true
|
||||
@component.parent_name = @parent_item.name
|
||||
|
||||
@component.engine_name = 'Announcement' # only support Announcement now
|
||||
end
|
||||
|
||||
def edit
|
||||
@component = Component.find(params[:id])
|
||||
end
|
||||
|
||||
def create
|
||||
@component = Component.new(params[:component])
|
||||
|
||||
if @component.save
|
||||
flash[:notice] = 'Component was successfully created.'
|
||||
redirect_to admin_items_url( :parent_name => @component.parent_name )
|
||||
else
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@component = Component.find(params[:id])
|
||||
|
||||
if @component.update_attributes(params[:component])
|
||||
flash[:notice] = 'Component was successfully updated.'
|
||||
redirect_to admin_items_url( :parent_name => @component.parent_name )
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@component = Component.find(params[:id])
|
||||
@component.destroy
|
||||
|
||||
#TODO: destroy engine data
|
||||
|
||||
redirect_to admin_items_url( :parent_name => @component.parent_name )
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
class AnnouncementsController < ApplicationController
|
||||
|
||||
def index
|
||||
@announcements = Announcement.all( :conditions => { :entry_name => params[:entry_name] })
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
@page = Page.find_by_name( 'announcement_index')
|
||||
@page_options = { "announcements" => @announcements.map{ |a| a.to_liquid } }
|
||||
render_liquid_page
|
||||
}
|
||||
format.xml { render :xml => @announcements }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@announcement = Announcement.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html{
|
||||
@page = Page.find_by_name( 'announcement_show')
|
||||
@page_options = { 'announcement' => @announcement.to_liquid }
|
||||
render_liquid_page
|
||||
}
|
||||
format.xml { render :xml => @announcement }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,49 +0,0 @@
|
||||
class Panel::AnnouncementsController < ApplicationController
|
||||
|
||||
before_filter :require_entry_name, :only => [:index, :new]
|
||||
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
@announcements = Announcement.all( :conditions => { :entry_name => params[:entry_name] })
|
||||
end
|
||||
|
||||
def new
|
||||
@announcement = Announcement.new
|
||||
@announcement.entry_name = params[:entry_name]
|
||||
end
|
||||
|
||||
def edit
|
||||
@announcement = Announcement.find(params[:id])
|
||||
end
|
||||
|
||||
def create
|
||||
@announcement = Announcement.new(params[:announcement])
|
||||
|
||||
if @announcement.save
|
||||
flash[:notice] = 'Announcement was successfully created.'
|
||||
redirect_to panel_announcements_path( :entry_name => @announcement.entry_name )
|
||||
else
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@announcement = Announcement.find(params[:id])
|
||||
|
||||
if @announcement.update_attributes(params[:announcement])
|
||||
flash[:notice] = 'Announcement was successfully updated.'
|
||||
redirect_to panel_announcements_path( :entry_name => @announcement.entry_name )
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@announcement = Announcement.find(params[:id])
|
||||
@announcement.destroy
|
||||
|
||||
redirect_to panel_announcements_path( :entry_name => @announcement.entry_name )
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
module Admin::UserAttributesHelper
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
module AnnouncementsHelper
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
module PagesHelper
|
||||
end
|
||||
@@ -1,13 +0,0 @@
|
||||
class Announcement
|
||||
|
||||
include MongoMapper::Document
|
||||
|
||||
key :component_name, String, :required => true, :index => true
|
||||
key_i18n :title, String
|
||||
key_i18n :content, String
|
||||
|
||||
def to_liquid
|
||||
{ "component_name" => self.entry_name, "id" => self.id.to_s, "title" => self.title, "content" => self.content }
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
class AssetImage < Asset
|
||||
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
class AssetJavascript < Asset
|
||||
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
class AssetPdf < Asset
|
||||
end
|
||||
@@ -1,3 +0,0 @@
|
||||
class AssetStylesheet < Asset
|
||||
|
||||
end
|
||||
@@ -1,22 +0,0 @@
|
||||
class Component < Item
|
||||
|
||||
include LayoutSupport
|
||||
|
||||
key :engine_name, String
|
||||
key :layout_name, String, :required => true
|
||||
key :layout_id, ObjectId, :required => true
|
||||
|
||||
belongs_to :layout
|
||||
|
||||
protected
|
||||
|
||||
def setup_default_value
|
||||
super
|
||||
|
||||
if self.layout_name
|
||||
self.layout_id = Layout.find_by_name( self.layout_name ).id
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,32 +0,0 @@
|
||||
<%= f.error_messages %>
|
||||
<%= f.hidden_field :parent_name %>
|
||||
|
||||
<p>
|
||||
<%= f.label :name, "Name" %>
|
||||
<%= f.text_field :name, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :title, "Title en" %>
|
||||
<%= f.text_field :title_en, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :layout_name, "Layout Name" %>
|
||||
<%= f.select :layout_name, Layout.all.map{ |l| [l.description, l.name] } %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :title, "Title zh_tw" %>
|
||||
<%= f.text_field :title_zh_tw, :class => 'text' %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :is_published, "Is Published" %>
|
||||
<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :engine_name, "Choose Engine" %>
|
||||
<%= f.text_field :engine_name %>
|
||||
</p>
|
||||
@@ -1,10 +0,0 @@
|
||||
<h1>Editing pages</h1>
|
||||
|
||||
<% form_for @component, :url => admin_component_path(@component) do |f| %>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Update' %>
|
||||
</p>
|
||||
<% end %>
|
||||
@@ -1,11 +0,0 @@
|
||||
<h1><%= t(:new_component, :scope => :admin) %></h1>
|
||||
|
||||
<% form_for @component, :url => admin_components_path do |f| %>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Create' %>
|
||||
</p>
|
||||
|
||||
<% end %>
|
||||
@@ -1,44 +0,0 @@
|
||||
<%= f.hidden_field :entry_name %>
|
||||
|
||||
<p id="title_zh_tw_block">
|
||||
<%= f.label "title_zh_tw", "Title (zh_tw)" %>
|
||||
<%= f.text_field "title_zh_tw" %>
|
||||
</p>
|
||||
|
||||
<p><a href="#" id="toggle_title_en_block">Edit english</a></p>
|
||||
|
||||
<p id="title_en_block">
|
||||
<%= f.label "title_en", "Title (en)" %>
|
||||
<%= f.text_field "title_en" %>
|
||||
</p>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$('#title_en_block').hide();
|
||||
$('#toggle_title_en_block').click(function(){
|
||||
$('#title_en_block').toggle();
|
||||
});
|
||||
</script>
|
||||
<% end -%>
|
||||
|
||||
|
||||
<p id="content_zh_tw_block">
|
||||
<%= f.label "content_zh_tw", "Content (zh_tw)" %>
|
||||
<%= f.text_area "content_zh_tw", :size => '100x30' %>
|
||||
</p>
|
||||
|
||||
<p><a href="#" id="toggle_content_en_block">Edit english</a></p>
|
||||
|
||||
<p id="content_en_block">
|
||||
<%= f.label "content_en", "Content (en)" %>
|
||||
<%= f.text_area "content_en", :size => '100x30' %>
|
||||
</p>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$('#content_en_block').hide();
|
||||
$('#toggle_content_en_block').click(function(){
|
||||
$('#content_en_block').toggle();
|
||||
});
|
||||
</script>
|
||||
<% end -%>
|
||||
@@ -1,14 +0,0 @@
|
||||
<h1>Editing announcement</h1>
|
||||
|
||||
<% form_for @announcement, :url => panel_announcement_path(@announcement) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Update' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Show', @announcement %> |
|
||||
<%= link_to 'Back', panel_announcements_path %>
|
||||
@@ -1,21 +0,0 @@
|
||||
<h1>Listing announcements</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
|
||||
<% @announcements.each do |announcement| %>
|
||||
<tr>
|
||||
<td><%=h announcement.title %></td>
|
||||
<td><%= link_to 'Show', announcement_path(announcement) %> |
|
||||
<%= link_to 'Edit', edit_panel_announcement_path(announcement) %> |
|
||||
<%= link_to 'Destroy', panel_announcement_path(announcement), :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New announcement', new_panel_announcement_path( :entry_name => params[:entry_name] ) %>
|
||||
@@ -1,13 +0,0 @@
|
||||
<h1>New announcement</h1>
|
||||
|
||||
<% form_for @announcement, :url => panel_announcements_path do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<%= render :partial => "form", :locals => { :f => f } %>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Create' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', panel_announcements_path %>
|
||||
Reference in new issue
Block a user