phcdevworks_tutorials 1.2.4 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/phcdevworks_tutorials_manifest.js +1 -1
  3. data/app/assets/stylesheets/phcdevworks_tutorials/category/posts.css +4 -0
  4. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.css +4 -0
  5. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.css +4 -0
  6. data/app/controllers/phcdevworks_tutorials/tutorial/categories_controller.rb +1 -2
  7. data/app/controllers/phcdevworks_tutorials/tutorial/posts_controller.rb +5 -6
  8. data/app/controllers/phcdevworks_tutorials/tutorial/steps_controller.rb +6 -12
  9. data/app/models/phcdevworks_tutorials/category.rb +7 -0
  10. data/app/models/phcdevworks_tutorials/tutorial/post.rb +1 -1
  11. data/app/models/phcdevworks_tutorials/tutorial/step.rb +1 -1
  12. data/app/views/layouts/phcdevworks_tutorials/application.html.erb +62 -77
  13. data/app/views/layouts/phcdevworks_tutorials/components/backend/footer/_footer.html.erb +7 -7
  14. data/app/views/layouts/phcdevworks_tutorials/components/backend/navigation/_top_menu.html.erb +37 -37
  15. data/app/views/layouts/phcdevworks_tutorials/components/backend/sidebars/_side_menu.html.erb +257 -239
  16. data/app/views/layouts/phcdevworks_tutorials/frontend.html.erb +0 -5
  17. data/app/views/phcdevworks_tutorials/tutorial/categories/_form.html.erb +16 -14
  18. data/app/views/phcdevworks_tutorials/tutorial/categories/edit.html.erb +31 -23
  19. data/app/views/phcdevworks_tutorials/tutorial/categories/index.html.erb +63 -52
  20. data/app/views/phcdevworks_tutorials/tutorial/categories/new.html.erb +31 -23
  21. data/app/views/phcdevworks_tutorials/tutorial/posts/_form.html.erb +46 -46
  22. data/app/views/phcdevworks_tutorials/tutorial/posts/edit.html.erb +31 -23
  23. data/app/views/phcdevworks_tutorials/tutorial/posts/index.html.erb +68 -56
  24. data/app/views/phcdevworks_tutorials/tutorial/posts/new.html.erb +31 -23
  25. data/app/views/phcdevworks_tutorials/tutorial/steps/_form.html.erb +31 -28
  26. data/app/views/phcdevworks_tutorials/tutorial/steps/edit.html.erb +31 -23
  27. data/app/views/phcdevworks_tutorials/tutorial/steps/index.html.erb +65 -50
  28. data/app/views/phcdevworks_tutorials/tutorial/steps/new.html.erb +31 -23
  29. data/app/views/phcdevworks_tutorials/tutorial/steps/show.html.erb +0 -14
  30. data/config/routes.rb +18 -18
  31. data/db/migrate/{20190911225813_create_phcdevworks_tutorials_tutorial_posts.rb → 20191017235259_create_phcdevworks_tutorials_tutorial_posts.rb} +3 -0
  32. data/db/migrate/{20190923113101_create_phcdevworks_tutorials_tutorial_steps.rb → 20191017235421_create_phcdevworks_tutorials_tutorial_steps.rb} +4 -2
  33. data/db/migrate/{20190911225925_create_phcdevworks_tutorials_tutorial_categories.rb → 20191018124910_create_phcdevworks_tutorials_tutorial_categories.rb} +0 -0
  34. data/lib/phcdevworks_tutorials/engine.rb +6 -8
  35. data/lib/phcdevworks_tutorials/version.rb +1 -1
  36. metadata +35 -20
  37. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/posts.coffee +0 -3
  38. data/app/assets/javascripts/phcdevworks_tutorials/tutorial/steps.coffee +0 -3
  39. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/posts.scss +0 -3
  40. data/app/assets/stylesheets/phcdevworks_tutorials/tutorial/steps.scss +0 -3
  41. data/app/assets/stylesheets/scaffolds.scss +0 -65
  42. data/config/initializers/friendly_id.rb +0 -107
  43. data/db/migrate/20190929044403_add_info_to_phcdevworks_tutorials_tutorial_posts.rb +0 -9
  44. data/db/migrate/20190929044505_add_info_to_phcdevworks_tutorials_tutorial_steps.rb +0 -7
  45. data/db/migrate/20191002093451_add_image_to_phcdevworks_tutorials_tutorial_posts.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ff71cf7890e9431a3c6aeb70737f58e3949ce986a891ea908ec663a7dd9d0a8
