serpscan-dashboard 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 89f0e7ed51256dafad60849cbb3eb5956d4e4547
4
- data.tar.gz: cba7157e7d9304d88e5c82504541192c0c55f943
3
+ metadata.gz: 641edc4bb107c289b8471aa27249fd1302328539
4
+ data.tar.gz: c69ea948240dc3ddfaf59103e9cde569766349bb
5
5
  SHA512:
6
- metadata.gz: 7fa8d8d2287ac7a78246d10f042a621c974392c57618ccf9d37040b69daf5e233aba7201882773d0b2f82cfcd14c6cbd4aa1b9d633968912506c044ee6c5d540
7
- data.tar.gz: 0237241881c861c81e51daf91e6825c0eb9b83efacf1a8f561e95c06c0a0f7a29bb002e88cb76829dd82be7d599623300a10ed4e11f9908865b5b7003fb7cd13
6
+ metadata.gz: 92fc0826562aa975544cd08dc2c0b720ca511248cebe71775d486a4e8f94f3ce3ed819c82204f2fca5f0f89fe4c3a4ef626ead5871ff8532b36b0f97263ad934
7
+ data.tar.gz: cc1aa3eab60914ea05525c3be01ba53ac716a811512f65478149fe59b1e5170e6ee97891a329652b8c14001c2cf061ae61b2f35d1ac8b1cc3872345bc5e56d94
@@ -7,16 +7,38 @@ module Serpscan
7
7
  @websites = Serpscan::Website.all
8
8
 
9
9
  if @websites.count.eql?(1)
10
- redirect_to "serpscan/#{@websites[0].id}"
10
+ redirect_to serpscan_dashboard.website_path(@websites.first.id)
11
11
  end
12
12
  end
13
13
 
14
+ def create
15
+ if params[:url].present?
16
+ Serpscan::Website.create(url: params[:url])
17
+ flash[:success] = "Website successfully created"
18
+ else
19
+ flash[:error] = "Please provide a url"
20
+ end
21
+
22
+ redirect_to :back
23
+ end
24
+
14
25
  def show
15
26
  @website = Serpscan::Website.find(params[:id])
16
27
  @keywords = @website.keywords
17
28
  @attributes = [:phrase, :current_rank, :day_change, :month_change, :alltime_change]
18
29
  @search_engines = Serpscan::SearchEngine.all
19
30
  end
31
+
32
+ def delete
33
+ if params[:id].present?
34
+ Serpscan::Website.find(params[:id]).delete
35
+ flash[:success] = "Website successfully deleted"
36
+ else
37
+ flash[:error] = "Please select a website to delete"
38
+ end
39
+
40
+ redirect_to serpscan_dashboard.websites_path
41
+ end
20
42
  end
21
43
  end
22
44
  end
@@ -15,13 +15,13 @@
15
15
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
16
 
17
17
  <!-- Latest compiled and minified CSS -->
18
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.7.0/bootstrap-table.min.css">
18
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.7.0/bootstrap-table.min.css">
19
19
 
20
20
  <!-- Latest compiled and minified JavaScript -->
21
- <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.7.0/bootstrap-table.min.js"></script>
21
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.7.0/bootstrap-table.min.js"></script>
22
22
 
23
23
  <!-- Select box JS -->
24
- <script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script>
24
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script>
25
25
  <!-- Select box theme -->
26
26
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css">
27
27
 
@@ -1,5 +1,9 @@
1
1
  <h1>SERP Scan</h1>
2
2
 
3
+ <button type="button" class="btn btn-default" data-toggle="modal" data-target="#new_website_modal" id="new_website">
4
+ <i class="glyphicon glyphicon-plus"></i>
5
+ </button>
6
+
3
7
  <table data-toggle="table" data-pagination="true" data-page-size="50" data-sort-name="url" data-sort-order="desc" data-toolbar="#create-keyword" data-search="true" class="table-striped">
4
8
  <thead>
5
9
  <tr>
@@ -14,3 +18,29 @@
14
18
  <% end %>
15
19
  </tbody>
16
20
  </table>
21
+
22
+
23
+ <div class="modal fade" id="new_website_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
24
+ <div class="modal-dialog">
25
+ <div class="modal-content">
26
+ <div class="modal-header">
27
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
28
+ <h4 class="modal-title" id="exampleModalLabel">New Website</h4>
29
+ </div>
30
+ <div class="modal-body">
31
+
32
+ <form class="form-inline" action="/serpscan/website" method="post" id="create-website" >
33
+ <label for="url" class="control-label">URL:</label>
34
+ <input type="text" class="form-control" name="url" placeholder="example.com" style="width:100%">
35
+
36
+
37
+ </div>
38
+ <div class="modal-footer">
39
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
40
+ <button type="submit" class="btn btn-primary">Create</button>
41
+ </div>
42
+ </form>
43
+ </div>
44
+
45
+ </div>
46
+ </div>
@@ -24,6 +24,11 @@
24
24
  .select2-selection--multiple {
25
25
  height: 75px;
26
26
  }
27
+
28
+ .delete-website {
29
+ float: right;
30
+ margin-top: 25px;
31
+ }
27
32
  </style>
28
33
 
29
34
  <h1><%= @website.url %></h1>
@@ -54,6 +59,9 @@
54
59
  <% end %>
55
60
  </tbody>
56
61
  </table>
62
+
63
+ <button type="button" class="btn btn-danger delete-website" id="delete-website-button" data-toggle="modal" data-target="#confirm-website-delete">Delete Website
64
+ </button>
57
65
  </div>
58
66
  </div>
59
67
 
@@ -135,6 +143,23 @@ $( document ).ready(function() {
135
143
  </div>
136
144
  </div>
137
145
 
146
+ <div class="modal fade" id="confirm-website-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
147
+ <div class="modal-dialog">
148
+ <div class="modal-content">
149
+ <div class="modal-header">
150
+ <h4 class="modal-title" id="exampleModalLabel">Delete website and all keywords?</h4>
151
+ </div>
152
+ <div class="modal-body">
153
+ All keywords and ranking history will be lost.
154
+ </div>
155
+ <div class="modal-footer">
156
+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
157
+ <a href="/serpscan/websites/<%= @website.id %>/delete" class="btn btn-danger btn-ok">Delete</a>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </div>
162
+
138
163
  <div id="create-keyword">
139
164
  <button type="button" class="btn btn-default" data-toggle="modal" data-target="#exampleModal">
140
165
  <i class="glyphicon glyphicon-plus"></i>
@@ -180,6 +205,5 @@ $( document ).ready(function() {
180
205
  </div>
181
206
  </form>
182
207
  </div>
183
-
184
208
  </div>
185
209
  </div>
data/config/routes.rb CHANGED
@@ -3,5 +3,7 @@ Serpscan::Dashboard::Engine.routes.draw do
3
3
  get '/error' => 'dashboard#error', as: :error
4
4
  get '/:id' => 'websites#show', as: :website
5
5
  post '/:id/keyword' => 'keywords#create'
6
+ post '/website' => 'websites#create'
6
7
  get '/keywords/delete' => 'keywords#delete'
8
+ get '/websites/:id/delete' => 'websites#delete'
7
9
  end
@@ -1,5 +1,5 @@
1
1
  module Serpscan
2
2
  module Dashboard
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serpscan-dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Montgomery
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-21 00:00:00.000000000 Z
12
+ date: 2015-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -39,34 +39,6 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: 0.1.4
42
- - !ruby/object:Gem::Dependency
43
- name: rspec-rails
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: sqlite3
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
42
  description: Dashboard to track your search engine rankings.
71
43
  email:
72
44
  - mail@citizensinspace.com