-
Notifications
You must be signed in to change notification settings - Fork 73
Refinery Core 4.0 compatibility #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
fb42458
573a44b
db7ccc5
4dff24a
a2a4188
e3f09be
a94d7fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,37 @@ | ||
| require 'responders' | ||
|
|
||
| module Refinery | ||
| module Calendar | ||
| class EventsController < ::ApplicationController | ||
| before_action :find_page, except: :archive | ||
|
|
||
| respond_to :html | ||
|
|
||
| def index | ||
| @events = Event.upcoming.order('refinery_calendar_events.starts_at DESC') | ||
| @events = Event.upcoming.order(starts_at: :desc) | ||
|
|
||
| # you can use meta fields from your model instead (e.g. browser_title) | ||
| # by swapping @page for @event in the line below: | ||
| present(@page) | ||
| respond_with (@events) do |format| | ||
| format.html | ||
| # format.rss { render layout: false } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not leave this commented code in the pull request.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are using |
||
| end | ||
| end | ||
|
|
||
| def show | ||
| @event = Event.friendly.find(params[:id]) | ||
|
|
||
| # you can use meta fields from your model instead (e.g. browser_title) | ||
| # by swapping @page for @event in the line below: | ||
| present(@page) | ||
| respond_with (@event) do |format| | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as before |
||
| format.html { present(@event) } | ||
| # format.js { render partial: 'post', layout: false } | ||
| end | ||
| end | ||
|
|
||
| def archive | ||
| @events = Event.archive.order('refinery_calendar_events.starts_at DESC') | ||
| @events = Event.archive.order(starts_at: :desc) | ||
| render :template => 'refinery/calendar/events/index' | ||
| end | ||
|
|
||
| protected | ||
|
|
||
| def find_page | ||
| @page = ::Refinery::Page.where(:link_url => "/calendar/events").first | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,15 @@ | ||
| <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(event) -%>"> | ||
| <span class='title'> | ||
| <span class="title"> | ||
| <%= event.title %> | ||
|
|
||
| </span> | ||
| <span class='actions'> | ||
|
|
||
| <%= link_to refinery_icon_tag("application_go.png"), refinery.calendar_event_path(event), | ||
| :title => t('.view_live_html'), | ||
| :target => "_blank" %> | ||
| <span class="actions"> | ||
| <%= action_icon :preview, refinery.calendar_event_path(event), t('.view_live_html') %> | ||
|
|
||
| <%= action_icon :edit, refinery.edit_calendar_admin_event_path(event), t('.edit') %> | ||
|
|
||
| <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_calendar_admin_event_path(event), | ||
| :title => t('.edit') %> | ||
| <%= link_to refinery_icon_tag("delete.png"), refinery.calendar_admin_event_path(event), | ||
| :class => "cancel confirm-delete", | ||
| :title => t('.delete'), | ||
| :confirm => t('message', :scope => 'refinery.admin.delete', :title => event.title), | ||
| :method => :delete %> | ||
| <%= action_icon :delete, refinery.calendar_admin_event_path(event), t('.delete'), | ||
| :class => 'cancel confirm-delete', | ||
| :confirm => t('refinery.admin.delete.message', :title => event.title) %> | ||
| </span> | ||
| </li> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <ul id='sortable_list'> | ||
| <ul id="sortable_list"> | ||
| <%= render :partial => 'event', :collection => @events %> | ||
| </ul> | ||
| <%= render '/refinery/admin/sortable_list', | ||
| :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %> | ||
|
|
||
| <%= render '/refinery/admin/sortable_list', :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| <section id='records'> | ||
| <h2><%= t('title', :scope => 'refinery.plugins.refinery_calendar') %> : <%= t('title', :scope => 'refinery.plugins.events') %></h2> | ||
| <section id="records"> | ||
| <h2><%= t('refinery.plugins.refinery_calendar.title') %>: <%= t('refinery.plugins.events.title') %></h2> | ||
| <%= render 'records' %> | ||
| </section> | ||
| <aside id='actions'> | ||
|
|
||
| <aside id="actions"> | ||
| <%= render 'actions' %> | ||
| </aside> | ||
|
|
||
| <%= render '/refinery/admin/make_sortable', :tree => false if !searching? and ::Refinery::Calendar::Admin::EventsController.sortable? and ::Refinery::Calendar::Event.count > 1 %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,28 @@ | ||
| <%= form_for [refinery, :calendar_admin, @venue] do |f| -%> | ||
| <%= render '/refinery/admin/error_messages', | ||
| :object => @venue, | ||
| :include_object_name => true %> | ||
| <%= render '/refinery/admin/error_messages', :object => @venue, :include_object_name => true %> | ||
|
|
||
|
|
||
| <div class='field'> | ||
| <div class="field"> | ||
| <%= f.label :name -%> | ||
| <%= f.text_field :name, :class => 'larger widest' -%> | ||
|
|
||
| <%= f.text_field :name, :class => 'larger widest' -%> | ||
| </div> | ||
|
|
||
| <div class='field'> | ||
| <div class="field"> | ||
| <%= f.label :address -%> | ||
| <%= f.text_field :address, :class => 'larger' -%> | ||
|
|
||
| <%= f.text_field :address, :class => 'larger widest' -%> | ||
| </div> | ||
|
|
||
| <div class='field'> | ||
| <div class="field"> | ||
| <%= f.label :url -%> | ||
| <%= f.text_field :url, :class => 'larger' -%> | ||
|
|
||
| <%= f.text_field :url, :class => 'larger widest' -%> | ||
| </div> | ||
|
|
||
| <div class='field'> | ||
| <div class="field"> | ||
| <%= f.label :phone -%> | ||
| <%= f.text_field :phone -%> | ||
|
|
||
| <%= f.text_field :phone, :class => 'larger widest' -%> | ||
| </div> | ||
|
|
||
| <%= render '/refinery/admin/form_actions', :f => f, | ||
| :continue_editing => false, | ||
| :delete_title => t('delete', :scope => 'refinery.venues.admin.venues.venue'), | ||
| :delete_confirmation => t('message', :scope => 'refinery.admin.delete', :title => @venue.name) %> | ||
| :delete_title => t('refinery.venues.admin.venues.venue.delete'), | ||
| :delete_confirmation => t('refinery.admin.delete.message', :title => @venue.name) %> | ||
| <% end -%> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <ul id='sortable_list'> | ||
| <ul id="sortable_list"> | ||
| <%= render :partial => 'venue', :collection => @venues %> | ||
| </ul> | ||
| <%= render '/refinery/admin/sortable_list', | ||
| :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %> | ||
|
|
||
| <%= render '/refinery/admin/sortable_list', :continue_reordering => (local_assigns.keys.include?(:continue_reordering)) ? continue_reordering : true %> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,13 @@ | ||
| <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(venue) -%>"> | ||
| <span class='title'> | ||
| <span class="title"> | ||
| <%= venue.name %> | ||
|
|
||
| </span> | ||
| <span class='actions'> | ||
| <%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_calendar_admin_venue_path(venue), | ||
| :title => t('.edit') %> | ||
| <%= link_to refinery_icon_tag("delete.png"), refinery.calendar_admin_venue_path(venue), | ||
|
|
||
| <span class="actions"> | ||
| <%= action_icon :edit, refinery.edit_calendar_admin_venue_path(venue), t('.edit') %> | ||
|
|
||
| <%= action_icon :delete, refinery.calendar_admin_venue_path(venue), t('.delete'), | ||
| :class => "cancel confirm-delete", | ||
| :title => t('.delete'), | ||
| :confirm => t('message', :scope => 'refinery.admin.delete', :title => venue.name), | ||
| :method => :delete %> | ||
| :confirm => t('message', :scope => 'refinery.admin.delete', :title => venue.name) %> | ||
| </span> | ||
| </li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the new syntax