4
- data.tar.gz: d078f7ef2afdcb5ee40b42903b0b020083ff7b3bf6f2a0260cbc001d39ad87d9
3
+ metadata.gz: 33e27b7f41f07b09e2baff0704a5aba9588b2408eff2c2d1824539e2b804d561
4
+ data.tar.gz: adfd438d8a8b1217fea7e9df4da3f77ccb3581f22dc6112a15e5e50809120b3a
5
5
  SHA512:
6
- metadata.gz: d56273632043b9429e4ec8c696e12942aaff4696b8d11c3cee50dc05e25d77b4dfe73e798018ca4b46b3e3a7afd6ac830247e94275c018b04b6dd47a0c90024b
7
- data.tar.gz: 9004b26ba26941eb7363a5837d306b54c7fc451ce47f3d900222c52f59a39f2513a4628748f18a7b259f9a6320a08e324fb17e6fe2e74d8b890aa970c036e682
6
+ metadata.gz: 5a24a436b3be0a2026e93abaf93ff77048fe3fbd916ff50d966660d572c91bac5250218338f9bbb862592ccad5e03b5ebe7a6b57a32d20172fef0729f6465022
7
+ data.tar.gz: 541c6f66f94a4850c67b2617894b87ad7f1ff2a632c6bfbf15fcf09b5a04f249b86e0f202ce251f2751be8a50e50f2e728fcc513f83156c8301f68d68384aae7
@@ -1,2 +1,2 @@
1
- //= link_directory ../javascripts/phcdevworks_tutorials .js
2
1
  //= link_directory ../stylesheets/phcdevworks_tutorials .scss
2
+ //= link_directory ../stylesheets/phcdevworks_tutorials .js
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -16,7 +16,6 @@ module PhcdevworksTutorials
16
16
 
17
17
  # GET /tutorial/categories/1
18
18
  def show
19
- @tutorial_category = Tutorial::Category.friendly.find(params[:id])
20
19
  end
21
20
 
22
21
  # GET /tutorial/categories/new
@@ -70,7 +69,7 @@ module PhcdevworksTutorials
70
69
 
71
70
  # Common Callbacks
72
71
  def set_tutorial_category
73
- @tutorial_category = Tutorial::Category.friendly.find(params[:id])
72
+ @tutorial_category = Tutorial::Category.find(params[:id])
74
73
  end
75
74
 
76
75
  # Whitelist
@@ -16,7 +16,6 @@ module PhcdevworksTutorials
16
16
 
17
17
  # GET /tutorial/posts/1
18
18
  def show
19
- @tutorial_post = Tutorial::Post.friendly.find(params[:id])
20
19
  end
21
20
 
22
21
  # GET /tutorial/posts/new
@@ -60,9 +59,9 @@ module PhcdevworksTutorials
60
59
  # DELETE /tutorial/posts/1
61
60
  def destroy
62
61
  @tutorial_post.destroy
63
- respond_to do |format|
64
- format.html { redirect_to tutorial_posts_path, :flash => { :error => 'Tutorial has been Removed.' }}
65
- format.json { head :no_content }
62
+ respond_to do |format|
63
+ format.html { redirect_to tutorial_posts_path, :flash => { :error => 'Tutorial has been Removed.' }}
64
+ format.json { head :no_content }
66
65
  end
67
66
  end
68
67
 
@@ -70,12 +69,12 @@ module PhcdevworksTutorials
70
69
 
71
70
  # Common Callbacks
72
71
  def set_tutorial_post
73
- @tutorial_post = Tutorial::Post.friendly.find(params[:id])
72
+ @tutorial_post = Tutorial::Post.find(params[:id])
74
73
  end
75
74
 
76
75
  # Whitelist
77
76
  def tutorial_post_params
78
- params.require(:tutorial_post).permit(:tutorial_post_step, :tutorial_post_title, :tutorial_post_text,:tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id, category_ids: [])
77
+ params.require(:tutorial_post).permit(:tutorial_post_title, :tutorial_post_description, :tutorial_post_status, :tutorial_post_image, :slug, :user_id, :org_id)
79
78
  end
