Skip to content
Snippets Groups Projects
Commit c8e6fd63 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents 1395992b df20006b
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ gem 'bootstrap5-kaminari-views'
gem 'octokit'
gem 'front_matter_parser'
gem 'two_factor_authentication', git: 'https://github.com/noesya/two_factor_authentication.git'
# gem 'two_factor_authentication', path: '../two_factor_authentication'
# Front
gem 'jquery-rails'
......
......@@ -76,10 +76,10 @@ class Communication::Website::Imported::Post < ApplicationRecord
self.post.title = "Untitled" # No title yet
self.post.save
else
# Don't touch if there are local changes (this would destroy some nice work)
# return if post.updated_at > updated_at
# Don't touch if there are no remote changes (this would do useless server workload)
# return if post.updated_at == updated_at
# Continue only if there are remote changes
# Don't touch if there are local changes (post.updated_at > updated_at)
# Don't touch if there are no remote changes (post.updated_at == updated_at)
# return unless updated_at > post.updated_at
end
puts "Update post #{post.id}"
sanitized_title = Wordpress.clean self.title.to_s
......
......@@ -49,10 +49,6 @@ class Communication::Website::Page < ApplicationRecord
has_many :children,
class_name: 'Communication::Website::Page',
foreign_key: :parent_id
has_one :imported_page,
class_name: 'Communication::Website::Imported::Page',
foreign_key: :page_id,
dependent: :destroy
validates :title, presence: true
......
......@@ -36,10 +36,6 @@ class Communication::Website::Post < ApplicationRecord
belongs_to :university
belongs_to :website,
foreign_key: :communication_website_id
has_one :imported_post,
class_name: 'Communication::Website::Imported::Post',
foreign_key: :post_id,
dependent: :destroy
scope :ordered, -> { order(published_at: :desc, created_at: :desc) }
scope :recent, -> { order(published_at: :desc).limit(5) }
......
......@@ -40,12 +40,6 @@
<%= t @page.published %>
</td>
</tr>
<% if @page.imported_page %>
<tr>
<td><%= t('communication.website.imported.from') %></td>
<td><a href="<%= @page.imported_page.url %>" target="_blank"><%= t('communication.website.imported.original_url') %></a></td>
</tr>
<% end %>
<% if @page.parent %>
<tr>
<td><%= Communication::Website::Page.human_attribute_name('parent') %></td>
......
......@@ -38,12 +38,6 @@
<% end %>
</td>
</tr>
<% if @post.imported_post %>
<tr>
<td><%= t('communication.website.imported.from') %></td>
<td><a href="<%= @post.imported_post.url %>" target="_blank"><%= t('communication.website.imported.original_url') %></a></td>
</tr>
<% end %>
</tbody>
</table>
</div>
......
......@@ -25,9 +25,9 @@ namespace :app do
Communication::Website::Page.find_each { |page|
page.update(text: page.old_text)
}
Communication::Website::Medium.find_each { |medium|
medium.send(:set_featured_images)
}
Communication::Website::Medium.find_each { |medium|
medium.send(:set_featured_images)
}
end
namespace :db do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment