phccodesnipper 6.0.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 805c8b76ea965b6e91f38f5aaa6559b027aa41cfcb62e48f07bea657df76125a
4
- data.tar.gz: ea2746063a7cd42fa209eb047ab667075042d398638f038cf7664c02aa3d135a
3
+ metadata.gz: 5e756162ca4dfb2a7482dee54c9c90f6a2d5717a8830c39e48c7836781416d5d
4
+ data.tar.gz: 6003240931a596f8f815dc939ee77b246fcd00841229509c3b00792c4b5550df
5
5
  SHA512:
6
- metadata.gz: 2ebd506d77116b6dfbf04fa4b26261a00fae376f5efe07a9871b64de4e721c0cabef11e761ae877d869ebe0df2b9a91321e6feb782c69ff32d0cedaaeb3303a5
7
- data.tar.gz: 820116ee8a48e73487fce1ee5e302ed461c4e6423f3bd721bcd17883caea78cd63fb7b32bec5915af2d2e6449b39e712e8f862b994a33ae085fc3cdd4f3b4438
6
+ metadata.gz: 83655f448bd20efcfd6990270de1f726a24b7d7bccd00f2b702d2324110b9dfee01a0bfe80a52f6676a984e1d41172ac9d234d3544f10a9642d24ae7bfecc459
7
+ data.tar.gz: dd3c3712bf429317c35cd6168c1c88fecbd46f3e7c11ccd22aec306a7cf670a865bb2c0aa3cc060152a0de836c23bca5e68f9ad9fc7b04b21de085663cebf252
@@ -1,67 +1,67 @@
1
1
  require_dependency "phccodesnipper/application_controller"
2
2
 
3
3
  module Phccodesnipper
4
- class Script::SnippetsController < ApplicationController
4
+ class Script::SnippetsController < ApplicationController
5
5
 
6
- # Include Core Helpers, Security & Action Filters
7
- include PhcdevworksCore::PhcdevPluginsHelper
8
- before_action :authenticate_user!
9
- before_action :set_script_snippet, only: [:show, :edit, :update, :destroy]
6
+ # Include Core Helpers, Security & Action Filters
7
+ include PhcdevworksCore::PhcdevPluginsHelper
8
+ before_action :authenticate_user!
9
+ before_action :set_script_snippet, only: [:show, :edit, :update, :destroy]
10
10
 
11
- # INDEX
12
- def index
13
- @script_snippets = Script::Snippet.all
14
- end
11
+ # INDEX
12
+ def index
13
+ @script_snippets = Script::Snippet.all
14
+ end
15
15
 
16
- # SHOW
17
- def show
18
- end
16
+ # SHOW
17
+ def show
18
+ end
19
19
 
20
- # NEW
21
- def new
22
- @script_snippet = Script::Snippet.new
23
- end
20
+ # NEW
21
+ def new
22
+ @script_snippet = Script::Snippet.new
23
+ end
24
24
 
25
- # EDIT
26
- def edit
27
- end
25
+ # EDIT
26
+ def edit
27
+ end
28
28
 
29
- # CREATE
30
- def create
31
- @script_snippet = Script::Snippet.new(script_snippet_params)
32
- if @script_snippet.save
33
- redirect_to @script_snippet, :flash => { :success => 'Snippet was successfully created.' }
34
- else
35
- render :new
36
- end
37
- end
29
+ # CREATE
30
+ def create
31
+ @script_snippet = Script::Snippet.new(script_snippet_params)
32
+ if @script_snippet.save
33
+ redirect_to @script_snippet, :flash => { :success => 'Code snippet was successfully created.' }
34
+ else
35
+ render :new
36
+ end
37
+ end
38
38
 
39
- # UPDATE
40
- def update
41
- if @script_snippet.update(script_snippet_params)
42
- redirect_to @script_snippet, :flash => { :success => 'Snippet was successfully updated.' }
43
- else
44
- render :edit
45
- end
46
- end
39
+ # UPDATE
40
+ def update
41
+ if @script_snippet.update(script_snippet_params)
42
+ redirect_to @script_snippet, :flash => { :success => 'Code snippet was successfully updated.' }
43
+ else
44
+ render :edit
45
+ end
46
+ end
47
47
 
48
- # DELETE
49
- def destroy
50
- @script_snippet.destroy
51
- redirect_to script_snippets_url, :flash => { :error => 'Snippet was successfully destroyed.' }
52
- end
48
+ # DELETE
49
+ def destroy
50
+ @script_snippet.destroy
51
+ redirect_to script_snippets_url, :flash => { :error => 'Code snippet was successfully destroyed.' }
52
+ end
53
53
 
54
- private
54
+ private
55
55
 
56
- # Common Callbacks
57
- def set_script_snippet
58
- @script_snippet = Script::Snippet.find(params[:id])
59
- end
56
+ # Common Callbacks
57
+ def set_script_snippet
58
+ @script_snippet = Script::Snippet.find(params[:id])
59
+ end
60
60
 
61
- # Whitelist
62
- def script_snippet_params
63
- params.require(:script_snippet).permit(:snippet_title, :snippet_code)
64
- end
61
+ # Whitelist
62
+ def script_snippet_params
63
+ params.require(:script_snippet).permit(:snippet_title, :snippet_code)
64
+ end
65
65
 
66
- end
66
+ end
67
67
  end
@@ -1,76 +1,70 @@
1
1
  require_dependency "phccodesnipper/application_controller"
2
2
 
3
3
  module Phccodesnipper
4
- class Script::UrlsController < ApplicationController
4
+ class Script::UrlsController < ApplicationController
5
5
 
6
- # Include Core Helpers, Security & Action Filters
7
- include PhcdevworksCore::PhcdevPluginsHelper
8
- before_action :authenticate_user!
9
- before_action :set_script_url, only: [:show, :edit, :update, :destroy]
6
+ # Include Core Helpers, Security & Action Filters
7
+ include PhcdevworksCore::PhcdevPluginsHelper
8
+ before_action :authenticate_user!
9
+ before_action :set_script_url, only: [:show, :edit, :update, :destroy]
10
10
 
11
- # INDEX
12
- def index
13
- snippet = Script::Snippet.find(params[:snippet_id])
14
- @script_urls = snippet.urls.all
15
- end
11
+ # INDEX
12
+ def index
13
+ snippet = Script::Snippet.find(params[:snippet_id])
14
+ @script_urls = snippet.urls.all
15
+ end
16
16
 
17
- # SHOW
18
- def show
19
- script_snippet = Script::Snippet.find(params[:snippet_id])
20
- @script_url = script_snippet.urls.find(params[:id])
21
- end
17
+ # NEW
18
+ def new
19
+ script_snippet = Script::Snippet.find(params[:snippet_id])
20
+ @script_url = script_snippet.urls.build
21
+ end
22
22
 
23
- # NEW
24
- def new
25
- script_snippet = Script::Snippet.find(params[:snippet_id])
26
- @script_url = script_snippet.urls.build
27
- end
23
+ # EDIT
24
+ def edit
25
+ end
28
26
 
29
- # EDIT
30
- def edit
31
- end
27
+ # CREATE
28
+ def create
29
+ @script_snippet = Script::Snippet.find(params[:snippet_id])
30
+ @script_url = @script_snippet.urls.create(script_url_params)
31
+ @script_url.user_id = current_user.id
32
+ if @script_url.save
33
+ redirect_to script_snippet_urls_path, :flash => { :success => 'Script URL was successfully created.' }
34
+ else
35
+ render :new
36
+ end
37
+ end
32
38
 
33
- # CREATE
34
- def create
35
- @script_snippet = Script::Snippet.find(params[:snippet_id])
36
- @script_url = @script_snippet.urls.create(script_url_params)
37
- @script_url.user_id = current_user.id
38
- if @script_url.save
39
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully created.' }
40
- else
41
- render :new
42
- end
43
- end
39
+ # UPDATE
40
+ def update
41
+ @script_snippet = Script::Snippet.find(params[:snippet_id])
42
+ if @script_url.update(script_url_params)
43
+ redirect_to script_snippet_urls_path, :flash => { :success => 'Script URL was successfully updated.' }
44
+ else
45
+ render :edit
46
+ end
47
+ end
44
48
 
45
- # UPDATE
46
- def update
47
- @script_snippet = Script::Snippet.find(params[:snippet_id])
48
- if @script_url.update(script_url_params)
49
- redirect_to script_snippet_urls_path, :flash => { :success => 'Script url was successfully updated.' }
50
- else
51
- render :edit
52
- end
53
- end
49
+ # DELETE
50
+ def destroy
51
+ @script_snippet = Script::Snippet.find(params[:snippet_id])
52
+ @script_url = @script_snippet.urls.find(params[:id])
53
+ @script_url.destroy
54
+ redirect_to script_snippet_urls_path, :flash => { :error => 'Script URL was successfully removed.' }
55
+ end
54
56
 
55
- # DELETE
56
- def destroy
57
- @script_snippet = Script::Snippet.find(params[:snippet_id])
58
- @script_url = @script_snippet.urls.find(params[:id])
59
- @script_url.destroy
60
- redirect_to script_snippet_urls_path, :flash => { :error => 'Script url was successfully destroyed.' }
61
- end
57
+ private
62
58
 
63
- private
59
+ # Common Callbacks
60
+ def set_script_url
61
+ @script_url = Script::Url.find(params[:id])
62
+ end
64
63
 
65
- # Common Callbacks
66
- def set_script_url
67
- @script_url = Script::Url.find(params[:id])
68
- end
64
+ # Whitelist
65
+ def script_url_params
66
+ params.require(:script_url).permit(:script_url, :snippet_id)
67
+ end
69
68
 
70
- # Whitelist
71
- def script_url_params
72
- params.require(:script_url).permit(:script_url, :snippet_id)
73
- end
74
-
75
- end
69
+ end
76
70
  end
@@ -0,0 +1,30 @@
1
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container -->
2
+ <div class="container">
3
+
4
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Branding -->
5
+ <a href="index.html" class="navbar-brand">
6
+ <span class="brand-logo"></span>
7
+ <span class="brand-text">
8
+ <span class="text-theme">PHC</span>CodeSnipper
9
+ </span>
10
+ </a>
11
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Branding -->
12
+
13
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Mobile Button -->
14
+ <button type="button" class="navbar-toggle collapsed" data-bs-toggle="collapse" data-bs-target="#header-navbar">
15
+ <span class="icon-bar"></span>
16
+ <span class="icon-bar"></span>
17
+ <span class="icon-bar"></span>
18
+ </button>
19
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Mobile Button -->
20
+
21
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Navigation -->
22
+ <div class="collapse navbar-collapse" id="header-navbar">
23
+ <ul class="nav navbar-nav navbar-end">
24
+ <li class="nav-item"><%= link_to "Code Snippets", phccodesnipper.script_snippets_path, class: "nav-link" %></li>
25
+ </ul>
26
+ </div>
27
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Navigation -->
28
+
29
+ </div>
30
+ <!-- -PHCDEV- Main Wrapper - Header - Navbar - Container -->
@@ -37,6 +37,9 @@
37
37
  <%= link_to "Update", phccodesnipper.edit_script_snippet_path, class: "btn btn-primary" %>
38
38
  <%= link_to "Remove", phccodesnipper.script_snippet_path, method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
39
39
  </div>
40
+ <div class="btn-group d-flex" role="group">
41
+ <%= link_to "Add URL", phccodesnipper.script_snippet_urls_path(@script_snippet), class: "btn btn-succss" %>
42
+ </div>
40
43
  </div>
41
44
  <!-- -PHCDEV- Panel - Body -->
42
45
 
@@ -43,9 +43,8 @@
43
43
  <td><%= script_url.script_url %></td>
44
44
  <td>
45
45
  <div class="btn-group d-flex" role="group">
46
- <%= link_to "Details", script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-purple btn-xs" %>
47
- <%= link_to "Update", edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
48
- <%= link_to "Remove", script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
46
+ <%= link_to "Update URL", edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
47
+ <%= link_to "Remove URL", script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
49
48
  </div>
50
49
  </td>
51
50
  </tr>
@@ -33,10 +33,7 @@
33
33
 
34
34
  <!-- -PHCDEV- Panel - Body -->
35
35
  <div class="panel-body">
36
- <div class="btn-group d-flex" role="group">
37
- <%= link_to "Update", phccodesnipper.edit_script_snippet_url_path, class: "btn btn-primary" %>
38
- <%= link_to "Remove", phccodesnipper.script_snippet_url_path(@script_url), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
39
- </div>
36
+ <%= link_to "Update", phccodesnipper.edit_script_snippet_url_path, class: "btn btn-primary" %>
40
37
  </div>
41
38
  <!-- -PHCDEV- Panel - Body -->
42
39
 
@@ -1,3 +1,3 @@
1
1
  module Phccodesnipper
2
- VERSION = "6.0.1"
2
+ VERSION = "6.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phccodesnipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-17 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -317,6 +317,7 @@ files:
317
317
  - app/views/layouts/phccodesnipper/components/backend/footer/_footer.html.erb
318
318
  - app/views/layouts/phccodesnipper/components/backend/navigation/_top_menu.html.erb
319
319
  - app/views/layouts/phccodesnipper/components/backend/sidebars/_side_menu.html.erb
320
+ - app/views/layouts/phccodesnipper/components/frontend/header/_main_nav.html.erb
320
321
  - app/views/phccodesnipper/script/snippets/_form.html.erb
321
322
  - app/views/phccodesnipper/script/snippets/edit.html.erb
322
323
  - app/views/phccodesnipper/script/snippets/index.html.erb