80
79
 
81
80
  end
@@ -10,13 +10,11 @@ module PhcdevworksTutorials
10
10
  before_action :set_tutorial_step, only: [:show, :edit, :update, :destroy]
11
11
 
12
12
  # GET /tutorial/steps
13
- # GET /tutorial/steps.json
14
13
  def index
15
- @tutorial_steps = tutorial_post.steps.all
14
+ @tutorial_steps = tutorial_post.steps.order("tutorial_step_number")
16
15
  end
17
16
 
18
17
  # GET /tutorial/steps/1
19
- # GET /tutorial/steps/1.json
20
18
  def show
21
19
  @tutorial_step = tutorial_post.steps.find(params[:id])
22
20
  end
@@ -28,18 +26,17 @@ module PhcdevworksTutorials
28
26
 
29
27
  # GET /tutorial/steps/1/edit
30
28
  def edit
31
- @tutorial_step = Tutorial::Post.friendly.find(params[:post_id])
29
+ @tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
32
30
  end
33
31
 
34
32
  # POST /tutorial/steps
35
- # POST /tutorial/steps.json
36
33
  def create
37
34
  @tutorial_step = tutorial_post.steps.create(tutorial_step_params)
38
35
  @tutorial_step.user_id = current_user.id
39
36
  @tutorial_step.org_id = current_user.org_id
40
37
  respond_to do |format|
41
38
  if @tutorial_step.save
42
- format.html { redirect_to tutorial_post_steps_path, :flash => { :success => 'Tutorial Step has been Added' }}
39
+ format.html { redirect_to tutorial_post_steps_url, :flash => { :success => 'Member Listing has been Added' }}
43
40
  format.json { render :show, status: :created, location: @tutorial_step }
44
41
  else
45
42
  format.html { render :new }
@@ -49,12 +46,11 @@ module PhcdevworksTutorials
49
46
  end
50
47
 
51
48
  # PATCH/PUT /tutorial/steps/1
52
- # PATCH/PUT /tutorial/steps/1.json
53
49
  def update
54
50
  @tutorial_post = Tutorial::Post.friendly.find(params[:post_id])
55
51
  respond_to do |format|
56
52
  if @tutorial_step.update(tutorial_step_params)
57
- format.html { redirect_to tutorial_post_steps_path, :flash => { :notice => 'Tutorial Step has been Updated.' }}
53
+ format.html { redirect_to tutorial_post_steps_url, :flash => { :notice => 'Member Listing has been Updated.' }}
58
54
  format.json { render :show, status: :ok, location: @tutorial_step }
59
55
  else
60
56
  format.html { render :edit }
@@ -64,12 +60,11 @@ module PhcdevworksTutorials
64
60
  end
65
61
 
66
62
  # DELETE /tutorial/steps/1
67
- # DELETE /tutorial/steps/1.json
68
63
  def destroy
69
64
  @tutorial_step = tutorial_post.steps.find(params[:id])
70
65
  @tutorial_step.destroy
71
66
  respond_to do |format|
72
- format.html { redirect_to tutorial_post_steps_path, :flash => { :error => 'Tutorial Step has been Removed' }}
67
+ format.html { redirect_to tutorial_post_steps_url, :flash => { :error => 'Member Listing has been Removed' }}
73
68
  format.json { head :no_content }
74
69
  end
75
70
  end
@@ -77,7 +72,6 @@ module PhcdevworksTutorials
77
72
  private
78
73
 
79
74
  # Common Callbacks
80
-
81
75
  def set_tutorial_step
82
76
  @tutorial_step = Tutorial::Step.find(params[:id])
83
77
  end
@@ -88,7 +82,7 @@ module PhcdevworksTutorials
88
82
 
89
83
  # Whitelist
90
84
  def tutorial_step_params
91
- params.require(:tutorial_step).permit(:tutorial_step_number, :tutorial_step_body, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
85
+ params.require(:tutorial_step).permit(:tutorial_step_number, :tutorial_step_title, :tutorial_step_description, :tutorial_step_image, :post_id, :slug, :user_id, :org_id)
92
86
  end
93
87
 
94
88
  end
@@ -0,0 +1,7 @@
1
+ module PhcdevworksTutorials
2
+ module Category
3
+ def self.table_name_prefix
4
+ 'phcdevworks_tutorials_category_'
5
+ end
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  module PhcdevworksTutorials
2
2
  class Tutorial::Post < ApplicationRecord
3
-
3
+
4
4
  # Clean URL Initialize
5
5
  extend FriendlyId
6
6
 
@@ -5,7 +5,7 @@ module PhcdevworksTutorials
5
5
  has_one_attached :tutorial_step_image
6
6
 
7
7
  # Relationships
8
- belongs_to :post, class_name: "PhcdevworksTutorials::Tutorial::Post"
8
+ belongs_to :post, class_name: "Tutorial::Post"
9
9
  has_many :categories, class_name: "Tutorial::Category", :through => :post
10
10
  belongs_to :user, class_name: "PhcdevworksAccounts::User"
11
11
 
@@ -2,93 +2,78 @@
2
2
  <html>
3
3
  <head>
4
4
 
5
- <!-- SEO System -->
6
- <% phc_seo_title "PHCTutorials by PHCDevworks" %>
7
- <% phc_seo_description "Ruby on Rails 6 Tutorial engine to manage and post tutorials." %>
8
- <!-- SEO System -->
9
-
10
- <!-- SEO and Site Description -->
11
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
12
- <title><%= yield(:phc_seo_title) %></title>
13
- <meta name="description" content="<%= yield(:phc_seo_description) %>">
14
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
15
- <link rel="canonical" href="http://phcdevworks.com">
16
- <!-- SEO and Site Description -->
17
-
18
- <!-- Rails Security Tags -->
19
- <%= csrf_meta_tags %>
20
- <%= csp_meta_tag %>
21
- <!-- Rails Security Tags -->
22
-
23
- <!-- CSS Styles -->
24
- <%= stylesheet_link_tag 'phcdevworks_tutorials/application', media: 'all', 'data-turbolinks-track': 'reload' %>
25
- <!-- CSS Styles -->
26
-
27
- <!-- Font -->
28
- <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700"/>
29
- <!-- Font -->
5
+ <!-- SEO System -->
6
+ <% phc_seo_title "PHCDevworks Scripts" %>
7
+ <% phc_seo_description "Ruby on Rails 6 Script CDN and Code Snippets Listing Management Engine." %>
8
+ <!-- SEO System -->
9
+
10
+ <!-- SEO and Site Description -->
11
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
12
+ <title><%= yield(:phc_seo_title) %></title>
13
+ <meta name="description" content="<%= yield(:phc_seo_description) %>">
14
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
15
+ <link rel="canonical" href="http://phcdevworks.com">
16
+ <!-- SEO and Site Description -->
17
+
18
+ <!-- Rails Security Tags -->
19
+ <%= csrf_meta_tags %>
20
+ <%= csp_meta_tag %>
21
+ <!-- Rails Security Tags -->
22
+
23
+ <!-- CSS Styles -->
24
+ <%= stylesheet_link_tag "phcdevworks_tutorials/application", media: "all" %>
25
+ <!-- CSS Styles -->
26
+
27
+ <!-- Font -->
28
+ <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CRaleway:300,400,500,600,700%7CLato:300,400,400italic,600,700"/>
29
+ <!-- Font -->
30
30
 
31
31
  </head>
32
32
  <body>
33
33
 
34
- <!-- Page Container -->
35
- <div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
36
-
37
- <!-- Page Header -->
38
- <div id="header" class="header navbar-default">
39
- <%= render 'layouts/phcdevworks_tutorials/components/backend/navigation/top_menu' %>
40
- </div>
41
- <!-- Page Header -->
42
-
43
- <!-- Page Sidebar -->
44
- <div id="sidebar" class="sidebar">
45
- <%= render 'layouts/phcdevworks_tutorials/components/backend/sidebars/side_menu' %>
46
- </div>
47
- <div class="sidebar-bg"></div>
48
- <!-- Page Sidebar -->
49
-
50
- <!-- Page Content -->
51
- <div id="content" class="content">
52
- <%= render 'phcdevworks_notifications/bootstrap/notifications' %>
53
- <%= yield %>
54
- </div>
55
- <!-- Page Content -->
34
+ <!-- Page Container -->
35
+ <div id="page-container" class="fade page-sidebar-fixed page-header-fixed">
36
+
37
+ <!-- Page Header -->
38
+ <div id="header" class="header navbar-default">
39
+ <%= render "layouts/phcdevworks_tutorials/components/backend/navigation/top_menu" %>
40
+ </div>
41
+ <!-- Page Header -->
42
+
43
+ <!-- Page Sidebar -->
44
+ <div id="sidebar" class="sidebar">
45
+ <%= render "layouts/phcdevworks_tutorials/components/backend/sidebars/side_menu" %>
46
+ </div>
47
+ <div class="sidebar-bg"></div>
48
+ <!-- Page Sidebar -->
49
+
50
+ <!-- Page Content -->
51
+ <div id="content" class="content">
52
+ <%= render "phcdevworks_notifications/bootstrap/notifications" %>
53
+ <%= yield %>
54
+ </div>
55
+ <!-- Page Content -->
56
+
57
+ <!-- Footer Content -->
58
+ <div id="footer" class="footer mb-4">
59
+ <%= render "layouts/phcdevworks_tutorials/components/backend/footer/footer" %>
60
+ </div>
61
+ <!-- Footer Content -->
56
62
 
57
- <!-- Footer Content -->
58
- <div id="footer" class="footer mb-4">
59
- <%= render 'layouts/phcdevworks_tutorials/components/backend/footer/footer' %>
60
63
  </div>
61
- <!-- Footer Content -->
62
-
63
- </div>
64
- <!-- Page Container -->
65
-
66
- <!-- JavaScript -->
67
- <%= javascript_include_tag "phcdevworks_tutorials/application", 'data-turbolinks-track': 'reload' %>
68
- <!-- JavaScript -->
64
+ <!-- Page Container -->
69
65
 
70
- <!-- JavaScript CKEditor -->
71
- <script>
72
- ClassicEditor.create( document.querySelector( '#editor' ) )
73
- .then( editor => {
74
- window.editor = editor;
75
- const wordCountPlugin = editor.plugins.get( 'WordCount' );
76
- const wordCountWrapper = document.getElementById( 'word-count' );
77
- wordCountWrapper.appendChild( wordCountPlugin.wordCountContainer );
78
- } )
79
- .catch( err => {
80
- console.error( err.stack );
81
- } );
82
- </script>
83
- <!-- JavaScript CKEditor -->
66
+ <!-- JavaScript -->
67
+ <%= javascript_include_tag "phcdevworks_tutorials/application", "data-turbolinks-track": "reload" %>
68
+ <!-- JavaScript -->
84
69
 
85
- <!-- JavaScript Loader -->
86
- <script>
70
+ <!-- JavaScript Loader -->
71
+ <script>
87
72
  $(document).ready(function() {
88
- App.init();
73
+ App.init();
89
74
  });
90
- </script>
91
- <!-- JavaScript Loader -->
75
+ </script>
76
+ <!-- JavaScript Loader -->
92
77
 
93
78
  </body>
94
79
  </html>
@@ -1,16 +1,16 @@
1
1
  <!-- Footer Content - Left -->
2
2
  <span>
3
- <!-- Footer Content - Left - Time in Production -->
4
- <i class="fab fa-osi font-weight-bolder"></i> 2012-<%= Time.now.year %> -
5
- <span class="font-weight-bold">PHC</span>Devworks Tutorials -
6
- Engine v<%= Gem.loaded_specs["phcdevworks_tutorials"].version.to_s %>
7
- <!-- Footer Content - Left - Time in Production -->
3
+ <!-- Footer Content - Left - Time in Production -->
4
+ <i class="fab fa-osi font-weight-bolder"></i> 2012-<%= Time.now.year %> -
5
+ <span class="font-weight-bold">PHC</span>Devworks Scripts & Snippets -
6
+ Engine v<%= Gem.loaded_specs["phcdevworks_tutorials"].version.to_s %>
7
+ <!-- Footer Content - Left - Time in Production -->
8
8
  </span>
9
9
  <!-- Footer Content - Left -->
10
10
 
11
11
  <!-- Footer Content - Right -->
12
12
  <span class="float-right">
13
- Developed with <i class="fas fa-heart hanna_hearts"></i> by
14
- <a class="phcnet_copyright text-dark" href="https://phcdevworks.com/"><u><span class="font-weight-bold">PHC</span>Devworks</u></a>
13
+ Developed with <i class="fas fa-heart hanna_hearts"></i> by
14
+ <a class="phcnet_copyright text-dark" href="https://phcdevworks.com/"><u><span class="font-weight-bold">PHC</span>Devworks</u></a>
15
15
  </span>
16
16
  <!-- Footer Content - Right -->
@@ -1,37 +1,37 @@
1
- <!-- Topbar - Navigation Header -->
2
- <div class="navbar-header">
3
- <%= link_to phcdevworks_tutorials.tutorial_posts_path, class: "navbar-brand" do %>
4
- <b>PHCDevworks</b> Tutorials
5
- <% end %>
6
- <button type="button" class="navbar-toggle" data-click="sidebar-toggled">
7
- <span class="icon-bar"></span>
8
- <span class="icon-bar"></span>
9
- <span class="icon-bar"></span>
10
- </button>
11
- </div>
12
- <!-- Topbar - Navigation Header -->
13
-
14
- <!-- Topbar - Navigation Main -->
15
- <% if current_user %>
16
- <ul class="navbar-nav navbar-right">
17
-
18
- <!-- Topbar - Navigation Main - User Menu -->
19
- <li class="dropdown navbar-user">
20
- <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
21
- <%= image_tag current_user.gravatar_url %>
22
- <span class="d-none d-md-inline"><%= current_user.firstname + ' ' + current_user.lastname %></span> <b class="caret"></b>
23
- </a>
24
- <div class="dropdown-menu dropdown-menu-right">
25
- <%= link_to phcdevworks_accounts.edit_user_registration_path, class: "dropdown-item" do %>
26
- <i class="fad fa-cogs"></i> Account Settings
27
- <% end %>
28
- <%= link_to phcdevworks_accounts.destroy_user_session_path, method: :delete, class: "dropdown-item" do %>
29
- <i class="fad fa-sign-out-alt"></i> Logout
30
- <% end %>
31
- </div>
32
- </li>
33
- <!-- Topbar - Navigation Main - User Menu -->
34
-
35
- </ul>
36
- <% end %>
37
- <!-- Topbar - Navigation Main -->
1
+ <!-- Topbar - Navigation Header -->
2
+ <div class="navbar-header">
3
+ <%= link_to phcdevworks_tutorials.tutorial_posts_path, class: "navbar-brand" do %>
4
+ <strong>PHCDevworks</strong>Tutorial
5
+ <% end %>
6
+ <button type="button" class="navbar-toggle" data-click="sidebar-toggled">
7
+ <span class="icon-bar"></span>
8
+ <span class="icon-bar"></span>
9
+ <span class="icon-bar"></span>
10
+ </button>
11
+ </div>
12
+ <!-- Topbar - Navigation Header -->
13
+
14
+ <!-- Topbar - Navigation Main -->
15
+ <% if current_user %>
16
+ <ul class="navbar-nav navbar-right">
17
+
18
+ <!-- Topbar - Navigation Main - User Menu -->
19
+ <li class="dropdown navbar-user">
20
+ <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown">
21
+ <%= image_tag current_user.gravatar_url %>
22
+ <span class="d-none d-md-inline"><%= current_user.firstname + " " + current_user.lastname %></span> <b class="caret"></b>
23
+ </a>
24
+ <div class="dropdown-menu dropdown-menu-right">
25
+ <%= link_to phcdevworks_accounts.edit_user_registration_path, class: "dropdown-item" do %>
26
+ <i class="fad fa-cogs"></i> Account Settings
27
+ <% end %>
28
+ <%= link_to phcdevworks_accounts.destroy_user_session_path, method: :delete, class: "dropdown-item" do %>
29
+ <i class="fad fa-sign-out-alt"></i> Logout
30
+ <% end %>
31
+ </div>
32
+ </li>
33
+ <!-- Topbar - Navigation Main - User Menu -->
34
+
35
+ </ul>
36
+ <% end %>
37
+ <!-- Topbar - Navigation Main -->