forked from publify/publify
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User can access to some dashboard part, or not
Don't break demeter's law.
- Loading branch information
Yannick Francois
committed
Sep 12, 2013
1 parent
52c4b33
commit 99c81c9
Showing
8 changed files
with
60 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
module Admin::DashboardHelper | ||
def dashboard_theme_link | ||
return unless current_user.profile.modules.include? :themes | ||
return unless current_user.can_access_to_themes? | ||
_("You can also do a bit of design, %s or %s." , | ||
link_to(_("change your blog presentation"), :controller => 'themes') , | ||
link_to(_("enable plugins"), :controller => 'sidebar')) | ||
end | ||
|
||
def dashboard_sidebar_link | ||
return unless current_user.profile.modules.include? :sidebar | ||
_("You can also %s to customize your Publify blog.", | ||
return unless current_user.can_access_to_customizesidebar? | ||
_("You can also %s to customize your Publify blog.", | ||
link_to(_('download some plugins'), 'http://plugins.publify.co')) | ||
end | ||
end | ||
|
||
def dashboard_action_links | ||
links = [] | ||
links << link_to(_('write a post'), :controller => 'content', :action => 'new') if current_user.profile.modules.include? :articles | ||
links << link_to(_('write a page'), :controller => 'pages', :action => 'new') if current_user.profile.modules.include? :pages | ||
links << link_to(_("update your profile or change your password"), :controller => 'profiles', :action => 'index') if current_user.profile.modules.include? :profile | ||
|
||
links << link_to(_('write a post'), :controller => 'content', :action => 'new') if current_user.can_access_to_articles? | ||
links << link_to(_('write a page'), :controller => 'pages', :action => 'new') if current_user.can_access_to_pages? | ||
links << link_to(_("update your profile or change your password"), :controller => 'profiles', :action => 'index') if current_user.can_access_to_profile? | ||
|
||
links.join(', ') | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters