diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 11:36:55 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-12-17 11:38:07 +0100 |
commit | 9be44b3fa9985b8a93160434ce9f6dc922ec4387 (patch) | |
tree | cf488691c1168caf9e02be7830635da76b3bc57b /vendor/extensions/gallery_links/app | |
parent | 302aadd8bfd4030d9b2a71d5121fd650c0918338 (diff) | |
download | hmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.tar.gz hmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.tar.bz2 hmnoweb-9be44b3fa9985b8a93160434ce9f6dc922ec4387.zip |
New extension GalleryLinks
Diffstat (limited to 'vendor/extensions/gallery_links/app')
14 files changed, 241 insertions, 0 deletions
diff --git a/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/admin/gallery_links_controller.rb b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/admin/gallery_links_controller.rb new file mode 100644 index 0000000..89c5a66 --- /dev/null +++ b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/admin/gallery_links_controller.rb @@ -0,0 +1,12 @@ +module Refinery + module GalleryLinks + module Admin + class GalleryLinksController < ::Refinery::AdminController + + crudify :'refinery/gallery_links/gallery_link', + :xhr_paging => true + + end + end + end +end diff --git a/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb new file mode 100644 index 0000000..c6a4e7e --- /dev/null +++ b/vendor/extensions/gallery_links/app/controllers/refinery/gallery_links/gallery_links_controller.rb @@ -0,0 +1,34 @@ +module Refinery + module GalleryLinks + class GalleryLinksController < ::ApplicationController + + before_filter :find_all_gallery_links + before_filter :find_page + + def index + # you can use meta fields from your model instead (e.g. browser_title) + # by swapping @page for @gallery_link in the line below: + present(@page) + end + + def show + @gallery_link = GalleryLink.find(params[:id]) + + # you can use meta fields from your model instead (e.g. browser_title) + # by swapping @page for @gallery_link in the line below: + present(@page) + end + + protected + + def find_all_gallery_links + @gallery_links = GalleryLink.order('position ASC') + end + + def find_page + @page = ::Refinery::Page.where(:link_url => "/gallery_links").first + end + + end + end +end diff --git a/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb new file mode 100644 index 0000000..b83cdd1 --- /dev/null +++ b/vendor/extensions/gallery_links/app/models/refinery/gallery_links/gallery_link.rb @@ -0,0 +1,11 @@ +module Refinery + module GalleryLinks + class GalleryLink < Refinery::Core::BaseModel + self.table_name = 'refinery_gallery_links' + + attr_accessible :title, :url, :photographer, :description, :image_id, :position + + validates :title, :presence => true, :uniqueness => true + end + end +end diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_actions.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_actions.html.erb new file mode 100644 index 0000000..31a33b9 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_actions.html.erb @@ -0,0 +1,25 @@ +<ul> + <% if ::Refinery::GalleryLinks::Admin::GalleryLinksController.searchable? %> + <li> + <%= render '/refinery/admin/search', :url => refinery.gallery_links_admin_gallery_links_path %> + </li> + <% end %> + <li> + <%= link_to t('.create_new'), refinery.new_gallery_links_admin_gallery_link_path, + :class => "add_icon" %> + </li> +<% if !searching? && ::Refinery::GalleryLinks::Admin::GalleryLinksController.sortable? && ::Refinery::GalleryLinks::GalleryLink.many? %> + <li> + <%= link_to t('.reorder', :what => "Gallery Links"), + refinery.gallery_links_admin_gallery_links_path, + :id => "reorder_action", + :class => "reorder_icon" %> + + <%= link_to t('.reorder_done', :what => "Gallery Links"), + refinery.gallery_links_admin_gallery_links_path, + :id => "reorder_action_done", + :style => "display: none;", + :class => "reorder_icon" %> + </li> +<% end %> +</ul> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb new file mode 100644 index 0000000..0692e6c --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_form.html.erb @@ -0,0 +1,45 @@ +<%= form_for [refinery, :gallery_links_admin, @gallery_link] do |f| -%> + <%= render '/refinery/admin/error_messages', + :object => @gallery_link, + :include_object_name => true %> + + <div class='field'> + <%= f.label :title -%> + <%= f.text_field :title, :class => 'larger widest' -%> + </div> + + <div class='field'> + <%= f.label :url -%> + <%= f.text_field :url -%> + </div> + + <div class='field'> + <%= f.label :photographer -%> + <%= f.text_field :photographer -%> + </div> + + <div class='field'> + <%= render '/refinery/admin/wysiwyg', + :f => f, + :fields => [:description], + :object => "gallery_links/gallery_link" -%> + </div> + + <div class='field'> + <%= f.label :image_id -%> + <%= f.text_field :image_id -%> + </div> + + <%= render '/refinery/admin/form_actions', :f => f, + :continue_editing => false, + :delete_title => t('delete', :scope => 'refinery.gallery_links.admin.gallery_links.gallery_link'), + :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @gallery_link.title) -%> +<% end -%> + +<% content_for :javascripts do -%> + <script> + $(document).ready(function(){ + page_options.init(false, '', ''); + }); + </script> +<% end -%> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_link.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_link.html.erb new file mode 100644 index 0000000..7ad61a0 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_link.html.erb @@ -0,0 +1,20 @@ +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(gallery_link) -%>"> + <span class='title'> + <%= gallery_link.title %> + + </span> + <span class='actions'> + + <%= link_to refinery_icon_tag("application_go.png"), refinery.gallery_links_gallery_link_path(gallery_link), + :title => t('.view_live_html'), + :target => "_blank" %> + + <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_gallery_links_admin_gallery_link_path(gallery_link), + :title => t('.edit') %> + <%= link_to refinery_icon_tag("delete.png"), refinery.gallery_links_admin_gallery_link_path(gallery_link), + :class => "cancel confirm-delete", + :title => t('.delete'), + :confirm => t('message', :scope => 'refinery.admin.delete', :title => gallery_link.title), + :method => :delete %> + </span> +</li> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_links.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_links.html.erb new file mode 100644 index 0000000..4d7ef99 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_gallery_links.html.erb @@ -0,0 +1,2 @@ +<%= will_paginate @gallery_links if Refinery::GalleryLinks::Admin::GalleryLinksController.pageable? %> +<%= render 'sortable_list' %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_records.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_records.html.erb new file mode 100644 index 0000000..7ec7a2a --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_records.html.erb @@ -0,0 +1,16 @@ +<%= render 'refinery/admin/search_header', :url => refinery.gallery_links_admin_gallery_links_path %> +<div class='pagination_container'> + <% if @gallery_links.any? %> + <%= render 'gallery_links' %> + <% else %> + <p> + <% unless searching? %> + <strong> + <%= t('.no_items_yet') %> + </strong> + <% else %> + <%= t('no_results', :scope => 'refinery.admin.search') %> + <% end %> + </p> + <% end %> +</div> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_sortable_list.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_sortable_list.html.erb new file mode 100644 index 0000000..b7489c3 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/_sortable_list.html.erb @@ -0,0 +1,5 @@ +<ul id='sortable_list'> + <%= render :partial => 'gallery_link', :collection => @gallery_links %> +</ul> +<%= render '/refinery/admin/sortable_list', + :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/edit.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/edit.html.erb new file mode 100644 index 0000000..2d34363 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/edit.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/index.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/index.html.erb new file mode 100644 index 0000000..55fcbb8 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/index.html.erb @@ -0,0 +1,7 @@ +<section id='records'> + <%= render 'records' %> +</section> +<aside id='actions'> + <%= render 'actions' %> +</aside> +<%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::GalleryLinks::Admin::GalleryLinksController.sortable? and ::Refinery::GalleryLinks::GalleryLink.many? %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/new.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/new.html.erb new file mode 100644 index 0000000..2d34363 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/admin/gallery_links/new.html.erb @@ -0,0 +1 @@ +<%= render 'form' %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/index.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/index.html.erb new file mode 100644 index 0000000..684af05 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/index.html.erb @@ -0,0 +1,11 @@ +<% content_for :body do %> + <ul id="gallery_links"> + <% @gallery_links.each do |gallery_link| %> + <li> + <%= link_to gallery_link.title, refinery.gallery_links_gallery_link_path(gallery_link) %> + </li> + <% end %> + </ul> +<% end %> + +<%= render '/refinery/content_page' %> diff --git a/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/show.html.erb b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/show.html.erb new file mode 100644 index 0000000..5496612 --- /dev/null +++ b/vendor/extensions/gallery_links/app/views/refinery/gallery_links/gallery_links/show.html.erb @@ -0,0 +1,51 @@ +<% content_for :body_content_title do %> + <%= @gallery_link.title %> +<% end %> + +<% content_for :body do %> + <section> + <h1>Title</h1> + <p> + <%=raw @gallery_link.title %> + </p> + </section> + <section> + <h1>Url</h1> + <p> + <%=raw @gallery_link.url %> + </p> + </section> + <section> + <h1>Photographer</h1> + <p> + <%=raw @gallery_link.photographer %> + </p> + </section> + <section> + <h1>Description</h1> + <p> + <%=raw @gallery_link.description %> + </p> + </section> + <section> + <h1>Image</h1> + <p> + <%=raw @gallery_link.image_id %> + </p> + </section> +<% end %> + +<% content_for :side_body do %> + <aside> + <h2><%= t('.other') %></h2> + <ul id="gallery_links"> + <% @gallery_links.each do |gallery_link| %> + <li> + <%= link_to gallery_link.title, refinery.gallery_links_gallery_link_path(gallery_link) %> + </li> + <% end %> + </ul> + </aside> +<% end %> + +<%= render '/refinery/content_page' %> |