Skip to content
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

[WIP] Entry theme selection #764

Closed
wants to merge 38 commits into from
Closed

Conversation

aviav
Copy link
Contributor

@aviav aviav commented May 19, 2017

No description provided.

config.themes.register(:named_theme)
end

theming = build(:theming, :theme_name => 'named_theme')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new Ruby 1.9 hash syntax.

@@ -44,6 +44,10 @@ class Revision < ActiveRecord::Base
validate :published_until_unchanged, :if => :published_until_was_in_past?
validate :published_until_blank, :if => :published_at_blank?

validates_inclusion_of(:theme_name, in: lambda do |revision|
Pageflow.config_for(revision.entry.account).themes.names
end)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end at 49, 27 is not aligned with lambda do |revision| at 47, 44 or validates_inclusion_of(:theme_name, in: lambda do |revision| at 47, 4.

include RenderJsonHelper

def themes_options_json_seed(config = Pageflow.config)
config.themes.each_with_object({}) do |theme, options|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer {...} over do...end for multi-line chained blocks.

}

li.active {
background-color: #d2e5fa;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #d2e5fa should only be used in variable declarations; they should be referred to via variable everywhere else.

margin: 10px;
}

li.active {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge rule li.active with rule on line 77

}

.use_theme {
@include button(#590);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #590 should only be used in variable declarations; they should be referred to via variable everywhere else.

overflow: auto;
background-color: #fff;

&>div {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary parent selector (&)

bottom: 50px;
left: 20px;
overflow: auto;
background-color: #fff;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.

right: 20px;
max-width: 1100px;
max-height: 650px;
background-color: #eee;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #eee should only be used in variable declarations; they should be referred to via variable everywhere else.

@@ -0,0 +1,106 @@
button.change_theme {
@include button(#559ff2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #559ff2 should only be used in variable declarations; they should be referred to via variable everywhere else.

@coveralls
Copy link

coveralls commented May 19, 2017

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling 4c23293 on aviav:entry-theme-selection into 81a3276 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling 6217402 on aviav:entry-theme-selection into 81a3276 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling 6217402 on aviav:entry-theme-selection into 81a3276 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling c8e3a80 on aviav:entry-theme-selection into 81a3276 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling c8e3a80 on aviav:entry-theme-selection into 81a3276 on codevise:master.

@coveralls
Copy link

coveralls commented May 22, 2017

Coverage Status

Coverage increased (+0.03%) to 99.055% when pulling c8e3a80 on aviav:entry-theme-selection into 81a3276 on codevise:master.

aviav added 2 commits May 22, 2017 15:28
- also move setting home_button_enabled to theming
- rename copy_default_meta_tags to reflect this change and make it
  private
- test the public API method instead of the now private helper
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling e0b275a on aviav:entry-theme-selection into 81a3276 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling e0b275a on aviav:entry-theme-selection into 81a3276 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 0b8ee69 on aviav:entry-theme-selection into b452c34 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 0b8ee69 on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

coveralls commented May 29, 2017

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 9aa1c3e on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 9aa1c3e on aviav:entry-theme-selection into b452c34 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 9aa1c3e on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

coveralls commented May 29, 2017

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 456ba9c on aviav:entry-theme-selection into b452c34 on codevise:master.

aviav added 10 commits May 30, 2017 10:32
On choosing a page link, properly update title when it should be an
empty string. Without this, e.g. in ReferenceInputView, `title` will
not update in certain situations, because page#title() returns
`'undefined'` due to `''` falsiness in Javascript.

To reproduce:
```
this.configuration.get('title') === ''
this.configuration.get('additional_title') === undefined
```
To be stored at
`app/assets/images/pageflow/themes/$THEME_NAME/preview_thumbnail.png`.
Just from the code we cannot tell that there is a recommended way to
deal with different attribute names.
@coveralls
Copy link

coveralls commented May 30, 2017

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling efb03b7 on aviav:entry-theme-selection into b452c34 on codevise:master.

@tf tf modified the milestone: v12.1 May 30, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.059% when pulling 936ea61 on aviav:entry-theme-selection into b452c34 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.059% when pulling 936ea61 on aviav:entry-theme-selection into b452c34 on codevise:master.

aviav added 2 commits May 30, 2017 14:17
To be stored at
`app/assets/images/pageflow/themes/$THEME_NAME/preview_thumbnail.png`.
@coveralls
Copy link

coveralls commented May 30, 2017

Coverage Status

Coverage increased (+0.03%) to 99.059% when pulling d83ec1a on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.059% when pulling 7e45b84 on aviav:entry-theme-selection into b452c34 on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.059% when pulling 7e45b84 on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

coveralls commented May 30, 2017

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 5f64e02 on aviav:entry-theme-selection into b452c34 on codevise:master.

@@ -15,6 +15,8 @@ class ThemeGenerator < Rails::Generators::Base
def copy_template
directory('themes', File.join('app', 'assets', 'stylesheets', 'pageflow', 'themes'))
empty_directory(File.join('app', 'assets', 'images', 'pageflow', 'themes', name))
copy_file('preview.png', "app/assets/images/pageflow/themes/#{name}/preview.png")
copy_file('preview_thumbnail.png', "app/assets/images/pageflow/themes/#{name}/preview_thumbnail.png")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [109/100]

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling 62c2cc6 on aviav:entry-theme-selection into b452c34 on codevise:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling bdbf888 on aviav:entry-theme-selection into a1cba5a on codevise:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 99.058% when pulling bdbf888 on aviav:entry-theme-selection into a1cba5a on codevise:master.

@aviav aviav closed this May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants