2 Commits

Author SHA1 Message Date
  Dylan Baker 1d2d251fb8 bugs 3 years ago
  Dylan Baker fa505aeda1 Don't deploy db log 3 years ago
4 changed files with 17 additions and 12 deletions
  1. 1
    1
      Rakefile
  2. 2
    1
      web/assets/script.js
  3. 8
    4
      web/assets/styles/form.scss
  4. 6
    6
      web/views/partials/search.erb

+ 1
- 1
Rakefile View File

27
 task 'deploy' do
27
 task 'deploy' do
28
   username = ENV['PROD_USERNAME']
28
   username = ENV['PROD_USERNAME']
29
   hostname = ENV['PROD_HOSTNAME']
29
   hostname = ENV['PROD_HOSTNAME']
30
-  puts `rsync -rv ./db #{username}@#{hostname}:/var/www/vlv-search/`
30
+  puts `rsync -rv ./db/*.rb #{username}@#{hostname}:/var/www/vlv-search/`
31
   puts `rsync -rv ./lib #{username}@#{hostname}:/var/www/vlv-search/`
31
   puts `rsync -rv ./lib #{username}@#{hostname}:/var/www/vlv-search/`
32
   puts `rsync -rv ./web #{username}@#{hostname}:/var/www/vlv-search/`
32
   puts `rsync -rv ./web #{username}@#{hostname}:/var/www/vlv-search/`
33
   puts `rsync -rv ./Rakefile #{username}@#{hostname}:/var/www/vlv-search/`
33
   puts `rsync -rv ./Rakefile #{username}@#{hostname}:/var/www/vlv-search/`

+ 2
- 1
web/assets/script.js View File

1
 var types = document.querySelectorAll('input[type=radio][name=type]');
1
 var types = document.querySelectorAll('input[type=radio][name=type]');
2
 types.forEach(function (type) {
2
 types.forEach(function (type) {
3
   type.addEventListener('change', function (e) {
3
   type.addEventListener('change', function (e) {
4
-    document.querySelector('.filters__section--sort').classList.toggle('open');
4
+    document.querySelector('.filters__subsection--sort').classList.toggle('open');
5
+    document.querySelector('.filters__subsection--sort input[type=radio]:first-child').checked = true;
5
   });
6
   });
6
 });
7
 });

+ 8
- 4
web/assets/styles/form.scss View File

22
   padding: .5em 0;
22
   padding: .5em 0;
23
 }
23
 }
24
 
24
 
25
-.filters__section--sort {
26
-  display: none;
25
+.filters__subsection--sort {
26
+  visibility: hidden;
27
 }
27
 }
28
 
28
 
29
-.filters__section--sort.open {
30
-  display: flex;
29
+.filters__subsection--sort.open {
30
+  visibility: visible;
31
 }
31
 }
32
 
32
 
33
 .filters__subsection {
33
 .filters__subsection {
34
   flex: 1;
34
   flex: 1;
35
   padding: 0 1em;
35
   padding: 0 1em;
36
+
37
+  &.filters__subsection--static {
38
+    flex: 1;
39
+  }
36
 }
40
 }
37
 
41
 
38
 .form__field {
42
 .form__field {

+ 6
- 6
web/views/partials/search.erb View File

40
         </label>
40
         </label>
41
       </div>
41
       </div>
42
     </div>
42
     </div>
43
-    <div class="filters__section filters__section--sort <%= params[:type] == 'threads' ? 'open' : '' %>">
44
-      <div class="filters__subsection">
43
+    <div class="filters__section">
44
+      <div class="filters__subsection filters__subsection--static">
45
+        <p>Posted by:</p>
46
+        <input type="text" name="username" value="<%= params[:username] %>" class="form__text-field">
47
+      </div>
48
+      <div class="filters__subsection filters__subsection--sort <%= params[:type] == 'threads' ? 'open' : '' %>">
45
         <p>Sort by:</p>
49
         <p>Sort by:</p>
46
         <label class="form__label">
50
         <label class="form__label">
47
           <input type="radio" name="sort" value="thread" <% if [nil, "thread"].include? params[:sort] %>checked<% end%>>
51
           <input type="radio" name="sort" value="thread" <% if [nil, "thread"].include? params[:sort] %>checked<% end%>>
52
           Most recent post
56
           Most recent post
53
         </label>
57
         </label>
54
       </div>
58
       </div>
55
-      <div class="filters__subsection">
56
-        <p>Posted by:</p>
57
-        <input type="text" name="username" value="<%= params[:username] %>" class="form__text-field">
58
-      </div>
59
     </div>
59
     </div>
60
   </div>
60
   </div>
61
   <input type="submit" value="Search" class="btn form__submit">
61
   <input type="submit" value="Search" class="btn form__submit">

Loading…
Cancel
Save